Merge pull request #174 from brynet/patch-1
authorsbyx <steven@midlink.org>
Wed, 20 Aug 2014 11:04:22 +0000 (13:04 +0200)
committersbyx <steven@midlink.org>
Wed, 20 Aug 2014 11:04:22 +0000 (13:04 +0200)
net/openssh: Update PKG_SOURCE_URL

276 files changed:
CONTRIBUTING.md
README.md
admin/debootstrap/Makefile
admin/htop/Makefile
admin/monit/Makefile
admin/muninlite/Makefile
admin/zabbix/Makefile
devel/gcc/Makefile [new file with mode: 0644]
devel/gcc/README [new file with mode: 0644]
devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch [new file with mode: 0644]
devel/gcc/patches/003-mpfr-longlong-mips.patch [new file with mode: 0644]
devel/gcc/patches/010-documentation.patch [new file with mode: 0644]
devel/gcc/patches/100-uclibc-conf.patch [new file with mode: 0644]
devel/gcc/patches/200-musl.patch [new file with mode: 0644]
devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch [new file with mode: 0644]
devel/gcc/patches/810-arm-softfloat-libgcc.patch [new file with mode: 0644]
devel/gcc/patches/820-libgcc_pic.patch [new file with mode: 0644]
devel/gcc/patches/830-arm_unbreak_armv4t.patch [new file with mode: 0644]
devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch [new file with mode: 0644]
devel/gcc/patches/850-use_shared_libgcc.patch [new file with mode: 0644]
devel/gcc/patches/860-uclibc_use_eh_frame.patch [new file with mode: 0644]
devel/gcc/patches/870-ppc_no_crtsavres.patch [new file with mode: 0644]
devel/gcc/patches/880-no_java_section.patch [new file with mode: 0644]
devel/gcc/patches/900-bad-mips16-crt.patch [new file with mode: 0644]
devel/gcc/patches/910-mbsd_multi.patch [new file with mode: 0644]
devel/gcc/patches/920-specs_nonfatal_getenv.patch [new file with mode: 0644]
devel/patch/Makefile
ipv6/aiccu/Makefile
ipv6/tayga/Makefile
lang/luabitop/Makefile
lang/luaposix/Makefile
lang/micropython-lib/Makefile [new file with mode: 0644]
lang/micropython/Makefile [new file with mode: 0644]
lang/perl-compress-bzip2/Makefile
lang/perl-dbi/Makefile
lang/perl-html-parser/Makefile
lang/perl-html-tagset/Makefile
lang/perl-html-tree/Makefile
lang/perl-lockfile-simple/Makefile
lang/perl-net-telnet/Makefile
lang/perl-test-harness/Makefile
lang/perl-uri/Makefile
lang/perl-www-curl/Makefile
lang/perl-www-mechanize/Makefile
lang/perl-www/Makefile
lang/perl-www/patches/010-lwp-https-call-verify-hostname-when-avail.patch [new file with mode: 0644]
lang/perl-www/patches/020-lwp-https-verify-hostnames-by-default.patch [new file with mode: 0644]
lang/perl/Makefile
lang/perl/files/Module/ScanDeps.pm [deleted file]
lang/perl/files/config.sh-arm.in
lang/perl/files/config.sh-armeb.in
lang/perl/files/config.sh-avr32.in
lang/perl/files/config.sh-i486.in
lang/perl/files/config.sh-mips.in
lang/perl/files/config.sh-mipsel.in
lang/perl/files/config.sh-powerpc.in
lang/perl/files/config.sh-x86_64.in
lang/perl/files/perlmod-deps.sh [deleted file]
lang/perl/files/scan-perlbase.sh [deleted file]
lang/perl/files/strippm.sh [deleted file]
lang/perl/patches/500-add-relink-hack.patch [new file with mode: 0644]
lang/perl/perlbase.mk
lang/perl/perlmod.mk
lang/ruby/Makefile [new file with mode: 0644]
libs/cyrus-sasl/Makefile
libs/db47/Makefile
libs/db47/patches/001-sequence_lock.patch [deleted file]
libs/db47/patches/002-lock.patch [deleted file]
libs/db47/patches/003-dead_lock.patch [deleted file]
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/dtndht/Makefile [new file with mode: 0644]
libs/engine_pkcs11/Makefile
libs/file/Makefile
libs/flac/Makefile
libs/gdbm/Makefile
libs/ibrcommon/Makefile [new file with mode: 0644]
libs/ibrdtn/Makefile [new file with mode: 0644]
libs/libarchive/Makefile [new file with mode: 0644]
libs/libdmapsharing/Makefile [new file with mode: 0644]
libs/libdmapsharing/patches/001-diable_pixbuf.patch [new file with mode: 0644]
libs/libexif/Makefile
libs/libid3tag/Makefile
libs/libidn/Makefile
libs/libogg/Makefile
libs/libowfat/Makefile
libs/libp11/Makefile
libs/libpam/Makefile
libs/libpam/patches/007-cve-2014-2583.patch [new file with mode: 0644]
libs/libsigc++/Makefile
libs/libsigc++/patches/001-no_doc_tests_examples.patch
libs/libssh2/Makefile
libs/libuecc/Makefile
libs/libvorbis/Makefile
libs/libvorbisidec/Makefile
libs/libxslt/Makefile
libs/nacl/Makefile
libs/nspr/Makefile [new file with mode: 0644]
libs/nspr/patches/001-compile.patch [new file with mode: 0644]
libs/tiff/Makefile
libs/vips/Makefile
mail/dovecot/Makefile
multimedia/ffmpeg/Config.in
multimedia/ffmpeg/Makefile
multimedia/ffmpeg/patches/010-remove_unused_fminf_definition.patch [new file with mode: 0644]
multimedia/minidlna/Makefile
multimedia/mjpg-streamer/Config.in
multimedia/mjpg-streamer/Makefile
net/bind/Makefile [new file with mode: 0644]
net/bind/files/bind/db.0 [new file with mode: 0644]
net/bind/files/bind/db.127 [new file with mode: 0644]
net/bind/files/bind/db.255 [new file with mode: 0644]
net/bind/files/bind/db.local [new file with mode: 0644]
net/bind/files/bind/db.root [new file with mode: 0644]
net/bind/files/bind/named.conf.example [new file with mode: 0644]
net/bind/files/named.init [new file with mode: 0644]
net/bind/patches/001-no-tests.patch [new file with mode: 0644]
net/ddns-scripts/Makefile
net/dmapd/Makefile [new file with mode: 0644]
net/dmapd/files/dmapd.init [new file with mode: 0644]
net/dmapd/patches/001-dmapd_conf.patch [new file with mode: 0644]
net/ethtool/Makefile
net/ethtool/patches/100-ixp4xx.patch [deleted file]
net/fastd/Makefile
net/freeradius2/Makefile
net/haproxy/Makefile
net/haproxy/patches/0004-BUG-config-error-in-http-response-replace-header-num.patch [new file with mode: 0644]
net/ibrdtn-tools/Makefile [new file with mode: 0644]
net/ibrdtnd/Makefile [new file with mode: 0644]
net/ibrdtnd/files/build-config.sh [new file with mode: 0644]
net/ibrdtnd/files/ibrdtn.init [new file with mode: 0644]
net/ibrdtnd/files/ibrdtn.uci [new file with mode: 0644]
net/ibrdtnd/files/mkcontainer.sh [new file with mode: 0644]
net/ibrdtnd/files/mountcontainer.sh [new file with mode: 0644]
net/ibrdtnd/files/safety-wrapper.sh [new file with mode: 0644]
net/ibrdtnd/files/systemcheck.sh [new file with mode: 0644]
net/ipsec-tools/Makefile [new file with mode: 0644]
net/ipsec-tools/files/racoon.init [new file with mode: 0644]
net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch [new file with mode: 0644]
net/ipsec-tools/patches/001-no_libfl.patch [new file with mode: 0644]
net/ipsec-tools/patches/002-patch8-utmp.patch [new file with mode: 0644]
net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch [new file with mode: 0644]
net/ipsec-tools/patches/005-isakmp-fix.patch [new file with mode: 0644]
net/ipsec-tools/patches/006-linux-3.7-compat.patch [new file with mode: 0644]
net/ipsec-tools/patches/force_HAVE_POLICY_FWD [new file with mode: 0644]
net/knot/Makefile
net/mosquitto/Makefile
net/mtr/Makefile
net/mwan3-luci/Makefile [new file with mode: 0644]
net/mwan3-luci/files/etc/hotplug.d/iface/16-mwan3custombak [new file with mode: 0644]
net/mwan3-luci/files/etc/uci-defaults/mwan3 [new file with mode: 0755]
net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_hotplug.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_mwan3.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_network.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interface.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interfaceconfig.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_member.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_memberconfig.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policy.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policyconfig.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_rule.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_ruleconfig.lua [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan3.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_diagnostics.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_hotplug.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_mwan3.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_network.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_troubleshoot.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_config_css.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_detail.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_interface.htm [new file with mode: 0644]
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_status.htm [new file with mode: 0644]
net/mwan3/Makefile [new file with mode: 0644]
net/mwan3/files/etc/config/mwan3 [new file with mode: 0644]
net/mwan3/files/etc/hotplug.d/iface/15-mwan3 [new file with mode: 0644]
net/mwan3/files/etc/init.d/mwan3 [new file with mode: 0755]
net/mwan3/files/usr/sbin/mwan3 [new file with mode: 0755]
net/mwan3/files/usr/sbin/mwan3track [new file with mode: 0755]
net/ntpclient/Makefile [new file with mode: 0644]
net/ntpclient/files/ntpclient.config [new file with mode: 0644]
net/ntpclient/files/ntpclient.hotplug [new file with mode: 0644]
net/ntpclient/patches/100-daemon.patch [new file with mode: 0644]
net/opentracker/Makefile
net/rsync/Makefile
net/smartsnmpd/Makefile [new file with mode: 0644]
net/smartsnmpd/files/mibs/dummy.lua [new file with mode: 0644]
net/smartsnmpd/files/mibs/interfaces.lua [new file with mode: 0644]
net/smartsnmpd/files/mibs/system.lua [new file with mode: 0644]
net/smartsnmpd/files/smartsnmpd.conf [new file with mode: 0644]
net/smartsnmpd/files/smartsnmpd.init [new file with mode: 0755]
net/socat/Makefile [new file with mode: 0644]
net/socat/patches/010-fix_cross_compiling_error.patch [new file with mode: 0644]
net/sslh/Makefile
net/strongswan/Config.in [new file with mode: 0644]
net/strongswan/Makefile [new file with mode: 0644]
net/strongswan/files/ipsec.init [new file with mode: 0644]
net/strongswan/files/ipsec.secrets [new file with mode: 0644]
net/strongswan/files/ipsec.user [new file with mode: 0644]
net/strongswan/patches/201-kmodloader.patch [new file with mode: 0644]
net/strongswan/patches/203-uci.patch [new file with mode: 0644]
net/strongswan/patches/300-include-ipsec-user-script.patch [new file with mode: 0644]
net/tgt/Makefile
net/tinyproxy/Makefile
net/tinyproxy/patches/CVE-2012-3505-tiniproxy-randomized-hashmaps.patch [new file with mode: 0644]
net/tinyproxy/patches/CVE-2012-3505-tinyproxy-limit-headers.patch [new file with mode: 0644]
net/umurmur/Makefile [new file with mode: 0644]
net/unbound/Makefile [new file with mode: 0644]
net/unbound/files/named.cache [new file with mode: 0644]
net/unbound/files/root.key [new file with mode: 0644]
net/unbound/files/unbound.init [new file with mode: 0755]
net/unbound/patches/001-conf.patch [new file with mode: 0644]
net/wavemon/Makefile
net/wget/Makefile
net/xinetd/Makefile
net/xinetd/patches/004-ident-bind.patch [new file with mode: 0644]
net/xl2tpd/Makefile
net/xl2tpd/files/l2tp.sh [new file with mode: 0644]
net/xl2tpd/files/l2tpv2.sh [deleted file]
sound/lame/Makefile
sound/mpc/Makefile
sound/pulseaudio/Makefile
sound/sox/Makefile
utils/acl/Makefile
utils/attr/Makefile
utils/bash/Makefile [new file with mode: 0644]
utils/bash/patches/001-compile-fix.patch [new file with mode: 0644]
utils/bash/patches/002-force-internal-readline.patch [new file with mode: 0644]
utils/bash/patches/101-upstream-bash43-001.patch [new file with mode: 0644]
utils/bash/patches/102-upstream-bash43-002.patch [new file with mode: 0644]
utils/bash/patches/103-upstream-bash43-003.patch [new file with mode: 0644]
utils/bash/patches/104-upstream-bash43-004.patch [new file with mode: 0644]
utils/bash/patches/105-upstream-bash43-005.patch [new file with mode: 0644]
utils/bash/patches/106-upstream-bash43-006.patch [new file with mode: 0644]
utils/bash/patches/107-upstream-bash43-007.patch [new file with mode: 0644]
utils/bash/patches/108-upstream-bash43-008.patch [new file with mode: 0644]
utils/bash/patches/109-upstream-bash43-009.patch [new file with mode: 0644]
utils/bash/patches/110-upstream-bash43-010.patch [new file with mode: 0644]
utils/bash/patches/111-upstream-bash43-011.patch [new file with mode: 0644]
utils/bash/patches/112-upstream-bash43-012.patch [new file with mode: 0644]
utils/bash/patches/113-upstream-bash43-013.patch [new file with mode: 0644]
utils/bash/patches/114-upstream-bash43-014.patch [new file with mode: 0644]
utils/bash/patches/115-upstream-bash43-015.patch [new file with mode: 0644]
utils/bash/patches/116-upstream-bash43-016.patch [new file with mode: 0644]
utils/bash/patches/117-upstream-bash43-017.patch [new file with mode: 0644]
utils/bash/patches/118-upstream-bash43-018.patch [new file with mode: 0644]
utils/bash/patches/119-upstream-bash43-019.patch [new file with mode: 0644]
utils/bash/patches/120-upstream-bash43-020.patch [new file with mode: 0644]
utils/bash/patches/121-upstream-bash43-021.patch [new file with mode: 0644]
utils/bash/patches/122-upstream-bash43-022.patch [new file with mode: 0644]
utils/bash/patches/129-no_doc.patch [new file with mode: 0644]
utils/ccid/Makefile
utils/haserl/Makefile
utils/mktorrent/Makefile
utils/mysql/Makefile [new file with mode: 0644]
utils/mysql/conf/my.cnf [new file with mode: 0644]
utils/mysql/files/mysqld.init [new file with mode: 0644]
utils/mysql/patches/100-fix_hostname.patch [new file with mode: 0644]
utils/mysql/patches/110-cross_compile.patch [new file with mode: 0644]
utils/ntfs-3g/Makefile [new file with mode: 0644]
utils/opensc/Makefile
utils/pcsc-lite/Makefile
utils/picocom/Makefile [new file with mode: 0644]
utils/pv/Makefile [new file with mode: 0644]
utils/shadow/Makefile
utils/shadow/patches/001-busybox_ash.patch
utils/shadow/patches/002-disable-ruser-lookup.patch
utils/shadow/patches/003-fix-disabling-subids.patch [new file with mode: 0644]
utils/smartmontools/Makefile
utils/tmux/Makefile
utils/watchcat/Makefile [new file with mode: 0644]
utils/watchcat/files/initd_watchcat [new file with mode: 0644]
utils/watchcat/files/uci_defaults_watchcat [new file with mode: 0644]
utils/watchcat/files/watchcat.sh [new file with mode: 0644]

index 3851be3afcb925adcd3d732ff69936a6d0ce6fcb..f28aea38f3021a70043954c59f00b9eb24125656 100644 (file)
@@ -1,25 +1,91 @@
-# Contributing Guidelines
+# Contributing Guidelines  
+(See <http://wiki.openwrt.org/doc/devel/packages> for overall format and construction)
+
+All packages you commit or submit by pull-request should follow these simple guidelines:
 
-Please make sure that all packages you commit or request to pull:
 * Package a version which is still maintained by the upstream author.
-* Have yourself or another person listed in the (PKG_)MAINTAINER field.
 * Will be updated regularly to maintained and supported versions.
-* Have no dependencies outside the openwrt core packages or this feed.
-* Are tested to run (or at the very least tested to compile sucessfully)
+* Have no dependencies outside the OpenWrt core packages or this repository feed.
+* Have been tested to compile with the correct includes and dependencies. Also, test with "Compile with full language support" found under "General Build Settings" set.
+* Best of all -- it works as expected!
+
+Makefile contents should contain:
+
+* An up-to-date copyright notice. Use OpenWrt if no other present or supply your own.
+* A (PKG_)MAINTAINER definition listing either yourself or another person in the field.  
+    (E.g.: PKG_MAINTAINER:= Joe D. Hacker `<jdh@jdhs-email-provider.org`>)
+* A PKG_LICENSE tag declaring the main license of the package.
+    (E.g.: PKG_LICENSE:=GPL-2.0+) Please use SPDX identifiers if possible (see list at the bottom).
+* An optional PKG_LICENSE_FILE including the filename of the license-file in the source-package.
+    (E.g.: PKG_LICENSE_FILE:=COPYING)
 
-Please make sure that all commits you make to this repository:
-* Are signed-off (see https://dev.openwrt.org/wiki/SubmittingPatches#a10.Signyourwork)
-* Have a proper description prefixed with the package name
+Commits and pull-requests:
+
+* Have a useful description prefixed with the package name  
+    (E.g.: "foopkg: Add libzot dependency")
+* Include Signed-off-by in the comment  
+    (See <https://dev.openwrt.org/wiki/SubmittingPatches#a10.Signyourwork>)
 
 If you have commit access:
+
 * Do NOT use git push --force.
 * Do NOT commit to other maintainer's packages without their consent.
 * Use Pull Requests if you are unsure and to suggest changes to other maintainers.
 
+Gaining commit access:
+
+* We will gladly grant commit access to responsible contributors who have made
+  useful pull requests and / or feedback or patches to this repository or
+  OpenWrt in general. Please include your request for commit access in your
+  next pull request or ticket.
+
 Release Branches:
+
 * Branches named "for-XX.YY" (e.g. for-14.07) are release branches.
 * These branches are built with the respective OpenWrt release and are created
   during the release stabilisation phase.
 * Please ONLY cherry-pick or commit security and bug-fixes to these branches.
 * Do NOT add new packages and do NOT do major upgrades of packages here.
 * If you are unsure if your change is suitable, please use a pull request.
+
+####Common LICENSE tags (short list)  
+(Complete list can be found at: <http://spdx.org/licenses>)
+####  
+
+| Full Name | Identifier  |
+|---|:---|
+|Apache License 1.0|Apache-1.0|
+|Apache License 1.1|Apache-1.1|
+|Apache License 2.0|Apache-2.0|
+|Artistic License 1.0|Artistic-1.0|
+|Artistic License 1.0 (Perl)|Artistic-1.0-Perl|
+|Artistic License 1.0 w/clause 8|Artistic-1.0-cl8|
+|Artistic License 2.0|Artistic-2.0|
+|BSD 2-clause "Simplified" License|BSD-2-Clause|
+|BSD 2-clause FreeBSD License|BSD-2-Clause-FreeBSD|
+|BSD 2-clause NetBSD License|BSD-2-Clause-NetBSD|
+|BSD 3-clause "New" or "Revised" License|BSD-3-Clause|
+|BSD 3-clause Clear License|BSD-3-Clause-Clear|
+|BSD 4-clause "Original" or "Old" License|BSD-4-Clause|
+|BSD Protection License|BSD-Protection|
+|BSD with attribution|BSD-3-Clause-Attribution|
+|BSD-4-Clause (University of California-Specific)|BSD-4-Clause-UC|
+|GNU General Public License v1.0 only|GPL-1.0|
+|GNU General Public License v1.0 or later|GPL-1.0+|
+|GNU General Public License v2.0 only|GPL-2.0|
+|GNU General Public License v2.0 or later|GPL-2.0+|
+|GNU General Public License v3.0 only|GPL-3.0|
+|GNU General Public License v3.0 or later|GPL-3.0+|
+|GNU Lesser General Public License v2.1 only|LGPL-2.1|
+|GNU Lesser General Public License v2.1 or later|LGPL-2.1+|
+|GNU Lesser General Public License v3.0 only|LGPL-3.0|
+|GNU Lesser General Public License v3.0 or later|LGPL-3.0+|
+|GNU Library General Public License v2 only|LGPL-2.0|
+|GNU Library General Public License v2 or later|LGPL-2.0+|
+|Fair License|Fair|
+|ISC License|ISC|
+|MIT License|MIT|
+|No Limit Public License|NLPL|
+|OpenSSL License|OpenSSL|
+|X11 License|X11|
+|zlib License|Zlib|
index 3d3e97b13986246d3d9bd290d0da2d4a7ea1a71d..dd33d776b5b33138c6892fd49564a96fe7ed1ae4 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# OpenWRT packages feed
+# OpenWrt packages feed
 
 ## Description
 
index 8089f92de96e985c33ecd15ff85bfb2ca865cb6e..9c3fc617174bf172a28473d1d2eb56dedca7c235 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Copyright (C) 2010 Gianluigi Tiesi <sherpya@netfarm.it>
-# Copyright (C) 2011-2013 OpenWrt.org
+# Copyright (C) 2011-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -16,6 +16,8 @@ PKG_MAINTAINER=Daniel Golle <daniel@makrotopia.org>
 PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
 PKG_MD5SUM:=6d4e3b97981b9e0bb86f49d8edac91af
+PKG_LICENSE:=Unique
+PKG_LICENSE_FILES:=debian/copyright
 
 UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.xz | xzcat | tar -C $(1) -xf -
 
index a27ce03c65092f999521d2fc5d89e1562219cdac..7cb47067a1d772281d4f634ae55e7806e29823bd 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2007-2012 OpenWrt.org
+# Copyright (C) 2007-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://hisham.hm/htop/releases/$(PKG_VERSION)/
 PKG_MD5SUM:=e768b9b55c033d9c1dffda72db3a6ac7
 
 PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index fb2b15857014d76b3507472b5c664d71cd283af5..fd8a979e9a8f5d39d14ef41440cf4b0cc0ec2ba4 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://mmonit.com/monit/dist
 PKG_MD5SUM:=9467328f1da0b644a766a387443db2ea
 
 PKG_LICENSE:=AGPL-3.0
-PKG_LICENSE_FILES:=
+PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL:=1
index 3388a2b87df1a3eb06fddaa2721eb595637fd4f9..1c1793edd82e0c6735d0337baf0e9fbb57322e55 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=5
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/$(PKG_NAME)
 PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=LICENSE
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -23,7 +25,7 @@ define Package/muninlite
   DEPENDS:=+xinetd
   TITLE:=Munin node implemented in shell
   URL:=http://sourceforge.net/projects/muninlite/
-  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
+  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 endef
 
 define Package/muninlite/Default/description
index f015aca276ff233e81f075dff14c76624bec03c9..c05aa449c4f2bf3ee1200c360b9831a9bf1464dc 100644 (file)
@@ -15,8 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/zabbix
 PKG_MD5SUM:=e7b74a0208743f743585d9cc1d46eccf
 
-PKG_LICENSE:=GPLv2
-PKG_LICENSE_FILES:=
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile
new file mode 100644 (file)
index 0000000..c8d8733
--- /dev/null
@@ -0,0 +1,115 @@
+#
+# Copyright (C) 2008 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gcc
+PKG_VERSION:=4.8.3
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \
+     http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \
+    ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=7c60f24fab389f77af203d2516ee110f
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_LANGUAGES:="c,c++"
+BUGURL=https://dev.openwrt.org/
+PKGVERSION=OpenWrt GCC $(PKG_VERSION)
+
+# not using sstrip here as this fucks up the .so's somehow
+STRIP:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip
+RSTRIP:= \
+       NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
+       STRIP="$(STRIP)" \
+       STRIP_KMOD="$(STRIP) --strip-debug" \
+       $(SCRIPT_DIR)/rstrip.sh
+
+
+define Package/gcc
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=gcc
+  MAINTAINER:=Christian Beier <cb@shoutrlabs.com>
+  DEPENDS:= +binutils +libstdcpp
+endef
+
+define Package/gcc/description
+       build a native toolchain for compiling on target
+endef
+
+
+define Build/Prepare
+       $(PKG_UNPACK)
+#      we have to download additional stuff before patching
+       (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites)
+       $(Build/Patch)
+endef
+
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); rm -f config.cache; \
+               SHELL="$(BASH)" \
+               $(TARGET_CONFIGURE_OPTS) \
+               $(PKG_BUILD_DIR)/configure \
+                       $(CONFIGURE_ARGS) \
+                       --build=$(GNU_HOST_NAME) \
+                       --host=$(REAL_GNU_TARGET_NAME) \
+                       --target=$(REAL_GNU_TARGET_NAME) \
+                       --enable-languages=$(TARGET_LANGUAGES) \
+                       --with-bugurl=$(BUGURL) \
+                       --with-pkgversion="$(PKGVERSION)" \
+                       --enable-shared \
+                       --disable-__cxa_atexit \
+                       --enable-target-optspace \
+                       --with-gnu-ld \
+                       --disable-nls \
+                       --disable-libmudflap \
+                       --disable-multilib \
+                       --disable-libgomp \
+                       --disable-libquadmath \
+                       --disable-libssp \
+                       --disable-decimal-float \
+                       --disable-libstdcxx-pch \
+                       --with-host-libstdcxx=-lstdc++ \
+                       --prefix=/usr \
+                       --libexecdir=/usr/lib \
+                       $(SOFT_FLOAT_CONFIG_OPTION) \
+                       $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
+                       $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
+                       --with-abi=$(subst ",,$(CONFIG_MIPS64_ABI))) \
+       );
+endef
+
+define Build/Compile
+       export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
+                       DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
+endef
+
+define Package/gcc/install
+       $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       cp -ar $(PKG_INSTALL_DIR)/usr/include $(1)/usr
+       cp -a $(PKG_INSTALL_DIR)/usr/bin/{$(REAL_GNU_TARGET_NAME)-{g++,gcc},cpp,gcov} $(1)/usr/bin
+       ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/c++
+       ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/g++
+       ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++
+       ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc
+       ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION)
+       cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib
+       $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a
+       cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+       cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a  $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+endef
+
+$(eval $(call BuildPackage,gcc))
diff --git a/devel/gcc/README b/devel/gcc/README
new file mode 100644 (file)
index 0000000..6cbc80d
--- /dev/null
@@ -0,0 +1,8 @@
+Native GCC that runs on target.
+
+To save disk space, this GCC only supports dynamic linking on the target box,
+there are no static libraries shipped.
+
+For now, this was only tested on a mips target. Others to be done...
+
+   Christian Beier <cb@shoutrlabs.com>
\ No newline at end of file
diff --git a/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch b/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch
new file mode 100644 (file)
index 0000000..8472960
--- /dev/null
@@ -0,0 +1,15 @@
+diff --git a/gcc/real.h b/gcc/real.h
+index 2ff84f6..fbb4b0e 100644
+--- a/gcc/real.h
++++ b/gcc/real.h
+@@ -72,8 +72,10 @@ struct GTY(()) real_value {
+    + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */
+ /* Verify the guess.  */
++#ifndef __LP64__
+ extern char test_real_width
+   [sizeof(REAL_VALUE_TYPE) <= REAL_WIDTH*sizeof(HOST_WIDE_INT) ? 1 : -1];
++#endif
+ /* Calculate the format for CONST_DOUBLE.  We need as many slots as
+    are necessary to overlay a REAL_VALUE_TYPE on them.  This could be
diff --git a/devel/gcc/patches/003-mpfr-longlong-mips.patch b/devel/gcc/patches/003-mpfr-longlong-mips.patch
new file mode 100644 (file)
index 0000000..0ab9fe5
--- /dev/null
@@ -0,0 +1,38 @@
+diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h
+--- -a/mpfr-2.4.2/mpfr-longlong.h      2009-11-30 02:43:08.000000000 +0000
++++ -b/mpfr-2.4.2/mpfr-longlong.h      2009-12-18 12:04:29.000000000 +0000
+@@ -1011,7 +1011,15 @@
+ #endif /* __m88000__ */
+ #if defined (__mips) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
++#define umul_ppmm(w1, w0, u, v) \
++  do {                                                                        \
++    UDItype _r;                                                       \
++    _r = (UDItype) u * v;                                             \
++    (w1) = _r >> 32;                                                  \
++    (w0) = (USItype) _r;                                              \
++  } while (0)
++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+ #else
+@@ -1024,7 +1032,16 @@
+ #endif /* __mips */
+ #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
++typedef unsigned int UTItype __attribute__ ((mode (TI)));
++#define umul_ppmm(w1, w0, u, v) \
++  do {                                                                        \
++    UTItype _r;                                                       \
++    _r = (UTItype) u * v;                                             \
++    (w1) = _r >> 64;                                                  \
++    (w0) = (UDItype) _r;                                              \
++  } while (0)
++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+ #else
diff --git a/devel/gcc/patches/010-documentation.patch b/devel/gcc/patches/010-documentation.patch
new file mode 100644 (file)
index 0000000..3f604ee
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4326,18 +4326,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+ doc/gccint.info: $(TEXI_GCCINT_FILES)
+ doc/cppinternals.info: $(TEXI_CPPINT_FILES)
+-doc/%.info: %.texi
+-      if [ x$(BUILD_INFO) = xinfo ]; then \
+-              $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \
+-                      -I $(gcc_docdir)/include -o $@ $<; \
+-      fi
++doc/%.info:
+ # Duplicate entry to handle renaming of gccinstall.info
+-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES)
+-      if [ x$(BUILD_INFO) = xinfo ]; then \
+-              $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \
+-                      -I $(gcc_docdir)/include -o $@ $<; \
+-      fi
++doc/gccinstall.info:
+ doc/cpp.dvi: $(TEXI_CPP_FILES)
+ doc/gcc.dvi: $(TEXI_GCC_FILES)
diff --git a/devel/gcc/patches/100-uclibc-conf.patch b/devel/gcc/patches/100-uclibc-conf.patch
new file mode 100644 (file)
index 0000000..ff9ad94
--- /dev/null
@@ -0,0 +1,33 @@
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
+  then
+   make all-gdb all-dejagnu all-ld || exit 1
+   make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++  make all-gdb all-dejagnu all-ld || exit 1
++  make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+   make bootstrap || exit 1
+   make install || exit 1
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux
+   ;;
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
diff --git a/devel/gcc/patches/200-musl.patch b/devel/gcc/patches/200-musl.patch
new file mode 100644 (file)
index 0000000..2e6df47
--- /dev/null
@@ -0,0 +1,321 @@
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -549,7 +549,7 @@ case ${target} in
+ esac
+ # Common C libraries.
+-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
+ # Common parts for widely ported systems.
+ case ${target} in
+@@ -652,6 +652,9 @@ case ${target} in
+     *-*-*uclibc*)
+       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
+       ;;
++    *-*-*musl*)
++      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
++      ;;
+     *)
+       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
+       ;;
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,6 +77,10 @@
+     %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+     %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
++/* musl has no "classic" (i.e. broken) mode */
++#undef  MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+    use the GNU/Linux version, not the generic BPABI version.  */
+ #undef  LINK_SPEC
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3.
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -30,3 +30,7 @@ see the files COPYING3 and COPYING.RUNTI
+ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+ #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI
+ #define OPTION_GLIBC  (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#define OPTION_MUSL   (DEFAULT_LIBC == LIBC_MUSL)
+ #else
+ #define OPTION_GLIBC  (linux_libc == LIBC_GLIBC)
+ #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+ #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
++#define OPTION_MUSL   (linux_libc == LIBC_MUSL)
+ #endif
+ #define GNU_USER_TARGET_OS_CPP_BUILTINS()                     \
+@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTI
+    uClibc or Bionic is the default C library and whether
+    -muclibc or -mglibc or -mbionic has been passed to change the default.  */
+-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3)    \
+-  "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4)        \
++  "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
+ #if DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+-  CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++  CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
+ #elif DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+-  CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++  CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
+ #elif DEFAULT_LIBC == LIBC_BIONIC
+-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+-  CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++  CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
++  CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif /* DEFAULT_LIBC */
+@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTI
+ #define GNU_USER_DYNAMIC_LINKER                                               \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+-                       BIONIC_DYNAMIC_LINKER)
++                       BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define GNU_USER_DYNAMIC_LINKER32                                     \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+-                       BIONIC_DYNAMIC_LINKER32)
++                       BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64                                     \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+-                       BIONIC_DYNAMIC_LINKER64)
++                       BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define GNU_USER_DYNAMIC_LINKERX32                                    \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
+-                       BIONIC_DYNAMIC_LINKERX32)
++                       BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
+ /* Determine whether the entire c99 runtime
+    is present in the runtime library.  */
+--- a/gcc/config/linux.opt
++++ b/gcc/config/linux.opt
+@@ -30,3 +30,7 @@ Use GNU C library
+ muclibc
+ Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
++Use musl C library
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -18,3 +18,5 @@ along with GCC; see the file COPYING3.
+ <http://www.gnu.org/licenses/>.  */
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -364,17 +364,21 @@ extern int dot_symbols;
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
+ #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+ #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER32 \
+-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
++  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
+ #define GNU_USER_DYNAMIC_LINKER64 \
+-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
++  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
+ #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -789,15 +789,18 @@ extern int fixuplabelno;
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
++#elif DEFAULT_LIBC == LIBC_MUSL
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
+ #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
+-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
+ #else
+ #error "Unsupported DEFAULT_LIBC"
+ #endif
+ #define GNU_USER_DYNAMIC_LINKER \
+-  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
++  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
+ #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+   %{rdynamic:-export-dynamic} \
+--- a/gcc/ginclude/stddef.h
++++ b/gcc/ginclude/stddef.h
+@@ -181,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #ifndef _GCC_SIZE_T
+ #ifndef _SIZET_
+ #ifndef __size_t
++#ifndef __DEFINED_size_t /* musl */
+ #define __size_t__    /* BeOS */
+ #define __SIZE_T__    /* Cray Unicos/Mk */
+ #define _SIZE_T
+@@ -197,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+ #define ___int_size_t_h
+ #define _GCC_SIZE_T
+ #define _SIZET_
++#define __DEFINED_size_t /* musl */
+ #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
+   || defined(__FreeBSD_kernel__)
+ /* __size_t is a typedef on FreeBSD 5, must not trash it. */
+@@ -214,6 +216,7 @@ typedef __SIZE_TYPE__ size_t;
+ typedef long ssize_t;
+ #endif /* __BEOS__ */
+ #endif /* !(defined (__GNUG__) && defined (size_t)) */
++#endif /* __DEFINED_size_t */
+ #endif /* __size_t */
+ #endif /* _SIZET_ */
+ #endif /* _GCC_SIZE_T */
+--- a/libgomp/config/posix/time.c
++++ b/libgomp/config/posix/time.c
+@@ -28,6 +28,8 @@
+    The following implementation uses the most simple POSIX routines.
+    If present, POSIX 4 clocks should be used instead.  */
++#define _POSIX_C_SOURCE 199309L /* for clocks */
++
+ #include "libgomp.h"
+ #include <unistd.h>
+ #if TIME_WITH_SYS_TIME
+--- a/libitm/config/arm/hwcap.cc
++++ b/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
+ #ifdef __linux__
+ #include <unistd.h>
++#ifdef __GLIBC__
+ #include <sys/fcntl.h>
++#else
++#include <fcntl.h>
++#endif
+ #include <elf.h>
+ static void __attribute__((constructor))
+--- a/libitm/config/linux/x86/tls.h
++++ b/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+    GLIBC has reserved words 10 through 13 for TM.  */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+ #include "config/generic/tls.h"
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+ #endif // LIBITM_X86_TLS_H
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -264,6 +264,13 @@ case "${host_os}" in
+     os_include_dir="os/bsd/freebsd"
+     ;;
+   gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
++    # check for musl by target
++    case "${host_os}" in
++      *-musl*)
++        os_include_dir="os/generic"
++        ;;
++      *)
++
+     if [ "$uclibc" = "yes" ]; then
+       os_include_dir="os/uclibc"
+     elif [ "$bionic" = "yes" ]; then
+@@ -272,6 +279,9 @@ case "${host_os}" in
+       os_include_dir="os/gnu-linux"
+     fi
+     ;;
++
++    esac
++    ;;
+   hpux*)
+     os_include_dir="os/hpux"
+     ;;
+--- a/gcc/config/mips/linux64.h
++++ b/gcc/config/mips/linux64.h
+@@ -27,6 +27,9 @@ along with GCC; see the file COPYING3.
+ #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
+ #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
++#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1"
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1"
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+-                       BIONIC_DYNAMIC_LINKERN32)
++                       BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
+--- a/gcc/config/sparc/linux64.h       2013-09-10 10:02:45.663973856 +0100
++++ b/gcc/config/sparc/linux64.h       2013-09-10 10:03:17.871972435 +0100
+@@ -104,6 +104,9 @@
+ #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+ #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-sparc.so.1"
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-sparc.so.1"
++
+ #ifdef SPARC_BI_ARCH
+ #undef SUBTARGET_EXTRA_SPECS
+
diff --git a/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch b/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch
new file mode 100644 (file)
index 0000000..ae4f651
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/gcc/config/arm/arm.h
++++ b/gcc/config/arm/arm.h
+@@ -271,7 +271,7 @@ extern void (*arm_lang_output_object_att
+ /* Thumb-1 only.  */
+ #define TARGET_THUMB1_ONLY            (TARGET_THUMB1 && !arm_arch_notm)
+-#define TARGET_LDRD                   (arm_arch5e && ARM_DOUBLEWORD_ALIGN \
++#define TARGET_LDRD                   (arm_arch6 && ARM_DOUBLEWORD_ALIGN \
+                                          && !TARGET_THUMB1)
+ /* The following two macros concern the ability to execute coprocessor
diff --git a/devel/gcc/patches/810-arm-softfloat-libgcc.patch b/devel/gcc/patches/810-arm-softfloat-libgcc.patch
new file mode 100644 (file)
index 0000000..33cf8ad
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/libgcc/config/arm/t-linux
++++ b/libgcc/config/arm/t-linux
+@@ -1,6 +1,10 @@
+ LIB1ASMSRC = arm/lib1funcs.S
+ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \
+-      _ctzsi2 _arm_addsubdf3 _arm_addsubsf3
++      _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \
++      _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \
++      _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \
++      _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \
++      _arm_fixsfsi _arm_fixunssfsi
+ # Just for these, we omit the frame pointer since it makes such a big
+ # difference.
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -55,8 +55,6 @@
+    %{shared:-lc} \
+    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
+-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+-
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} \
diff --git a/devel/gcc/patches/820-libgcc_pic.patch b/devel/gcc/patches/820-libgcc_pic.patch
new file mode 100644 (file)
index 0000000..7a0ac73
--- /dev/null
@@ -0,0 +1,36 @@
+--- a/libgcc/Makefile.in
++++ b/libgcc/Makefile.in
+@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir
+ # Static libraries.
+ libgcc.a: $(libgcc-objects)
++libgcc_pic.a: $(libgcc-s-objects)
+ libgcov.a: $(libgcov-objects)
+ libunwind.a: $(libunwind-objects)
+ libgcc_eh.a: $(libgcc-eh-objects)
+-libgcc.a libgcov.a libunwind.a libgcc_eh.a:
++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a:
+       -rm -f $@
+       objects="$(objects)";                                   \
+@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E
+ endif
+ ifeq ($(enable_shared),yes)
+-all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT)
+ ifneq ($(LIBUNWIND),)
+ all: libunwind$(SHLIB_EXT)
+ endif
+@@ -1058,6 +1059,10 @@ install-shared:
+       chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
+       $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
++      $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/
++      chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++      $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a
++
+       $(subst @multilib_dir@,$(MULTIDIR),$(subst \
+               @shlib_base_name@,libgcc_s,$(subst \
+               @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
diff --git a/devel/gcc/patches/830-arm_unbreak_armv4t.patch b/devel/gcc/patches/830-arm_unbreak_armv4t.patch
new file mode 100644 (file)
index 0000000..37f8f2a
--- /dev/null
@@ -0,0 +1,13 @@
+http://sourceware.org/ml/crossgcc/2008-05/msg00009.html
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -45,7 +45,7 @@
+    The ARM10TDMI core is the default for armv5t, so set
+    SUBTARGET_CPU_DEFAULT to achieve this.  */
+ #undef  SUBTARGET_CPU_DEFAULT
+-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi
++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi
+ /* TARGET_BIG_ENDIAN_DEFAULT is set in
+    config.gcc for big endian configurations.  */
diff --git a/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch b/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch
new file mode 100644 (file)
index 0000000..e938905
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -81,10 +81,15 @@
+ #undef  MUSL_DYNAMIC_LINKER
+ #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
++  "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+    use the GNU/Linux version, not the generic BPABI version.  */
+ #undef  LINK_SPEC
+-#define LINK_SPEC BE8_LINK_SPEC                                               \
++#define LINK_SPEC BE8_LINK_SPEC TARGET_FIX_V4BX_SPEC                  \
+   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,                                \
+                      LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
diff --git a/devel/gcc/patches/850-use_shared_libgcc.patch b/devel/gcc/patches/850-use_shared_libgcc.patch
new file mode 100644 (file)
index 0000000..2c7369f
--- /dev/null
@@ -0,0 +1,47 @@
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -114,10 +114,6 @@
+ #define ENDFILE_SPEC \
+   LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
+-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
+-   do not use -lfloat.  */
+-#undef LIBGCC_SPEC
+-
+ /* Clear the instruction cache from `beg' to `end'.  This is
+    implemented in lib1funcs.S, so ensure an error if this definition
+    is used.  */
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
+       builtin_assert ("system=posix");                        \
+     } while (0)
++#ifndef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}"
++#endif
++
+ /* Determine which dynamic linker to use depending on whether GLIBC or
+    uClibc or Bionic is the default C library and whether
+    -muclibc or -mglibc or -mbionic has been passed to change the default.  */
+--- a/libgcc/mkmap-symver.awk
++++ b/libgcc/mkmap-symver.awk
+@@ -132,5 +132,5 @@ function output(lib) {
+   else if (inherit[lib])
+     printf("} %s;\n", inherit[lib]);
+   else
+-    printf ("\n  local:\n\t*;\n};\n");
++    printf ("\n\t*;\n};\n");
+ }
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -61,6 +61,9 @@
+ #undef  CPLUSPLUS_CPP_SPEC
+ #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
++#undef LIBGCC_SPEC
++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
++
+ #undef  LINK_SHLIB_SPEC
+ #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}"
diff --git a/devel/gcc/patches/860-uclibc_use_eh_frame.patch b/devel/gcc/patches/860-uclibc_use_eh_frame.patch
new file mode 100644 (file)
index 0000000..0464bd7
--- /dev/null
@@ -0,0 +1,29 @@
+--- a/libgcc/crtstuff.c
++++ b/libgcc/crtstuff.c
+@@ -100,15 +100,20 @@ call_ ## FUNC (void)                                     \
+ #if defined(OBJECT_FORMAT_ELF) \
+     && !defined(OBJECT_FORMAT_FLAT) \
+     && defined(HAVE_LD_EH_FRAME_HDR) \
+-    && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
+-    && defined(__GLIBC__) && __GLIBC__ >= 2
++    && !defined(inhibit_libc) && !defined(CRTSTUFFT_O)
+ #include <link.h>
+ /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
+    But it doesn't use PT_GNU_EH_FRAME ELF segment currently.  */
+-# if !defined(__UCLIBC__) \
+-     && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
+-     || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
+-#  define USE_PT_GNU_EH_FRAME
++# if defined(__UCLIBC__)
++#  if (__UCLIBC_MAJOR__ > 0 || __UCLIBC_MINOR__ > 9 || \
++       (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 33))
++#   define USE_PT_GNU_EH_FRAME
++#  endif
++# elif defined(__GLIBC__)
++#  if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
++       || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
++#   define USE_PT_GNU_EH_FRAME
++#  endif
+ # endif
+ #endif
diff --git a/devel/gcc/patches/870-ppc_no_crtsavres.patch b/devel/gcc/patches/870-ppc_no_crtsavres.patch
new file mode 100644 (file)
index 0000000..d8c460a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/gcc/config/rs6000/rs6000.c
++++ b/gcc/config/rs6000/rs6000.c
+@@ -17653,7 +17653,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+   /* Define cutoff for using out-of-line functions to save registers.  */
+   if (DEFAULT_ABI == ABI_V4 || TARGET_ELF)
+     {
+-      if (!optimize_size)
++      if (1)
+       {
+         strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS;
+         strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS;
diff --git a/devel/gcc/patches/880-no_java_section.patch b/devel/gcc/patches/880-no_java_section.patch
new file mode 100644 (file)
index 0000000..def6c9f
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI
+ /* If we have named section and we support weak symbols, then use the
+    .jcr section for recording java classes which need to be registered
+    at program start-up time.  */
+-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK
+ #ifndef JCR_SECTION_NAME
+ #define JCR_SECTION_NAME ".jcr"
+ #endif
diff --git a/devel/gcc/patches/900-bad-mips16-crt.patch b/devel/gcc/patches/900-bad-mips16-crt.patch
new file mode 100644 (file)
index 0000000..dd6e9dc
--- /dev/null
@@ -0,0 +1,9 @@
+--- a/libgcc/config/mips/t-mips16
++++ b/libgcc/config/mips/t-mips16
+@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16
+ # Version these symbols if building libgcc.so.
+ SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver
++
++CRTSTUFF_T_CFLAGS += -mno-mips16
++CRTSTUFF_T_CFLAGS_S += -mno-mips16
diff --git a/devel/gcc/patches/910-mbsd_multi.patch b/devel/gcc/patches/910-mbsd_multi.patch
new file mode 100644 (file)
index 0000000..d04dc7d
--- /dev/null
@@ -0,0 +1,253 @@
+
+       This patch brings over a few features from MirBSD:
+       * -fhonour-copts
+         If this option is not given, it's warned (depending
+         on environment variables). This is to catch errors
+         of misbuilt packages which override CFLAGS themselves.
+       * -Werror-maybe-reset
+         Has the effect of -Wno-error if GCC_NO_WERROR is
+         set and not '0', a no-operation otherwise. This is
+         to be able to use -Werror in "make" but prevent
+         GNU autoconf generated configure scripts from
+         freaking out.
+       * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
+         the default for -O2/-Os, because they trigger gcc bugs
+         and can delete code with security implications.
+
+       This patch was authored by Thorsten Glaser <tg at mirbsd.de>
+       with copyright assignment to the FSF in effect.
+
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -104,6 +104,9 @@ static size_t include_cursor;
+ /* Whether any standard preincluded header has been preincluded.  */
+ static bool done_preinclude;
++/* Check if a port honours COPTS.  */
++static int honour_copts = 0;
++
+ static void handle_OPT_d (const char *);
+ static void set_std_cxx98 (int);
+ static void set_std_cxx11 (int);
+@@ -383,6 +386,9 @@ c_common_handle_option (size_t scode, co
+       cpp_opts->warn_endif_labels = value;
+       break;
++    case OPT_Werror_maybe_reset:
++      break;
++
+     case OPT_Winvalid_pch:
+       cpp_opts->warn_invalid_pch = value;
+       break;
+@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co
+       flag_no_builtin = !value;
+       break;
++    case OPT_fhonour_copts:
++      if (c_language == clk_c) {
++        honour_copts++;
++      }
++      break;
++
+     case OPT_fconstant_string_class_:
+       constant_string_class_name = arg;
+       break;
+@@ -1027,6 +1039,47 @@ c_common_init (void)
+       return false;
+     }
++  if (c_language == clk_c) {
++    char *ev = getenv ("GCC_HONOUR_COPTS");
++    int evv;
++    if (ev == NULL)
++      evv = -1;
++    else if ((*ev == '0') || (*ev == '\0'))
++      evv = 0;
++    else if (*ev == '1')
++      evv = 1;
++    else if (*ev == '2')
++      evv = 2;
++    else if (*ev == 's')
++      evv = -1;
++    else {
++      warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1");
++      evv = 1; /* maybe depend this on something like MIRBSD_NATIVE?  */
++    }
++    if (evv == 1) {
++      if (honour_copts == 0) {
++        error ("someone does not honour COPTS at all in lenient mode");
++        return false;
++      } else if (honour_copts != 1) {
++        warning (0, "someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++      }
++    } else if (evv == 2) {
++      if (honour_copts == 0) {
++        error ("someone does not honour COPTS at all in strict mode");
++        return false;
++      } else if (honour_copts != 1) {
++        error ("someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++        return false;
++      }
++    } else if (evv == 0) {
++      if (honour_copts != 1)
++        inform (0, "someone does not honour COPTS correctly, passed %d times",
++         honour_copts);
++    }
++  }
++
+   return true;
+ }
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -379,6 +379,10 @@ Werror-implicit-function-declaration
+ C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration)
+ This switch is deprecated; use -Werror=implicit-function-declaration instead
++Werror-maybe-reset
++C ObjC C++ ObjC++
++; Documented in common.opt
++
+ Wfloat-equal
+ C ObjC C++ ObjC++ Var(warn_float_equal) Warning
+ Warn if testing floating point numbers for equality
+@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception
+ fhonor-std
+ C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
++fhonour-copts
++C ObjC C++ ObjC++ RejectNegative
++
+ fhosted
+ C ObjC
+ Assume normal C execution environment
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -541,6 +541,10 @@ Werror=
+ Common Joined
+ Treat specified warning as error
++Werror-maybe-reset
++Common
++If environment variable GCC_NO_WERROR is set, act as -Wno-error
++
+ Wextra
+ Common Var(extra_warnings) Warning
+ Print extra (possibly unwanted) warnings
+@@ -1242,6 +1246,9 @@ fguess-branch-probability
+ Common Report Var(flag_guess_branch_prob) Optimization
+ Enable guessing of branch probabilities
++fhonour-copts
++Common RejectNegative
++
+ ; Nonzero means ignore `#ident' directives.  0 means handle them.
+ ; Generate position-independent code for executables if possible
+ ; On SVR4 targets, it also controls whether or not to emit a
+--- a/gcc/opts.c
++++ b/gcc/opts.c
+@@ -468,8 +468,6 @@ static const struct default_options defa
+     { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 },
+ #endif
+     { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 },
+-    { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 },
+-    { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 },
+     { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 },
+     { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 },
+     { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 },
+@@ -488,6 +486,8 @@ static const struct default_options defa
+     { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 },
+     /* -O3 optimizations.  */
++    { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 },
++    { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 },
+     { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 },
+     { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 },
+     /* Inlining of functions reducing size is a good idea with -Os
+@@ -1423,6 +1423,17 @@ common_handle_option (struct gcc_options
+                              opts, opts_set, loc, dc);
+       break;
++    case OPT_Werror_maybe_reset:
++      {
++        char *ev = getenv ("GCC_NO_WERROR");
++        if ((ev != NULL) && (*ev != '0'))
++          warnings_are_errors = 0;
++      }
++      break;
++
++    case OPT_fhonour_copts:
++      break;
++
+     case OPT_Wlarger_than_:
+       opts->x_larger_than_size = value;
+       opts->x_warn_larger_than = value != -1;
+--- a/gcc/doc/cppopts.texi
++++ b/gcc/doc/cppopts.texi
+@@ -163,6 +163,11 @@ in older programs.  This warning is on b
+ Make all warnings into hard errors.  Source code which triggers warnings
+ will be rejected.
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
+ @item -Wsystem-headers
+ @opindex Wsystem-headers
+ Issue warnings for code in system headers.  These are normally unhelpful
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wno-deprecated  @gol
+ -Wno-deprecated-declarations -Wdisabled-optimization  @gol
+ -Wno-div-by-zero -Wdouble-promotion -Wempty-body  -Wenum-compare @gol
+--Wno-endif-labels -Werror  -Werror=* @gol
++-Wno-endif-labels -Werror  -Werror=* -Werror-maybe-reset @gol
+ -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
+ -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
+ -Wformat-security  -Wformat-y2k @gol
+@@ -4808,6 +4808,22 @@ This option is only supported for C and
+ @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
+ @option{-Wno-pointer-sign}.
++ at item -Werror-maybe-reset
++ at opindex Werror-maybe-reset
++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment
++variable is set to anything other than 0 or empty.
++
++ at item -fhonour-copts
++ at opindex fhonour-copts
++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not
++given at least once, and warn if it is given more than once.
++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not
++given exactly once.
++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option
++is not given exactly once.
++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}.
++This flag and environment variable only affect the C language.
++
+ @item -Wstack-protector
+ @opindex Wstack-protector
+ @opindex Wno-stack-protector
+@@ -6919,7 +6935,7 @@ so, the first branch is redirected to ei
+ second branch or a point immediately following it, depending on whether
+ the condition is known to be true or false.
+-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
++Enabled at levels @option{-O3}.
+ @item -fsplit-wide-types
+ @opindex fsplit-wide-types
+--- a/gcc/java/jvspec.c
++++ b/gcc/java/jvspec.c
+@@ -626,6 +626,7 @@ lang_specific_pre_link (void)
+      class name.  Append dummy `.c' that can be stripped by set_input so %b
+      is correct.  */ 
+   set_input (concat (main_class_name, "main.c", NULL));
++  putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack!  */
+   err = do_spec (jvgenmain_spec);
+   if (err == 0)
+     {
diff --git a/devel/gcc/patches/920-specs_nonfatal_getenv.patch b/devel/gcc/patches/920-specs_nonfatal_getenv.patch
new file mode 100644 (file)
index 0000000..4baa966
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -8003,7 +8003,10 @@ getenv_spec_function (int argc, const ch
+   value = getenv (argv[0]);
+   if (!value)
+-    fatal_error ("environment variable %qs not defined", argv[0]);
++    {
++      warning (0, "environment variable %qs not defined", argv[0]);
++      value = "";
++    }
+   /* We have to escape every character of the environment variable so
+      they are not interpreted as active spec characters.  A
index 0177d707a3e904d41b5d97e9b5ed99d49742b79b..63809c5b8c92127912a1c463f2d727ba44e4953d 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/patch
 PKG_MD5SUM:=e9ae5393426d3ad783a300a338c09b72
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
 
index fe1f162ddb7bdfa2858a42fb3b687f1548bc218e..bfa8a83206c2f09c417ea2889a40ced1715fea54 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=11
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix
 PKG_MD5SUM:=c9bcc83644ed788e22a7c3f3d4021350
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=doc/LICENSE
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
 
index 5f8418770d23030390afb5f53a58bc211cb7ed65..8b645650fb80301226ad0f2ab18a71ae49238c2b 100644 (file)
@@ -9,8 +9,10 @@ PKG_RELEASE:=2
 PKG_SOURCE:=tayga-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.litech.org/tayga/
 PKG_MD5SUM:=7a7b24165ce008df772f398d86fa280e
-PKG_CAT:=bzcat
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
 
+PKG_CAT:=bzcat
 PKG_BUILD_DIR:=$(BUILD_DIR)/tayga-$(PKG_VERSION)
 PKG_FIXUP:=autoreconf
 
index c0588e3a99510d59575fd22cd4fea8196127fa55..eda6f9b821e906bfdce5163aab14f163456e6e43 100644 (file)
@@ -18,6 +18,7 @@ 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
 
index ceb407d3fb8194e823a39577a76686171c02bedd..29f1a676fe6d1e63c1183ebd4337409cb5037f0a 100644 (file)
@@ -18,6 +18,7 @@ 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
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/lang/micropython-lib/Makefile b/lang/micropython-lib/Makefile
new file mode 100644 (file)
index 0000000..3334b22
--- /dev/null
@@ -0,0 +1,53 @@
+#
+# 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:=micropython-lib
+PKG_VERSION:=2014-08-12
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
+PKG_SOURCE_VERSION:=7bc0c0a45894ec10eb3fd3515428a087a24ac228
+
+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
+    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..0825bd9
--- /dev/null
@@ -0,0 +1,58 @@
+#
+# 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:=micropython
+PKG_VERSION=1.2-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/micropython/micropython.git
+PKG_SOURCE_VERSION:=86de21b810693bccdd88d53aacb6d8acf26f09e0
+
+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
+  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
+
+# The following hacks have been tested for MIPS builds, but may need to be modified for other platforms.
+# (Based on: https://github.com/pfalcon/micropython/blob/2663b63241498569d9acb9c7cf9e01e831dbd816/unix/build-mips.sh)
+TARGET_CFLAGS_EXTRA += -DMICROPY_GCREGS_SETJMP=1 -DMICROPY_NLR_SETJMP=1 -DMICROPY_EMIT_X64=0
+TARGET_STRIPFLAGS_EXTRA += --remove-section=.pdr -R .comment -R .gnu.version -R .gnu.version_r -R .gnu.attributes -R .reginfo -R .mdebug.abi32
+
+MAKE_FLAGS += \
+       -C $(PKG_BUILD_DIR)/unix \
+       MICROPY_USE_READLINE=0 \
+       CFLAGS_EXTRA="$(TARGET_CFLAGS_EXTRA)" \
+       STRIPFLAGS_EXTRA="$(TARGET_STRIPFLAGS_EXTRA)"
+
+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))
index b31458598a95160ac3598a48923a85f9f8718cac..9f9430a6782f3e97746874d409fdc57bb794ff66 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-compress-bzip2
-PKG_VERSION:=2.17
+PKG_VERSION:=2.18
 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:=d8b809f6efe3edb33f81d608c932b2ef
+PKG_MD5SUM:=c4a1995df9443cb97c28593cbbb23304
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
index 5db0bb023a2c9d803bbf45abe633f923fccd8165..53c15066f7f852e922dd77d295856478d59aabcc 100644 (file)
@@ -9,18 +9,20 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-dbi
 PKG_VERSION:=1.631
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/
 PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz
 PKG_MD5SUM:=444d3c305e86597e11092b517794a840
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
 
 include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
 include ../perl/perlmod.mk
 
 define Package/perl-dbi
@@ -40,9 +42,22 @@ 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))
index 629d588747f8f806ac34ed2bf1534701c211bb45..6baa88d8232834d0ba1704312f31c5d42d0d58c7 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/
 PKG_SOURCE:=HTML-Parser-$(PKG_VERSION).tar.gz
 PKG_MD5SUM:=9128a45893097dfa3bf03301b19c5efe
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
index d0aa245cb4eac0ce6424b546fe944a971017cef6..fbec409cfcd498061549df929c3930296aedaed2 100644 (file)
@@ -15,7 +15,7 @@ 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:=GPLv1+ ARTISTIC
+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)
index b03adf90c518b3654cf0a17eed4a79e6b00b9e4d..614aff7fb62dd81fd012219a6fa62699b8ce07d8 100644 (file)
@@ -16,7 +16,7 @@ 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:=GPLv1+ ARTISTIC
+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)
index 930f6603210a6dc8d7e52859b66bd094a9b6acf3..e65d4a570505623c5e8017fb00a0fb75d2595e09 100644 (file)
@@ -15,7 +15,7 @@ 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:=GPLv2+ ARTISTIC
+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)
index 1eaeb66e9783e404dfafccb3ea9b05c84d25a9d3..d229cd814936e7ea52113908735823dcab07296d 100644 (file)
@@ -15,7 +15,7 @@ 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:=GPLv1+ ARTISTIC
+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)
index 89650b218e4188ebad4be8d3a86a2e9b6463169e..524bbd751d6cdcf1e7c499319dd281f87b85f2b8 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-test-harness
-PKG_VERSION:=3.32
+PKG_VERSION:=3.33
 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:=a1241b628dc80f5271ed9235c211e55c
+PKG_MD5SUM:=7a72849ee1e67184db098146cc7c8855
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
index a3ea9271eed102b21b745f72323966f42d514300..d298dd98cd40f6aa1b7a8982d4b77543d33e7867 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
 PKG_MD5SUM:=975b2282bc8f0fd72a6dae5cefc33824
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
index ea8102c832c8864a7e42ca77f6ae46d4fd583378..8bc3bfda54558391ea9453fa1eb6a42c0c3f6200 100644 (file)
@@ -15,7 +15,7 @@ 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:=GPLv1+ ARTISTIC
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 
index 934ed3d962f20db4f1978c20c9c181bbda5c3d2e..4fe85ebc55d63fe8e1c1d27afd9cac9775621ad7 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE:=WWW-Mechanize-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
 PKG_MD5SUM:=de0a9c528c12793c881151301bc14d1a
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
index e70e491f4c476fffda1c24d9d1ce8098969691a9..fadc1c0238d9e48c4fcff349815925d73e2e0d10 100644 (file)
@@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl-www
 PKG_VERSION:=5.837
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_URL:=http://www.cpan.org/authors/id/G/GA/GAAS/
 PKG_SOURCE:=libwww-perl-$(PKG_VERSION).tar.gz
 PKG_MD5SUM:=9bbf1bce482b0bac98bb4f04253c03d0
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+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)
diff --git a/lang/perl-www/patches/010-lwp-https-call-verify-hostname-when-avail.patch b/lang/perl-www/patches/010-lwp-https-call-verify-hostname-when-avail.patch
new file mode 100644 (file)
index 0000000..9166e89
--- /dev/null
@@ -0,0 +1,41 @@
+commit 3b266f17ccd5613a9c42d1e04118e94ca6467489
+Author: Gisle Aas <gisle@aas.no>
+Date:   Sun Jan 16 12:56:30 2011 +0100
+
+    Call IO::Socket::SSL's verify_hostname when available
+
+--- a/lib/LWP/Protocol/https.pm
++++ b/lib/LWP/Protocol/https.pm
+@@ -14,6 +14,15 @@ sub socket_type
+ sub _check_sock
+ {
+     my($self, $req, $sock) = @_;
++    if ($sock->can("verify_hostname")) {
++      if (!$sock->verify_hostname($req->uri->host, "www")) {
++          my $subject = $sock->peer_certificate("subject");
++          die "SSL-peer fails verification [subject=$subject]\n";
++      }
++      else {
++          $req->{ssl_sock_verified}++;
++      }
++    }
+     my $check = $req->header("If-SSL-Cert-Subject");
+     if (defined $check) {
+       my $cert = $sock->get_peer_certificate ||
+@@ -36,9 +45,14 @@ sub _get_sock_info
+       $res->header("Client-SSL-Cert-Subject" => $cert->subject_name);
+       $res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name);
+     }
+-    if(! eval { $sock->get_peer_verify }) {
+-       $res->header("Client-SSL-Warning" => "Peer certificate not verified");
++    if (!$res->request->{ssl_sock_verified}) {
++      if(! eval { $sock->get_peer_verify }) {
++          my $msg = "Peer certificate not verified";
++          $msg .= " [$@]" if $@;
++          $res->header("Client-SSL-Warning" => $msg);
++      }
+     }
++    $res->header("Client-SSL-Socket-Class" => $Net::HTTPS::SSL_SOCKET_CLASS);
+ }
+ #-----------------------------------------------------------
diff --git a/lang/perl-www/patches/020-lwp-https-verify-hostnames-by-default.patch b/lang/perl-www/patches/020-lwp-https-verify-hostnames-by-default.patch
new file mode 100644 (file)
index 0000000..465010e
--- /dev/null
@@ -0,0 +1,113 @@
+commit 62dd58188d8f8987d24bd84951813a54a8bf5987
+Author: Gisle Aas <gisle@aas.no>
+Date:   Mon Jan 24 23:19:59 2011 +0100
+
+    Default to verifying hostnames when using SSL
+
+--- a/lib/LWP/Protocol/https.pm
++++ b/lib/LWP/Protocol/https.pm
+@@ -11,18 +11,30 @@ sub socket_type
+     return "https";
+ }
+-sub _check_sock
++sub _extra_sock_opts
+ {
+-    my($self, $req, $sock) = @_;
+-    if ($sock->can("verify_hostname")) {
+-      if (!$sock->verify_hostname($req->uri->host, "www")) {
+-          my $subject = $sock->peer_certificate("subject");
+-          die "SSL-peer fails verification [subject=$subject]\n";
+-      }
+-      else {
+-          $req->{ssl_sock_verified}++;
++    my $self = shift;
++    my %ssl_opts = %{$self->{ua}{ssl_opts} || {}};
++    unless (exists $ssl_opts{SSL_verify_mode}) {
++      $ssl_opts{SSL_verify_mode} = 1;
++    }
++    if (delete $ssl_opts{verify_hostname}) {
++      $ssl_opts{SSL_verify_mode} ||= 1;
++      $ssl_opts{SSL_verifycn_scheme} = 'www';
++    }
++    if ($ssl_opts{SSL_verify_mode}) {
++      unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
++          require Mozilla::CA;
++          $ssl_opts{SSL_ca_file} = Mozilla::CA::SSL_ca_file();
+       }
+     }
++    $self->{ssl_opts} = \%ssl_opts;
++    return (%ssl_opts, $self->SUPER::_extra_sock_opts);
++}
++
++sub _check_sock
++{
++    my($self, $req, $sock) = @_;
+     my $check = $req->header("If-SSL-Cert-Subject");
+     if (defined $check) {
+       my $cert = $sock->get_peer_certificate ||
+@@ -45,12 +57,11 @@ sub _get_sock_info
+       $res->header("Client-SSL-Cert-Subject" => $cert->subject_name);
+       $res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name);
+     }
+-    if (!$res->request->{ssl_sock_verified}) {
+-      if(! eval { $sock->get_peer_verify }) {
+-          my $msg = "Peer certificate not verified";
+-          $msg .= " [$@]" if $@;
+-          $res->header("Client-SSL-Warning" => $msg);
+-      }
++    if (!$self->{ssl_opts}{SSL_verify_mode}) {
++      $res->push_header("Client-SSL-Warning" => "Peer certificate not verified");
++    }
++    elsif (!$self->{ssl_opts}{SSL_verifycn_scheme}) {
++      $res->push_header("Client-SSL-Warning" => "Peer hostname match with certificate not verified");
+     }
+     $res->header("Client-SSL-Socket-Class" => $Net::HTTPS::SSL_SOCKET_CLASS);
+ }
+--- a/lib/LWP/UserAgent.pm
++++ b/lib/LWP/UserAgent.pm
+@@ -41,6 +41,7 @@ sub new
+     my $timeout = delete $cnf{timeout};
+     $timeout = 3*60 unless defined $timeout;
+     my $local_address = delete $cnf{local_address};
++    my $ssl_opts = delete $cnf{ssl_opts};
+     my $use_eval = delete $cnf{use_eval};
+     $use_eval = 1 unless defined $use_eval;
+     my $parse_head = delete $cnf{parse_head};
+@@ -83,6 +84,7 @@ sub new
+                     def_headers  => $def_headers,
+                     timeout      => $timeout,
+                     local_address => $local_address,
++                    ssl_opts     => { $ssl_opts ? %$ssl_opts  : (verify_hostname => 1) },
+                     use_eval     => $use_eval,
+                       show_progress=> $show_progress,
+                     max_size     => $max_size,
+@@ -582,6 +584,20 @@ sub max_size     { shift->_elem('max_siz
+ sub max_redirect { shift->_elem('max_redirect', @_); }
+ sub show_progress{ shift->_elem('show_progress', @_); }
++sub ssl_opts {
++    my $self = shift;
++    if (@_ == 1) {
++      my $k = shift;
++      return $self->{ssl_opts}{$k};
++    }
++    if (@_) {
++      %{$self->{ssl_opts}} = (%{$self->{ssl_opts}}, @_);
++    }
++    else {
++      return keys %{$self->{ssl_opts}};
++    }
++}
++
+ sub parse_head {
+     my $self = shift;
+     if (@_) {
+@@ -1040,6 +1056,7 @@ The following options correspond to attr
+    cookie_jar              undef
+    default_headers         HTTP::Headers->new
+    local_address           undef
++   ssl_opts              { verify_hostname => 1 }
+    max_size                undef
+    max_redirect            7
+    parse_head              1
index bcf0bf68da570bda2758811321b04a8af802acdb..f1989080fb3b756fa8998bcd98c19482802c7f18 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=perl
 PKG_VERSION:=5.20.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
                http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \
@@ -22,12 +22,13 @@ PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_MD5SUM:=406ec049ebe3afcc80d9c76ec78ca4f8
 
-PKG_LICENSE:=GPLv1+ ARTISTIC
+PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
 PKG_LICENSE_FILES:=Copying Artistic README
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 
 # 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
@@ -45,6 +46,7 @@ TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
+include perlmod.mk
 
 define Package/perl
   SUBMENU:=Perl
@@ -69,6 +71,11 @@ endef
 define Host/Install
        ( cd $(HOST_BUILD_DIR); ./miniperl installperl )
        $(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
@@ -98,14 +105,17 @@ define Build/Compile
 endef
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/CORE
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20/CORE/*.h $(1)/usr/lib/perl5/5.20/CORE/
+       $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20 $(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/5.20/CORE
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20/CORE/libperl.so $(1)/usr/lib/perl5/5.20/CORE/
 endef
 
 
@@ -116,5 +126,4 @@ $(eval $(call RequireCommand,rsync, \
 $(eval $(call BuildPackage,perl))
 $(eval $(call HostBuild))
 
-include perlmod.mk
 -include perlbase.mk
diff --git a/lang/perl/files/Module/ScanDeps.pm b/lang/perl/files/Module/ScanDeps.pm
deleted file mode 100644 (file)
index 0493be1..0000000
+++ /dev/null
@@ -1,1083 +0,0 @@
-package Module::ScanDeps;
-
-use 5.004;
-use strict;
-use vars qw( $VERSION @EXPORT @EXPORT_OK $CurrentPackage );
-
-$VERSION   = '0.62';
-@EXPORT    = qw( scan_deps scan_deps_runtime );
-@EXPORT_OK = qw( scan_line scan_chunk add_deps scan_deps_runtime );
-
-use Config;
-use Exporter;
-use base 'Exporter';
-use constant dl_ext  => ".$Config{dlext}";
-use constant lib_ext => $Config{lib_ext};
-use constant is_insensitive_fs => (
-    -s $0
-        and (-s lc($0) || -1) == (-s uc($0) || -1)
-        and (-s lc($0) || -1) == -s $0
-);
-
-use Cwd ();
-use File::Path ();
-use File::Temp ();
-use File::Basename ();
-use FileHandle;
-
-=head1 NAME
-
-Module::ScanDeps - Recursively scan Perl code for dependencies
-
-=head1 VERSION
-
-This document describes version 0.61 of Module::ScanDeps, released
-June 30, 2006.
-
-=head1 SYNOPSIS
-
-Via the command-line program L<scandeps.pl>:
-
-    % scandeps.pl *.pm          # Print PREREQ_PM section for *.pm
-    % scandeps.pl -e "use utf8" # Read script from command line
-    % scandeps.pl -B *.pm       # Include core modules
-    % scandeps.pl -V *.pm       # Show autoload/shared/data files
-
-Used in a program;
-
-    use Module::ScanDeps;
-
-    # standard usage
-    my $hash_ref = scan_deps(
-        files   => [ 'a.pl', 'b.pl' ],
-        recurse => 1,
-    );
-
-    # shorthand; assume recurse == 1
-    my $hash_ref = scan_deps( 'a.pl', 'b.pl' );
-
-    # App::Packer::Frontend compatible interface
-    # see App::Packer::Frontend for the structure returned by get_files
-    my $scan = Module::ScanDeps->new;
-    $scan->set_file( 'a.pl' );
-    $scan->set_options( add_modules => [ 'Test::More' ] );
-    $scan->calculate_info;
-    my $files = $scan->get_files;
-
-=head1 DESCRIPTION
-
-This module scans potential modules used by perl programs, and returns a
-hash reference; its keys are the module names as appears in C<%INC>
-(e.g. C<Test/More.pm>); the values are hash references with this structure:
-
-    {
-        file    => '/usr/local/lib/perl5/5.8.0/Test/More.pm',
-        key     => 'Test/More.pm',
-        type    => 'module',    # or 'autoload', 'data', 'shared'
-        used_by => [ 'Test/Simple.pm', ... ],
-    }
-
-One function, C<scan_deps>, is exported by default.  Three other
-functions (C<scan_line>, C<scan_chunk>, C<add_deps>) are exported upon
-request.
-
-Users of B<App::Packer> may also use this module as the dependency-checking
-frontend, by tweaking their F<p2e.pl> like below:
-
-    use Module::ScanDeps;
-    ...
-    my $packer = App::Packer->new( frontend => 'Module::ScanDeps' );
-    ...
-
-Please see L<App::Packer::Frontend> for detailed explanation on
-the structure returned by C<get_files>.
-
-=head2 B<scan_deps>
-
-    $rv_ref = scan_deps(
-        files   => \@files,     recurse => $recurse,
-        rv      => \%rv,        skip    => \%skip,
-        compile => $compile,    execute => $execute,
-    );
-    $rv_ref = scan_deps(@files); # shorthand, with recurse => 1
-
-This function scans each file in C<@files>, registering their
-dependencies into C<%rv>, and returns a reference to the updated
-C<%rv>.  The meaning of keys and values are explained above.
-
-If C<$recurse> is true, C<scan_deps> will call itself recursively,
-to perform a breadth-first search on text files (as defined by the
--T operator) found in C<%rv>.
-
-If the C<\%skip> is specified, files that exists as its keys are
-skipped.  This is used internally to avoid infinite recursion.
-
-If C<$compile> or C<$execute> is true, runs C<files> in either
-compile-only or normal mode, then inspects their C<%INC> after
-termination to determine additional runtime dependencies.
-
-If C<$execute> is an array reference, runs the files contained
-in it instead of C<@files>.
-
-=head2 B<scan_deps_runtime>
-
-Like B<scan_deps>, but skips the static scanning part.
-
-=head2 B<scan_line>
-
-    @modules = scan_line($line);
-
-Splits a line into chunks (currently with the semicolon characters), and
-return the union of C<scan_chunk> calls of them.
-
-If the line is C<__END__> or C<__DATA__>, a single C<__END__> element is
-returned to signify the end of the program.
-
-Similarly, it returns a single C<__POD__> if the line matches C</^=\w/>;
-the caller is responsible for skipping appropriate number of lines
-until C<=cut>, before calling C<scan_line> again.
-
-=head2 B<scan_chunk>
-
-    $module = scan_chunk($chunk);
-    @modules = scan_chunk($chunk);
-
-Apply various heuristics to C<$chunk> to find and return the module
-name(s) it contains.  In scalar context, returns only the first module
-or C<undef>.
-
-=head2 B<add_deps>
-
-    $rv_ref = add_deps( rv => \%rv, modules => \@modules );
-    $rv_ref = add_deps( @modules ); # shorthand, without rv
-
-Resolves a list of module names to its actual on-disk location, by
-finding in C<@INC>; modules that cannot be found are skipped.
-
-This function populates the C<%rv> hash with module/filename pairs, and
-returns a reference to it.
-
-=head1 CAVEATS
-
-This module intentially ignores the B<BSDPAN> hack on FreeBSD -- the
-additional directory is removed from C<@INC> altogether.
-
-The static-scanning heuristic is not likely to be 100% accurate, especially
-on modules that dynamically load other modules.
-
-Chunks that span multiple lines are not handled correctly.  For example,
-this one works:
-
-    use base 'Foo::Bar';
-
-But this one does not:
-
-    use base
-        'Foo::Bar';
-
-=cut
-
-my $SeenTk;
-
-# Pre-loaded module dependencies {{{
-my %Preload = (
-    'AnyDBM_File.pm'  => [qw( SDBM_File.pm )],
-    'Authen/SASL.pm'  => 'sub',
-    'Bio/AlignIO.pm'  => 'sub',
-    'Bio/Assembly/IO.pm'  => 'sub',
-    'Bio/Biblio/IO.pm'  => 'sub',
-    'Bio/ClusterIO.pm'  => 'sub',
-    'Bio/CodonUsage/IO.pm'  => 'sub',
-    'Bio/DB/Biblio.pm'  => 'sub',
-    'Bio/DB/Flat.pm'  => 'sub',
-    'Bio/DB/GFF.pm'  => 'sub',
-    'Bio/DB/Taxonomy.pm'  => 'sub',
-    'Bio/Graphics/Glyph.pm'  => 'sub',
-    'Bio/MapIO.pm'  => 'sub',
-    'Bio/Matrix/IO.pm'  => 'sub',
-    'Bio/Matrix/PSM/IO.pm'  => 'sub',
-    'Bio/OntologyIO.pm'  => 'sub',
-    'Bio/PopGen/IO.pm'  => 'sub',
-    'Bio/Restriction/IO.pm'  => 'sub',
-    'Bio/Root/IO.pm'  => 'sub',
-    'Bio/SearchIO.pm'  => 'sub',
-    'Bio/SeqIO.pm'  => 'sub',
-    'Bio/Structure/IO.pm'  => 'sub',
-    'Bio/TreeIO.pm'  => 'sub',
-    'Bio/LiveSeq/IO.pm'  => 'sub',
-    'Bio/Variation/IO.pm'  => 'sub',
-    'Crypt/Random.pm' => sub {
-        _glob_in_inc('Crypt/Random/Provider', 1);
-    },
-    'Crypt/Random/Generator.pm' => sub {
-        _glob_in_inc('Crypt/Random/Provider', 1);
-    },
-    'DBI.pm' => sub {
-        grep !/\bProxy\b/, _glob_in_inc('DBD', 1);
-    },
-    'DBIx/SearchBuilder.pm' => 'sub',
-    'DBIx/ReportBuilder.pm' => 'sub',
-    'Device/ParallelPort.pm' => 'sub',
-    'Device/SerialPort.pm' => [ qw(
-        termios.ph asm/termios.ph sys/termiox.ph sys/termios.ph sys/ttycom.ph
-    ) ],
-    'ExtUtils/MakeMaker.pm' => sub {
-        grep /\bMM_/, _glob_in_inc('ExtUtils', 1);
-    },
-    'File/Basename.pm' => [qw( re.pm )],
-    'File/Spec.pm'     => sub {
-        require File::Spec;
-        map { my $name = $_; $name =~ s!::!/!g; "$name.pm" } @File::Spec::ISA;
-    },
-    'HTTP/Message.pm' => [ qw(
-        URI/URL.pm          URI.pm
-    ) ],
-    'IO.pm' => [ qw(
-        IO/Handle.pm        IO/Seekable.pm      IO/File.pm
-        IO/Pipe.pm          IO/Socket.pm        IO/Dir.pm
-    ) ],
-    'IO/Socket.pm'     => [qw( IO/Socket/UNIX.pm )],
-    'LWP/UserAgent.pm' => [ qw(
-        URI/URL.pm          URI/http.pm         LWP/Protocol/http.pm
-        LWP/Protocol/https.pm
-    ), _glob_in_inc("LWP/Authen", 1) ],
-    'Locale/Maketext/Lexicon.pm'    => 'sub',
-    'Locale/Maketext/GutsLoader.pm' => [qw( Locale/Maketext/Guts.pm )],
-    'Mail/Audit.pm'                => 'sub',
-    'Math/BigInt.pm'                => 'sub',
-    'Math/BigFloat.pm'              => 'sub',
-       'Math/Symbolic.pm'              => 'sub',
-    'Module/Build.pm'               => 'sub',
-    'Module/Pluggable.pm'           => sub {
-        _glob_in_inc('$CurrentPackage/Plugin', 1);
-    },
-    'MIME/Decoder.pm'               => 'sub',
-    'Net/DNS/RR.pm'                 => 'sub',
-    'Net/FTP.pm'                    => 'sub',
-    'Net/SSH/Perl.pm'               => 'sub',
-    'PDF/API2/Resource/Font.pm'     => 'sub',
-    'PDF/API2/Basic/TTF/Font.pm'    => sub {
-        _glob_in_inc('PDF/API2/Basic/TTF', 1);
-    },
-    'PDF/Writer.pm'                 => 'sub',
-    'POE'                           => [ qw(
-        POE/Kernel.pm POE/Session.pm
-    ) ],
-    'POE/Kernel.pm'                    => [
-        map "POE/Resource/$_.pm", qw(
-            Aliases Events Extrefs FileHandles
-            SIDs Sessions Signals Statistics
-        )
-    ],
-    'Parse/AFP.pm'                  => 'sub',
-    'Parse/Binary.pm'               => 'sub',
-    'Regexp/Common.pm'              => 'sub',
-    'SerialJunk.pm' => [ qw(
-        termios.ph asm/termios.ph sys/termiox.ph sys/termios.ph sys/ttycom.ph
-    ) ],
-    'SOAP/Lite.pm'                  => sub {
-        (($] >= 5.008 ? ('utf8.pm') : ()), _glob_in_inc('SOAP/Transport', 1));
-    },
-    'SQL/Parser.pm' => sub {
-        _glob_in_inc('SQL/Dialects', 1);
-    },
-    'SVK/Command.pm' => sub {
-        _glob_in_inc('SVK', 1);
-    },
-    'SVN/Core.pm' => sub {
-        _glob_in_inc('SVN', 1),
-        map "auto/SVN/$_->{name}", _glob_in_inc('auto/SVN'),
-    },
-    'Template.pm'      => 'sub',
-    'Term/ReadLine.pm' => 'sub',
-       'Test/Deep.pm'     => 'sub',
-    'Tk.pm'            => sub {
-        $SeenTk = 1;
-        qw( Tk/FileSelect.pm Encode/Unicode.pm );
-    },
-    'Tk/Balloon.pm'     => [qw( Tk/balArrow.xbm )],
-    'Tk/BrowseEntry.pm' => [qw( Tk/cbxarrow.xbm Tk/arrowdownwin.xbm )],
-    'Tk/ColorEditor.pm' => [qw( Tk/ColorEdit.xpm )],
-    'Tk/DragDrop/Common.pm' => sub {
-        _glob_in_inc('Tk/DragDrop', 1),
-    },
-    'Tk/FBox.pm'        => [qw( Tk/folder.xpm Tk/file.xpm )],
-    'Tk/Getopt.pm'      => [qw( Tk/openfolder.xpm Tk/win.xbm )],
-    'Tk/Toplevel.pm'    => [qw( Tk/Wm.pm )],
-    'URI.pm'            => sub {
-        grep !/.\b[_A-Z]/, _glob_in_inc('URI', 1);
-    },
-    'Win32/EventLog.pm'    => [qw( Win32/IPC.pm )],
-    'Win32/Exe.pm'         => 'sub',
-    'Win32/TieRegistry.pm' => [qw( Win32API/Registry.pm )],
-    'Win32/SystemInfo.pm'  => [qw( Win32/cpuspd.dll )],
-    'XML/Parser.pm'        => sub {
-        _glob_in_inc('XML/Parser/Style', 1),
-        _glob_in_inc('XML/Parser/Encodings', 1),
-    },
-    'XML/Parser/Expat.pm' => sub {
-        ($] >= 5.008) ? ('utf8.pm') : ();
-    },
-    'XML/SAX.pm' => [qw( XML/SAX/ParserDetails.ini ) ],
-    'XMLRPC/Lite.pm' => sub {
-        _glob_in_inc('XMLRPC/Transport', 1),;
-    },
-    'diagnostics.pm' => sub {
-        # shamelessly taken and adapted from diagnostics.pm
-        use Config;
-        my($privlib, $archlib) = @Config{qw(privlibexp archlibexp)};
-        if ($^O eq 'VMS') {
-            require VMS::Filespec;
-            $privlib = VMS::Filespec::unixify($privlib);
-            $archlib = VMS::Filespec::unixify($archlib);
-        }
-
-        for (
-              "pod/perldiag.pod",
-              "Pod/perldiag.pod",
-              "pod/perldiag-$Config{version}.pod",
-              "Pod/perldiag-$Config{version}.pod",
-              "pods/perldiag.pod",
-              "pods/perldiag-$Config{version}.pod",
-        ) {
-            return $_ if _find_in_inc($_);
-        }
-
-        for (
-              "$archlib/pods/perldiag.pod",
-              "$privlib/pods/perldiag-$Config{version}.pod",
-              "$privlib/pods/perldiag.pod",
-        ) {
-            return $_ if -f $_;
-        }
-
-        return 'pod/perldiag.pod';
-    },
-    'utf8.pm' => [
-        'utf8_heavy.pl', do {
-            my $dir = 'unicore';
-            my @subdirs = qw( To );
-            my @files = map "$dir/lib/$_->{name}", _glob_in_inc("$dir/lib");
-
-            if (@files) {
-                # 5.8.x
-                push @files, (map "$dir/$_.pl", qw( Exact Canonical ));
-            }
-            else {
-                # 5.6.x
-                $dir = 'unicode';
-                @files = map "$dir/Is/$_->{name}", _glob_in_inc("$dir/Is")
-                  or return;
-                push @subdirs, 'In';
-            }
-
-            foreach my $subdir (@subdirs) {
-                foreach (_glob_in_inc("$dir/$subdir")) {
-                    push @files, "$dir/$subdir/$_->{name}";
-                }
-            }
-            @files;
-        }
-    ],
-    'charnames.pm' => [
-        _find_in_inc('unicore/Name.pl') ? 'unicore/Name.pl' : 'unicode/Name.pl'
-    ],
-);
-
-# }}}
-
-my $Keys = 'files|keys|recurse|rv|skip|first|execute|compile';
-sub scan_deps {
-    my %args = (
-        rv => {},
-        (@_ and $_[0] =~ /^(?:$Keys)$/o) ? @_ : (files => [@_], recurse => 1)
-    );
-
-    scan_deps_static(\%args);
-
-    if ($args{execute} or $args{compile}) {
-        scan_deps_runtime(
-            rv      => $args{rv},
-            files   => $args{files},
-            execute => $args{execute},
-            compile => $args{compile},
-            skip    => $args{skip}
-        );
-    }
-
-    return ($args{rv});
-}
-
-sub scan_deps_static {
-    my ($args) = @_;
-    my ($files, $keys, $recurse, $rv, $skip, $first, $execute, $compile) =
-      @$args{qw( files keys recurse rv skip first execute compile )};
-
-    $rv   ||= {};
-    $skip ||= {};
-
-    foreach my $file (@{$files}) {
-        my $key = shift @{$keys};
-        next if $skip->{$file}++;
-        next if is_insensitive_fs()
-          and $file ne lc($file) and $skip->{lc($file)}++;
-
-        local *FH;
-        open FH, $file or die "Cannot open $file: $!";
-
-        $SeenTk = 0;
-
-        # Line-by-line scanning
-        LINE:
-        while (<FH>) {
-            chomp(my $line = $_);
-            foreach my $pm (scan_line($line)) {
-                last LINE if $pm eq '__END__';
-
-                if ($pm eq '__POD__') {
-                    while (<FH>) { last if (/^=cut/) }
-                    next LINE;
-                }
-
-                $pm = 'CGI/Apache.pm' if /^Apache(?:\.pm)$/;
-
-                add_deps(
-                    used_by => $key,
-                    rv      => $rv,
-                    modules => [$pm],
-                    skip    => $skip
-                );
-
-                my $preload = $Preload{$pm} or next;
-                if ($preload eq 'sub') {
-                    $pm =~ s/\.p[mh]$//i;
-                    $preload = [ _glob_in_inc($pm, 1) ];
-                }
-                elsif (UNIVERSAL::isa($preload, 'CODE')) {
-                    $preload = [ $preload->($pm) ];
-                }
-
-                add_deps(
-                    used_by => $key,
-                    rv      => $rv,
-                    modules => $preload,
-                    skip    => $skip
-                );
-            }
-        }
-        close FH;
-
-        # }}}
-    }
-
-    # Top-level recursion handling {{{
-    while ($recurse) {
-        my $count = keys %$rv;
-        my @files = sort grep -T $_->{file}, values %$rv;
-        scan_deps_static({
-            files   => [ map $_->{file}, @files ],
-            keys    => [ map $_->{key},  @files ],
-            rv      => $rv,
-            skip    => $skip,
-            recurse => 0,
-        }) or ($args->{_deep} and return);
-        last if $count == keys %$rv;
-    }
-
-    # }}}
-
-    return $rv;
-}
-
-sub scan_deps_runtime {
-    my %args = (
-        perl => $^X,
-        rv   => {},
-        (@_ and $_[0] =~ /^(?:$Keys)$/o) ? @_ : (files => [@_], recurse => 1)
-    );
-    my ($files, $rv, $execute, $compile, $skip, $perl) =
-      @args{qw( files rv execute compile skip perl )};
-
-    $files = (ref($files)) ? $files : [$files];
-
-    my ($inchash, $incarray, $dl_shared_objects) = ({}, [], []);
-    if ($compile) {
-        my $file;
-
-        foreach $file (@$files) {
-            ($inchash, $dl_shared_objects, $incarray) = ({}, [], []);
-            _compile($perl, $file, $inchash, $dl_shared_objects, $incarray);
-
-            my $rv_sub = _make_rv($inchash, $dl_shared_objects, $incarray);
-            _merge_rv($rv_sub, $rv);
-        }
-    }
-    elsif ($execute) {
-        my $excarray = (ref($execute)) ? $execute : [@$files];
-        my $exc;
-        my $first_flag = 1;
-        foreach $exc (@$excarray) {
-            ($inchash, $dl_shared_objects, $incarray) = ({}, [], []);
-            _execute(
-                $perl, $exc, $inchash, $dl_shared_objects, $incarray,
-                $first_flag
-            );
-            $first_flag = 0;
-        }
-
-        my $rv_sub = _make_rv($inchash, $dl_shared_objects, $incarray);
-        _merge_rv($rv_sub, $rv);
-    }
-
-    return ($rv);
-}
-
-sub scan_line {
-    my $line = shift;
-    my %found;
-
-    return '__END__' if $line =~ /^__(?:END|DATA)__$/;
-    return '__POD__' if $line =~ /^=\w/;
-
-    $line =~ s/\s*#.*$//;
-    $line =~ s/[\\\/]+/\//g;
-
-    foreach (split(/;/, $line)) {
-        if (/^\s*package\s+(\w+)/) {
-            $CurrentPackage = $1;
-            $CurrentPackage =~ s{::}{/}g;
-            return;
-        }
-        return if /^\s*(use|require)\s+[\d\._]+/;
-        if (my ($autouse) = /^\s*use\s+autouse\s+(["'].*?["']|\w+)/)   
-        {
-            $autouse =~ s/["']//g;
-            $autouse =~ s{::}{/}g;
-            return ("autouse.pm", "$autouse.pm");
-        }
-
-        if (my ($libs) = /\b(?:use\s+lib\s+|(?:unshift|push)\W+\@INC\W+)(.+)/)
-        {
-            my $archname =
-              defined($Config{archname}) ? $Config{archname} : '';
-            my $ver = defined($Config{version}) ? $Config{version} : '';
-            foreach (grep(/\w/, split(/["';() ]/, $libs))) {
-                unshift(@INC, "$_/$ver")           if -d "$_/$ver";
-                unshift(@INC, "$_/$archname")      if -d "$_/$archname";
-                unshift(@INC, "$_/$ver/$archname") if -d "$_/$ver/$archname";
-            }
-            next;
-        }
-
-        $found{$_}++ for scan_chunk($_);
-    }
-
-    return sort keys %found;
-}
-
-sub scan_chunk {
-    my $chunk = shift;
-
-    # Module name extraction heuristics {{{
-    my $module = eval {
-        $_ = $chunk;
-
-        return [ 'base.pm',
-            map { s{::}{/}g; "$_.pm" }
-              grep { length and !/^q[qw]?$/ } split(/[^\w:]+/, $1) ]
-          if /^\s* use \s+ base \s+ (.*)/sx;
-
-        return [ 'Class/Autouse.pm',
-            map { s{::}{/}g; "$_.pm" }
-              grep { length and !/^:|^q[qw]?$/ } split(/[^\w:]+/, $1) ]
-          if /^\s* use \s+ Class::Autouse \s+ (.*)/sx
-              or /^\s* Class::Autouse \s* -> \s* autouse \s* (.*)/sx;
-
-        return [ 'POE.pm',
-            map { s{::}{/}g; "POE/$_.pm" }
-              grep { length and !/^q[qw]?$/ } split(/[^\w:]+/, $1) ]
-          if /^\s* use \s+ POE \s+ (.*)/sx;
-
-        return [ 'encoding.pm',
-            map { _find_encoding($_) }
-              grep { length and !/^q[qw]?$/ } split(/[^\w:-]+/, $1) ]
-          if /^\s* use \s+ encoding \s+ (.*)/sx;
-
-        return $1 if /(?:^|\s)(?:use|no|require)\s+([\w:\.\-\\\/\"\']+)/;
-        return $1
-          if /(?:^|\s)(?:use|no|require)\s+\(\s*([\w:\.\-\\\/\"\']+)\s*\)/;
-
-        if (   s/(?:^|\s)eval\s+\"([^\"]+)\"/$1/
-            or s/(?:^|\s)eval\s*\(\s*\"([^\"]+)\"\s*\)/$1/)
-        {
-            return $1 if /(?:^|\s)(?:use|no|require)\s+([\w:\.\-\\\/\"\']*)/;
-        }
-
-        return "File/Glob.pm" if /<[^>]*[^\$\w>][^>]*>/;
-        return "DBD/$1.pm"    if /\b[Dd][Bb][Ii]:(\w+):/;
-        if (/(?:(:encoding)|\b(?:en|de)code)\(\s*['"]?([-\w]+)/) {
-            my $mod = _find_encoding($2);
-            return [ 'PerlIO.pm', $mod ] if $1 and $mod;
-            return $mod if $mod;
-        }
-        return $1 if /(?:^|\s)(?:do|require)\s+[^"]*"(.*?)"/;
-        return $1 if /(?:^|\s)(?:do|require)\s+[^']*'(.*?)'/;
-        return $1 if /[^\$]\b([\w:]+)->\w/ and $1 ne 'Tk';
-        return $1 if /\b(\w[\w:]*)::\w+\(/;
-
-        if ($SeenTk) {
-            my @modules;
-            while (/->\s*([A-Z]\w+)/g) {
-                push @modules, "Tk/$1.pm";
-            }
-            while (/->\s*Scrolled\W+([A-Z]\w+)/g) {
-                push @modules, "Tk/$1.pm";
-                push @modules, "Tk/Scrollbar.pm";
-            }
-            return \@modules;
-        }
-        return;
-    };
-
-    # }}}
-
-    return unless defined($module);
-    return wantarray ? @$module : $module->[0] if ref($module);
-
-    $module =~ s/^['"]//;
-    return unless $module =~ /^\w/;
-
-    $module =~ s/\W+$//;
-    $module =~ s/::/\//g;
-    return if $module =~ /^(?:[\d\._]+|'.*[^']|".*[^"])$/;
-
-    $module .= ".pm" unless $module =~ /\./;
-    return $module;
-}
-
-sub _find_encoding {
-    return unless $] >= 5.008 and eval { require Encode; %Encode::ExtModule };
-
-    my $mod = $Encode::ExtModule{ Encode::find_encoding($_[0])->name }
-      or return;
-    $mod =~ s{::}{/}g;
-    return "$mod.pm";
-}
-
-sub _add_info {
-    my ($rv, $module, $file, $used_by, $type) = @_;
-    return unless defined($module) and defined($file);
-
-    $rv->{$module} ||= {
-        file => $file,
-        key  => $module,
-        type => $type,
-    };
-
-    push @{ $rv->{$module}{used_by} }, $used_by
-      if defined($used_by)
-      and $used_by ne $module
-      and !grep { $_ eq $used_by } @{ $rv->{$module}{used_by} };
-}
-
-sub add_deps {
-    my %args =
-      ((@_ and $_[0] =~ /^(?:modules|rv|used_by)$/)
-        ? @_
-        : (rv => (ref($_[0]) ? shift(@_) : undef), modules => [@_]));
-
-    my $rv   = $args{rv}   || {};
-    my $skip = $args{skip} || {};
-    my $used_by = $args{used_by};
-
-    foreach my $module (@{ $args{modules} }) {
-        if (exists $rv->{$module}) {
-            _add_info($rv, undef, undef, $used_by, undef);
-            next;
-        }
-
-        my $file = _find_in_inc($module) or next;
-        next if $skip->{$file};
-        next if is_insensitive_fs() and $skip->{lc($file)};
-
-        my $type = 'module';
-        $type = 'data' unless $file =~ /\.p[mh]$/i;
-        _add_info($rv, $module, $file, $used_by, $type);
-
-        if ($module =~ /(.*?([^\/]*))\.p[mh]$/i) {
-            my ($path, $basename) = ($1, $2);
-
-            foreach (_glob_in_inc("auto/$path")) {
-                next if $skip->{$_->{file}};
-                next if is_insensitive_fs() and $skip->{lc($_->{file})};
-                next if $_->{file} =~ m{\bauto/$path/.*/};  # weed out subdirs
-                next if $_->{name} =~ m/(?:^|\/)\.(?:exists|packlist)$/;
-                my $ext = lc($1) if $_->{name} =~ /(\.[^.]+)$/;
-                next if $ext eq lc(lib_ext());
-                my $type = 'shared' if $ext eq lc(dl_ext());
-                $type = 'autoload' if $ext eq '.ix' or $ext eq '.al';
-                $type ||= 'data';
-
-                _add_info($rv, "auto/$path/$_->{name}", $_->{file}, $module,
-                    $type);
-            }
-        }
-    }
-
-    return $rv;
-}
-
-sub _find_in_inc {
-    my $file = shift;
-
-    # absolute file names
-    return $file if -f $file;
-
-    foreach my $dir (grep !/\bBSDPAN\b/, @INC) {
-        return "$dir/$file" if -f "$dir/$file";
-    }
-    return;
-}
-
-sub _glob_in_inc {
-    my $subdir  = shift;
-    my $pm_only = shift;
-    my @files;
-
-    require File::Find;
-
-    $subdir =~ s/\$CurrentPackage/$CurrentPackage/;
-
-    foreach my $dir (map "$_/$subdir", grep !/\bBSDPAN\b/, @INC) {
-        next unless -d $dir;
-        File::Find::find(
-            sub {
-                my $name = $File::Find::name;
-                $name =~ s!^\Q$dir\E/!!;
-                return if $pm_only and lc($name) !~ /\.p[mh]$/i;
-                push @files, $pm_only
-                  ? "$subdir/$name"
-                  : {             file => $File::Find::name,
-                    name => $name,
-                  }
-                  if -f;
-            },
-            $dir
-        );
-    }
-
-    return @files;
-}
-
-# App::Packer compatibility functions
-
-sub new {
-    my ($class, $self) = @_;
-    return bless($self ||= {}, $class);
-}
-
-sub set_file {
-    my $self = shift;
-    foreach my $script (@_) {
-        my $basename = $script;
-        $basename =~ s/.*\///;
-        $self->{main} = {
-            key  => $basename,
-            file => $script,
-        };
-    }
-}
-
-sub set_options {
-    my $self = shift;
-    my %args = @_;
-    foreach my $module (@{ $args{add_modules} }) {
-        $module =~ s/::/\//g;
-        $module .= '.pm' unless $module =~ /\.p[mh]$/i;
-        my $file = _find_in_inc($module) or next;
-        $self->{files}{$module} = $file;
-    }
-}
-
-sub calculate_info {
-    my $self = shift;
-    my $rv   = scan_deps(
-        keys  => [ $self->{main}{key}, sort keys %{ $self->{files} }, ],
-        files => [ $self->{main}{file},
-            map { $self->{files}{$_} } sort keys %{ $self->{files} },
-        ],
-        recurse => 1,
-    );
-
-    my $info = {
-        main => {  file     => $self->{main}{file},
-            store_as => $self->{main}{key},
-        },
-    };
-
-    my %cache = ($self->{main}{key} => $info->{main});
-    foreach my $key (sort keys %{ $self->{files} }) {
-        my $file = $self->{files}{$key};
-
-        $cache{$key} = $info->{modules}{$key} = {
-            file     => $file,
-            store_as => $key,
-            used_by  => [ $self->{main}{key} ],
-        };
-    }
-
-    foreach my $key (sort keys %{$rv}) {
-        my $val = $rv->{$key};
-        if ($cache{ $val->{key} }) {
-            push @{ $info->{ $val->{type} }->{ $val->{key} }->{used_by} },
-              @{ $val->{used_by} };
-        }
-        else {
-            $cache{ $val->{key} } = $info->{ $val->{type} }->{ $val->{key} } =
-              {        file     => $val->{file},
-                store_as => $val->{key},
-                used_by  => $val->{used_by},
-              };
-        }
-    }
-
-    $self->{info} = { main => $info->{main} };
-
-    foreach my $type (sort keys %{$info}) {
-        next if $type eq 'main';
-
-        my @val;
-        if (UNIVERSAL::isa($info->{$type}, 'HASH')) {
-            foreach my $val (sort values %{ $info->{$type} }) {
-                @{ $val->{used_by} } = map $cache{$_} || "!!$_!!",
-                  @{ $val->{used_by} };
-                push @val, $val;
-            }
-        }
-
-        $type = 'modules' if $type eq 'module';
-        $self->{info}{$type} = \@val;
-    }
-}
-
-sub get_files {
-    my $self = shift;
-    return $self->{info};
-}
-
-# scan_deps_runtime utility functions
-
-sub _compile {
-    my ($perl, $file, $inchash, $dl_shared_objects, $incarray) = @_;
-
-    my ($fhout, $fname) = File::Temp::tempfile("XXXXXX");
-    my $fhin  = FileHandle->new($file) or die "Couldn't open $file\n";
-
-    my $line = do { local $/; <$fhin> };
-    $line =~ s/use Module::ScanDeps::DataFeed.*?\n//sg;
-    $line =~ s/^(.*?)((?:[\r\n]+__(?:DATA|END)__[\r\n]+)|$)/
-use Module::ScanDeps::DataFeed '$fname.out';
-sub {
-$1
-}
-$2/s;
-    $fhout->print($line);
-    $fhout->close;
-    $fhin->close;
-
-    system($perl, $fname);
-
-    _extract_info("$fname.out", $inchash, $dl_shared_objects, $incarray);
-    unlink("$fname");
-    unlink("$fname.out");
-}
-
-sub _execute {
-    my ($perl, $file, $inchash, $dl_shared_objects, $incarray, $firstflag) = @_;
-
-    $DB::single = $DB::single = 1;
-    my ($fhout, $fname) = File::Temp::tempfile("XXXXXX");
-    $fname = _abs_path($fname);
-    my $fhin  = FileHandle->new($file) or die "Couldn't open $file";
-
-    my $line = do { local $/; <$fhin> };
-    $line =~ s/use Module::ScanDeps::DataFeed.*?\n//sg;
-    $line = "use Module::ScanDeps::DataFeed '$fname.out';\n" . $line;
-    $fhout->print($line);
-    $fhout->close;
-    $fhin->close;
-
-    File::Path::rmtree( ['_Inline'], 0, 1); # XXX hack
-    system($perl, $fname) == 0 or die "SYSTEM ERROR in executing $file: $?";
-
-    _extract_info("$fname.out", $inchash, $dl_shared_objects, $incarray);
-    unlink("$fname");
-    unlink("$fname.out");
-}
-
-sub _make_rv {
-    my ($inchash, $dl_shared_objects, $inc_array) = @_;
-
-    my $rv = {};
-    my @newinc = map(quotemeta($_), @$inc_array);
-    my $inc = join('|', sort { length($b) <=> length($a) } @newinc);
-
-    require File::Spec;
-
-    my $key;
-    foreach $key (keys(%$inchash)) {
-        my $newkey = $key;
-        $newkey =~ s"^(?:(?:$inc)/?)""sg if File::Spec->file_name_is_absolute($newkey);
-
-        $rv->{$newkey} = {
-            'used_by' => [],
-            'file'    => $inchash->{$key},
-            'type'    => _gettype($inchash->{$key}),
-            'key'     => $key
-        };
-    }
-
-    my $dl_file;
-    foreach $dl_file (@$dl_shared_objects) {
-        my $key = $dl_file;
-        $key =~ s"^(?:(?:$inc)/?)""s;
-
-        $rv->{$key} = {
-            'used_by' => [],
-            'file'    => $dl_file,
-            'type'    => 'shared',
-            'key'     => $key
-        };
-    }
-
-    return $rv;
-}
-
-sub _extract_info {
-    my ($fname, $inchash, $dl_shared_objects, $incarray) = @_;
-
-    use vars qw(%inchash @dl_shared_objects @incarray);
-    my $fh = FileHandle->new($fname) or die "Couldn't open $fname";
-    my $line = do { local $/; <$fh> };
-    $fh->close;
-
-    eval $line;
-
-    $inchash->{$_} = $inchash{$_} for keys %inchash;
-    @$dl_shared_objects = @dl_shared_objects;
-    @$incarray          = @incarray;
-}
-
-sub _gettype {
-    my $name = shift;
-    my $dlext = quotemeta(dl_ext());
-
-    return 'autoload' if $name =~ /(?:\.ix|\.al|\.bs)$/i;
-    return 'module'   if $name =~ /\.p[mh]$/i;
-    return 'shared'   if $name =~ /\.$dlext$/i;
-    return 'data';
-}
-
-sub _merge_rv {
-    my ($rv_sub, $rv) = @_;
-
-    my $key;
-    foreach $key (keys(%$rv_sub)) {
-        my %mark;
-        if ($rv->{$key} and _not_dup($key, $rv, $rv_sub)) {
-            warn "Different modules for file '$key' were found.\n"
-                . " -> Using '" . _abs_path($rv_sub->{$key}{file}) . "'.\n"
-                . " -> Ignoring '" . _abs_path($rv->{$key}{file}) . "'.\n";
-            $rv->{$key}{used_by} = [
-                grep (!$mark{$_}++,
-                    @{ $rv->{$key}{used_by} },
-                    @{ $rv_sub->{$key}{used_by} })
-            ];
-            @{ $rv->{$key}{used_by} } = grep length, @{ $rv->{$key}{used_by} };
-            $rv->{$key}{file} = $rv_sub->{$key}{file};
-        }
-        elsif ($rv->{$key}) {
-            $rv->{$key}{used_by} = [
-                grep (!$mark{$_}++,
-                    @{ $rv->{$key}{used_by} },
-                    @{ $rv_sub->{$key}{used_by} })
-            ];
-            @{ $rv->{$key}{used_by} } = grep length, @{ $rv->{$key}{used_by} };
-        }
-        else {
-            $rv->{$key} = {
-                used_by => [ @{ $rv_sub->{$key}{used_by} } ],
-                file    => $rv_sub->{$key}{file},
-                key     => $rv_sub->{$key}{key},
-                type    => $rv_sub->{$key}{type}
-            };
-
-            @{ $rv->{$key}{used_by} } = grep length, @{ $rv->{$key}{used_by} };
-        }
-    }
-}
-
-sub _not_dup {
-    my ($key, $rv1, $rv2) = @_;
-    (_abs_path($rv1->{$key}{file}) ne _abs_path($rv2->{$key}{file}));
-}
-
-sub _abs_path {
-    return join(
-        '/',
-        Cwd::abs_path(File::Basename::dirname($_[0])),
-        File::Basename::basename($_[0]),
-    );
-}
-
-1;
-
-__END__
-
-=head1 SEE ALSO
-
-L<scandeps.pl> is a bundled utility that writes C<PREREQ_PM> section
-for a number of files.
-
-An application of B<Module::ScanDeps> is to generate executables from
-scripts that contains prerequisite modules; this module supports two
-such projects, L<PAR> and L<App::Packer>.  Please see their respective
-documentations on CPAN for further information.
-
-=head1 AUTHORS
-
-Audrey Tang E<lt>autrijus@autrijus.orgE<gt>
-
-Parts of heuristics were deduced from:
-
-=over 4
-
-=item *
-
-B<PerlApp> by ActiveState Tools Corp L<http://www.activestate.com/>
-
-=item *
-
-B<Perl2Exe> by IndigoStar, Inc L<http://www.indigostar.com/>
-
-=back
-
-The B<scan_deps_runtime> function is contributed by Edward S. Peschko.
-
-L<http://par.perl.org/> is the official website for this module.  You
-can write to the mailing list at E<lt>par@perl.orgE<gt>, or send an empty
-mail to E<lt>par-subscribe@perl.orgE<gt> to participate in the discussion.
-
-Please submit bug reports to E<lt>bug-Module-ScanDeps@rt.cpan.orgE<gt>.
-
-=head1 COPYRIGHT
-
-Copyright 2002, 2003, 2004, 2005, 2006 by
-Audrey Tang E<lt>autrijus@autrijus.orgE<gt>.
-
-This program is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
-
-See L<http://www.perl.com/perl/misc/Artistic.html>
-
-=cut
index 7d6d0cd255384188e4be923c777c76052349b71f..a23a6fdc6df601b02e68bab7082b034e0ee623d6 100644 (file)
@@ -53,7 +53,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -739,7 +738,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -1002,7 +1001,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1156,6 +1155,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index e180a5cca4ee2652e52ebc8ce7ca6d58516d50e1..aee8b2af63dbbce3592e8eaa7c8aed8374fb3b53 100644 (file)
@@ -53,7 +53,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -739,7 +738,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -1002,7 +1001,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1156,6 +1155,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index eb272e8e8a2793dbedaf2370a54ae781ca0d1b40..64542e8afda20090f0a8b13682e76cb6eeb58cce 100644 (file)
@@ -53,7 +53,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -741,7 +740,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -1004,7 +1003,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1158,6 +1157,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 799e711bdf06bb98378833f8d2f098b34e3336b1..f915fd84c0bfee902ea1779698b52f667ace6d94 100644 (file)
@@ -51,7 +51,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -732,7 +731,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -991,7 +990,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1141,6 +1140,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index bb6d2fc9c3b7acfb7c244b53f7854cf5e6c7b9dc..b0eb0fe06b5b93a088f1838bbac2c04c587d8994 100644 (file)
@@ -53,7 +53,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -739,7 +738,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -1002,7 +1001,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1156,6 +1155,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index d3ebbe28bc0d2963a80d6c5012feb9c0de4d3696..557d9a19993464917f09871382472d0e0c42d312 100644 (file)
@@ -51,7 +51,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -732,7 +731,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -991,7 +990,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1141,6 +1140,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 855b81263d0e6b6951e4c097491c7986c5cabef9..39b595516a94aa5ff8b18aee33eab5f9f71f2ef1 100644 (file)
@@ -53,7 +53,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -739,7 +738,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -1002,7 +1001,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1156,6 +1155,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
index 203edf845601699d9d54b4305c4fa3d645160c38..6ec080f5867076fc4b24a20217bad137b07b520c 100644 (file)
@@ -51,7 +51,6 @@ castflags='0'
 cat='cat'
 cc='%%CC%%'
 cccdlflags='-fPIC'
-ccdlflags='-Wl,-E'
 ccflags='%%CFLAGS%%'
 ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 ccname='gcc'
@@ -732,7 +731,7 @@ ldlibpthname='LD_LIBRARY_PATH'
 less='less'
 lib_ext='.a'
 libc=''
-libperl='libperl.a'
+libperl='libperl.so'
 libpth='%%LIBDIRS%%'
 libs='-lgdbm -ldb -lnsl -ldl -lm -lcrypt -lutil -lc'
 libsdirs='%%LIBDIRS%%'
@@ -991,7 +990,7 @@ useposix='true'
 usereentrant='undef'
 userelocatableinc='undef'
 usesfio='false'
-useshrplib='false'
+useshrplib='true'
 usesitecustomize='undef'
 usesocks='undef'
 usethreads='undef'
@@ -1141,6 +1140,7 @@ version_patchlevel_string='version 20 subversion 0'
 PERL_VERSION=20
 PERL_API_VERSION=20
 patchlevel='20'
+ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
 
 # Make perl use these tools instead of the target binaries during build.
 hostgenerate='%%HOSTGENERATE%%'
diff --git a/lang/perl/files/perlmod-deps.sh b/lang/perl/files/perlmod-deps.sh
deleted file mode 100644 (file)
index d144b4d..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-#
-# Generate perl module package dependencies
-#
-# Copyright (C) 2007  Peter Colberg <peter@petercolberg.org>
-# Licensed under the terms of the GNU General Public License.
-#
-
-if [ $# -lt 3 ]; then
-    echo >&2 "Usage: $(basename $0) STAGING-DIR PERL-BUILD-DIR [FILES...] [DIRECTORIES...]"
-    exit 1
-fi
-
-STAGING_DIR="$1"
-PERL_BIN="$STAGING_DIR/usr/bin/perl"
-PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10"
-INC_DIR="$(dirname $0)"
-shift
-
-"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$@" <<'PERL_SCRIPT'
-use strict;
-use warnings;
-
-use Module::ScanDeps;
-use File::Find;
-use Cwd;
-
-our $sitelib = "/usr/lib/perl5/5.10";
-
-sub scandeps {
-    my $builddir = Cwd::abs_path(shift);
-    my @scanpaths = @_;
-    my ($curdir, @pkgdirs, $dir, @deps, %depends, $file);
-    our ($pkg, %bundles, $path, @files);
-
-    @pkgdirs = glob($builddir . "/*/ipkg");
-    $curdir = getcwd();
-    @INC = ();
-    for $dir (@pkgdirs) {
-       chdir($dir) or die "$dir: $!";
-       for $pkg (glob("*")) {
-           chdir($dir . "/" . $pkg . $sitelib) or next;
-           push @INC, getcwd();
-           sub wanted {
-               return unless (-f $_);
-               s/^\.\///;
-               $bundles{$_} = $pkg;
-           }
-           find({ wanted => \&wanted, no_chdir => 1 }, ".");
-       }
-    }
-    chdir($curdir) or die "$curdir: $!\n";
-
-    for $path (@scanpaths) {
-       sub scan_wanted {
-           return unless (-f $_ and /\.(pl|pm)$/);
-           push @files, $_;
-       }
-       if (-f $path) {
-           push @files, $path;
-       }
-       elsif (-d $path) {
-           find({ wanted => \&scan_wanted, no_chdir => 1 }, $path);
-       }
-    }
-
-    @deps = keys %{scan_deps(files => \@files, recurse => 0)};
-    for $file (grep { not exists $bundles{$_} } @deps) {
-       warn "could not resolve dependency: $file\n";
-    }
-    %depends = map { $bundles{$_}, 1 } grep { exists $bundles{$_} } @deps;
-
-    if (%depends) {
-       print join(' ', 'perl', sort keys %depends), "\n";
-    }
-}
-
-if (@ARGV > 1) {
-    scandeps(@ARGV);
-}
-PERL_SCRIPT
diff --git a/lang/perl/files/scan-perlbase.sh b/lang/perl/files/scan-perlbase.sh
deleted file mode 100644 (file)
index d9fe80a..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-#!/bin/sh
-#
-# Generate perl base modules package definitions
-#
-# Copyright (C) 2007  Peter Colberg <peter@petercolberg.org>
-# Licensed under the terms of the GNU General Public License.
-#
-
-if [ $# -lt 1 ]; then
-    echo >&2 "Usage: $(basename $0) STAGING-DIR [OUTFILE]"
-    exit 1
-fi
-
-STAGING_DIR="$1"
-PERL_BIN="$STAGING_DIR/usr/bin/perl"
-PERL_LIB="$STAGING_DIR/usr/lib/perl5/5.10"
-INC_DIR="$(dirname $0)"
-shift
-
-"$PERL_BIN" -I"$INC_DIR" -I"$PERL_LIB" - "$PERL_LIB" "$@" <<'PERL_SCRIPT'
-use strict;
-use warnings;
-
-use Module::ScanDeps;
-use File::Find;
-use File::Basename;
-
-our $skipfiles = 'CORE vmsish.pm auto/sdbm';
-
-our %defmodules = (
-    'essential' => 'lib.pm vars.pm strict.pm warnings.pm warnings Carp Carp.pm Exporter Exporter.pm locale.pm subs.pm overload.pm constant.pm',
-    'getoptpl' => 'getopt.pl getopts.pl',
-    'utf8' => 'utf8_heavy.pl',
-    'Getopt' => 'newgetopt.pl',
-    'open' => 'open2.pl open3.pl',
-    'Config' => 'Config_heavy.pl',
-    'bytes' => 'bytes_heavy.pl',
-);
-
-our %defdepends = (
-    'DB_File' => 'libdb1-compat',
-    'GDBM_File' => 'libgdbm',
-);
-
-our $prefix = 'perlbase-';
-
-sub template ($) {
-    $_ = $_[0];
-    return <<TEMPLATE;
-define Package/$$_{package}
-SECTION:=lang
-CATEGORY:=Languages
-URL:=http://www.cpan.org/
-TITLE:=$$_{module} perl module
-DEPENDS:=$$_{depends}
-endef
-
-define Package/$$_{package}/install
-\$(call perlmod/Install,\$(1),$$_{files},$$_{exclude})
-endef
-
-\$(eval \$(call BuildPackage,$$_{package}))
-
-
-TEMPLATE
-}
-
-
-sub scandeps ($) {
-    my $sitedir = shift;
-    my @result;
-
-    my ($mod, $file, @deps, $dep, %depends, $parent, $pkg);
-    our (%files, %modules);
-    my (%packages, %excludes);
-
-    for $mod (keys %defmodules) {
-       ($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/;
-       $modules{$pkg} = $mod;
-       for $file (split / /, $defmodules{$mod}) {
-           $files{$file} = $pkg;
-       }
-    }
-    for $file ('pod', 'Pod', split(/ /, $skipfiles)) {
-       $files{$file} = undef;
-    }
-
-    sub wanted {
-       s/^\.\///;
-       return if (/^(\.|auto)$/ or exists $files{$_});
-       if (/\.pod$/) {
-           $files{$_} = undef;
-       }
-       elsif (exists $files{dirname($_)}) {
-           $files{$_} = $files{dirname($_)};
-       }
-       elsif (m!^(?:auto/)?([^./]+)(?:\.(?:pl|pm)|/|$)!) {
-           (my $pkg = $prefix . $1) =~ tr/A-Z_/a-z-/;
-           $modules{$pkg} = $1;
-           $files{$_} = $pkg;
-       }
-       else {
-           $files{$_} = undef;
-       }
-    }
-    chdir($sitedir);
-    find({ wanted => \&wanted, no_chdir => 1}, '.');
-
-    for $pkg (keys %modules) {
-       $packages{$pkg} = [];
-       $excludes{$pkg} = [];
-       $depends{$pkg} = {};
-    }
-
-    for $file (keys %files) {
-       $mod = $files{$file};
-       $parent = $files{dirname($file)};
-
-       if (defined ($mod)) {
-           if (defined ($parent) and not ($parent eq $mod)) {
-               push @{$packages{$mod}}, $file;
-               push @{$excludes{$parent}}, $file;
-           }
-           elsif (not defined ($parent)) {
-               push @{$packages{$mod}}, $file;
-           }
-       }
-       elsif (defined ($parent)) {
-           push @{$excludes{$parent}}, $file;
-       }
-    }
-
-    for $mod (keys %defdepends) {
-       ($pkg = $prefix . $mod) =~ tr/A-Z_/a-z-/;
-       for $dep (split / /, $defdepends{$mod}) {
-           ${$depends{$pkg}}{$dep} = 1;
-       }
-    }
-
-    @INC = ('.');
-    for $file (grep { -f $_ and defined $files{$_} } keys %files) {
-       @deps = keys %{scan_deps(files => [ $file ], recurse => 0)};
-       $pkg = $files{$file};
-
-       for $dep (grep { not defined $files{$_} } @deps) {
-           warn "$file: could not resolve dependency: $dep\n";
-       }
-       for $dep (grep { defined $files{$_} } @deps) {
-           next if ($files{$dep} eq $pkg);
-           ${$depends{$pkg}}{$files{$dep}} = 1;
-       }
-    }
-
-    for $pkg (sort keys %packages) {
-       push @result, template({
-           package => $pkg,
-           module => $modules{$pkg},
-           depends => join(' ', 'perl', sort keys %{$depends{$pkg}}),
-           files => join(' ', sort @{$packages{$pkg}}),
-           exclude => join(' ', sort @{$excludes{$pkg}}),
-       });
-    }
-
-    return join('', @result);
-}
-
-
-if (@ARGV > 1) {
-    open FILE, ">$ARGV[1]" or die "$ARGV[1]: $!\n";
-    print FILE scandeps($ARGV[0]);
-    close FILE;
-}
-else {
-    print scandeps($ARGV[0] or '.');
-}
-PERL_SCRIPT
diff --git a/lang/perl/files/strippm.sh b/lang/perl/files/strippm.sh
deleted file mode 100644 (file)
index 48622e5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-#
-# Attempt to strip comments and pod docs from perl modules
-#
-
-[ "$#" -gt 0 ] || set .
-echo "---> Stripping modules in: $@" >&2
-find "$@" -name \*.pm -or -name \*.pl -or -name \*.pod | while read fn; do
-       echo "   $fn" >&2
-       sed -i -e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d; /^=\(head\|pod\|item\|over\|back\)/,$d; /^#$/d; /^#[^!"'"'"']/d' "$fn"
-done
diff --git a/lang/perl/patches/500-add-relink-hack.patch b/lang/perl/patches/500-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");
index 3dc451c55f68c79dca4f09b96bdb6ee7b9924195..cc9169076ea6fac9bd59cfaa59d0e02303adb597 100644 (file)
@@ -9,6 +9,7 @@ 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
@@ -21,6 +22,7 @@ $(eval $(call BuildPackage,perlbase-anydbm-file))
 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
@@ -33,6 +35,7 @@ $(eval $(call BuildPackage,perlbase-archive))
 define Package/perlbase-attribute
 $(call Package/perlbase-template)
 TITLE:=Attribute perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-attribute/install
@@ -45,6 +48,7 @@ $(eval $(call BuildPackage,perlbase-attribute))
 define Package/perlbase-attributes
 $(call Package/perlbase-template)
 TITLE:=attributes perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-attributes/install
@@ -57,6 +61,7 @@ $(eval $(call BuildPackage,perlbase-attributes))
 define Package/perlbase-autoloader
 $(call Package/perlbase-template)
 TITLE:=AutoLoader perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-autoloader/install
@@ -69,6 +74,7 @@ $(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
@@ -93,6 +99,7 @@ $(eval $(call BuildPackage,perlbase-autouse))
 define Package/perlbase-b
 $(call Package/perlbase-template)
 TITLE:=B perl module
+DEPENDS+=+perlbase-config +perlbase-essential
 endef
 
 define Package/perlbase-b/install
@@ -105,6 +112,7 @@ $(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
@@ -117,6 +125,7 @@ $(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
@@ -129,6 +138,7 @@ $(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
@@ -141,6 +151,7 @@ $(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
@@ -153,6 +164,7 @@ $(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
@@ -177,6 +189,7 @@ $(eval $(call BuildPackage,perlbase-bytes))
 define Package/perlbase-cgi
 $(call Package/perlbase-template)
 TITLE:=CGI perl module
+DEPENDS+=+perlbase-base +perlbase-essential +perlbase-file +perlbase-if
 endef
 
 define Package/perlbase-cgi/install
@@ -189,6 +202,7 @@ $(eval $(call BuildPackage,perlbase-cgi))
 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
@@ -201,6 +215,7 @@ $(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
@@ -213,6 +228,7 @@ $(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
@@ -237,6 +253,7 @@ $(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-list +perlbase-net +perlbase-safe +perlbase-scalar +perlbase-sys +perlbase-text +perlbase-version
 endef
 
 define Package/perlbase-cpan/install
@@ -249,6 +266,7 @@ $(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
@@ -261,6 +279,7 @@ $(eval $(call BuildPackage,perlbase-cwd))
 define Package/perlbase-data
 $(call Package/perlbase-template)
 TITLE:=Data perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-data/install
@@ -273,7 +292,7 @@ $(eval $(call BuildPackage,perlbase-data))
 define Package/perlbase-db
 $(call Package/perlbase-template)
 TITLE:=DB perl module
-DEPENDS+= +libdb47
+DEPENDS+=+libdb47 +perlbase-essential
 endef
 
 define Package/perlbase-db/install
@@ -286,7 +305,7 @@ $(eval $(call BuildPackage,perlbase-db))
 define Package/perlbase-db-file
 $(call Package/perlbase-template)
 TITLE:=DB_File perl module
-DEPENDS+= +libdb47
+DEPENDS+=+libdb47 +perlbase-essential
 endef
 
 define Package/perlbase-db-file/install
@@ -299,6 +318,7 @@ $(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
@@ -311,6 +331,7 @@ $(eval $(call BuildPackage,perlbase-dbm-filter))
 define Package/perlbase-devel
 $(call Package/perlbase-template)
 TITLE:=Devel perl module
+DEPENDS+=+perlbase-essential +perlbase-file
 endef
 
 define Package/perlbase-devel/install
@@ -323,6 +344,7 @@ $(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
@@ -335,6 +357,7 @@ $(eval $(call BuildPackage,perlbase-diagnostics))
 define Package/perlbase-digest
 $(call Package/perlbase-template)
 TITLE:=Digest perl module
+DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-integer
 endef
 
 define Package/perlbase-digest/install
@@ -347,6 +370,7 @@ $(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
@@ -359,6 +383,7 @@ $(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
@@ -383,6 +408,7 @@ $(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
@@ -395,6 +421,7 @@ $(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
@@ -407,6 +434,7 @@ $(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
@@ -431,6 +459,7 @@ $(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
@@ -443,6 +472,7 @@ $(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
@@ -455,10 +485,11 @@ $(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 lib.pm locale.pm overload.pm strict.pm subs.pm vars.pm warnings warnings.pm overloading.pm,)
+$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,)
 endef
 
 $(eval $(call BuildPackage,perlbase-essential))
@@ -467,6 +498,7 @@ $(eval $(call BuildPackage,perlbase-essential))
 define Package/perlbase-extutils
 $(call Package/perlbase-template)
 TITLE:=ExtUtils perl module
+DEPENDS+=+perlbase-autosplit +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-file +perlbase-io +perlbase-ipc +perlbase-symbol +perlbase-text
 endef
 
 define Package/perlbase-extutils/install
@@ -479,6 +511,7 @@ $(eval $(call BuildPackage,perlbase-extutils))
 define Package/perlbase-fatal
 $(call Package/perlbase-template)
 TITLE:=Fatal perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-scalar +perlbase-tie
 endef
 
 define Package/perlbase-fatal/install
@@ -491,6 +524,7 @@ $(eval $(call BuildPackage,perlbase-fatal))
 define Package/perlbase-fcntl
 $(call Package/perlbase-template)
 TITLE:=Fcntl perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-fcntl/install
@@ -515,6 +549,7 @@ $(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
@@ -527,6 +562,7 @@ $(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
 endef
 
 define Package/perlbase-file/install
@@ -539,6 +575,7 @@ $(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
@@ -551,6 +588,7 @@ $(eval $(call BuildPackage,perlbase-filecache))
 define Package/perlbase-filehandle
 $(call Package/perlbase-template)
 TITLE:=FileHandle perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-filehandle/install
@@ -575,6 +613,7 @@ $(eval $(call BuildPackage,perlbase-filetest))
 define Package/perlbase-filter
 $(call Package/perlbase-template)
 TITLE:=Filter perl module
+DEPENDS+=+perlbase-essential +perlbase-text
 endef
 
 define Package/perlbase-filter/install
@@ -587,6 +626,7 @@ $(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
@@ -599,7 +639,7 @@ $(eval $(call BuildPackage,perlbase-findbin))
 define Package/perlbase-gdbm-file
 $(call Package/perlbase-template)
 TITLE:=GDBM_File perl module
-DEPENDS+= +libgdbm
+DEPENDS+=+libgdbm +perlbase-essential
 endef
 
 define Package/perlbase-gdbm-file/install
@@ -612,6 +652,7 @@ $(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
@@ -624,6 +665,7 @@ $(eval $(call BuildPackage,perlbase-getopt))
 define Package/perlbase-hash
 $(call Package/perlbase-template)
 TITLE:=Hash perl module
+DEPENDS+=+perlbase-essential +perlbase-scalar
 endef
 
 define Package/perlbase-hash/install
@@ -636,6 +678,7 @@ $(eval $(call BuildPackage,perlbase-hash))
 define Package/perlbase-i18n
 $(call Package/perlbase-template)
 TITLE:=I18N perl module
+DEPENDS+=+perlbase-essential +perlbase-posix
 endef
 
 define Package/perlbase-i18n/install
@@ -672,9 +715,7 @@ $(eval $(call BuildPackage,perlbase-integer))
 define Package/perlbase-io
 $(call Package/perlbase-template)
 TITLE:=IO perl module
-DEPENDS+=+perlbase-symbol +perlbase-selectsaver +perlbase-essential \
-         +perlbase-xsloader +perlbase-fcntl +perlbase-tie \
-         +perlbase-file +perlbase-errno
+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
@@ -687,6 +728,7 @@ $(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
@@ -699,6 +741,7 @@ $(eval $(call BuildPackage,perlbase-ipc))
 define Package/perlbase-less
 $(call Package/perlbase-template)
 TITLE:=less perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-less/install
@@ -711,6 +754,7 @@ $(eval $(call BuildPackage,perlbase-less))
 define Package/perlbase-list
 $(call Package/perlbase-template)
 TITLE:=List perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-list/install
@@ -723,6 +767,7 @@ $(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
@@ -735,6 +780,7 @@ $(eval $(call BuildPackage,perlbase-locale))
 define Package/perlbase-math
 $(call Package/perlbase-template)
 TITLE:=Math perl module
+DEPENDS+=+perlbase-config +perlbase-essential +perlbase-scalar
 endef
 
 define Package/perlbase-math/install
@@ -747,6 +793,7 @@ $(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
@@ -759,6 +806,7 @@ $(eval $(call BuildPackage,perlbase-memoize))
 define Package/perlbase-mime
 $(call Package/perlbase-template)
 TITLE:=MIME perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-mime/install
@@ -771,6 +819,7 @@ $(eval $(call BuildPackage,perlbase-mime))
 define Package/perlbase-module
 $(call Package/perlbase-template)
 TITLE:=Module perl module
+DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-filehandle +perlbase-if +perlbase-io +perlbase-locale +perlbase-params +perlbase-text +perlbase-version
 endef
 
 define Package/perlbase-module/install
@@ -783,6 +832,7 @@ $(eval $(call BuildPackage,perlbase-module))
 define Package/perlbase-mro
 $(call Package/perlbase-template)
 TITLE:=mro perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-mro/install
@@ -795,6 +845,7 @@ $(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
@@ -807,6 +858,7 @@ $(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
@@ -819,6 +871,7 @@ $(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
@@ -831,6 +884,7 @@ $(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
@@ -843,6 +897,7 @@ $(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
@@ -855,6 +910,7 @@ $(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
@@ -867,6 +923,7 @@ $(eval $(call BuildPackage,perlbase-ops))
 define Package/perlbase-package
 $(call Package/perlbase-template)
 TITLE:=Package perl module
+DEPENDS+=+perlbase-essential +perlbase-if
 endef
 
 define Package/perlbase-package/install
@@ -879,6 +936,7 @@ $(eval $(call BuildPackage,perlbase-package))
 define Package/perlbase-params
 $(call Package/perlbase-template)
 TITLE:=Params perl module
+DEPENDS+=+perlbase-essential +perlbase-locale
 endef
 
 define Package/perlbase-params/install
@@ -891,6 +949,7 @@ $(eval $(call BuildPackage,perlbase-params))
 define Package/perlbase-perl5db
 $(call Package/perlbase-template)
 TITLE:=perl5db perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-perl5db/install
@@ -903,6 +962,7 @@ $(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
@@ -911,9 +971,11 @@ 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
@@ -926,6 +988,7 @@ $(eval $(call BuildPackage,perlbase-pod))
 define Package/perlbase-posix
 $(call Package/perlbase-template)
 TITLE:=POSIX perl module
+DEPENDS+=+perlbase-essential +perlbase-fcntl
 endef
 
 define Package/perlbase-posix/install
@@ -938,6 +1001,7 @@ $(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
@@ -950,6 +1014,7 @@ $(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
 endef
 
 define Package/perlbase-safe/install
@@ -962,6 +1027,7 @@ $(eval $(call BuildPackage,perlbase-safe))
 define Package/perlbase-scalar
 $(call Package/perlbase-template)
 TITLE:=Scalar perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-scalar/install
@@ -974,6 +1040,7 @@ $(eval $(call BuildPackage,perlbase-scalar))
 define Package/perlbase-sdbm-file
 $(call Package/perlbase-template)
 TITLE:=SDBM_File perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-sdbm-file/install
@@ -986,6 +1053,7 @@ $(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
@@ -998,6 +1066,7 @@ $(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
@@ -1010,6 +1079,7 @@ $(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
@@ -1022,6 +1092,7 @@ $(eval $(call BuildPackage,perlbase-selfloader))
 define Package/perlbase-sigtrap
 $(call Package/perlbase-template)
 TITLE:=sigtrap perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-sigtrap/install
@@ -1034,6 +1105,7 @@ $(eval $(call BuildPackage,perlbase-sigtrap))
 define Package/perlbase-socket
 $(call Package/perlbase-template)
 TITLE:=Socket perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-socket/install
@@ -1046,6 +1118,7 @@ $(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
@@ -1058,6 +1131,7 @@ $(eval $(call BuildPackage,perlbase-sort))
 define Package/perlbase-storable
 $(call Package/perlbase-template)
 TITLE:=Storable perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-storable/install
@@ -1082,6 +1156,7 @@ $(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
@@ -1094,6 +1169,7 @@ $(eval $(call BuildPackage,perlbase-sys))
 define Package/perlbase-term
 $(call Package/perlbase-template)
 TITLE:=Term perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-term/install
@@ -1106,13 +1182,13 @@ $(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-symbol +perlbase-text
 endef
 
 define Package/perlbase-test/install
 $(call perlmod/Install,$(1),Test Test.pm,Test/Harness/TAP.pod Test/Tutorial.pod)
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prove $(1)/usr/bin
-       $(call perlmod/Install,$(1),Test Test.pm,Test/Harness/TAP.pod Test/Tutorial.pod)
 endef
 
 $(eval $(call BuildPackage,perlbase-test))
@@ -1121,6 +1197,7 @@ $(eval $(call BuildPackage,perlbase-test))
 define Package/perlbase-text
 $(call Package/perlbase-template)
 TITLE:=Text perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-text/install
@@ -1133,6 +1210,7 @@ $(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
@@ -1145,6 +1223,7 @@ $(eval $(call BuildPackage,perlbase-thread))
 define Package/perlbase-threads
 $(call Package/perlbase-template)
 TITLE:=threads perl module
+DEPENDS+=+perlbase-essential +perlbase-scalar
 endef
 
 define Package/perlbase-threads/install
@@ -1157,6 +1236,7 @@ $(eval $(call BuildPackage,perlbase-threads))
 define Package/perlbase-tie
 $(call Package/perlbase-template)
 TITLE:=Tie perl module
+DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-posix
 endef
 
 define Package/perlbase-tie/install
@@ -1169,6 +1249,7 @@ $(eval $(call BuildPackage,perlbase-tie))
 define Package/perlbase-time
 $(call Package/perlbase-template)
 TITLE:=Time perl module
+DEPENDS+=+perlbase-class +perlbase-config +perlbase-essential
 endef
 
 define Package/perlbase-time/install
@@ -1181,6 +1262,7 @@ $(eval $(call BuildPackage,perlbase-time))
 define Package/perlbase-unicode
 $(call Package/perlbase-template)
 TITLE:=Unicode perl module
+DEPENDS+=+perlbase-base +perlbase-charnames +perlbase-essential +perlbase-file
 endef
 
 define Package/perlbase-unicode/install
@@ -1217,6 +1299,7 @@ $(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
@@ -1229,6 +1312,7 @@ $(eval $(call BuildPackage,perlbase-user))
 define Package/perlbase-utf8
 $(call Package/perlbase-template)
 TITLE:=utf8 perl module
+DEPENDS+=+perlbase-essential +perlbase-re
 endef
 
 define Package/perlbase-utf8/install
@@ -1241,6 +1325,7 @@ $(eval $(call BuildPackage,perlbase-utf8))
 define Package/perlbase-version
 $(call Package/perlbase-template)
 TITLE:=version perl module
+DEPENDS+=+perlbase-essential
 endef
 
 define Package/perlbase-version/install
index 05bcc5e74371c2e45ef30701170104de0d7dfc11..3c3d56720a63a6c53e7bacbcbd9c3b80432d1f13 100644 (file)
@@ -12,6 +12,37 @@ PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0
 # Module install prefix
 PERL_SITELIB:=/usr/lib/perl5/5.20
 
+define perlmod/host/relink
+       rm -f $(1)/Makefile.aperl
+       $(MAKE) -C $(1) perl
+       $(CP) $(1)/perl $(PERL_CMD)
+       $(CP) $(1)/perl $(STAGING_DIR_HOST)/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 $(PKG_BUILD_DIR); \
        PERL_MM_USE_DEFAULT=1 \
diff --git a/lang/ruby/Makefile b/lang/ruby/Makefile
new file mode 100644 (file)
index 0000000..661b3e7
--- /dev/null
@@ -0,0 +1,488 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+#
+# To Do:
+#  - split up encodings
+#  - allow selection of either native or pure version of a library where supported
+#  +-> some native libraries are probably only supported if ruby-dl is enabled
+# anything else?
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ruby
+PKG_VERSION:=2.1.2
+PKG_RELEASE:=1
+
+PKG_LIBVER:=2.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
+PKG_MD5SUM:=ed9b8565bdeccb401d628ec8d54a0774
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILE:=COPYING
+
+PKG_BUILD_DEPENDS:=ruby/host
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+HOST_BUILD_DEPENDS:=gmp/host
+
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/ruby/Default
+  SUBMENU:=Ruby
+  SECTION:=lang
+  CATEGORY:=Languages
+  TITLE:=Ruby scripting language
+  URL:=http://www.ruby-lang.org/
+endef
+
+define Package/ruby/Default/description
+ Ruby is the interpreted scripting language for quick and  easy
+ object-oriented programming.  It has many features to process text files
+ and to do system management tasks (as in perl).  It is simple,
+ straight-forward, and extensible.
+endef
+
+define Package/ruby
+$(call Package/ruby/Default)
+  TITLE+= (interpreter)
+  DEPENDS:=+libruby
+endef
+
+define Package/ruby/description
+$(call Package/ruby/Default/description)
+endef
+
+define Package/libruby
+$(call Package/ruby/Default)
+  SUBMENU:=
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= (shared library)
+  DEPENDS+= +libpthread +librt +libgmp
+endef
+
+# Ongoing work to break up ruby's standard library into coherent pieces
+# with minimal dependencies between them
+
+define Package/ruby-core
+$(call Package/ruby/Default)
+  TITLE:=Ruby standard libraries
+  DEPENDS:=ruby +libdb47 +libffi
+endef
+
+define Package/ruby-cgi
+$(call Package/ruby/Default)
+  TITLE:=Ruby CGI support toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-dl
+$(call Package/ruby/Default)
+  TITLE+= (dynamic linker support) (adds 5MB+)
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-enc
+$(call Package/ruby/Default)
+  TITLE+= (character re-coding library) (adds 2MB+)
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-erb
+$(call Package/ruby/Default)
+  TITLE+= (embedded interpreter)
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-gdbm
+$(call Package/ruby/Default)
+  TITLE:=Ruby support for gdbm
+  DEPENDS:=ruby +libgdbm
+endef
+
+define Package/ruby-gems
+$(call Package/ruby/Default)
+  TITLE:=Ruby gems packet management
+  DEPENDS:=ruby +ruby-yaml +ruby-zlib +ruby-openssl +ruby-webrick +ruby-erb
+endef
+
+define Package/ruby-irb
+$(call Package/ruby/Default)
+  TITLE+= (interactive shell)
+  DEPENDS:=ruby +ruby-core
+endef
+
+define Package/ruby-json
+$(call Package/ruby/Default)
+  TITLE:=Ruby support for JSON
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-ncurses
+$(call Package/ruby/Default)
+  TITLE:=Ruby support for ncurses
+  DEPENDS:=ruby +libncurses +libncursesw
+endef
+
+define Package/ruby-nkf
+$(call Package/ruby/Default)
+  TITLE:=Ruby Network Kanji Filter
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-openssl
+$(call Package/ruby/Default)
+  TITLE:=Ruby support for openssl
+  DEPENDS:=ruby +libopenssl
+endef
+
+define Package/ruby-rdoc
+$(call Package/ruby/Default)
+  TITLE+= (documentation generator)
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-rake
+$(call Package/ruby/Default)
+  TITLE+=Ruby Rake (make replacement)
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-readline
+$(call Package/ruby/Default)
+  TITLE:=Ruby support for readline
+  DEPENDS:=ruby +libncurses +libreadline
+endef
+
+define Package/ruby-rexml
+$(call Package/ruby/Default)
+  TITLE:=Ruby XML toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-rss
+$(call Package/ruby/Default)
+  TITLE:=Ruby RSS toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-unit
+$(call Package/ruby/Default)
+  TITLE:=Ruby unit testing toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-webrick
+$(call Package/ruby/Default)
+  TITLE:=Ruby Web server toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-xmlrpc
+$(call Package/ruby/Default)
+  TITLE:=Ruby XML-RPC toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-yaml
+$(call Package/ruby/Default)
+  TITLE:=Ruby YAML toolkit
+  DEPENDS:=ruby
+endef
+
+define Package/ruby-zlib
+$(call Package/ruby/Default)
+  TITLE:=Ruby support for zlib
+  DEPENDS:=ruby +zlib
+endef
+
+HOST_CONFIGURE_ARGS += \
+       --disable-install-doc \
+       --disable-install-rdoc \
+       --disable-install-capi
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --disable-rpath \
+       --enable-ipv6 \
+       --with-ruby-version=minor \
+       --with-iconv-dir=$(ICONV_PREFIX) \
+
+TARGET_LDFLAGS += -L$(PKG_BUILD_DIR)
+
+MAKE_FLAGS += \
+       DESTDIR="$(PKG_INSTALL_DIR)" \
+       SHELL="/bin/bash"
+
+define Package/ruby/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ruby $(1)/usr/bin/
+endef
+
+define Package/libruby/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libruby.so.* $(1)/usr/lib/
+endef
+
+define Package/ruby-core/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby $(1)/usr/lib/
+       rm -rf  \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick/ssl.rb \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/enc \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/completion.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb/ext/save-history.rb \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/json.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/json \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/json \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/irb \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rdoc \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rake \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rubygems \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/cgi \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rexml \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/test \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc \
+               \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
+               $(1)/usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
+
+       find $(1) -name '*.h' | xargs rm -f
+endef
+
+define Package/ruby-cgi/install
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/cgi.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-dl/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/*/dl.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-enc/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/*/enc \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-erb/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/erb $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/erb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-gdbm/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/*/gdbm.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-gems/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/gem $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rubygems $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-irb/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/irb $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/irb.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-json/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/json.rb \
+               usr/lib/ruby/$(PKG_LIBVER)/json \
+               usr/lib/ruby/$(PKG_LIBVER)/*/json \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-ncurses/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/*/curses.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-nkf/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/kconv.rb \
+               usr/lib/ruby/$(PKG_LIBVER)/*/nkf.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-openssl/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/digest \
+               usr/lib/ruby/$(PKG_LIBVER)/digest.rb \
+               usr/lib/ruby/$(PKG_LIBVER)/*/digest.so \
+               usr/lib/ruby/$(PKG_LIBVER)/*/digest/*.so \
+               usr/lib/ruby/$(PKG_LIBVER)/openssl \
+               usr/lib/ruby/$(PKG_LIBVER)/openssl.rb \
+               usr/lib/ruby/$(PKG_LIBVER)/*/openssl.so \
+               usr/lib/ruby/$(PKG_LIBVER)/drb/ssl.rb \
+               usr/lib/ruby/$(PKG_LIBVER)/net/https.rb \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-rdoc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdoc $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ri $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rdoc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-rake/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rake $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rake $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-readline/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/*/readline.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-rexml/install
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rexml $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+
+define Package/ruby-rss/install
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/rss.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-unit/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/testrb $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/test $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-webrick/install
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/webrick.rb $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-xmlrpc/install
+       $(INSTALL_DIR) $(1)/usr/lib/ruby/$(PKG_LIBVER)
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ruby/$(PKG_LIBVER)/xmlrpc $(1)/usr/lib/ruby/$(PKG_LIBVER)/
+endef
+
+define Package/ruby-yaml/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/yaml \
+               usr/lib/ruby/$(PKG_LIBVER)/yaml.rb \
+               usr/lib/ruby/$(PKG_LIBVER)/*/syck.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Package/ruby-zlib/install
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               usr/lib/ruby/$(PKG_LIBVER)/*/zlib.so \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+define Build/InstallDev
+       ( cd $(PKG_INSTALL_DIR); $(TAR) -cf - \
+               . \
+       ) | ( cd $(1); $(TAR) -xf - )
+endef
+
+$(eval $(call BuildPackage,ruby))
+$(eval $(call BuildPackage,libruby))
+$(eval $(call BuildPackage,ruby-core))
+$(eval $(call BuildPackage,ruby-cgi))
+$(eval $(call BuildPackage,ruby-dl))
+$(eval $(call BuildPackage,ruby-enc))
+$(eval $(call BuildPackage,ruby-erb))
+$(eval $(call BuildPackage,ruby-gdbm))
+$(eval $(call BuildPackage,ruby-gems))
+$(eval $(call BuildPackage,ruby-json))
+$(eval $(call BuildPackage,ruby-irb))
+$(eval $(call BuildPackage,ruby-ncurses))
+$(eval $(call BuildPackage,ruby-nkf))
+$(eval $(call BuildPackage,ruby-openssl))
+$(eval $(call BuildPackage,ruby-rake))
+$(eval $(call BuildPackage,ruby-rdoc))
+$(eval $(call BuildPackage,ruby-readline))
+$(eval $(call BuildPackage,ruby-rexml))
+$(eval $(call BuildPackage,ruby-rss))
+$(eval $(call BuildPackage,ruby-unit))
+$(eval $(call BuildPackage,ruby-webrick))
+$(eval $(call BuildPackage,ruby-xmlrpc))
+$(eval $(call BuildPackage,ruby-yaml))
+$(eval $(call BuildPackage,ruby-zlib))
+$(eval $(call HostBuild))
index 02e427b946dff77eb3901ee0a9f5cee39ac5ce16..258365603cc9709731a5e47d859d832485a41282 100644 (file)
@@ -11,6 +11,8 @@ PKG_NAME:=cyrus-sasl
 PKG_VERSION:=2.1.26
 PKG_RELEASE:=2
 
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.cyrusimap.org/cyrus-sasl/
 PKG_MD5SUM:=a7f4e5e559a0e37b3ffc438c9456e425
index e609c3f01eff1d49038b0c82c1f02faed81d2dd2..2083fc9dcabf74600bb896abdd99a96f11cd3763 100644 (file)
@@ -8,16 +8,19 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/uclibc++.mk
 
+BASE_VERSION:=4.7.25
+
 PKG_NAME:=db47
-PKG_VERSION:=4.7.25.NC
-PKG_RELEASE:=6
+PKG_VERSION:=$(BASE_VERSION).4.NC
+PKG_RELEASE:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(PKG_VERSION)
-PKG_SOURCE:=db-$(PKG_VERSION).tar.gz
+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:=BSD-2c
+PKG_LICENSE:=Sleepycat
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_FIXUP:=autoreconf
@@ -31,7 +34,7 @@ define Package/libdb47
   CATEGORY:=Libraries
   DEPENDS:=+libxml2
   TITLE:=Berkeley DB library (4.7)
-  URL:=http://www.sleepycat.com/products/db.shtml
+  URL:=http://www.oracle.com/us/products/database/berkeley-db
 endef
 
 define Package/libdb47/description
@@ -43,7 +46,7 @@ define Package/libdb47xx
   CATEGORY:=Libraries
   DEPENDS:=+libdb47 $(CXX_DEPENDS)
   TITLE:=Berkeley DB library (4.7) for C++
-  URL:=http://www.sleepycat.com/products/db.shtml
+  URL:=http://www.oracle.com/us/products/database/berkeley-db
 endef
 
 define Package/libdb47xx/description
@@ -95,4 +98,3 @@ endef
 
 $(eval $(call BuildPackage,libdb47))
 $(eval $(call BuildPackage,libdb47xx))
-
diff --git a/libs/db47/patches/001-sequence_lock.patch b/libs/db47/patches/001-sequence_lock.patch
deleted file mode 100644 (file)
index 8ede4b4..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-diff -ruN db-4.7.25.NC/sequence/sequence.c db-4.7.25.NC.new/sequence/sequence.c
---- db-4.7.25.NC/sequence/sequence.c   2008-05-05 22:25:09.000000000 +0200
-+++ db-4.7.25.NC.new/sequence/sequence.c       2009-11-08 12:50:27.000000000 +0100
-@@ -187,7 +187,11 @@
-       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 @@
-               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 @@
-        */
-       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 @@
-       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/002-lock.patch b/libs/db47/patches/002-lock.patch
deleted file mode 100644 (file)
index 8cfd8fa..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -urN db-4.7.25.NC/lock/lock.c db-4.7.25.NC.new/lock/lock.c
---- db-4.7.25.NC/lock/lock.c   2008-05-07 14:27:35.000000000 +0200
-+++ db-4.7.25.NC.new/lock/lock.c       2009-11-08 12:52:19.000000000 +0100
-@@ -1274,10 +1274,12 @@
-               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 @@
-               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/003-dead_lock.patch b/libs/db47/patches/003-dead_lock.patch
deleted file mode 100644 (file)
index 2b86660..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-diff -urN db-4.7.25.NC/lock/lock_deadlock.c db-4.7.25.NC.new/lock/lock_deadlock.c
---- db-4.7.25.NC/lock/lock_deadlock.c  2008-03-10 14:31:33.000000000 +0100
-+++ db-4.7.25.NC.new/lock/lock_deadlock.c      2009-11-08 12:53:25.000000000 +0100
-@@ -121,7 +121,7 @@
-       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 @@
-       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 @@
-       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 @@
-               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 @@
-                       __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 @@
- #define       DD_INVALID_ID   ((u_int32_t) -1)
-+/*
-+ * __dd_build --
-+ *    Build the lock dependency bit maps.
-+ * Notes on syncronization:  
-+ *    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 @@
-        * 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 @@
-                       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 @@
-       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 @@
-                       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 @@
-        * 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 @@
-                       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 @@
-       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 @@
- 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/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..59b00e6
--- /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 syncronization:  
++ *    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/dtndht/Makefile b/libs/dtndht/Makefile
new file mode 100644 (file)
index 0000000..6bc8084
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# 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
+PKG_BUILD_DEPENDS:=libopenssl
+
+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/lib$(PKG_NAME){.so,-$(PKG_VERSION_MAJOR).$(PKG_VERSION_MINOR).so.*} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,dtndht))
index d91cfba0443b3f84c0400194ff5f475c198c9472..dbdafdab695856afd7bdbe8b14514cd1e12126c4 100644 (file)
@@ -11,6 +11,7 @@ PKG_NAME:=engine_pkcs11
 PKG_VERSION:=20131021
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1+
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
index 7fac33d78cfc338649fd34cbfc1a5dc5a2736a7b..85f01ba62b906bfdb771cb8fd05605f564a974a2 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=file
-PKG_VERSION:=5.11
+PKG_VERSION:=5.19
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/
-PKG_MD5SUM:=16a407bd66d6c7a832f3a5c0d609c27b
+PKG_MD5SUM:=e3526f59023f3f7d1ffa4d541335edab
 
 PKG_LICENSE:=BSD-2c
 PKG_LICENSE_FILES:=COPYING
@@ -27,7 +27,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/file/Default
   TITLE:=File type determination
   URL:=ftp://ftp.astron.com/pub/file/
-  MAINTAINER:=Luka Perkov <openwrt@lukaperkov.net>
+  MAINTAINER:=Luka Perkov <luka@openwrt.org>
 endef
 
 define Package/file
index 1a9574277f6503146d3c38d53da975914134fdba..edfcb1dcf64b262a23363500cb566fe18101426c 100644 (file)
@@ -18,7 +18,7 @@ PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 PKG_INSTALL:=1
 
-PKG_LICENSE:=GFDLv1.2 GPLv2 LGPLv2.1 BSD-3c
+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
index 8d078b62524ca568fcfe408c505b8768dc275deb..d2c4939bc826d28c824ae25d530538d0777e7624 100644 (file)
@@ -15,7 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/gdbm
 PKG_MD5SUM:=72c832680cf0999caedbe5b265c8c1bd
 
-PKG_LICENSE:=GPLv3
+PKG_LICENSE:=GPL-3.0+
 PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 
diff --git a/libs/ibrcommon/Makefile b/libs/ibrcommon/Makefile
new file mode 100644 (file)
index 0000000..fb95b95
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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:=ibrcommon
+PKG_VERSION:=0.12.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:=45681f48138bbbbd17384d25dc91454a
+PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+PKG_BUILD_DEPENDS:=libnl libopenssl
+
+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/lib$(PKG_NAME){.so,-$(PKG_VERSION_MAJOR).$(PKG_VERSION_MINOR).so.*} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,ibrcommon))
diff --git a/libs/ibrdtn/Makefile b/libs/ibrdtn/Makefile
new file mode 100644 (file)
index 0000000..d86dcc3
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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:=ibrdtn
+PKG_VERSION:=0.12.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:=96428dd4af541ea0c52db80776976a65
+PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_FIXUP:=libtool
+PKG_BUILD_DEPENDS:=ibrcommon zlib
+
+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
+
+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/lib$(PKG_NAME){.so,-$(PKG_VERSION_MAJOR).$(PKG_VERSION_MINOR).so.*} $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,ibrdtn))
diff --git a/libs/libarchive/Makefile b/libs/libarchive/Makefile
new file mode 100644 (file)
index 0000000..a820f89
--- /dev/null
@@ -0,0 +1,52 @@
+#
+# 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.1.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.libarchive.org/downloads
+PKG_MD5SUM:=efad5a503f66329bb9d2f4308b5de98a
+PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+PKG_BUILD_DEPENDS:=libxml2 libopenssl zlib
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libarchive/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  URL:=http://www.libarchive.org
+endef
+
+define Package/libarchive
+  $(call Package/libarchive/Default)
+  DEPENDS:=+libxml2 +libopenssl +zlib
+  TITLE:=Multi-format archive and compression library
+endef
+
+define Package/libarchive/description
+ Multi-format archive and compression library.
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)
+       $(CP) $(PKG_INSTALL_DIR)/* $(1)/
+endef
+
+define Package/libarchive/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libarchive.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libarchive))
diff --git a/libs/libdmapsharing/Makefile b/libs/libdmapsharing/Makefile
new file mode 100644 (file)
index 0000000..3fc5096
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# Copyright (C) 2009-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# This Makefile is a skeleton
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libdmapsharing
+PKG_VERSION:=2.9.28
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE=LGPLv2.1
+PKG_LICENSE_FILE=COPYING
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/libdmapsharing-$(PKG_VERSION)
+PKG_SOURCE:=libdmapsharing-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.flyn.org/projects/libdmapsharing/
+PKG_MD5SUM:=a530bee446040f6e6664a38212f16f60
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+TARGET_LDFLAGS+= \
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
+
+define Package/libdmapsharing
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libsoup +mdnsresponder +gstreamer1 +gst1-plugins-base +libgst1app
+  TITLE:=libdmapsharing
+  URL:=http://www.flyn.org/projects/libdmapsharing/
+endef
+
+define Package/libdmapsharing/decription
+  Libdmapsharing is a DMAP library implementation in C
+endef
+
+CONFIGURE_ARGS += \
+       --disable-introspection \
+       --disable-gtk-doc
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/libdmapsharing-3.0/ \
+               $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+               $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libdmapsharing/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+               $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdmapsharing))
diff --git a/libs/libdmapsharing/patches/001-diable_pixbuf.patch b/libs/libdmapsharing/patches/001-diable_pixbuf.patch
new file mode 100644 (file)
index 0000000..663dd49
--- /dev/null
@@ -0,0 +1,24 @@
+Index: libdmapsharing-2.9.15/configure.ac
+===================================================================
+--- libdmapsharing-2.9.15.orig/configure.ac    2012-08-14 21:02:31.861158482 +0200
++++ libdmapsharing-2.9.15/configure.ac 2012-08-14 21:03:42.448658906 +0200
+@@ -112,18 +112,7 @@
+ AC_SUBST(GOBJECT_CFLAGS)
+ AC_SUBST(GOBJECT_LIBS)
+-dnl Check for gdk-pixbuf, needed for DACP Now Playing Artwork
+-PKG_CHECK_MODULES(GDKPIXBUF, gdk-pixbuf-2.0,
+-  HAVE_GDKPIXBUF=yes,
+-  HAVE_GDKPIXBUF=no)
+-
+-if test x"$HAVE_GDKPIXBUF" = "xyes"; then
+-  AC_DEFINE(HAVE_GDKPIXBUF, 1, [Define if gdk-pixbuf support is enabled])
+-else
+-  AC_WARN(Gdk-pixbuf library not present, Now Playing artwork might be affected.)
+-fi
+-
+-AM_CONDITIONAL(USE_GDKPIXBUF, test x"$HAVE_GDKPIXBUF" = "xyes")
++HAVE_GDKPIXBUF=no
+ AC_SUBST(GDKPIXBUF_CFLAGS)
+ AC_SUBST(GDKPIXBUF_LIBS)
index 44857ef055aa3504d58cb06c8108d5506aabf8cc..c290bddb6c6804e504ceffe16f10b058e3b1c5fe 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -15,6 +15,9 @@ 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
 
index 7af23b7d491d9cbc2f9e9d9b5f1a34fdc18b3f7a..127bc17d7eafed6fb36f96c8d5c6b8d5492cd074 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=@SF/mad
 PKG_MD5SUM:=e5808ad997ba32c498803822078748c3
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_LICENSE:=GPLv2
+PKG_LICENSE:=GPL-2
 PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
index 659b3f26c9ce4282cae548e82b4b1abc00f253bb..69daced326c69dff20b6d73547e6ff212965f8bc 100644 (file)
@@ -8,14 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libidn
-PKG_VERSION:=1.28
+PKG_VERSION:=1.29
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/libidn
-PKG_MD5SUM:=43a6f14b16559e10a492acc65c4b0acc
+PKG_MD5SUM:=2b67bb507207af379f9461e1307dc84b
 
-PKG_LICENSE:=GPLv2 GPLv3 LGPLv2.1 LGPLv3 APACHEv2
+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_MAINTAINER:=Marcel Denia <naoir@gmx.net>
 
index c40c4328bf68197856618656c9d65efb8daa10bc..e5be95220402dac565954e04763f247c82398b96 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://downloads.xiph.org/releases/ogg/
 PKG_MD5SUM:=5c3a34309d8b98640827e5d0991a4015
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_LICENSE:=BSD-3c
+PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
index 3a0bcc310c01ecaf1da36929b0d0f94d1315a8dd..f7ed2ae4b826240606532cd984278aefab1c4cf9 100644 (file)
@@ -17,6 +17,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://dl.fefe.de
 PKG_MD5SUM:=6bbee9a86506419657d87123b7a6f2c1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
 
index 2fc1eb2a0eab22803069e8cf60aa5ca20c81310e..4258604e5347e498abaad9e825f50ca151c203da 100644 (file)
@@ -11,6 +11,8 @@ PKG_NAME:=libp11
 PKG_VERSION:=20131021
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
index 7881c3ef9158c9c60c379bd23caeaac948c742a4..e9c4a3c7017adae9209d262b549a6df6f2a2262a 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libpam
 PKG_VERSION:=1.1.8
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=Linux-PAM-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.linux-pam.org/library/
diff --git a/libs/libpam/patches/007-cve-2014-2583.patch b/libs/libpam/patches/007-cve-2014-2583.patch
new file mode 100644 (file)
index 0000000..8d24bea
--- /dev/null
@@ -0,0 +1,52 @@
+From 9dcead87e6d7f66d34e7a56d11a30daca367dffb Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Wed, 26 Mar 2014 22:17:23 +0000
+Subject: pam_timestamp: fix potential directory traversal issue (ticket #27)
+
+pam_timestamp uses values of PAM_RUSER and PAM_TTY as components of
+the timestamp pathname it creates, so extra care should be taken to
+avoid potential directory traversal issues.
+
+* modules/pam_timestamp/pam_timestamp.c (check_tty): Treat
+"." and ".." tty values as invalid.
+(get_ruser): Treat "." and ".." ruser values, as well as any ruser
+value containing '/', as invalid.
+
+Fixes CVE-2014-2583.
+
+Reported-by: Sebastian Krahmer <krahmer@suse.de>
+
+diff --git a/modules/pam_timestamp/pam_timestamp.c b/modules/pam_timestamp/pam_timestamp.c
+index 5193733..b3f08b1 100644
+--- a/modules/pam_timestamp/pam_timestamp.c
++++ b/modules/pam_timestamp/pam_timestamp.c
+@@ -158,7 +158,7 @@ check_tty(const char *tty)
+               tty = strrchr(tty, '/') + 1;
+       }
+       /* Make sure the tty wasn't actually a directory (no basename). */
+-      if (strlen(tty) == 0) {
++      if (!strlen(tty) || !strcmp(tty, ".") || !strcmp(tty, "..")) {
+               return NULL;
+       }
+       return tty;
+@@ -243,6 +243,17 @@ get_ruser(pam_handle_t *pamh, char *ruserbuf, size_t ruserbuflen)
+               if (pwd != NULL) {
+                       ruser = pwd->pw_name;
+               }
++      } else {
++              /*
++               * This ruser is used by format_timestamp_name as a component
++               * of constructed timestamp pathname, so ".", "..", and '/'
++               * are disallowed to avoid potential path traversal issues.
++               */
++              if (!strcmp(ruser, ".") ||
++                  !strcmp(ruser, "..") ||
++                  strchr(ruser, '/')) {
++                      ruser = NULL;
++              }
+       }
+       if (ruser == NULL || strlen(ruser) >= ruserbuflen) {
+               *ruserbuf = '\0';
+-- 
+cgit v0.10.2
+
index 9b0f17de2312b82be3f8bab62e42990344ad31c5..782f69962b1e93912fe97a0a713363404b34ea5d 100644 (file)
@@ -8,13 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libsigc++
-PKG_VERSION:=2.3.1
+PKG_VERSION:=2.3.2
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNOME/libsigc++/2.3
-PKG_MD5SUM:=06a0569e8ba161d3428e7daa838682f8
+PKG_MD5SUM:=e75fbd6f5cc34d058a9dabec96245dc8
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_LICENSE:=LGPL-2.1
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
index c69285f97cfac4df1bcb9a3e6250b2e821739953..f2c22c3b1a5df1cb9be9dc78f6549149166c678c 100644 (file)
  nodist_sigc_config_HEADERS = sigc++config.h
 --- a/Makefile.in
 +++ b/Makefile.in
-@@ -116,7 +116,7 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGE
-       distdir dist dist-all distcheck
+@@ -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)
index 5ab4f18719a7098e93a41b54ce7a1e10e1d8af7b..4497f389cf2991b8166c29abe3a7b6208cd75458 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libssh2
 PKG_VERSION:=1.4.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.libssh2.org/download
@@ -17,6 +17,9 @@ PKG_MD5SUM:=071004c60c5d6f90354ad1b701013a0b
 
 PKG_INSTALL:=1
 
+PKG_LICENSE:=BSD
+PKG_LICENSE_FILES:=COPYING
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/libssh2
index 0fe4833837ecf7b9bd424d1845e8a6a372f3cabd..6147948a1530011b510df6be2f498890ed250165 100644 (file)
@@ -16,6 +16,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/71
 PKG_MD5SUM:=7f44df5dc69cb8686947562e2a11eea9
 
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILE:=COPYRIGHT
+
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
index fbc39b8070a05386bc58df1e18d61dcf0859e984..6ce3734fe3439450459a2fb31027be5fca8f9ef9 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://downloads.xiph.org/releases/vorbis/
 PKG_MD5SUM:=55f2288055e44754275a17c9a2497391
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_LICENSE:=BSD-3c
+PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
index 9f8a99bb47ae6177a1a81f97464942ec05a6b0f3..cb87ee91a40aa89642df8f4c5dd13822f896bb57 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE_URL:=http://ftp.de.debian.org/debian/pool/main/libv/libvorbisidec/
 PKG_MD5SUM:=4190859414c5d6760e316b5cf00fe7c5
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_LICENSE:=BSD-3c
+PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
index b338653f02aef392ad12266de799e4edfd1dd6d2..df80b65b0ac1cd51310eeec8d005f37b9dbc21ee 100644 (file)
@@ -9,14 +9,17 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libxslt
 PKG_VERSION:=1.1.28
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
-¨     http://xmlsoft.org/sources/ \
+       http://xmlsoft.org/sources/ \
        ftp://fr.rpmfind.net/pub/libxml/
 PKG_MD5SUM:=9667bf6f9310b957254fdcf6596600b7
 
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=COPYING
+
 PKG_MAINTAINER:=Jiri Slachta <slachta@cesnet.cz>
 
 PKG_FIXUP:=autoreconf
@@ -45,7 +48,7 @@ define Package/libexslt
 endef
 
 define Package/libexslt/description
- A extention for XSLT.
+ An extension for XSLT.
 endef
 
 define Package/xsltproc
index 88d42c3c8e73e5302be0d647763851b1b721f450..e619ec4405873d91a1022d649ceded3f6f8be7b8 100644 (file)
@@ -16,6 +16,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://hyperelliptic.org/nacl
 PKG_MD5SUM:=7efb5715561c3d10dafd3fa97b4f2d20
 
+PKG_LICENSE:=PublicDomain
+
 include $(INCLUDE_DIR)/package.mk
 
 define Package/nacl
diff --git a/libs/nspr/Makefile b/libs/nspr/Makefile
new file mode 100644 (file)
index 0000000..36bdf41
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# 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:=nspr
+PKG_VERSION:=3.16
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/nss-$(PKG_VERSION)
+PKG_SOURCE:=nss-$(PKG_VERSION)-with-nspr-4.10.4.tar.gz
+PKG_SOURCE_URL:=ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_RTM/src/
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_PATH=nspr
+MAKE_PATH=nspr
+
+define Package/nspr
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Netscape Portable Runtime (NSPR)
+  URL:=https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR
+  DEPENDS:=+libpthread +librt
+  MAINTAINER:=Luka Perkov <luka@openwrt.org>
+endef
+
+define Package/nspr/description
+  Netscape Portable Runtime (NSPR) provides a platform-neutral API for system
+  level and libc-like functions. The API is used in the Mozilla clients, many of
+  Red Hat's and Sun's server applications, and other software offerings.
+endef
+
+CONFIGURE_ARGS += \
+       --with-arch=toolchain-default \
+       --with-fpu=toolchain-default \
+       --with-float-abi=toolchain-default \
+       --with-soft-float=toolchain-default
+
+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/*{a,so} $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/nspr.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/nspr/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*so $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,nspr))
diff --git a/libs/nspr/patches/001-compile.patch b/libs/nspr/patches/001-compile.patch
new file mode 100644 (file)
index 0000000..63b697e
--- /dev/null
@@ -0,0 +1,26 @@
+--- a/nspr/config/Makefile.in
++++ b/nspr/config/Makefile.in
+@@ -30,7 +30,6 @@ CSRCS        = now.c
+ # This version hasn't been ported for us; the one in mozilla/config has
+ ifneq ($(OS_ARCH),OS2)
+-CSRCS  += nsinstall.c
+  
+ PLSRCS        = nfspwd.pl
+ endif
+@@ -84,7 +83,6 @@ else
+ ifeq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH)))
+ TARGETS = $(PROGS)
+ else
+-PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
+ TARGETS = $(PROGS) $(PLSRCS:.pl=)
+ endif
+ endif
+@@ -114,6 +112,7 @@ endif
+ $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
+       @$(MAKE_OBJDIR)
+       $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@
++      gcc nsinstall.c -o nsinstall
+ install:: nspr.m4
+       $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal
index 1db3d37391a2bd60f4dc7912395d20723371f7b5..6476c46d94cae085de809dd5dc96e0fae08eaf15 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tiff
 PKG_VERSION:=4.0.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://download.osgeo.org/libtiff
@@ -18,6 +18,9 @@ PKG_MD5SUM:=051c1068e6a0627f461948c365290410
 PKG_FIXUP:=autoreconf
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
 
+PKG_LICENSE:=BSD
+PKG_LICENSE_FILES:=COPYRIGHT
+
 PKG_INSTALL:=1
 
 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_libtiffxx
index cf6133669d64e82bdafe128c0e01be071ce42c70..d832aa7e945fde19b7ece26a1a0cf8753abccf33 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.vips.ecs.soton.ac.uk/supported/7.38/
 PKG_MD5SUM:=768d1c0f50c5b2794bcab68383af33ee
 PKG_FIXUP:=autoreconf
+PKG_CHECK_FORMAT_SECURITY:=0
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
index fdc29303d568da75f90a4c61c0d18c36c922bfef..1f6becff7c04f2404a571ee5d5d58269313c40d1 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.dovecot.org/releases/2.2
 PKG_MD5SUM:=a3eb1c0b1822c4f2b0fe9247776baa71
+PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
+PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
 
 PKG_BUILD_DEPENDS:=libiconv
 
index 69234522d5ca19dade9e61029a5f1160f4e6b38d..3e6e2091d2974c7698f2d234f2f4007cf1235de4 100644 (file)
@@ -14,11 +14,12 @@ config FFMPEG_CUSTOM_FFSERVER_SUPPORT
        select FFMPEG_CUSTOM_DEMUXER_rtsp
        select FFMPEG_CUSTOM_PROTOCOL_rtp
 
-config FFMPEG_CUSTOM_LIBDLNA_SUPPORT
-       bool "Include support for libdlna/ushare"
+config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
+       bool "Include support for minidlna"
        depends on FFMPEG_CUSTOM_PATENTED
+       select FFMPEG_CUSTOM_DECODER_aac
        select FFMPEG_CUSTOM_DECODER_ac3
-       select FFMPEG_CUSTOM_DECODER_atrac3
+       select FFMPEG_CUSTOM_DECODER_flac
        select FFMPEG_CUSTOM_DECODER_h264
        select FFMPEG_CUSTOM_DECODER_jpegls
        select FFMPEG_CUSTOM_DECODER_mp3
@@ -26,40 +27,89 @@ config FFMPEG_CUSTOM_LIBDLNA_SUPPORT
        select FFMPEG_CUSTOM_DECODER_mpeg2video
        select FFMPEG_CUSTOM_DECODER_mpeg4
        select FFMPEG_CUSTOM_DECODER_mpegvideo
+       select FFMPEG_CUSTOM_DECODER_png
        select FFMPEG_CUSTOM_DECODER_wmav1
        select FFMPEG_CUSTOM_DECODER_wmav2
-       select FFMPEG_CUSTOM_DECODER_png
+       select FFMPEG_CUSTOM_DEMUXER_aac
        select FFMPEG_CUSTOM_DEMUXER_ac3
+       select FFMPEG_CUSTOM_DEMUXER_avi
+       select FFMPEG_CUSTOM_DEMUXER_flac
        select FFMPEG_CUSTOM_DEMUXER_h264
+       select FFMPEG_CUSTOM_DEMUXER_matroska
+       select FFMPEG_CUSTOM_DEMUXER_mov
        select FFMPEG_CUSTOM_DEMUXER_mp3
+       select FFMPEG_CUSTOM_DEMUXER_mpegts
        select FFMPEG_CUSTOM_DEMUXER_mpegvideo
+       select FFMPEG_CUSTOM_PARSER_ac3
+       select FFMPEG_CUSTOM_PARSER_flac
+       select FFMPEG_CUSTOM_PARSER_h264
+       select FFMPEG_CUSTOM_PARSER_mpeg4video
+       select FFMPEG_CUSTOM_PARSER_mpegaudio
+       select FFMPEG_CUSTOM_PROTOCOL_file
 
-config FFMPEG_CUSTOM_MINIDLNA_SUPPORT
-       bool "Include support for minidlna"
+config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
+       bool "Include support for most audio decoding requirements"
        depends on FFMPEG_CUSTOM_PATENTED
        select FFMPEG_CUSTOM_DECODER_aac
+       select FFMPEG_CUSTOM_DECODER_aac_latm
        select FFMPEG_CUSTOM_DECODER_ac3
+       select FFMPEG_CUSTOM_SELECT_adpcm
+       select FFMPEG_CUSTOM_DECODER_alac
+       select FFMPEG_CUSTOM_DECODER_amrnb
+       select FFMPEG_CUSTOM_DECODER_amrwb
+       select FFMPEG_CUSTOM_DECODER_ape
+       select FFMPEG_CUSTOM_DECODER_atrac3
        select FFMPEG_CUSTOM_DECODER_flac
-       select FFMPEG_CUSTOM_DECODER_h264
-       select FFMPEG_CUSTOM_DECODER_jpegls
+       select FFMPEG_CUSTOM_DECODER_mp2
        select FFMPEG_CUSTOM_DECODER_mp3
-       select FFMPEG_CUSTOM_DECODER_mpeg1video
-       select FFMPEG_CUSTOM_DECODER_mpeg2video
-       select FFMPEG_CUSTOM_DECODER_mpeg4
-       select FFMPEG_CUSTOM_DECODER_mpegvideo
+       select FFMPEG_CUSTOM_DECODER_mpc7
+       select FFMPEG_CUSTOM_DECODER_mpc8
+       select FFMPEG_CUSTOM_DECODER_pcm_s16be
+       select FFMPEG_CUSTOM_DECODER_pcm_s16le
+       select FFMPEG_CUSTOM_SELECT_speex
+       select FFMPEG_CUSTOM_DECODER_vorbis
+       select FFMPEG_CUSTOM_DECODER_wavpack
        select FFMPEG_CUSTOM_DECODER_wmav1
        select FFMPEG_CUSTOM_DECODER_wmav2
-       select FFMPEG_CUSTOM_DECODER_png
+       select FFMPEG_CUSTOM_DECODER_wmalossless
+       select FFMPEG_CUSTOM_DECODER_wmapro
+       select FFMPEG_CUSTOM_DECODER_zlib
        select FFMPEG_CUSTOM_DEMUXER_aac
        select FFMPEG_CUSTOM_DEMUXER_ac3
+       select FFMPEG_CUSTOM_DEMUXER_aiff
+       select FFMPEG_CUSTOM_DEMUXER_amr
+       select FFMPEG_CUSTOM_DEMUXER_ape
        select FFMPEG_CUSTOM_DEMUXER_avi
        select FFMPEG_CUSTOM_DEMUXER_flac
-       select FFMPEG_CUSTOM_DEMUXER_h264
+       select FFMPEG_CUSTOM_DEMUXER_ffm
        select FFMPEG_CUSTOM_DEMUXER_matroska
-       select FFMPEG_CUSTOM_DEMUXER_mov
        select FFMPEG_CUSTOM_DEMUXER_mp3
-       select FFMPEG_CUSTOM_DEMUXER_mpegvideo
+       select FFMPEG_CUSTOM_DEMUXER_mov
+       select FFMPEG_CUSTOM_DEMUXER_mpc
+       select FFMPEG_CUSTOM_DEMUXER_mpc8
+       select FFMPEG_CUSTOM_DEMUXER_mpegts
+       select FFMPEG_CUSTOM_DEMUXER_ogg
+       select FFMPEG_CUSTOM_DEMUXER_rm
+       select FFMPEG_CUSTOM_DEMUXER_rtsp
+       select FFMPEG_CUSTOM_DEMUXER_rtp
+       select FFMPEG_CUSTOM_DEMUXER_sdp
+       select FFMPEG_CUSTOM_DEMUXER_wav
+       select FFMPEG_CUSTOM_DEMUXER_wv
+       select FFMPEG_CUSTOM_PARSER_aac
+       select FFMPEG_CUSTOM_PARSER_aac_latm
+       select FFMPEG_CUSTOM_PARSER_flac
+       select FFMPEG_CUSTOM_PARSER_ac3
+       select FFMPEG_CUSTOM_PARSER_mpegaudio
        select FFMPEG_CUSTOM_PROTOCOL_file
+       select FFMPEG_CUSTOM_PROTOCOL_http
+       select FFMPEG_CUSTOM_PROTOCOL_rtp
+       select FFMPEG_CUSTOM_PROTOCOL_tcp
+       select FFMPEG_CUSTOM_PROTOCOL_udp
+
+comment "External Libraries ---"
+
+config FFMPEG_CUSTOM_SELECT_speex
+       bool "Speex"
 
 comment "Encoders ---"
 
@@ -185,11 +235,9 @@ config FFMPEG_CUSTOM_DECODER_png
        bool "PNG"
        select FFMPEG_CUSTOM_DECODER_zlib
 
-config FFMPEG_CUSTOM_SELECT_speex
-       bool "Speex"
-
 config FFMPEG_CUSTOM_DECODER_vorbis
        bool "Vorbis"
+       select FFMPEG_CUSTOM_DEMUXER_ogg
 
 config FFMPEG_CUSTOM_DECODER_wavpack
        bool "Wavpack"
index be90b3ebc3dcc97b388b04710a5916474eefb35c..71680141d5cb2f655a335e915768a589107d5389 100644 (file)
@@ -8,15 +8,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ffmpeg
-PKG_VERSION:=0.11.5
-PKG_RELEASE:=5
+PKG_VERSION:=2.3.1
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=ea25fc252c132141f12988ed5506bfe8
+PKG_MD5SUM:=bb02e99c39941d7f3dc56658b9324a2b
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_LICENSE:=LGPLv2.1+ GPLv2+ LGPLv3
+PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
 PKG_LICENSE_FILES:=COPYING.GPLv2 COPYING.GPLv3 COPYING.LGPLv2.1 COPYING.LGPLv3
 
 FFMPEG_CUSTOM_ENCODERS:= \
@@ -110,14 +110,10 @@ FFMPEG_CUSTOM_PARSERS:= \
 FFMPEG_CUSTOM_PROTOCOLS:= \
        file http pipe rtp tcp udp
 
-FFMPEG_MINI_ENCODERS:= \
-
 FFMPEG_MINI_DECODERS:= \
        aac \
        ac3 \
-       atrac3 \
        flac \
-       h263 \
        h264 \
        jpegls \
        mp3 \
@@ -129,15 +125,10 @@ FFMPEG_MINI_DECODERS:= \
        wmav1 \
        wmav2 \
 
-FFMPEG_MINI_MUXERS:= \
-       ffm \
-
 FFMPEG_MINI_DEMUXERS := \
        aac \
        ac3 \
-       asf \
        avi \
-       ffm \
        flac \
        h264 \
        matroska \
@@ -145,19 +136,16 @@ FFMPEG_MINI_DEMUXERS := \
        mp3 \
        mpegts \
        mpegvideo \
-       sdp \
-       rtsp \
 
 FFMPEG_MINI_PARSERS:= \
        ac3 \
        flac \
-       h263 \
        h264 \
        mpeg4video \
        mpegaudio \
 
 FFMPEG_MINI_PROTOCOLS := \
-       file http rtp tcp udp \
+       file \
 
 FFMPEG_AUDIO_DECODERS:= \
        aac \
@@ -368,23 +356,47 @@ FFMPEG_CONFIGURE:= \
        --arch="$(ARCH)" \
        --target-os=linux \
        --prefix="/usr" \
+       --pkg-config="pkg-config" \
        --enable-shared \
        --enable-static \
+       --enable-small \
+       --enable-pthreads \
+       --enable-zlib \
+       --disable-runtime-cpudetect \
+       --disable-doc \
        --disable-debug \
-       --pkg-config="pkg-config" \
        \
        --enable-gpl \
        --enable-version3 \
        \
        --disable-altivec \
-       --disable-asm \
-       --disable-doc \
+       --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-vfp \
+       --disable-neon \
+       --disable-inline-asm \
+       --disable-yasm \
+       --disable-mipsdspr1 \
+       --disable-mipsdspr2 \
+       --disable-mipsfpu \
+       \
        --disable-dxva2 \
-       --enable-pthreads \
-       --disable-optimizations \
-       --enable-small \
-       --disable-stripping \
-       --enable-zlib \
+       --disable-vaapi \
+       --disable-vda \
+       --disable-vdpau \
        --disable-outdevs
 
 ifeq ($(BUILD_VARIANT),custom)
@@ -395,10 +407,7 @@ ifeq ($(BUILD_VARIANT),custom)
        )
 
   FFMPEG_CONFIGURE+= \
-       --disable-ffmpeg \
-       --disable-ffplay \
-       --disable-ffprobe \
-       --disable-ffserver \
+       --disable-programs \
        --disable-avfilter \
        --disable-postproc \
        --disable-swresample \
@@ -435,10 +444,7 @@ ifeq ($(BUILD_VARIANT),audio-dec)
        )
 
   FFMPEG_CONFIGURE+= \
-       --disable-ffmpeg \
-       --disable-ffplay \
-       --disable-ffprobe \
-       --disable-ffserver \
+       --disable-programs \
        --disable-avfilter \
        --disable-postproc \
        --disable-swresample \
@@ -461,19 +467,14 @@ ifeq ($(BUILD_VARIANT),mini)
        )
 
   FFMPEG_CONFIGURE+= \
-       --disable-ffmpeg \
-       --disable-ffplay \
-       --disable-ffprobe \
-       --disable-ffserver \
+       --disable-programs \
        --disable-avdevice \
        --disable-avfilter \
        --disable-postproc \
        --disable-swresample \
        --disable-swscale \
        --disable-everything \
-       $(call FFMPEG_ENABLE,encoder,$(FFMPEG_MINI_ENCODERS)) \
        $(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
-       $(call FFMPEG_ENABLE,muxer,$(FFMPEG_MINI_MUXERS)) \
        $(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
        $(call FFMPEG_ENABLE,parser,$(FFMPEG_MINI_PARSERS)) \
        $(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
diff --git a/multimedia/ffmpeg/patches/010-remove_unused_fminf_definition.patch b/multimedia/ffmpeg/patches/010-remove_unused_fminf_definition.patch
new file mode 100644 (file)
index 0000000..7dc0c27
--- /dev/null
@@ -0,0 +1,18 @@
+--- a/libavutil/libm.h
++++ b/libavutil/libm.h
+@@ -82,6 +82,7 @@ static av_always_inline float cbrtf(floa
+ #define exp2f(x) ((float)exp2(x))
+ #endif /* HAVE_EXP2F */
++/* ---------- BROKEN: Defined in math.h but not present in uClibc 0.9.33.2 
+ #if !HAVE_FMINF
+ #undef fminf
+ static av_always_inline av_const float fminf(float x, float y)
+@@ -91,6 +92,7 @@ static av_always_inline av_const float f
+     return x > y ? y : (x == x ? x : y);
+ }
+ #endif
++------------------------------------------------------------------------- */
+ #if !HAVE_ISINF
+ static av_always_inline av_const int isinf(float x)
index a4ab71d540a9caab748ddd657babebedbcc6a380..2b30ba83965696970abe79c44783383eef68c025 100644 (file)
@@ -14,11 +14,11 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/minidlna
 PKG_MD5SUM:=879027192c89e5376cdd2ae2d1aa33b4
+PKG_LICENSE:=GPL-2.0 BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
 
 PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
 
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
 PKG_BUILD_PARALLEL:=0
 PKG_BUILD_DEPENDS:=util-linux
 
index 4e57f02a676275dfb790732298e18c85fb8bd13c..4a29ba9ff2c761277c50c76d2118eb8ac921ba5b 100644 (file)
@@ -6,8 +6,8 @@ if PACKAGE_mjpg-streamer
 
 config MJPG_STREAMER_V4L2
        bool "Compile input_uvc with libv4l2 (camera controls)"
-       depends on PACKAGE_libv4l
        default n
+       select PACKAGE_libv4l
 
 config MJPG_STREAMER_INPUT_FILE
        bool "Install input file plugin"
index 925d82fe4e3537d29b003f0140d922a2b6fe6b06..d8df190b5301abcbc9f35fcf978c17c6532caf99 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=mjpg-streamer
 PKG_REV:=182
 PKG_VERSION:=r$(PKG_REV)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
@@ -28,7 +28,10 @@ define Package/mjpg-streamer
   SECTION:=multimedia
   CATEGORY:=Multimedia
   TITLE:=MJPG-streamer
-  DEPENDS:=+libpthread +libjpeg +PACKAGE_libv4l:libv4l
+  DEPENDS:=+libpthread +libjpeg 
+  ifeq ($(CONFIG_MJPG_STREAMER_V4L2),y)
+       DEPENDS+=+libv4l
+  endif
   URL:=http://mjpg-streamer.wiki.sourceforge.net/
   MENU:=1
 endef
diff --git a/net/bind/Makefile b/net/bind/Makefile
new file mode 100644 (file)
index 0000000..99ac1c9
--- /dev/null
@@ -0,0 +1,203 @@
+#
+# Copyright (C) 2006-2012 OpenWrt.org
+#               2014 Noah Meyerhans <frodo@morgul.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bind
+PKG_VERSION:=9.9.5-P1
+PKG_RELEASE:=1
+
+PKG_MAINTAINER := Noah Meyerhans <frodo@morgul.net>
+PKG_LICENSE := BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= \
+       ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \
+       http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION)
+PKG_MD5SUM:=3408af8c6d27d6cb8a05287f2ee32ad0
+
+PKG_FIXUP:=autoreconf
+PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bind/Default
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+bind-libs
+  TITLE:=bind
+  URL:=https://www.isc.org/software/bind
+  SUBMENU:=IP Addresses and Names
+endef
+
+define Package/bind-libs
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=+libopenssl
+  TITLE:=bind shared libraries
+  URL:=https://www.isc.org/software/bind
+endef
+
+define Package/bind-server
+  $(call Package/bind/Default)
+  TITLE+= DNS server
+endef
+
+define Package/bind-client
+  $(call Package/bind/Default)
+  TITLE+= dynamic DNS client
+endef
+
+define Package/bind-tools
+  $(call Package/bind/Default)
+  TITLE+= administration tools (all)
+endef
+
+define Package/bind-rndc
+  $(call Package/bind/Default)
+  TITLE+= administration tools (rndc and rndc-confgen only)
+endef
+
+define Package/bind-check
+  $(call Package/bind/Default)
+  TITLE+= administration tools (named-checkconf and named-checkzone only)
+endef
+
+define Package/bind-dnssec
+  $(call Package/bind/Default)
+  TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
+endef
+
+define Package/bind-host
+  $(call Package/bind/Default)
+  TITLE+= simple DNS client
+endef
+
+define Package/bind-dig
+  $(call Package/bind/Default)
+  TITLE+= DNS excavation tool
+endef
+
+export BUILD_CC="$(TARGET_CC)"
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-randomdev="/dev/urandom" \
+       --disable-threads \
+       --disable-linux-caps \
+       --with-openssl="$(STAGING_DIR)/usr" \
+       --with-libtool \
+       --with-libxml2=no \
+       --enable-epoll=yes \
+       --with-gost=no \
+       --with-gssapi=no \
+       --with-ecdsa=no \
+       --with-readline=no
+
+CONFIGURE_VARS += \
+       BUILD_CC="$(TARGET_CC)" \
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \
+               BUILD_CC="$(HOSTCC)" \
+               CC="$(HOSTCC)" \
+               CFLAGS="-O2" \
+               LIBS="" \
+               gen
+       $(call Build/Compile/Default)
+endef
+
+define Package/bind-libs/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+endef
+
+define Package/bind-server/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/bind
+       $(CP) \
+               ./files/bind/db.0 \
+               ./files/bind/db.127 \
+               ./files/bind/db.255 \
+               ./files/bind/db.local \
+               ./files/bind/db.root \
+               $(1)/etc/bind/
+       $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named
+       find $(1)/etc/bind/ -name ".svn" | xargs rm -rf
+endef
+
+define Package/bind-server/conffiles
+/etc/bind/db.0
+/etc/bind/db.127
+/etc/bind/db.255
+/etc/bind/db.local
+/etc/bind/db.root
+/etc/bind/named.conf
+endef
+
+define Package/bind-client/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/
+endef
+
+define Package/bind-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
+endef
+
+define Package/bind-rndc/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/
+endef
+
+define Package/bind-check/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
+endef
+
+define Package/bind-dnssec/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
+endef
+
+define Package/bind-host/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
+endef
+
+define Package/bind-dig/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,bind-libs))
+$(eval $(call BuildPackage,bind-server))
+$(eval $(call BuildPackage,bind-client))
+$(eval $(call BuildPackage,bind-tools))
+$(eval $(call BuildPackage,bind-rndc))
+$(eval $(call BuildPackage,bind-check))
+$(eval $(call BuildPackage,bind-dnssec))
+$(eval $(call BuildPackage,bind-host))
+$(eval $(call BuildPackage,bind-dig))
diff --git a/net/bind/files/bind/db.0 b/net/bind/files/bind/db.0
new file mode 100644 (file)
index 0000000..e3aabdb
--- /dev/null
@@ -0,0 +1,12 @@
+;
+; BIND reverse data file for broadcast zone
+;
+$TTL   604800
+@      IN      SOA     localhost. root.localhost. (
+                             1         ; Serial
+                        604800         ; Refresh
+                         86400         ; Retry
+                       2419200         ; Expire
+                        604800 )       ; Negative Cache TTL
+;
+@      IN      NS      localhost.
diff --git a/net/bind/files/bind/db.127 b/net/bind/files/bind/db.127
new file mode 100644 (file)
index 0000000..cd05bef
--- /dev/null
@@ -0,0 +1,13 @@
+;
+; BIND reverse data file for local loopback interface
+;
+$TTL   604800
+@      IN      SOA     localhost. root.localhost. (
+                             1         ; Serial
+                        604800         ; Refresh
+                         86400         ; Retry
+                       2419200         ; Expire
+                        604800 )       ; Negative Cache TTL
+;
+@      IN      NS      localhost.
+1.0.0  IN      PTR     localhost.
diff --git a/net/bind/files/bind/db.255 b/net/bind/files/bind/db.255
new file mode 100644 (file)
index 0000000..e3aabdb
--- /dev/null
@@ -0,0 +1,12 @@
+;
+; BIND reverse data file for broadcast zone
+;
+$TTL   604800
+@      IN      SOA     localhost. root.localhost. (
+                             1         ; Serial
+                        604800         ; Refresh
+                         86400         ; Retry
+                       2419200         ; Expire
+                        604800 )       ; Negative Cache TTL
+;
+@      IN      NS      localhost.
diff --git a/net/bind/files/bind/db.local b/net/bind/files/bind/db.local
new file mode 100644 (file)
index 0000000..66b4892
--- /dev/null
@@ -0,0 +1,13 @@
+;
+; BIND data file for local loopback interface
+;
+$TTL   604800
+@      IN      SOA     localhost. root.localhost. (
+                             1         ; Serial
+                        604800         ; Refresh
+                         86400         ; Retry
+                       2419200         ; Expire
+                        604800 )       ; Negative Cache TTL
+;
+@      IN      NS      localhost.
+@      IN      A       127.0.0.1
diff --git a/net/bind/files/bind/db.root b/net/bind/files/bind/db.root
new file mode 100644 (file)
index 0000000..0eb52af
--- /dev/null
@@ -0,0 +1,45 @@
+
+; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
+;; global options:  printcmd
+;; Got answer:
+;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
+;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
+
+;; QUESTION SECTION:
+;.                             IN      NS
+
+;; ANSWER SECTION:
+.                      518400  IN      NS      A.ROOT-SERVERS.NET.
+.                      518400  IN      NS      B.ROOT-SERVERS.NET.
+.                      518400  IN      NS      C.ROOT-SERVERS.NET.
+.                      518400  IN      NS      D.ROOT-SERVERS.NET.
+.                      518400  IN      NS      E.ROOT-SERVERS.NET.
+.                      518400  IN      NS      F.ROOT-SERVERS.NET.
+.                      518400  IN      NS      G.ROOT-SERVERS.NET.
+.                      518400  IN      NS      H.ROOT-SERVERS.NET.
+.                      518400  IN      NS      I.ROOT-SERVERS.NET.
+.                      518400  IN      NS      J.ROOT-SERVERS.NET.
+.                      518400  IN      NS      K.ROOT-SERVERS.NET.
+.                      518400  IN      NS      L.ROOT-SERVERS.NET.
+.                      518400  IN      NS      M.ROOT-SERVERS.NET.
+
+;; ADDITIONAL SECTION:
+A.ROOT-SERVERS.NET.    3600000 IN      A       198.41.0.4
+B.ROOT-SERVERS.NET.    3600000 IN      A       192.228.79.201
+C.ROOT-SERVERS.NET.    3600000 IN      A       192.33.4.12
+D.ROOT-SERVERS.NET.    3600000 IN      A       128.8.10.90
+E.ROOT-SERVERS.NET.    3600000 IN      A       192.203.230.10
+F.ROOT-SERVERS.NET.    3600000 IN      A       192.5.5.241
+G.ROOT-SERVERS.NET.    3600000 IN      A       192.112.36.4
+H.ROOT-SERVERS.NET.    3600000 IN      A       128.63.2.53
+I.ROOT-SERVERS.NET.    3600000 IN      A       192.36.148.17
+J.ROOT-SERVERS.NET.    3600000 IN      A       192.58.128.30
+K.ROOT-SERVERS.NET.    3600000 IN      A       193.0.14.129
+L.ROOT-SERVERS.NET.    3600000 IN      A       199.7.83.42
+M.ROOT-SERVERS.NET.    3600000 IN      A       202.12.27.33
+
+;; Query time: 81 msec
+;; SERVER: 198.41.0.4#53(a.root-servers.net.)
+;; WHEN: Sun Feb  1 11:27:14 2004
+;; MSG SIZE  rcvd: 436
+
diff --git a/net/bind/files/bind/named.conf.example b/net/bind/files/bind/named.conf.example
new file mode 100644 (file)
index 0000000..1624549
--- /dev/null
@@ -0,0 +1,45 @@
+// This is the primary configuration file for the BIND DNS server named.
+
+options {
+       directory "/tmp";
+
+       // If your ISP provided one or more IP addresses for stable 
+       // nameservers, you probably want to use them as forwarders.  
+       // Uncomment the following block, and insert the addresses replacing 
+       // the all-0's placeholder.
+
+       // forwarders {
+       //      0.0.0.0;
+       // };
+
+       auth-nxdomain no;    # conform to RFC1035
+};
+
+// prime the server with knowledge of the root servers
+zone "." {
+       type hint;
+       file "/etc/bind/db.root";
+};
+
+// be authoritative for the localhost forward and reverse zones, and for
+// broadcast zones as per RFC 1912
+
+zone "localhost" {
+       type master;
+       file "/etc/bind/db.local";
+};
+
+zone "127.in-addr.arpa" {
+       type master;
+       file "/etc/bind/db.127";
+};
+
+zone "0.in-addr.arpa" {
+       type master;
+       file "/etc/bind/db.0";
+};
+
+zone "255.in-addr.arpa" {
+       type master;
+       file "/etc/bind/db.255";
+};
diff --git a/net/bind/files/named.init b/net/bind/files/named.init
new file mode 100644 (file)
index 0000000..986e5fe
--- /dev/null
@@ -0,0 +1,40 @@
+#!/bin/sh /etc/rc.common
+START=50
+
+config_file=/etc/bind/named.conf
+pid_file=/var/run/named/named.pid
+
+start() {
+  if [ -e $pid_file ]
+  then
+     echo "  named already running with PID `cat $pid_file`"
+     return 1
+  fi
+  echo Starting isc-bind
+
+  /usr/sbin/named -c $config_file
+
+  if [ $? -ne 0 ]
+  then
+    echo "  isc-bind failed to start"
+  fi
+}
+
+stop() {
+  echo "Stopping isc-bind"
+  if [ -e $pid_file ]
+  then
+    kill `cat $pid_file`
+
+    if [ $? -ne 0 ]
+    then
+      echo "  PID " `cat $pid_file` not found
+      echo "  Is the named server running?"
+    fi
+
+    rm -f $pid_file
+
+    else
+    echo "  $pid_file not found"
+  fi
+}
diff --git a/net/bind/patches/001-no-tests.patch b/net/bind/patches/001-no-tests.patch
new file mode 100644 (file)
index 0000000..c969c5e
--- /dev/null
@@ -0,0 +1,26 @@
+Index: bind-9.9.4/bin/Makefile.in
+===================================================================
+--- bind-9.9.4.orig/bin/Makefile.in
++++ bind-9.9.4/bin/Makefile.in
+@@ -19,7 +19,7 @@ srcdir =     @srcdir@
+ VPATH =               @srcdir@
+ top_srcdir =  @top_srcdir@
+-SUBDIRS =     named rndc dig dnssec tools tests nsupdate \
++SUBDIRS =     named rndc dig dnssec tools nsupdate \
+               check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
+ TARGETS =
+Index: bind-9.9.4/lib/Makefile.in
+===================================================================
+--- bind-9.9.4.orig/lib/Makefile.in
++++ bind-9.9.4/lib/Makefile.in
+@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@
+ # Attempt to disable parallel processing.
+ .NOTPARALLEL:
+ .NO_PARALLEL:
+-SUBDIRS =     isc isccc dns isccfg bind9 lwres tests
++SUBDIRS =     isc isccc dns isccfg bind9 lwres
+ TARGETS =
+ @BIND9_MAKE_RULES@
index f828a4e40609f4d5c7cb0666c89d71625d90dd23..5104c9d60c54609cfd3bfdfd3a31d91d1a23461d 100644 (file)
@@ -3,6 +3,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=1.0.0
 PKG_RELEASE:=23
+PKG_LICENSE:=GPL-2.0
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/net/dmapd/Makefile b/net/dmapd/Makefile
new file mode 100644 (file)
index 0000000..ca53f6b
--- /dev/null
@@ -0,0 +1,65 @@
+#
+# Copyright (C) 2009-2012 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dmapd
+PKG_VERSION:=0.0.70
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILE:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd
+PKG_MD5SUM:=f503bf95f79b5c1f9418cccf26203952
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=2
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/dmapd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libdmapsharing +libdb47 +vips
+  TITLE:= dmapd
+  URL:=http://www.flyn.org/projects/dmapd/
+endef
+
+define Package/dmapd/decription
+       Dmapd is a DMAP server
+endef
+
+define Package/dmapd/conffiles
+/etc/dmapd.conf
+endef
+
+TARGET_LDFLAGS+=\
+       -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
+
+define Package/dmapd/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/distro/dmapd.conf $(1)/etc/
+       $(INSTALL_BIN) ./files/dmapd.init $(1)/etc/init.d/dmapd
+       $(INSTALL_DIR) $(1)/usr/lib/dmapd/$(PKG_VERSION)/modules
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/sbin/dmapd \
+               $(1)/usr/sbin/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/libdmapd.so* \
+               $(1)/usr/lib/
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/lib/dmapd/$(PKG_VERSION)/modules/*.so \
+               $(1)/usr/lib/dmapd/$(PKG_VERSION)/modules/
+endef
+
+$(eval $(call BuildPackage,dmapd))
diff --git a/net/dmapd/files/dmapd.init b/net/dmapd/files/dmapd.init
new file mode 100644 (file)
index 0000000..2d9e9aa
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2012 OpenWrt.org
+
+START=60
+
+start() {
+       user_exists dmapd 56 || user_add dmapd 56
+       group_exists dmapd 56 || group_add dmapd 56
+       [ -d /var/run/dmapd ] || {
+               mkdir -m 0755 -p /var/run/dmapd
+               chown dmapd:dmapd /var/run/dmapd
+       }
+       [ -d /var/db/dmapd/DAAP ] || {
+               mkdir -m 0755 -p /var/db/dmapd/DAAP
+               chown dmapd:dmapd /var/db/dmapd/DAAP
+       }
+       [ -d /var/db/dmapd/DPAP ] || {
+               mkdir -m 0755 -p /var/db/dmapd/DPAP
+               chown dmapd:dmapd /var/db/dmapd/DPAP
+       }
+       mkdir -m 0755 -p /var/lock/subsys
+       mkdir -m 0755 -p /var/media/music
+       mkdir -m 0755 -p /var/media/pictures
+
+       service_start /usr/sbin/dmapd -u dmapd -g dmapd -m /var/media/music -p /var/media/pictures --vips-disc-threshold 64k
+}
+
+stop() {
+       service_stop /usr/sbin/dmapd
+}
diff --git a/net/dmapd/patches/001-dmapd_conf.patch b/net/dmapd/patches/001-dmapd_conf.patch
new file mode 100644 (file)
index 0000000..9c1e60a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/distro/dmapd.conf
++++ b/distro/dmapd.conf
+@@ -3,7 +3,7 @@
+ Database-Dir=/var/db/dmapd
+ # Name that will be used to identify share:
+-Share-Name=dmapd
++Share-Name=OpenWrt
+ # User that dmapd will run as, current user if undefined:
+ User=dmapd
index 1f2cea167a04f1ae62e0c5c6d24f278a9f0c4c73..7fa772aeda982a5afaec80b86f88f6aef371cd44 100644 (file)
@@ -8,13 +8,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ethtool
-PKG_VERSION:=3.14
+PKG_VERSION:=3.15
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
-PKG_MD5SUM:=d46b809ddd672b51d7e23787ae9122e0
+PKG_MD5SUM:=e7bf0c355d2bf6ee281ebc713c5fb987
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILE:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/net/ethtool/patches/100-ixp4xx.patch b/net/ethtool/patches/100-ixp4xx.patch
deleted file mode 100644 (file)
index 48c0119..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -13,7 +13,7 @@ ethtool_SOURCES += \
-                 fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c \
-                 pcnet32.c realtek.c tg3.c marvell.c vioc.c    \
-                 smsc911x.c at76c50x-usb.c sfc.c stmmac.c      \
--                sfpid.c sfpdiag.c ixgbevf.c
-+                sfpid.c sfpdiag.c ixgbevf.c ixp4xx.c
- endif
- TESTS = test-cmdline test-features
---- a/ethtool.c
-+++ b/ethtool.c
-@@ -894,6 +894,7 @@ static const struct {
-       { "ixgb", ixgb_dump_regs },
-       { "ixgbe", ixgbe_dump_regs },
-       { "ixgbevf", ixgbevf_dump_regs },
-+      { "ixp4xx", ixp4xx_dump_regs },
-       { "natsemi", natsemi_dump_regs },
-       { "e100", e100_dump_regs },
-       { "amd8111e", amd8111e_dump_regs },
---- a/internal.h
-+++ b/internal.h
-@@ -243,6 +243,9 @@ int st_gmac_dump_regs(struct ethtool_drv
- /* Et131x ethernet controller */
- int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
-+/* Intel IXP4xx internal MAC */
-+int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
-+
- /* Rx flow classification */
- int rxclass_parse_ruleopts(struct cmd_context *ctx,
-                          struct ethtool_rx_flow_spec *fsp);
---- /dev/null
-+++ b/ixp4xx.c
-@@ -0,0 +1,130 @@
-+/*
-+ * Copyright (c) 2006 Christian Hohnstaed <chohnstaedt@innominate.com>
-+ * This file is released under the GPLv2
-+ */
-+
-+#include <stdio.h>
-+#include "internal.h"
-+
-+#ifndef BIT
-+#define BIT(x) (1<<x)
-+#endif
-+
-+#define TX_CNTRL1_TX_EN         BIT(0)
-+#define TX_CNTRL1_DUPLEX        BIT(1)
-+#define TX_CNTRL1_RETRY         BIT(2)
-+#define TX_CNTRL1_PAD_EN        BIT(3)
-+#define TX_CNTRL1_FCS_EN        BIT(4)
-+#define TX_CNTRL1_2DEFER        BIT(5)
-+#define TX_CNTRL1_RMII          BIT(6)
-+
-+/* TX Control Register 2 */
-+#define TX_CNTRL2_RETRIES_MASK  0xf
-+
-+/* RX Control Register 1 */
-+#define RX_CNTRL1_RX_EN         BIT(0)
-+#define RX_CNTRL1_PADSTRIP_EN   BIT(1)
-+#define RX_CNTRL1_CRC_EN        BIT(2)
-+#define RX_CNTRL1_PAUSE_EN      BIT(3)
-+#define RX_CNTRL1_LOOP_EN       BIT(4)
-+#define RX_CNTRL1_ADDR_FLTR_EN  BIT(5)
-+#define RX_CNTRL1_RX_RUNT_EN    BIT(6)
-+#define RX_CNTRL1_BCAST_DIS     BIT(7)
-+
-+/* Core Control Register */
-+#define CORE_RESET              BIT(0)
-+#define CORE_RX_FIFO_FLUSH      BIT(1)
-+#define CORE_TX_FIFO_FLUSH      BIT(2)
-+#define CORE_SEND_JAM           BIT(3)
-+#define CORE_MDC_EN             BIT(4)
-+
-+#define MAC "%02x:%02x:%02x:%02x:%02x:%02x"
-+#define MAC_DATA(d) (d)[0], (d)[1], (d)[2], (d)[3], (d)[4], (d)[5]
-+
-+int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
-+{
-+      u8 *data = regs->data;
-+
-+      fprintf(stdout,
-+              "TXctrl:          0x%02x:0x%02x\n"
-+              "    Enable:      %s\n"
-+              "    Duplex:      %s\n"
-+              "    Retry:       %s (%d)\n"
-+              "    Padding:     %s\n"
-+              "    Frame check: %s\n"
-+              "    TX deferral: %s\n"
-+              "    Connection:  %s\n"
-+              "\n",
-+              data[0], data[1],
-+              data[0] & TX_CNTRL1_TX_EN   ? "yes"      : "no",
-+              data[0] & TX_CNTRL1_DUPLEX  ? "half"     : "full",
-+              data[0] & TX_CNTRL1_RETRY   ? "enabled"  : "disabled",
-+              data[1] & TX_CNTRL2_RETRIES_MASK,
-+              data[0] & TX_CNTRL1_PAD_EN  ? "enabled"  : "disabled",
-+              data[0] & TX_CNTRL1_FCS_EN  ? "enabled"  : "disabled",
-+              data[0] & TX_CNTRL1_2DEFER  ? "two-part" : "one-part",
-+              data[0] & TX_CNTRL1_RMII    ? "RMII"     : "Full MII"
-+      );
-+
-+      fprintf(stdout,
-+              "RXctrl:          0x%02x\n"
-+              "    Enable:      %s\n"
-+              "    Pad strip:   %s\n"
-+              "    CRC check:   %s\n"
-+              "    Pause:       %s\n"
-+              "    Loop:        %s\n"
-+              "    Promiscous:  %s\n"
-+              "    Runt frames: %s\n"
-+              "    Broadcast:   %s\n"
-+              "\n",
-+              data[2],
-+              data[2] & RX_CNTRL1_RX_EN        ? "yes"      : "no",
-+              data[2] & RX_CNTRL1_PADSTRIP_EN  ? "enabled"  : "disabled",
-+              data[2] & RX_CNTRL1_CRC_EN       ? "enabled"  : "disabled",
-+              data[2] & RX_CNTRL1_PAUSE_EN     ? "enabled"  : "disabled",
-+              data[2] & RX_CNTRL1_LOOP_EN      ? "enabled"  : "disabled",
-+              data[2] & RX_CNTRL1_ADDR_FLTR_EN ? "disabled" : "enabled",
-+              data[2] & RX_CNTRL1_RX_RUNT_EN   ? "forward"  : "discard",
-+              data[2] & RX_CNTRL1_BCAST_DIS    ? "disabled" : "enabled"
-+      );
-+      fprintf(stdout,
-+              "Core control:    0x%02x\n"
-+              "    Core state:  %s\n"
-+              "    RX fifo:     %s\n"
-+              "    TX fifo:     %s\n"
-+              "    Send jam:    %s\n"
-+              "    MDC clock    %s\n"
-+              "\n",
-+              data[32],
-+              data[32] & CORE_RESET          ? "reset"  : "normal operation",
-+              data[32] & CORE_RX_FIFO_FLUSH  ? "flush"  : "ok",
-+              data[32] & CORE_TX_FIFO_FLUSH  ? "flush"  : "ok",
-+              data[32] & CORE_SEND_JAM       ? "yes"    : "no",
-+              data[32] & CORE_MDC_EN         ? "output" : "input"
-+      );
-+      fprintf(stdout,
-+              "MAC addresses: \n"
-+              "  Multicast mask:     " MAC "\n"
-+              "  Multicast address:  " MAC "\n"
-+              "  Unicast address:    " MAC "\n"
-+              "\n",
-+              MAC_DATA(data+13), MAC_DATA(data+19), MAC_DATA(data+26)
-+      );
-+      fprintf(stdout,
-+              "Random seed:      0x%02x\n"
-+              "Threshold empty:   %3d\n"
-+              "Threshold full:    %3d\n"
-+              "TX buffer size:    %3d\n"
-+              "TX deferral:       %3d\n"
-+              "RX deferral:       %3d\n"
-+              "TX two deferral 1: %3d\n"
-+              "TX two deferral 2: %3d\n"
-+              "Slot time:         %3d\n"
-+              "Internal clock:    %3d\n"
-+              "\n",
-+              data[4], data[5], data[6], data[7], data[8], data[9],
-+              data[10], data[11], data[12], data[25]
-+      );
-+
-+      return 0;
-+}
index 0629cd7b6d45c9503dd3a199b903ecb5992d7ca5..e2fca698e194b618822eb3c421cefa67b7614aad 100644 (file)
@@ -16,6 +16,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/75
 PKG_MD5SUM:=34f6bdebd0410a1fba7c8fd06fff7a05
 
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILE:=COPYRIGHT
+
 PKG_CONFIG_DEPENDS:=\
        CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
        CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC \
index 4eddb26b22baa64ef418b78dfc47106b443fd55e..745dca87823016e1e945dc092ab7e73448b1fc89 100644 (file)
@@ -15,6 +15,8 @@ PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
 PKG_MD5SUM:=40535bace507d7a3134c3d858f3cbc5a
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYRIGHT LICENSE
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
 PKG_FIXUP:=autoreconf
index 7d97e53f21d92fe68ce8d84bf34486bf5b0a475c..a0d8e39c44c5b57296ba52a6e12da6a821d13d1b 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=haproxy
 PKG_VERSION:=1.5.3
-PKG_RELEASE:=03
+PKG_RELEASE:=04
 PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
 PKG_MD5SUM:=e999a547d57445d5a5ab7eb6a06df9a1
diff --git a/net/haproxy/patches/0004-BUG-config-error-in-http-response-replace-header-num.patch b/net/haproxy/patches/0004-BUG-config-error-in-http-response-replace-header-num.patch
new file mode 100644 (file)
index 0000000..881336a
--- /dev/null
@@ -0,0 +1,34 @@
+From a772b945d757c25037ac58de64ccc27ceeb4b4a7 Mon Sep 17 00:00:00 2001
+From: Baptiste Assmann <bedis9@gmail.com>
+Date: Fri, 8 Aug 2014 17:29:06 +0200
+Subject: [PATCH 4/4] BUG: config: error in http-response replace-header number
+ of arguments
+
+A couple of typo fixed in 'http-response replace-header':
+- an error when counting the number of arguments
+- a typo in the alert message
+
+This should be backported to 1.5.
+(cherry picked from commit 12cb00b216d67468b7c4bd84abedcb4ecd1a32bc)
+---
+ src/proto_http.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/proto_http.c b/src/proto_http.c
+index b7ed85d..2b75b32 100644
+--- a/src/proto_http.c
++++ b/src/proto_http.c
+@@ -9281,8 +9281,8 @@ struct http_res_rule *parse_http_res_cond(const char **args, const char *file, i
+               cur_arg = 1;
+               if (!*args[cur_arg] || !*args[cur_arg+1] || !*args[cur_arg+2] ||
+-                  (*args[cur_arg+3] && strcmp(args[cur_arg+2], "if") != 0 && strcmp(args[cur_arg+2], "unless") != 0)) {
+-                      Alert("parsing [%s:%d]: 'http-request %s' expects exactly 3 arguments.\n",
++                  (*args[cur_arg+3] && strcmp(args[cur_arg+3], "if") != 0 && strcmp(args[cur_arg+3], "unless") != 0)) {
++                      Alert("parsing [%s:%d]: 'http-response %s' expects exactly 3 arguments.\n",
+                             file, linenum, args[0]);
+                       goto out_err;
+               }
+-- 
+1.8.5.5
+
diff --git a/net/ibrdtn-tools/Makefile b/net/ibrdtn-tools/Makefile
new file mode 100644 (file)
index 0000000..00424a7
--- /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:=ibrdtn-tools
+PKG_VERSION:=0.12.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:=0ce0c6e754263919ad48661967c2f6fd
+PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=libarchive ibrdtn
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ibrdtn-tools
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+ibrdtn +libarchive
+  TITLE:=DTN Tools
+endef
+
+define Package/ibrdtn-tools/description
+ The IBR-DTN Tools include functionality for sending and receiving files (dtnsend/dtnrecv)
+ and a tools to ping a DTN node (dtnping).
+endef
+
+define Package/ibrdtn-tools/install
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtnping $(1)/usr/bin/dtnping
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtnsend $(1)/usr/bin/dtnsend
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtnrecv $(1)/usr/bin/dtnrecv
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtninbox $(1)/usr/bin/dtninbox
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtnoutbox $(1)/usr/bin/dtnoutbox
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtntrigger $(1)/usr/bin/dtntrigger
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtntracepath $(1)/usr/bin/dtntracepath
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dtnstream $(1)/usr/bin/dtnstream
+endef
+
+$(eval $(call BuildPackage,ibrdtn-tools))
diff --git a/net/ibrdtnd/Makefile b/net/ibrdtnd/Makefile
new file mode 100644 (file)
index 0000000..72d58b1
--- /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:=ibrdtnd
+PKG_VERSION:=0.12.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:=8dad5ebbcfaa4c16ba151c9c289066c3
+PKG_MAINTAINER:=Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
+PKG_LICENSE:=Apache-2.0
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=dtndht ibrdtn libsqlite3
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ibrdtnd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+dtndht +ibrdtn +libsqlite3
+  TITLE:=DTN Deamon
+endef
+
+define Package/ibrdtnd/conffiles
+/etc/config/ibrdtn
+endef
+
+define Package/ibrdtnd/description
+ The implementation of the bundle protocol of the IBR (TU Braunschweig).
+endef
+
+CONFIGURE_ARGS += \
+        --with-tls --with-sqlite --with-dht
+
+define Package/ibrdtnd/install
+       $(INSTALL_DIR) $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dtnd $(1)/usr/sbin/
+       $(INSTALL_BIN) files/safety-wrapper.sh $(1)/usr/sbin/dtnd-safety-wrapper.sh
+       $(INSTALL_DIR) $(1)/usr/share/ibrdtn/
+       $(INSTALL_BIN) files/build-config.sh $(1)/usr/share/ibrdtn/build-config.sh
+       $(INSTALL_BIN) files/mkcontainer.sh $(1)/usr/share/ibrdtn/mkcontainer.sh
+       $(INSTALL_BIN) files/mountcontainer.sh $(1)/usr/share/ibrdtn/mountcontainer.sh
+       $(INSTALL_BIN) files/systemcheck.sh $(1)/usr/share/ibrdtn/systemcheck.sh
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) files/ibrdtn.init $(1)/etc/init.d/ibrdtn
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) files/ibrdtn.uci $(1)/etc/config/ibrdtn
+endef
+
+$(eval $(call BuildPackage,ibrdtnd))
diff --git a/net/ibrdtnd/files/build-config.sh b/net/ibrdtnd/files/build-config.sh
new file mode 100644 (file)
index 0000000..82f161c
--- /dev/null
@@ -0,0 +1,168 @@
+#!/bin/sh
+#
+# convert uci configuration into daemon specific format
+#
+
+UCI=/sbin/uci
+
+create_file() {
+       echo "# -- DO NOT EDIT THIS FILE --" > $1
+       echo "# automatic generated configuration file for IBR-DTN daemon" >> $1
+       echo "#" >> $1
+}
+
+add_param() {
+       VALUE=`$UCI -q get $2`
+       
+       if [ $? == 0 ]; then
+               echo "$3 = $VALUE" >> $1
+       fi
+}
+
+getconfig() {
+       $UCI -q get ibrdtn.$1
+       return $?
+}
+
+if [ "$1" == "--safe-mode" ]; then
+       SAFEMODE=yes
+       CONFFILE=$2
+else
+       SAFEMODE=no
+       CONFFILE=$1
+fi
+
+# create the file and write some header info
+create_file $CONFFILE
+
+add_param $CONFFILE "ibrdtn.main.uri" "local_uri"
+add_param $CONFFILE "ibrdtn.main.routing" "routing"
+add_param $CONFFILE "ibrdtn.main.fragmentation" "fragmentation"
+
+if [ "$SAFEMODE" == "yes" ]; then
+       if [ -n "`getconfig safemode.forwarding`" ]; then
+               add_param $CONFFILE "ibrdtn.safemode.forwarding" "routing_forwarding"
+       else
+               add_param $CONFFILE "ibrdtn.main.forwarding" "routing_forwarding"
+       fi
+
+       if [ -n "`getconfig safemode.maxblock`" ]; then
+               add_param $CONFFILE "ibrdtn.safemode.maxblock" "limit_blocksize"
+       else
+               add_param $CONFFILE "ibrdtn.main.blocksize" "limit_blocksize"
+       fi
+
+       if [ -n "`getconfig safemode.storage`" ]; then
+               add_param $CONFFILE "ibrdtn.safemode.storage" "limit_storage"
+       else
+               add_param $CONFFILE "ibrdtn.storage.limit" "limit_storage"
+       fi
+else
+       add_param $CONFFILE "ibrdtn.main.forwarding" "routing_forwarding"
+       add_param $CONFFILE "ibrdtn.main.blocksize" "limit_blocksize"
+       add_param $CONFFILE "ibrdtn.storage.limit" "limit_storage"
+       add_param $CONFFILE "ibrdtn.storage.blobs" "blob_path"
+       add_param $CONFFILE "ibrdtn.storage.bundles" "storage_path"
+       add_param $CONFFILE "ibrdtn.storage.engine" "storage"
+fi
+
+add_param $CONFFILE "ibrdtn.main.max_predated_timestamp" "limit_predated_timestamp"
+add_param $CONFFILE "ibrdtn.main.limit_lifetime" "limit_lifetime"
+add_param $CONFFILE "ibrdtn.main.foreign_blocksize" "limit_foreign_blocksize"
+
+add_param $CONFFILE "ibrdtn.discovery.address" "discovery_address"
+add_param $CONFFILE "ibrdtn.discovery.timeout" "discovery_timeout"
+add_param $CONFFILE "ibrdtn.discovery.version" "discovery_version"
+add_param $CONFFILE "ibrdtn.discovery.crosslayer" "discovery_crosslayer"
+
+add_param $CONFFILE "ibrdtn.tcptuning.idle_timeout" "tcp_idle_timeout"
+add_param $CONFFILE "ibrdtn.tcptuning.nodelay" "tcp_nodelay"
+add_param $CONFFILE "ibrdtn.tcptuning.chunksize" "tcp_chunksize"
+
+add_param $CONFFILE "ibrdtn.security.level" "security_level"
+add_param $CONFFILE "ibrdtn.security.bab_key" "security_bab_default_key"
+add_param $CONFFILE "ibrdtn.security.key_path" "security_path"
+add_param $CONFFILE "ibrdtn.security.generate_dh" "generate_dh_params"
+
+add_param $CONFFILE "ibrdtn.tls.certificate" "security_certificate"
+add_param $CONFFILE "ibrdtn.tls.key" "security_key"
+add_param $CONFFILE "ibrdtn.tls.trustedpath" "security_trusted_ca_path"
+add_param $CONFFILE "ibrdtn.tls.required" "security_tls_required"
+add_param $CONFFILE "ibrdtn.tls.noencryption" "security_tls_disable_encryption"
+add_param $CONFFILE "ibrdtn.tls.fallback_badclock" "security_tls_fallback_badclock"
+
+add_param $CONFFILE "ibrdtn.timesync.reference" "time_reference"
+add_param $CONFFILE "ibrdtn.timesync.synchronize" "time_synchronize"
+add_param $CONFFILE "ibrdtn.timesync.discovery_announcement" "time_discovery_announcements"
+add_param $CONFFILE "ibrdtn.timesync.sigma" "time_sigma"
+add_param $CONFFILE "ibrdtn.timesync.psi" "time_psi"
+add_param $CONFFILE "ibrdtn.timesync.sync_level" "time_sync_level"
+add_param $CONFFILE "ibrdtn.timesync.time_set_clock" "time_set_clock"
+
+add_param $CONFFILE "ibrdtn.dht.enabled" "dht_enabled"
+add_param $CONFFILE "ibrdtn.dht.port" "dht_port"
+add_param $CONFFILE "ibrdtn.dht.id" "dht_id"
+add_param $CONFFILE "ibrdtn.dht.bootstrap" "dht_bootstrapping"
+add_param $CONFFILE "ibrdtn.dht.nodesfile" "dht_nodes_file"
+add_param $CONFFILE "ibrdtn.dht.enable_ipv4" "dht_enable_ipv4"
+add_param $CONFFILE "ibrdtn.dht.enable_ipv6" "dht_enable_ipv6"
+add_param $CONFFILE "ibrdtn.dht.bind_ipv4" "dht_bind_ipv4"
+add_param $CONFFILE "ibrdtn.dht.bind_ipv6" "dht_bind_ipv6"
+add_param $CONFFILE "ibrdtn.dht.ignore_neighbour_informations" "dht_ignore_neighbour_informations"
+add_param $CONFFILE "ibrdtn.dht.allow_neighbours_to_announce_me" "dht_allow_neighbours_to_announce_me"
+add_param $CONFFILE "ibrdtn.dht.allow_neighbour_announcement" "dht_allow_neighbour_announcement"
+
+
+# iterate through all network interfaces
+iter=0
+netinterfaces=
+while [ 1 == 1 ]; do
+       $UCI -q get "ibrdtn.@network[$iter]" > /dev/null
+       if [ $? == 0 ]; then
+               netinterfaces="${netinterfaces} lan${iter}"
+               add_param $CONFFILE "ibrdtn.@network[$iter].type" "net_lan${iter}_type"
+               add_param $CONFFILE "ibrdtn.@network[$iter].interface" "net_lan${iter}_interface"
+               add_param $CONFFILE "ibrdtn.@network[$iter].port" "net_lan${iter}_port"
+       else
+               break
+       fi
+       
+       let iter=iter+1
+done
+
+# write list of network interfaces
+echo "net_interfaces =$netinterfaces" >> $CONFFILE
+
+# iterate through all static routes
+iter=0
+while [ 1 == 1 ]; do
+       $UCI -q get "ibrdtn.@static-route[$iter]" > /dev/null
+       if [ $? == 0 ]; then
+               PATTERN=`$UCI -q get "ibrdtn.@static-route[$iter].pattern"`
+               DESTINATION=`$UCI -q get "ibrdtn.@static-route[$iter].destination"`
+               let NUMBER=iter+1
+               echo "route$NUMBER = $PATTERN $DESTINATION" >> $CONFFILE
+       else
+               break
+       fi
+       
+       let iter=iter+1
+done
+
+#iterate through all static connections
+iter=0
+while [ 1 == 1 ]; do
+       $UCI -q get "ibrdtn.@static-connection[$iter]" > /dev/null
+       if [ $? == 0 ]; then
+               let NUMBER=iter+1
+               add_param $CONFFILE "ibrdtn.@static-connection[$iter].uri" "static${NUMBER}_uri"
+               add_param $CONFFILE "ibrdtn.@static-connection[$iter].address" "static${NUMBER}_address"
+               add_param $CONFFILE "ibrdtn.@static-connection[$iter].port" "static${NUMBER}_port"
+               add_param $CONFFILE "ibrdtn.@static-connection[$iter].protocol" "static${NUMBER}_proto"
+               add_param $CONFFILE "ibrdtn.@static-connection[$iter].immediately" "static${NUMBER}_immediately"
+       else
+               break
+       fi
+       
+       let iter=iter+1
+done
diff --git a/net/ibrdtnd/files/ibrdtn.init b/net/ibrdtnd/files/ibrdtn.init
new file mode 100644 (file)
index 0000000..5a00c24
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007 OpenWrt.org
+
+START=90
+
+start() {
+       # check if the daemon is disabled
+       if [ "`/sbin/uci -P/var/state -q get ibrdtn.disable`" == "1" ]; then
+               /bin/echo "dtnd is disabled"
+               return
+       fi
+       
+       /bin/echo -n "running dtnd ..."
+       
+       # startup the safety-wrapper for the daemon
+       /usr/sbin/dtnd-safety-wrapper.sh &
+       
+       # store the pid of the process in uci states
+       /sbin/uci -P/var/state -q set ibrdtn.safetypid=`echo $!`
+       
+       /bin/echo " done"
+}
+
+stop() { 
+       # check if the daemon is disabled
+       if [ "`/sbin/uci -P/var/state -q get ibrdtn.disable`" == "1" ]; then
+               /bin/echo "dtnd is disabled"
+               return
+       fi
+       
+       /bin/echo -n "stopping dtnd ..."
+       
+       # set state to None, this indicates a clear shutdown to the safety-wrapper.
+       /sbin/uci -P/var/state -q set ibrdtn.state=None
+       
+       # stop the safety-wrapper
+       if [ -n "`/sbin/uci -P/var/state -q get ibrdtn.safetypid`" ]; then
+               /usr/bin/kill `/sbin/uci -P/var/state -q get ibrdtn.safetypid` 2> /dev/null >/dev/null
+       fi
+       
+       # finally kill really all safety-wrapper!
+       /bin/sleep 2
+       /usr/bin/killall -9 dtnd-safety-wrapper.sh
+       
+       # send a kill signal to the daemon
+       /usr/bin/killall dtnd 2> /dev/null >/dev/null
+       
+       # wait for some time
+       TIMEOUT=0;
+       
+       # check if the daemon is running
+       while [ -n "`ps | grep dtnd | grep -v grep`" ]; do
+               # check if the daemon is still running
+               if [ $TIMEOUT -ge 10 ]; then
+                       /bin/echo " killing"
+                       # kill all processes of dtnd
+                       /usr/bin/killall -9 dtnd 2> /dev/null >/dev/null
+                       return
+               fi
+               
+               # increment timeout
+               TIMEOUT=`expr $TIMEOUT + 1`
+               
+               echo -n "."
+               
+               # wait some time
+               /bin/sleep 1
+       done
+       
+       echo " done"
+}
diff --git a/net/ibrdtnd/files/ibrdtn.uci b/net/ibrdtnd/files/ibrdtn.uci
new file mode 100644 (file)
index 0000000..ab45044
--- /dev/null
@@ -0,0 +1,175 @@
+#####################################
+# IBR-DTN daemon                    #
+#####################################
+
+config 'daemon' 'main'
+       # The local eid of the dtn node. Default is the hostname.
+#      option uri                      dtn://node.dtn
+       
+       # logfile for standard output
+       option logfile          /tmp/ibrdtn.log
+       option errfile          /tmp/ibrdtn.err
+       
+       # debug level
+#      option debug            20
+
+       # block size limit
+#      option blocksize                512M
+#      option foreign_blocksize        128M
+
+
+#
+# If something bad happened, the safe mode will be activated.
+# These are the restrictions for safe mode only.
+#
+config 'daemon' 'safemode'
+       option forwarding       no
+       option storage          64M
+       option maxblock         16M
+#      option wait_mount       /dev/sda1
+
+
+#####################################
+# storage configuration             #
+#####################################
+
+config 'daemon' 'storage'
+       # possible engines are: simple, sqlite
+       option engine           simple
+       option blobs            /tmp/ibrdtn/blobs
+       option bundles          /tmp/ibrdtn/bundles
+#      option container        /tmp/ibrdtn/container.img
+#      option path                     /tmp/ibrdtn/container
+#      option limit            1G
+
+
+#####################################
+# routing configuration             #
+#####################################
+
+#
+# In the "default" the daemon only delivers bundles to neighbors and static
+# available nodes. The alternative module "epidemic" spread all bundles to
+# all available neighbors.
+#
+config 'daemon' 'main'
+       # values: none | default | epidemic | flooding | prophet
+       option  routing         prophet
+#      option  forwarding      no
+#      option  fragmentation   yes
+
+#
+# static routing rules
+# - a rule is a regex pattern
+# - format is <target-scheme> <routing-node>
+#
+#config 'static-route'
+#      list pattern            ^dtn://[[:alpha:]].moon.dtn/[[:alpha:]]
+#      option destination      dtn://router.dtn
+
+
+#####################################
+# static connections
+#####################################
+
+#config 'static-connection'
+#      option uri                      dtn://node-five.dtn
+#      option address          10.0.0.5
+#      option port                     4556
+#      option protocol         tcp
+#      option immediately      yes
+
+#config 'static-connection'
+#      option uri                      dtn://node-ten
+#      option address          10.0.0.10
+#      option port                     4556
+#      option protocol         udp
+#      option immediately      no
+
+
+#####################################
+# convergence layer configuration   #
+#####################################
+
+#
+# You can specify an multicast address to listen to for discovery announcements.
+# If no address is specified the multicast equivalent of broadcast is used.
+#
+config 'daemon' 'discovery'
+#      option address          224.0.0.1
+#      option timeout          5
+#      option crosslayer       yes
+
+config 'daemon' 'tcptuning'
+#      option 'idle_timeout'   120
+#      option 'nodelay'                yes
+#      option 'chunksize'              4096
+
+config 'network'
+       option type                     tcp
+       option interface        eth0
+       option port                     4556
+       
+#config 'network'
+#      option type                     tcp
+#      option interface        wlan0
+#      option port                     4556
+
+
+#####################################
+# bundle security protocol          #
+#####################################
+
+#
+# the level specifies the security constains
+#
+# 0 = no constrains (default)
+# 1 = accept only BAB authenticated bundles
+# 2 = accept only encrypted bundles
+# 3 = accept only BAB authenticated and encrypted bundles
+#
+
+#config 'daemon' 'security'
+#      option level            0
+#      option bab_key          /path/to/default-bab-key.mac
+#      option key_path         /path/to/security-keys
+#      option generate_dh      yes
+       
+#config 'daemon' 'tls'
+#      option certificate      /path/to/tls-cert.crt
+#      option key                      /path/to/tls-key.key
+#      option trustedpath      /path/to/tls-ca
+#      option required         no
+#      option noencryption no
+
+
+#####################################
+# time synchronization              #
+#####################################
+
+#config 'daemon' 'timesync'
+#      option reference                yes
+#      option synchronize              yes
+#      option discovery_announcement   yes
+#      option sigma                    1.001
+#      option psi                      0.9
+#      option sync_level               0.1
+
+#####################################
+# DHT                               #
+#####################################
+
+config 'daemon' 'dht'
+#      option 'enabled'        'yes'
+#      option 'id'             '<enter your unique id here>'
+       option 'bootstrap'      'yes'
+#      option 'nodesfile'      '/tmp/dht_nodes.dat'
+       option 'port'           '9999'
+       option 'enable_ipv6'    'no'
+#      option 'enable_ipv4'    'no'
+#      option 'bind_ipv4'      '127.0.0.1'
+#      option 'bind_ipv6'      '::1'
+       option 'ignore_neighbour_informations'          'yes'
+       option 'allow_neighbours_to_announce_me'        'no'
+       option 'allow_neighbour_announcement'           'no'
+
diff --git a/net/ibrdtnd/files/mkcontainer.sh b/net/ibrdtnd/files/mkcontainer.sh
new file mode 100644 (file)
index 0000000..5718111
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# This script creates a bundle storage of a given size.
+#
+# $1 = container file
+# $2 = size of the container in MB
+#
+
+help_message() {
+       echo "usage: "
+       echo " $0 <container file> <size in MB>"
+}
+
+if [ $# -le 1 ]; then
+       help_message
+       exit 1
+fi
+
+CONTAINER=$(cd "$(dirname "$1")"; pwd)/$(basename $1)
+SIZE=$2
+
+# check if the container already exists
+if [ -f $CONTAINER ]; then
+       echo "Aborted! The specified container already exists."
+       exit 1
+fi
+
+# create the container
+echo -n "creating the container file..."
+/bin/dd if=/dev/zero of=$CONTAINER bs=1M count=$SIZE >/dev/null 2>/dev/null
+echo " done" 
+
+# create file system
+echo -n "initializing ext3 filesystem for the container..."
+/usr/sbin/mkfs.ext3 -q -F $CONTAINER > /dev/null
+echo " done"
+
+# final hint
+echo "The container is now ready. To use it with IBR-DTN set the container with:"
+echo "# uci set ibrdtn.storage.container=$CONTAINER"
+echo "# uci set ibrdtn.storage.container_size=$SIZE"
+
+exit 0
diff --git a/net/ibrdtnd/files/mountcontainer.sh b/net/ibrdtnd/files/mountcontainer.sh
new file mode 100644 (file)
index 0000000..2eaed2f
--- /dev/null
@@ -0,0 +1,122 @@
+#!/bin/sh
+#
+
+CONTAINER=`/sbin/uci -q get ibrdtn.storage.container`
+CPATH=`/sbin/uci -q get ibrdtn.storage.path`
+
+check_var() {
+       if [ -z "$1" ]; then
+               echo "$2"
+               exit 1
+       fi
+}
+
+check_path() {
+       if [ ! -d "$1" ]; then
+               echo "$2"
+               return 1
+       fi
+}
+
+check_file() {
+       if [ ! -f "$1" ]; then
+               echo "$2"
+               exit 1
+       fi
+}
+
+container_mount() {
+       CONTAINER=`/sbin/uci -q get ibrdtn.storage.container`
+       CPATH=`/sbin/uci -q get ibrdtn.storage.path`
+
+       if [ -z "`mount | grep ' on $CPATH '`" ]; then
+               # try to mount the container
+               /bin/mount -o loop $CONTAINER $CPATH
+
+               return $?
+       fi
+
+       return 0
+}
+
+container_reinitialize() {
+       SIZE=`/sbin/uci get -q ibrdtn.storage.container_size`
+       CONTAINER=`/sbin/uci -q get ibrdtn.storage.container`
+
+       # try to rebuild the container
+       if [ -n "$SIZE" ]; then
+               /bin/rm -f $CONTAINER
+               /usr/share/ibrdtn/mkcontainer.sh $CONTAINER $SIZE
+
+               if [ $? -eq 0 ]; then
+                       container_mount
+                       return $?
+               fi
+
+               return 1
+       fi
+
+       return 1
+}
+
+check_var $CONTAINER "Storage container not set in uci.\nuse: uci set ibrdtn.storage.container=<container-file>"
+check_var $CPATH "Storage container mount path not set in uci.\nuse: uci set ibrdtn.storage.path=<mount-path>"
+
+check_path $CPATH "Storage container mount path does not exist."
+if [ $? -gt 0 ]; then
+       /bin/mkdir -p $CPATH
+
+       if [ $? -gt 0 ]; then
+               echo "can not create container mount path."
+               exit 1
+       fi
+fi
+
+if [ "$1" == "-u" ]; then
+       /bin/umount $CPATH
+       exit 0
+fi
+
+if [ -n "`/bin/mount | grep $CPATH`" ]; then
+       echo "Container already mounted"
+       exit 0
+fi
+
+if [ ! -f "$CONTAINER" ]; then
+       echo "Storage container file $CONTAINER does not exist."
+       container_reinitialize
+       exit $?
+fi
+
+# try to mount the container
+container_mount
+
+if [ $? -gt 0 ]; then
+       echo -n "can not mount container file. checking... "
+       /usr/sbin/e2fsck -p $CONTAINER
+
+       if [ $? -gt 0 ]; then
+               echo " error"
+               echo "Container file $CONTAINER broken. Try to reinitialize the container."
+               container_reinitialize
+
+               if [ $? -eq 0 ]; then
+                       echo "container ready!"
+                       exit 0
+               else
+                       exit 1
+               fi
+       fi
+       echo "done"
+
+       container_mount
+
+       if [ $? -gt 0 ]; then
+               echo "mount failed!"
+               exit 1
+       fi
+fi
+
+echo "container ready!"
+exit 0
+
diff --git a/net/ibrdtnd/files/safety-wrapper.sh b/net/ibrdtnd/files/safety-wrapper.sh
new file mode 100644 (file)
index 0000000..2f35283
--- /dev/null
@@ -0,0 +1,172 @@
+#!/bin/sh
+#
+# safety wrapper for IBR-DTN daemon
+#
+# Tasks:
+#  * start IBR-DTN daemon
+#  * restart the daemon after a crash
+#  * if respawning to fast, then slow down with backoff
+#  * check for enough space on disk and delete bundles if necessary.
+#  * clean the blob directory on startup
+#
+
+DTND=/usr/sbin/dtnd
+TMPCONF=/tmp/ibrdtn.config
+UCI=/sbin/uci
+
+getstate() {
+       $UCI -P/var/state -q get ibrdtn.$1
+       return $?
+}
+
+setstate() {
+       $UCI -P/var/state -q set ibrdtn.$1=$2
+       return $?
+}
+
+getconfig() {
+       $UCI -q get ibrdtn.$1
+       return $?
+}
+
+setconfig() {
+       $UCI -q set ibrdtn.$1=$2
+       return $?
+}
+
+# remove the old state file
+/bin/rm /var/state/ibrdtn
+
+# read uci configuration
+BLOB_PATH=`getconfig storage.blobs`
+BUNDLE_PATH=`getconfig storage.bundles`
+CONTAINER_PATH=`getconfig storage.path`
+CONTAINER_FILE=`getconfig storage.container`
+LOG_FILE=`getconfig main.logfile`
+ERR_FILE=`getconfig main.errfile`
+DEBUG_LEVEL=`getconfig main.debug`
+SAFEMODE=no
+
+# run a system check
+/bin/sh /usr/share/ibrdtn/systemcheck.sh
+
+if [ $? -eq 0 ]; then
+       # mount container if specified
+       if [ -n "$CONTAINER_FILE" ] && [ -n "$CONTAINER_PATH" ]; then
+               /bin/sh /usr/share/ibrdtn/mountcontainer.sh
+
+               # if the mount of the container failed
+               # switch to safe mode!
+               if [ $? -gt 0 ]; then
+                       SAFEMODE=yes
+               fi
+       fi
+else
+       SAFEMODE=yes
+fi
+
+# create blob & bundle path
+if [ -n "$BLOB_PATH" ]; then
+       /bin/mkdir -p $BLOB_PATH
+
+       # clean the blob directory on startup
+       /bin/rm -f $BLOB_PATH/file*
+fi
+
+if [ -n "$BUNDLE_PATH" ]; then
+       /bin/mkdir -p $BUNDLE_PATH
+fi
+
+LOGGING=""
+if [ -n "$LOG_FILE" ]; then
+       LOGGING="$LOGGING > $LOG_FILE"
+else
+       LOGGING="$LOGGING > /dev/null"
+fi
+
+if [ -n "$ERR_FILE" ]; then
+       LOGGING="$LOGGING 2> $ERR_FILE"
+else
+       LOGGING="$LOGGING 2> /dev/null"
+fi
+
+if [ -z "$LOG_FILE" ] && [ -z "$ERR_FILE" ]; then
+       LOGGING="-q"
+fi
+
+# check for debugging option
+if [ -n "$DEBUG_LEVEL" ]; then
+       DEBUG_ARGS="-v -d ${DEBUG_LEVEL}"
+else
+       DEBUG_ARGS=""
+fi
+
+# create configuration
+if [ "$SAFEMODE" == "yes" ]; then
+       /bin/sh /usr/share/ibrdtn/build-config.sh --safe-mode $TMPCONF
+else
+       /bin/sh /usr/share/ibrdtn/build-config.sh $TMPCONF
+fi
+
+# set the crash counter to zero
+CRASH=0
+
+# run the daemon
+setstate state running
+
+while [ "`getstate state`" == "running" ]; do
+       # run a system check
+       /bin/sh /usr/share/ibrdtn/systemcheck.sh
+
+       # run in safe mode if the system check has failed
+       if [ $? -gt 0 ] && [ "$SAFEMODE" == "no" ]; then
+               SAFEMODE=yes
+               /usr/bin/logger -t "ibrdtn-safe-wrapper" -p 2 "system check failed! Switch to safe-mode settings."
+               /bin/sh /usr/share/ibrdtn/build-config.sh --safe-mode $TMPCONF
+       fi
+
+       # measure the running time
+       TIMESTART=`/bin/date +%s`
+       
+       # run the daemon
+       echo "${DTND} ${DEBUG_ARGS} -c ${TMPCONF} ${LOGGING}" | /bin/sh
+       
+       # measure the stopping time
+       TIMESTOP=`/bin/date +%s`
+       
+       # calc the running time
+       let TIMERUN=$TIMESTOP-$TIMESTART
+       
+       # reset the CRASH counter if there is one hour between the crashes
+       if [ $TIMERUN -ge 3600 ]; then
+               CRASH=0
+       fi
+       
+       # check if the daemon is crashed
+       if [ "`getstate state`" == "running" ]; then
+               # if the crash counter is higher than 20 switch to safe-mode settings
+               if [ $CRASH -eq 20 ] && [ "$SAFEMODE" == "no" ]; then
+                       SAFEMODE=yes
+                       /usr/bin/logger -t "ibrdtn-safe-wrapper" -p 2 "IBR-DTN daemon crashed 20 times! Switch to safe-mode settings."
+                       /bin/sh /usr/share/ibrdtn/build-config.sh --safe-mode $TMPCONF
+               fi
+
+               # increment the crash counter
+               let CRASH=$CRASH+1
+               
+               # backoff wait timer
+               let WAIT=2**$CRASH
+               
+               # set a upper limit for the wait time
+               if [ $WAIT -ge 1800 ]; then
+                       WAIT=1800
+               fi
+
+               # log the crash
+               /usr/bin/logger -t "ibrdtn-safe-wrapper" -p 2 "IBR-DTN daemon crashed $CRASH times! Wait $WAIT seconds."
+               
+               # wait sometime
+               /bin/sleep $WAIT
+       fi
+done
+
diff --git a/net/ibrdtnd/files/systemcheck.sh b/net/ibrdtnd/files/systemcheck.sh
new file mode 100644 (file)
index 0000000..3110bcf
--- /dev/null
@@ -0,0 +1,101 @@
+#!/bin/sh
+#
+#
+
+check_mounted() {
+       DIR=$1
+       while [ "$DIR" != "/" ]; do
+               if [ -n "`mount | grep "$DIR"`" ]; then
+                       return 0
+               fi
+
+               DIR=`dirname $DIR`
+       done
+       return 1
+}
+
+check_writable() {
+       CHECKFILE="$1/.container-lock"
+       /bin/touch $CHECKFILE
+
+       if [ $? -gt 0 ]; then
+               return 1;
+       fi
+
+       /bin/echo "0123456789" >> $CHECKFILE
+
+       if [ $? -gt 0 ]; then
+               return 2;
+       fi
+
+       /bin/rm $CHECKFILE
+
+       if [ $? -gt 0 ]; then
+               return 3;
+       fi
+}
+
+check_mountdev() {
+       # get wait_mount option
+       WAIT_MOUNT_DEV=`uci -q get ibrdtn.safemode.wait_mount`
+       
+       if [ $? -ne 0 ]; then
+               return 0
+       fi
+       
+       DATA=`mount | grep ${WAIT_MOUNT_DEV}`
+
+       if [ -n "${DATA}" ]; then
+               return 0
+       fi
+       
+       return 1
+}
+
+# check the storage device
+check_mountdev
+RET=$?
+
+if [ ${RET} -ne 0 ]; then
+       WAIT_SECONDS=60
+       /usr/bin/logger -t "systemcheck.sh" -p 2 "disk storage not ready, wait max. ${WAIT_SECONDS} seconds until it is mounted"
+       while [ ${RET} -ne 0 ] && [ ${WAIT_SECONDS} -ne 0 ]; do
+               sleep 1
+               let WAIT_SECONDS=WAIT_SECONDS-1
+               check_mountdev
+               RET=$?
+       done
+fi
+
+if [ ${RET} -ne 0 ]; then
+       # failed, storage not mounted
+       exit 1
+fi
+
+# get the path for the container
+CONTAINER=`uci -q get ibrdtn.storage.container`
+
+if [ -z "$CONTAINER" ]; then
+       exit 0
+fi
+
+CONTAINER_PATH=`dirname $CONTAINER`
+
+if [ -n "$CONTAINER_PATH" ]; then
+       # check if the container is on a mounted device
+       check_mounted $CONTAINER_PATH
+
+       if [ $? -gt 0 ]; then
+               # failed
+               exit 1
+       fi
+
+       # check if the device is writable
+       check_writable $CONTAINER_PATH
+
+       if [ $? -gt 0 ]; then
+               # failed
+               exit 1
+       fi
+fi
+
diff --git a/net/ipsec-tools/Makefile b/net/ipsec-tools/Makefile
new file mode 100644 (file)
index 0000000..4131cff
--- /dev/null
@@ -0,0 +1,99 @@
+#
+# Copyright (C) 2006-2011 OpenWrt.org
+#               2014 Noah Meyerhans <frodo@morgul.net>
+#
+# 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:=ipsec-tools
+PKG_VERSION:=0.8.2
+PKG_RELEASE:=1
+PKG_MAINTAINER := "Noah Meyerhans <frodo@morgul.net>"
+PKG_LICENSE := BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@SF/ipsec-tools
+PKG_MD5SUM:=d53ec14a0a3ece64e09e5e34b3350b41
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ipsec-tools
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=VPN
+  DEPENDS:=+libopenssl +kmod-ipsec
+  TITLE:=IPsec management tools
+  URL:=http://ipsec-tools.sourceforge.net/
+  MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-kernel-headers="$(LINUX_DIR)/include" \
+       --without-readline \
+       --with-openssl="$(STAGING_DIR)/usr" \
+       --without-libradius \
+       --without-libpam \
+       --enable-dpd \
+       --enable-hybrid \
+       --enable-security-context=no \
+       --enable-natt \
+       --enable-adminport \
+       --enable-frag \
+        $(call autoconf_bool,CONFIG_IPV6,ipv6)
+
+# override CFLAGS holding "-Werror" that break builds on compile warnings
+MAKE_FLAGS+=\
+       CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)"
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       chmod -R u+w $(PKG_BUILD_DIR)
+endef
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); touch \
+               configure.ac \
+               aclocal.m4 \
+               Makefile.in \
+               config.h.in \
+               configure \
+       );
+       $(call Build/Configure/Default)
+       echo "#undef HAVE_SHADOW_H" >> $(PKG_BUILD_DIR)/config.h
+endef
+
+define Package/ipsec-tools/install
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/racoon.conf $(1)/etc/
+       $(SED) 's|@sysconfdir_x@|/etc|g' $(1)/etc/racoon.conf
+       $(INSTALL_DIR) $(1)/etc/racoon
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/racoon/samples/psk.txt $(1)/etc/racoon/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/racoon.init $(1)/etc/init.d/racoon
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipsec.so.* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libracoon.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/plainrsa-gen $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoon $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/racoonctl $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/setkey $(1)/usr/sbin/
+endef
+
+define Package/ipsec-tools/conffiles
+/etc/racoon.conf
+/etc/racoon/psk.txt
+endef
+
+$(eval $(call BuildPackage,ipsec-tools))
diff --git a/net/ipsec-tools/files/racoon.init b/net/ipsec-tools/files/racoon.init
new file mode 100644 (file)
index 0000000..d539b36
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2011 OpenWrt.org
+# Copyright (C) 2011 Artem Makhutov
+
+START=49
+
+SERVICE_USE_PID=1
+
+start() {
+       mkdir -m 0700 -p /var/racoon
+       [ -f /etc/ipsec.conf ] && /usr/sbin/setkey -f /etc/ipsec.conf
+       service_start /usr/sbin/racoon -f /etc/racoon.conf
+}
+
+stop() {
+       service_stop /usr/sbin/racoon
+}
diff --git a/net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch b/net/ipsec-tools/patches/001-ipsec-tools-def-psk.patch
new file mode 100644 (file)
index 0000000..db5b306
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/src/racoon/oakley.c
++++ b/src/racoon/oakley.c
+@@ -2424,8 +2424,21 @@ oakley_skeyid(iph1)
+                               plog(LLV_ERROR, LOCATION, iph1->remote,
+                                       "couldn't find the pskey for %s.\n",
+                                       saddrwop2str(iph1->remote));
++                      }
++              }
++              if (iph1->authstr == NULL) {
++                      /*
++                       * If we could not locate a psk above try and locate
++                       * the default psk, ie, "*".
++                       */
++                      iph1->authstr = privsep_getpsk("*", 1);
++                      if (iph1->authstr == NULL) {
++                              plog(LLV_ERROR, LOCATION, iph1->remote,
++                                      "couldn't find the the default pskey either.\n");
+                               goto end;
+                       }
++                      plog(LLV_NOTIFY, LOCATION, iph1->remote,
++                                      "Using default PSK.\n");
+               }
+               plog(LLV_DEBUG, LOCATION, NULL, "the psk found.\n");
+               /* should be secret PSK */
diff --git a/net/ipsec-tools/patches/001-no_libfl.patch b/net/ipsec-tools/patches/001-no_libfl.patch
new file mode 100644 (file)
index 0000000..b56b596
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/src/racoon/cftoken.l
++++ b/src/racoon/cftoken.l
+@@ -104,6 +104,8 @@ static struct include_stack {
+ static int incstackp = 0;
+ static int yy_first_time = 1;
++
++int yywrap(void) { return 1; }
+ %}
+ /* common seciton */
+--- a/src/setkey/token.l
++++ b/src/setkey/token.l
+@@ -86,6 +86,8 @@
+ #if defined(SADB_X_EALG_AES) && ! defined(SADB_X_EALG_AESCBC)
+ #define SADB_X_EALG_AESCBC  SADB_X_EALG_AES
+ #endif
++
++int yywrap(void) { return 1; }
+ %}
+ /* common section */
diff --git a/net/ipsec-tools/patches/002-patch8-utmp.patch b/net/ipsec-tools/patches/002-patch8-utmp.patch
new file mode 100644 (file)
index 0000000..16dc923
--- /dev/null
@@ -0,0 +1,72 @@
+--- a/src/racoon/isakmp_cfg.c
++++ b/src/racoon/isakmp_cfg.c
+@@ -38,7 +38,7 @@
+ #include <sys/socket.h>
+ #include <sys/queue.h>
+-#include <utmpx.h>
++#include <utmp.h>
+ #if defined(__APPLE__) && defined(__MACH__)
+ #include <util.h>
+ #endif
+@@ -1661,7 +1661,8 @@ isakmp_cfg_accounting_system(port, raddr
+       int inout;
+ {
+       int error = 0;
+-      struct utmpx ut;
++      struct utmp ut;
++      char term[UT_LINESIZE];
+       char addr[NI_MAXHOST];
+       
+       if (usr == NULL || usr[0]=='\0') {
+@@ -1670,34 +1671,37 @@ isakmp_cfg_accounting_system(port, raddr
+               return -1;
+       }
+-      memset(&ut, 0, sizeof ut);
+-      gettimeofday((struct timeval *)&ut.ut_tv, NULL);
+-      snprintf(ut.ut_id, sizeof ut.ut_id, TERMSPEC, port);
++      sprintf(term, TERMSPEC, port);
+       switch (inout) {
+       case ISAKMP_CFG_LOGIN:
+-              ut.ut_type = USER_PROCESS;
+-              strncpy(ut.ut_user, usr, sizeof ut.ut_user);
++              strncpy(ut.ut_name, usr, UT_NAMESIZE);
++              ut.ut_name[UT_NAMESIZE - 1] = '\0';
++              
++              strncpy(ut.ut_line, term, UT_LINESIZE);
++              ut.ut_line[UT_LINESIZE - 1] = '\0';
+               GETNAMEINFO_NULL(raddr, addr);
+-              strncpy(ut.ut_host, addr, sizeof ut.ut_host);
++              strncpy(ut.ut_host, addr, UT_HOSTSIZE);
++              ut.ut_host[UT_HOSTSIZE - 1] = '\0';
++
++              ut.ut_time = time(NULL);
+               plog(LLV_INFO, LOCATION, NULL,
+                       "Accounting : '%s' logging on '%s' from %s.\n",
+-                      ut.ut_user, ut.ut_id, addr);
+-
+-              pututxline(&ut);
++                      ut.ut_name, ut.ut_line, ut.ut_host);
++              login(&ut);
++              
+               break;
+       case ISAKMP_CFG_LOGOUT: 
+-              ut.ut_type = DEAD_PROCESS;
+               plog(LLV_INFO, LOCATION, NULL,
+                       "Accounting : '%s' unlogging from '%s'.\n",
+-                      usr, ut.ut_id);
+-
+-              pututxline(&ut);
++                      usr, term);
++              logout(term);
++              
+               break;
+       default:
+               plog(LLV_ERROR, LOCATION, NULL, "Unepected inout\n");
diff --git a/net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch b/net/ipsec-tools/patches/003-microsoft-fqdn-in-main.patch
new file mode 100644 (file)
index 0000000..443d38d
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/racoon/ipsec_doi.c
++++ b/src/racoon/ipsec_doi.c
+@@ -3582,8 +3582,8 @@ ipsecdoi_checkid1(iph1)
+           iph1->approval->authmethod == OAKLEY_ATTR_AUTH_METHOD_PSKEY) {
+                if (id_b->type != IPSECDOI_ID_IPV4_ADDR
+                 && id_b->type != IPSECDOI_ID_IPV6_ADDR) {
+-                      plog(LLV_ERROR, LOCATION, NULL,
+-                              "Expecting IP address type in main mode, "
++                      plog(LLV_WARNING, LOCATION, NULL,
++                              "Expecting IP address type in main mode (RFC2409) , "
+                               "but %s.\n", s_ipsecdoi_ident(id_b->type));
+                       return ISAKMP_NTYPE_INVALID_ID_INFORMATION;
+               }
diff --git a/net/ipsec-tools/patches/005-isakmp-fix.patch b/net/ipsec-tools/patches/005-isakmp-fix.patch
new file mode 100644 (file)
index 0000000..f7aa3c2
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/racoon/isakmp.c
++++ b/src/racoon/isakmp.c
+@@ -31,6 +31,8 @@
+  * SUCH DAMAGE.
+  */
++#define __packed __attribute__((__packed__))
++
+ #include "config.h"
+ #include <sys/types.h>
diff --git a/net/ipsec-tools/patches/006-linux-3.7-compat.patch b/net/ipsec-tools/patches/006-linux-3.7-compat.patch
new file mode 100644 (file)
index 0000000..46b11ee
--- /dev/null
@@ -0,0 +1,50 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -74,9 +74,10 @@ case "$host_os" in
+           [ KERNEL_INCLUDE="/lib/modules/`uname -r`/build/include" ])
+     AC_CHECK_HEADER($KERNEL_INCLUDE/linux/pfkeyv2.h, ,
+-      [ AC_CHECK_HEADER(/usr/src/linux/include/linux/pfkeyv2.h,
+-        KERNEL_INCLUDE=/usr/src/linux/include ,
+-        [ AC_MSG_ERROR([Unable to find linux-2.6 kernel headers. Aborting.]) ] ) ] )
++      [ AC_CHECK_HEADER($KERNEL_INCLUDE/uapi/linux/pfkeyv2.h, ,
++        [ AC_CHECK_HEADER(/usr/src/linux/include/linux/pfkeyv2.h,
++          KERNEL_INCLUDE=/usr/src/linux/include ,
++          [ AC_MSG_ERROR([Unable to find linux-2.6 kernel headers. Aborting.]) ] ) ] ) ] )
+     AC_SUBST(KERNEL_INCLUDE)
+     # We need the configure script to run with correct kernel headers.
+     # However we don't want to point to kernel source tree in compile time,
+@@ -643,7 +644,14 @@ AC_EGREP_CPP(yes,
+ #ifdef SADB_X_EXT_NAT_T_TYPE
+ yes
+ #endif
+-], [kernel_natt="yes"])
++], [kernel_natt="yes"], [
++  AC_EGREP_CPP(yes,
++  [#include <uapi/linux/pfkeyv2.h>
++  #ifdef SADB_X_EXT_NAT_T_TYPE
++  yes
++  #endif
++  ], [kernel_natt="yes"])
++])
+       ;;
+ freebsd*|netbsd*)
+ # NetBSD case
+--- a/src/include-glibc/Makefile.am
++++ b/src/include-glibc/Makefile.am
+@@ -1,14 +1,7 @@
+-
+-.includes: ${top_builddir}/config.status
+-      ln -snf $(KERNEL_INCLUDE)/linux
+-      touch .includes
+-
+-all: .includes
+-
+ EXTRA_DIST = \
+   glibc-bugs.h \
+   net/pfkeyv2.h \
+   netinet/ipsec.h \
+   sys/queue.h
+-DISTCLEANFILES = .includes linux
++DISTCLEANFILES = linux
diff --git a/net/ipsec-tools/patches/force_HAVE_POLICY_FWD b/net/ipsec-tools/patches/force_HAVE_POLICY_FWD
new file mode 100644 (file)
index 0000000..24e6445
--- /dev/null
@@ -0,0 +1,14 @@
+diff --git a/configure.ac b/configure.ac
+index 8506245..eca8895 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -724,7 +724,8 @@ case $host in
+                       ],
+                       [AC_MSG_RESULT(yes)
+                        AC_DEFINE([HAVE_POLICY_FWD], [], [Have forward policy])],
+-                      [AC_MSG_RESULT(no)])
++                      [AC_MSG_RESULT(forced)
++                       AC_DEFINE([HAVE_POLICY_FWD], [], [Have forward policy])])
+               ;;
+       *)
+               AC_MSG_RESULT(no)
index fbb35336721b7c288288e39d934002e24b6b5d1b..9d84334f5fc9b14f1668b0a47a70694411c74140 100644 (file)
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=knot
-PKG_VERSION:=1.5.0
+PKG_VERSION:=1.5.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
-PKG_MD5SUM:=d677de99c19afea3b1e8ef075a9d5a8b
+PKG_MD5SUM:=4109648a538d35babea8379993c34996
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_PARALLEL:=1
index 7671eb94fe17f870506804d13697f8e95f409773..586d315346f9553c5f930bd11e310cf50bdb31df 100644 (file)
@@ -9,12 +9,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mosquitto
-PKG_VERSION:=1.3.2
+PKG_VERSION:=1.3.4
 PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILE:=LICENSE.txt
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://mosquitto.org/files/source/
-PKG_MD5SUM:=5d2fe7c8bf2518eb9829547751c04bbf
+PKG_MD5SUM:=9d729849efd74c6e3eee17a4a002e1e9
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
@@ -44,9 +46,9 @@ define Package/$(PKG_NAME)-nossl
 endef
 
 define Package/$(PKG_NAME)/default/description
- mosquitto is a message broker that supports v3.1 of the MQ Telemetry
-Transport protocol. MQTT provides a lightweight method for
-messaging using a publish/subscribe model.
+Mosquitto is an open source (BSD licensed) message broker that implements
+the MQTT protocol version 3.1 and 3.1.1. MQTT provides a lightweight
+method of carrying out messaging using a publish/subscribe model.
 
 This package also includes some basic support for configuring via UCI
 endef
@@ -119,7 +121,7 @@ define Package/libmosquitto/default/description
 use by any third party software that wants to communicate with a
 mosquitto server.
 
-Should be useable for communicating with any MQTT v3.1 compatible
+Should be useable for communicating with any MQTT v3.1/3.1.1 compatible
 server, such as IBM's RSMB, in addition to Mosquitto
 endef
 
index 5d31ef21d79e6569ff7bb201c32b59252ada83a7..0d421d0c4a332593c50ecda731106516d73b7dd1 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.bitwizard.nl/mtr
 PKG_MD5SUM:=5e665c617e5659b6ec3e201ee7488eb1
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
@@ -27,7 +29,7 @@ define Package/mtr
   DEPENDS:=+libncurses
   TITLE:=Full screen ncurses traceroute tool
   URL:=http://www.bitwizard.nl/mtr/
-  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
+  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 endef
 
 define Package/mtr/description
diff --git a/net/mwan3-luci/Makefile b/net/mwan3-luci/Makefile
new file mode 100644 (file)
index 0000000..4653633
--- /dev/null
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2006-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-mwan3
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
+PKG_LICENSE:=GPLv2
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luci-app-mwan3
+  SECTION:=LuCI
+  CATEGORY:=LuCI
+  SUBMENU:=3. Applications
+  TITLE:=LuCI support for the MWAN3 multiwan hotplug script
+  DEPENDS:=+mwan3
+  PKGARCH:=all
+  MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
+endef
+
+define Package/luci-app-mwan3/description
+Hotplug script which makes configuration of multiple WAN interfaces simple and manageable
+With loadbalancing/failover support for up to 250 WAN interfaces, connection tracking and an easy to manage traffic ruleset
+endef
+
+define Build/Compile
+endef
+
+define Package/luci-app-mwan3/install
+       $(CP) ./files/* $(1)
+endef
+
+$(eval $(call BuildPackage,luci-app-mwan3))
diff --git a/net/mwan3-luci/files/etc/hotplug.d/iface/16-mwan3custombak b/net/mwan3-luci/files/etc/hotplug.d/iface/16-mwan3custombak
new file mode 100644 (file)
index 0000000..9bd0bee
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# to enable this script uncomment the case loop at the bottom
+# to report MWAN3 status on interface up/down events modify the lines in the send_reportdata function
+
+send_alert()
+{
+       # $1 stores the mwan3 status information
+       # insert your code here to send the contents of $1
+       echo "$1"
+}
+
+gather_event_info()
+{
+       # create event information message
+       local EVENT_INFO="Interface [ "$INTERFACE" ($DEVICE) ] on router [ "$(uci get -p /var/state system.@system[0].hostname)" ] has triggered an [ "$ACTION" ] hotplug event on "$(date)""
+
+       # get current interface, policy and rule status
+       local CURRENT_STATUS="$(mwan3 status)"
+
+       # get last 50 mwan3 systemlog messages
+       local MWAN3_LOG="$(echo -e "Last 50 MWAN3 systemlog entries. Newest entries sorted at the top:\n$(logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x')")"
+
+       # pass event info to send_alert function
+       send_alert "$(echo -e "$EVENT_INFO\n\n$CURRENT_STATUS\n\n$MWAN3_LOG")"
+}
+
+#case "$ACTION" in
+#      ifup)
+#              gather_event_info
+#      ;;
+#
+#      ifdown)
+#              gather_event_info
+#      ;;
+#esac
+
+exit 0
diff --git a/net/mwan3-luci/files/etc/uci-defaults/mwan3 b/net/mwan3-luci/files/etc/uci-defaults/mwan3
new file mode 100755 (executable)
index 0000000..a19d4cb
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+# delete existing mwan3 ucitrack entry and add new entry
+uci -q batch <<-EOF >/dev/null
+       del ucitrack.@mwan3[-1]
+       add ucitrack mwan3
+       set ucitrack.@mwan3[-1].exec="/etc/init.d/mwan3 restart"
+       commit ucitrack
+EOF
+
+# make controller file addition take effect without system restart
+rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
+
+exit 0
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua b/net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua
new file mode 100644 (file)
index 0000000..13ff090
--- /dev/null
@@ -0,0 +1,355 @@
+module("luci.controller.mwan3", package.seeall)
+
+sys = require "luci.sys"
+ut = require "luci.util"
+
+function index()
+       if not nixio.fs.access("/etc/config/mwan3") then
+               return
+       end
+
+       entry({"admin", "network", "mwan3"},
+               alias("admin", "network", "mwan3", "overview"),
+               _("Load Balancing"), 600)
+
+       entry({"admin", "network", "mwan3", "overview"},
+               alias("admin", "network", "mwan3", "overview", "over_iface"),
+               _("Overview"), 10)
+       entry({"admin", "network", "mwan3", "overview", "over_iface"},
+               template("mwan3/mwan3_over_interface"))
+       entry({"admin", "network", "mwan3", "overview", "iface_status"},
+               call("mwan3_iface_status"))
+       entry({"admin", "network", "mwan3", "overview", "over_detail"},
+               template("mwan3/mwan3_over_detail"))
+       entry({"admin", "network", "mwan3", "overview", "detail_status"},
+               call("mwan3_detail_status"))
+
+       entry({"admin", "network", "mwan3", "configuration"},
+               alias("admin", "network", "mwan3", "configuration", "interface"),
+               _("Configuration"), 20)
+       entry({"admin", "network", "mwan3", "configuration", "interface"},
+               arcombine(cbi("mwan3/mwan3_interface"), cbi("mwan3/mwan3_interfaceconfig")),
+               _("Interfaces"), 10).leaf = true
+       entry({"admin", "network", "mwan3", "configuration", "member"},
+               arcombine(cbi("mwan3/mwan3_member"), cbi("mwan3/mwan3_memberconfig")),
+               _("Members"), 20).leaf = true
+       entry({"admin", "network", "mwan3", "configuration", "policy"},
+               arcombine(cbi("mwan3/mwan3_policy"), cbi("mwan3/mwan3_policyconfig")),
+               _("Policies"), 30).leaf = true
+       entry({"admin", "network", "mwan3", "configuration", "rule"},
+               arcombine(cbi("mwan3/mwan3_rule"), cbi("mwan3/mwan3_ruleconfig")),
+               _("Rules"), 40).leaf = true
+
+       entry({"admin", "network", "mwan3", "advanced"},
+               alias("admin", "network", "mwan3", "advanced", "hotplug"),
+               _("Advanced"), 100)
+       entry({"admin", "network", "mwan3", "advanced", "hotplug"},
+               form("mwan3/mwan3_adv_hotplug"))
+       entry({"admin", "network", "mwan3", "advanced", "mwan3"},
+               form("mwan3/mwan3_adv_mwan3"))
+       entry({"admin", "network", "mwan3", "advanced", "network"},
+               form("mwan3/mwan3_adv_network"))
+       entry({"admin", "network", "mwan3", "advanced", "diag"},
+               template("mwan3/mwan3_adv_diagnostics"))
+       entry({"admin", "network", "mwan3", "advanced", "diag_display"},
+               call("mwan3_diag_data"), nil).leaf = true
+       entry({"admin", "network", "mwan3", "advanced", "tshoot"},
+               template("mwan3/mwan3_adv_troubleshoot"))
+       entry({"admin", "network", "mwan3", "advanced", "tshoot_display"},
+               call("mwan3_tshoot_data"))
+end
+
+function mwan3_get_iface_status(rulenum, ifname)
+       if ut.trim(sys.exec("uci get -p /var/state mwan3." .. ifname .. ".enabled")) == "1" then
+               if ut.trim(sys.exec("ip route list table " .. rulenum)) ~= "" then
+                       if ut.trim(sys.exec("uci get -p /var/state mwan3." .. ifname .. ".track_ip")) ~= "" then
+                               return "on"
+                       else
+                               return "nm"
+                       end
+               else
+                       return "off"
+               end
+       else
+               return "ne"
+       end
+end
+
+function mwan3_get_iface()
+       local rulenum, str = 0, ""
+       uci.cursor():foreach("mwan3", "interface",
+               function (section)
+                       rulenum = rulenum+1
+                       str = str .. section[".name"] .. "[" .. mwan3_get_iface_status(rulenum, section[".name"]) .. "]"
+               end
+       )
+       return str
+end
+
+function mwan3_iface_status()
+       local ntm = require "luci.model.network".init()
+
+       local rv = {    }
+
+       -- overview status
+       local statstr = mwan3_get_iface()
+       if statstr ~= "" then
+               rv.wans = { }
+               wansid = {}
+
+               for wanname, ifstat in string.gfind(statstr, "([^%[]+)%[([^%]]+)%]") do
+                       local wanifname = ut.trim(sys.exec("uci get -p /var/state network." .. wanname .. ".ifname"))
+                               if wanifname == "" then
+                                       wanifname = "X"
+                               end
+                       local wanlink = ntm:get_interface(wanifname)
+                               wanlink = wanlink and wanlink:get_network()
+                               wanlink = wanlink and wanlink:adminlink() or "#"
+                       wansid[wanname] = #rv.wans + 1
+                       rv.wans[wansid[wanname]] = { name = wanname, link = wanlink, ifname = wanifname, status = ifstat }
+               end
+       end
+
+       -- overview status log
+       local mwlg = ut.trim(sys.exec("logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x'"))
+       if mwlg ~= "" then
+               rv.mwan3log = { }
+               mwlog = {}
+               mwlog[mwlg] = #rv.mwan3log + 1
+               rv.mwan3log[mwlog[mwlg]] = { mwanlog = mwlg }
+       end
+
+       luci.http.prepare_content("application/json")
+       luci.http.write_json(rv)
+end
+
+function mwan3_detail_status()
+       local rv = {    }
+
+       -- detailed mwan3 status
+       local dst = ut.trim(sys.exec("mwan3 status"))
+       if dst ~= "" then
+               rv.mwan3dst = { }
+               dstat = {}
+               dstat[dst] = #rv.mwan3dst + 1
+               rv.mwan3dst[dstat[dst]] = { detailstat = dst }
+       end
+
+       luci.http.prepare_content("application/json")
+       luci.http.write_json(rv)
+end
+
+function mwan3_diag_data(iface, tool, alt)
+       function get_ifnum()
+               local num = 0
+               uci.cursor():foreach("mwan3", "interface",
+                       function (section)
+                               num = num+1
+                               if section[".name"] == iface then
+                                       ifnum = num
+                               end
+                       end
+               )
+       end
+
+       local rv = {    }
+
+       local res = ""
+       if tool == "service" then
+               os.execute("mwan3 " .. alt)
+               if alt == "restart" then
+                       res = "MWAN3 restarted"
+               elseif alt == "stop" then
+                       res = "MWAN3 stopped"
+               else
+                       res = "MWAN3 started"
+               end
+       else
+               local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. iface .. ".ifname"))
+               if ifdev ~= "" then
+                       if tool == "ping" then
+                               local gateway = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $2 }'"))
+                               if gateway ~= "" then
+                                       if alt == "gateway" then
+                                               local cmd = "ping -c 3 -W 2 -I " .. ifdev .. " " .. gateway
+                                               res = cmd .. "\n\n" .. sys.exec(cmd)
+                                       else
+                                               local str = ut.trim(sys.exec("uci get -p /var/state mwan3." .. iface .. ".track_ip"))
+                                               if str ~= "" then
+                                                       for z in str:gmatch("[^ ]+") do
+                                                               local cmd = "ping -c 3 -W 2 -I " .. ifdev .. " " .. z
+                                                               res = res .. cmd .. "\n\n" .. sys.exec(cmd) .. "\n\n"
+                                                       end
+                                               else
+                                                       res = "No tracking IP addresses configured on " .. iface
+                                               end
+                                       end
+                               else
+                                       res = "No default gateway for " .. iface .. " found. Default route does not exist or is configured incorrectly"
+                               end
+                       elseif tool == "rulechk" then
+                               get_ifnum()
+                               local rule1 = sys.exec("ip rule | grep $(echo $((" .. ifnum .. " + 1000)))")
+                               local rule2 = sys.exec("ip rule | grep $(echo $((" .. ifnum .. " + 2000)))")
+                               if rule1 ~= "" and rule2 ~= "" then
+                                       res = "All required interface IP rules found:\n\n" .. rule1 .. rule2
+                               elseif rule1 ~= "" or rule2 ~= "" then
+                                       res = "Missing 1 of the 2 required interface IP rules\n\n\nRules found:\n\n" .. rule1 .. rule2
+                               else
+                                       res = "Missing both of the required interface IP rules"
+                               end
+                       elseif tool == "routechk" then
+                               get_ifnum()
+                               local table = sys.exec("ip route list table " .. ifnum)
+                               if table ~= "" then
+                                       res = "Interface routing table " .. ifnum .. " was found:\n\n" .. table
+                               else
+                                       res = "Missing required interface routing table " .. ifnum
+                               end
+                       elseif tool == "hotplug" then
+                               if alt == "ifup" then
+                                       os.execute("mwan3 ifup " .. iface)
+                                       res = "Hotplug ifup sent to interface " .. iface .. "..."
+                               else
+                                       os.execute("mwan3 ifdown " .. iface)
+                                       res = "Hotplug ifdown sent to interface " .. iface .. "..."
+                               end
+                       end
+               else
+                       res = "Unable to perform diagnostic tests on " .. iface .. ". There is no physical or virtual device associated with this interface"
+               end
+       end
+       if res ~= "" then
+               res = ut.trim(res)
+               rv.diagres = { }
+               dres = {}
+               dres[res] = #rv.diagres + 1
+               rv.diagres[dres[res]] = { diagresult = res }
+       end
+
+       luci.http.prepare_content("application/json")
+       luci.http.write_json(rv)
+end
+
+function mwan3_tshoot_data()
+       local rv = {    }
+
+       -- software versions
+       local wrtrelease = ut.trim(luci.version.distversion)
+               if wrtrelease ~= "" then
+                       wrtrelease = "OpenWrt - " .. wrtrelease
+               else
+                       wrtrelease = "OpenWrt - unknown"
+               end
+       local lucirelease = ut.trim(luci.version.luciversion)
+               if lucirelease ~= "" then
+                       lucirelease = "\nLuCI - " .. lucirelease
+               else
+                       lucirelease = "\nLuCI - unknown"
+               end
+       local mwan3version = ut.trim(sys.exec("opkg info mwan3 | grep Version | awk -F' ' '{ print $2 }'"))
+               if mwan3version ~= "" then
+                       mwan3version = "\n\nmwan3 - " .. mwan3version
+               else
+                       mwan3version = "\nmwan3 - unknown"
+               end
+       local mwan3lversion = ut.trim(sys.exec("opkg info luci-app-mwan3 | grep Version | awk -F' ' '{ print $2 }'"))
+               if mwan3lversion ~= "" then
+                       mwan3lversion = "\nluci-app-mwan3 - " .. mwan3lversion
+               else
+                       mwan3lversion = "\nluci-app-mwan3 - unknown"
+               end
+       local softrev = wrtrelease .. lucirelease .. mwan3version .. mwan3lversion
+       rv.mw3ver = { }
+       mwv = {}
+       mwv[softrev] = #rv.mw3ver + 1
+       rv.mw3ver[mwv[softrev]] = { mwan3v = softrev }
+
+       -- mwan3 config
+       local mwcg = ut.trim(sys.exec("cat /etc/config/mwan3"))
+               if mwcg == "" then
+                       mwcg = "No data found"
+               end
+       rv.mwan3config = { }
+       mwan3cfg = {}
+       mwan3cfg[mwcg] = #rv.mwan3config + 1
+       rv.mwan3config[mwan3cfg[mwcg]] = { mwn3cfg = mwcg }
+
+       -- network config
+       local netcg = ut.trim(sys.exec("cat /etc/config/network | sed -e 's/.*username.*/       USERNAME HIDDEN/' -e 's/.*password.*/   PASSWORD HIDDEN/'"))
+               if netcg == "" then
+                       netcg = "No data found"
+               end
+       rv.netconfig = { }
+       ncfg = {}
+       ncfg[netcg] = #rv.netconfig + 1
+       rv.netconfig[ncfg[netcg]] = { netcfg = netcg }
+
+       -- ifconfig
+       local ifcg = ut.trim(sys.exec("ifconfig"))
+               if ifcg == "" then
+                       ifcg = "No data found"
+               end
+       rv.ifconfig = { }
+       icfg = {}
+       icfg[ifcg] = #rv.ifconfig + 1
+       rv.ifconfig[icfg[ifcg]] = { ifcfg = ifcg }
+
+       -- route -n
+       local routeshow = ut.trim(sys.exec("route -n"))
+               if routeshow == "" then
+                       routeshow = "No data found"
+               end
+       rv.rtshow = { }
+       rshw = {}
+       rshw[routeshow] = #rv.rtshow + 1
+       rv.rtshow[rshw[routeshow]] = { iprtshow = routeshow }
+
+       -- ip rule show
+       local ipr = ut.trim(sys.exec("ip rule show"))
+               if ipr == "" then
+                       ipr = "No data found"
+               end
+       rv.iprule = { }
+       ipruleid = {}
+       ipruleid[ipr] = #rv.iprule + 1
+       rv.iprule[ipruleid[ipr]] = { rule = ipr }
+
+       -- ip route list table 1-250
+       local routelisting, rlstr = ut.trim(sys.exec("ip rule | sed 's/://g' | awk -F' ' '$1>=2001 && $1<=2250' | awk -F' ' '{ print $NF }'")), ""
+               if routelisting ~= "" then
+                       for line in routelisting:gmatch("[^\r\n]+") do
+                               rlstr = rlstr .. line .. "\n" .. sys.exec("ip route list table " .. line)
+                       end
+                       rlstr = ut.trim(rlstr)
+               else
+                       rlstr = "No data found"
+               end
+       rv.routelist = { }
+       rtlist = {}
+       rtlist[rlstr] = #rv.routelist + 1
+       rv.routelist[rtlist[rlstr]] = { iprtlist = rlstr }
+
+       -- default firewall output policy
+       local defout = ut.trim(sys.exec("uci get -p /var/state firewall.@defaults[0].output"))
+               if defout == "" then
+                       defout = "No data found"
+               end
+       rv.fidef = { }
+       fwdf = {}
+       fwdf[defout] = #rv.fidef + 1
+       rv.fidef[fwdf[defout]] = { firedef = defout }
+
+       -- iptables
+       local iptbl = ut.trim(sys.exec("iptables -L -t mangle -v -n"))
+               if iptbl == "" then
+                       iptbl = "No data found"
+               end
+       rv.iptables = { }
+       tables = {}
+       tables[iptbl] = #rv.iptables + 1
+       rv.iptables[tables[iptbl]] = { iptbls = iptbl }
+
+       luci.http.prepare_content("application/json")
+       luci.http.write_json(rv)
+end
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_hotplug.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_hotplug.lua
new file mode 100644 (file)
index 0000000..93e125c
--- /dev/null
@@ -0,0 +1,55 @@
+-- ------ hotplug script configuration ------ --
+
+fs = require "nixio.fs"
+sys = require "luci.sys"
+ut = require "luci.util"
+
+script = "/etc/hotplug.d/iface/16-mwan3custom"
+scriptbak = "/etc/hotplug.d/iface/16-mwan3custombak"
+
+if luci.http.formvalue("cbid.luci.1._restorebak") then -- restore button has been clicked
+       luci.http.redirect(luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug") .. "?restore=yes")
+elseif luci.http.formvalue("restore") == "yes" then -- restore script from backup
+       os.execute("cp -f " .. scriptbak .. " " .. script)
+end
+
+
+m5 = SimpleForm("luci", nil)
+       m5:append(Template("mwan3/mwan3_adv_hotplug")) -- highlight current tab
+
+f = m5:section(SimpleSection, nil,
+       translate("This section allows you to modify the contents of /etc/hotplug.d/iface/16-mwan3custom<br />" ..
+       "This is useful for running system commands and/or scripts based on interface ifup or ifdown hotplug events<br /><br />" ..
+       "Notes:<br />" ..
+       "The first line of the script must be &#34;#!/bin/sh&#34; without quotes<br />" ..
+       "Lines beginning with # are comments and are not executed<br /><br />" ..
+       "Available variables:<br />" ..
+       "$ACTION is the hotplug event (ifup, ifdown)<br />" ..
+       "$INTERFACE is the interface name (wan1, wan2, etc.)<br />" ..
+       "$DEVICE is the device name attached to the interface (eth0.1, eth1, etc.)"))
+
+
+restore = f:option(Button, "_restorebak", translate("Restore default hotplug script"))
+       restore.inputtitle = translate("Restore...")
+       restore.inputstyle = "apply"
+
+t = f:option(TextValue, "lines")
+       t.rmempty = true
+       t.rows = 20
+
+       function t.cfgvalue()
+               local hps = fs.readfile(script)
+               if not hps or hps == "" then -- if script does not exist or is blank restore from backup
+                       sys.call("cp -f " .. scriptbak .. " " .. script)
+                       return fs.readfile(script)
+               else
+                       return hps
+               end
+       end
+
+       function t.write(self, section, data) -- format and write new data to script
+               return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_mwan3.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_mwan3.lua
new file mode 100644 (file)
index 0000000..9eb0df5
--- /dev/null
@@ -0,0 +1,32 @@
+-- ------ mwan3 configuration ------ --
+
+ut = require "luci.util"
+
+mwan3file = "/etc/config/mwan3"
+
+
+m5 = SimpleForm("luci", nil)
+       m5:append(Template("mwan3/mwan3_adv_mwan3")) -- highlight current tab
+
+
+f = m5:section(SimpleSection, nil,
+       translate("This section allows you to modify the contents of /etc/config/mwan3"))
+
+t = f:option(TextValue, "lines")
+       t.rmempty = true
+       t.rows = 20
+
+       function t.cfgvalue()
+               return nixio.fs.readfile(mwan3file) or ""
+       end
+
+       function t.write(self, section, data) -- format and write new data to script
+               return nixio.fs.writefile(mwan3file, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
+       end
+
+       function f.handle(self, state, data)
+               return true
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_network.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_network.lua
new file mode 100644 (file)
index 0000000..fee6a07
--- /dev/null
@@ -0,0 +1,32 @@
+-- ------ network configuration ------ --
+
+ut = require "luci.util"
+
+netfile = "/etc/config/network"
+
+
+m5 = SimpleForm("networkconf", nil)
+       m5:append(Template("mwan3/mwan3_adv_network")) -- highlight current tab
+
+
+f = m5:section(SimpleSection, nil,
+       translate("This section allows you to modify the contents of /etc/config/network"))
+
+t = f:option(TextValue, "lines")
+       t.rmempty = true
+       t.rows = 20
+
+       function t.cfgvalue()
+               return nixio.fs.readfile(netfile) or ""
+       end
+
+       function t.write(self, section, data) -- format and write new data to script
+               return nixio.fs.writefile(netfile, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
+       end
+
+       function f.handle(self, state, data)
+               return true
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interface.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interface.lua
new file mode 100644 (file)
index 0000000..3d504a2
--- /dev/null
@@ -0,0 +1,266 @@
+-- ------ extra functions ------ --
+
+function iface_check() -- find issues with too many interfaces, reliability and metric
+       uci.cursor():foreach("mwan3", "interface",
+               function (section)
+                       local ifname = section[".name"]
+                       ifnum = ifnum+1 -- count number of mwan3 interfaces configured
+                       -- create list of metrics for none and duplicate checking
+                       local metlkp = ut.trim(sys.exec("uci get -p /var/state network." .. ifname .. ".metric"))
+                       if metlkp == "" then
+                               err_found = 1
+                               err_nomet_list = err_nomet_list .. ifname .. " "
+                       else
+                               metric_list = metric_list .. ifname .. " " .. metlkp .. "\n"
+                       end
+                       -- check if any interfaces have a higher reliability requirement than tracking IPs configured
+                       local tipnum = tonumber(ut.trim(sys.exec("echo $(uci get -p /var/state mwan3." .. ifname .. ".track_ip) | wc -w")))
+                       if tipnum > 0 then
+                               local relnum = tonumber(ut.trim(sys.exec("uci get -p /var/state mwan3." .. ifname .. ".reliability")))
+                               if relnum and relnum > tipnum then
+                                       err_found = 1
+                                       err_rel_list = err_rel_list .. ifname .. " "
+                               end
+                       end
+                       -- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table
+                       if ut.trim(sys.exec("uci get -p /var/state network." .. ifname)) == "interface" then
+                               local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. ifname .. ".ifname"))
+                               if ifdev == "uci: Entry not found" or ifdev == "" then
+                                       err_found = 1
+                                       err_netcfg_list = err_netcfg_list .. ifname .. " "
+                                       err_route_list = err_route_list .. ifname .. " "
+                               else
+                                       local rtcheck = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $1 }'"))
+                                       if rtcheck == "" then
+                                               err_found = 1
+                                               err_route_list = err_route_list .. ifname .. " "
+                                       end
+                               end
+                       else
+                               err_found = 1
+                               err_netcfg_list = err_netcfg_list .. ifname .. " "
+                               err_route_list = err_route_list .. ifname .. " "
+                       end
+               end
+       )
+       -- check if any interfaces have duplicate metrics
+       local metric_dupnums = sys.exec("echo '" .. metric_list .. "' | awk -F' ' '{ print $2 }' | uniq -d")
+       if metric_dupnums ~= "" then
+               err_found = 1
+               local metric_dupes = ""
+               for line in metric_dupnums:gmatch("[^\r\n]+") do
+                       metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk -F' ' '{ print $1 }'")
+                       err_dupmet_list = err_dupmet_list .. metric_dupes
+               end
+               err_dupmet_list = sys.exec("echo '" .. err_dupmet_list .. "' | tr '\n' ' '")
+       end
+end
+
+function iface_warn() -- display status and warning messages at the top of the page
+       local warns = ""
+       if ifnum <= 250 then
+               warns = "<strong>There are currently " .. ifnum .. " of 250 supported interfaces configured</strong>"
+       else
+               warns = "<font color=\"ff0000\"><strong>WARNING: " .. ifnum .. " interfaces are configured exceeding the maximum of 250!</strong></font>"
+       end
+       if err_rel_list ~= " " then
+               warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have a higher reliability requirement than there are tracking IP addresses!</strong></font>"
+       end
+       if err_route_list ~= " " then
+               warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have no default route in the main routing table!</strong></font>"
+       end
+       if err_netcfg_list ~= " " then
+               warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces are configured incorrectly or not at all in /etc/config/network!</strong></font>"
+       end
+       if err_nomet_list ~= " " then
+               warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have no metric configured in /etc/config/network!</strong></font>"
+       end
+       if err_dupmet_list ~= " " then
+               warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have duplicate metrics configured in /etc/config/network!</strong></font>"
+       end
+       return warns
+end
+
+-- ------ interface configuration ------ --
+
+dsp = require "luci.dispatcher"
+sys = require "luci.sys"
+ut = require "luci.util"
+
+ifnum = 0
+metric_list = ""
+err_found = 0
+err_dupmet_list = " "
+err_netcfg_list = " "
+err_nomet_list = " "
+err_rel_list = " "
+err_route_list = " "
+iface_check()
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Interface Configuration"),
+       translate(iface_warn()))
+       m5:append(Template("mwan3/mwan3_config_css"))
+
+
+mwan_interface = m5:section(TypedSection, "interface", translate("Interfaces"),
+       translate("MWAN3 supports up to 250 physical and/or logical interfaces<br />" ..
+       "MWAN3 requires that all interfaces have a unique metric configured in /etc/config/network<br />" ..
+       "Names must match the interface name found in /etc/config/network (see advanced tab)<br />" ..
+       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
+       "Interfaces may not share the same name as configured members, policies or rules"))
+       mwan_interface.addremove = true
+       mwan_interface.dynamic = false
+       mwan_interface.sectionhead = "Interface"
+       mwan_interface.sortable = true
+       mwan_interface.template = "cbi/tblsection"
+       mwan_interface.extedit = dsp.build_url("admin", "network", "mwan3", "configuration", "interface", "%s")
+       function mwan_interface.create(self, section)
+               TypedSection.create(self, section)
+               m5.uci:save("mwan3")
+               luci.http.redirect(dsp.build_url("admin", "network", "mwan3", "configuration", "interface", section))
+       end
+
+
+enabled = mwan_interface:option(DummyValue, "enabled", translate("Enabled"))
+       enabled.rawhtml = true
+       function enabled.cfgvalue(self, s)
+               if self.map:get(s, "enabled") == "1" then
+                       return "Yes"
+               else
+                       return "No"
+               end
+       end
+
+track_ip = mwan_interface:option(DummyValue, "track_ip", translate("Tracking IP"))
+       track_ip.rawhtml = true
+       function track_ip.cfgvalue(self, s)
+               local str = ""
+               tracked = self.map:get(s, "track_ip")
+               if tracked then
+                       for k,v in pairs(tracked) do
+                               str = str .. v .. "<br />"
+                       end
+                       return str
+               else
+                       return "&#8212;"
+               end
+       end
+
+reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracking reliability"))
+       reliability.rawhtml = true
+       function reliability.cfgvalue(self, s)
+               if tracked then
+                       return self.map:get(s, "reliability") or "&#8212;"
+               else
+                       return "&#8212;"
+               end
+       end
+
+count = mwan_interface:option(DummyValue, "count", translate("Ping count"))
+       count.rawhtml = true
+       function count.cfgvalue(self, s)
+               if tracked then
+                       return self.map:get(s, "count") or "&#8212;"
+               else
+                       return "&#8212;"
+               end
+       end
+
+timeout = mwan_interface:option(DummyValue, "timeout", translate("Ping timeout"))
+       timeout.rawhtml = true
+       function timeout.cfgvalue(self, s)
+               if tracked then
+                       local tcheck = self.map:get(s, "timeout")
+                       if tcheck then
+                               return tcheck .. "s"
+                       else
+                               return "&#8212;"
+                       end
+               else
+                       return "&#8212;"
+               end
+       end
+
+interval = mwan_interface:option(DummyValue, "interval", translate("Ping interval"))
+       interval.rawhtml = true
+       function interval.cfgvalue(self, s)
+               if tracked then
+                       local icheck = self.map:get(s, "interval")
+                       if icheck then
+                               return icheck .. "s"
+                       else
+                               return "&#8212;"
+                       end
+               else
+                       return "&#8212;"
+               end
+       end
+
+down = mwan_interface:option(DummyValue, "down", translate("Interface down"))
+       down.rawhtml = true
+       function down.cfgvalue(self, s)
+               if tracked then
+                       return self.map:get(s, "down") or "&#8212;"
+               else
+                       return "&#8212;"
+               end
+       end
+
+up = mwan_interface:option(DummyValue, "up", translate("Interface up"))
+       up.rawhtml = true
+       function up.cfgvalue(self, s)
+               if tracked then
+                       return self.map:get(s, "up") or "&#8212;"
+               else
+                       return "&#8212;"
+               end
+       end
+
+metric = mwan_interface:option(DummyValue, "metric", translate("Metric"))
+       metric.rawhtml = true
+       function metric.cfgvalue(self, s)
+               local metcheck = sys.exec("uci get -p /var/state network." .. s .. ".metric")
+               if metcheck ~= "" then
+                       return metcheck
+               else
+                       return "&#8212;"
+               end
+       end
+
+errors = mwan_interface:option(DummyValue, "errors", translate("Errors"))
+       errors.rawhtml = true
+       function errors.cfgvalue(self, s)
+               if err_found == 1 then
+                       local mouseover, linebrk = "", ""
+                       if string.find(err_rel_list, " " .. s .. " ") then
+                               mouseover = "Higher reliability requirement than there are tracking IP addresses"
+                               linebrk = "&#10;&#10;"
+                       end
+                       if string.find(err_route_list, " " .. s .. " ") then
+                               mouseover = mouseover .. linebrk .. "No default route in the main routing table"
+                               linebrk = "&#10;&#10;"
+                       end
+                       if string.find(err_netcfg_list, " " .. s .. " ") then
+                               mouseover = mouseover .. linebrk .. "Configured incorrectly or not at all in /etc/config/network"
+                               linebrk = "&#10;&#10;"
+                       end
+                       if string.find(err_nomet_list, " " .. s .. " ") then
+                               mouseover = mouseover .. linebrk .. "No metric configured in /etc/config/network"
+                               linebrk = "&#10;&#10;"
+                       end
+                       if string.find(err_dupmet_list, " " .. s .. " ") then
+                               mouseover = mouseover .. linebrk .. "Duplicate metric configured in /etc/config/network"
+                       end
+                       if mouseover == "" then
+                               return ""
+                       else
+                               return "<span title=\"" .. mouseover .. "\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
+                       end
+               else
+                       return ""
+               end
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interfaceconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interfaceconfig.lua
new file mode 100644 (file)
index 0000000..2119c04
--- /dev/null
@@ -0,0 +1,191 @@
+-- ------ extra functions ------ --
+
+function iface_check()
+       metcheck = ut.trim(sys.exec("uci get -p /var/state network." .. arg[1] .. ".metric"))
+       if metcheck == "" then -- no metric
+               err_nomet = 1
+       else -- if metric exists create list of interface metrics to compare against for duplicates
+               uci.cursor():foreach("mwan3", "interface",
+                       function (section)
+                               local metlkp = ut.trim(sys.exec("uci get -p /var/state network." .. section[".name"] .. ".metric"))
+                               metric_list = metric_list .. section[".name"] .. " " .. metlkp .. "\n"
+                       end
+               )
+               -- compare metric against list
+               local metric_dupnums, metric_dupes = sys.exec("echo '" .. metric_list .. "' | awk -F' ' '{ print $2 }' | uniq -d"), ""
+               for line in metric_dupnums:gmatch("[^\r\n]+") do
+                       metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk -F' ' '{ print $1 }'")
+                       err_dupmet_list = err_dupmet_list .. metric_dupes
+               end
+               if sys.exec("echo '" .. err_dupmet_list .. "' | grep -w " .. arg[1]) ~= "" then
+                       err_dupmet = 1
+               end
+       end
+       -- check if this interface has a higher reliability requirement than track IPs configured
+       local tipnum = tonumber(ut.trim(sys.exec("echo $(uci get -p /var/state mwan3." .. arg[1] .. ".track_ip) | wc -w")))
+       if tipnum > 0 then
+               local relnum = tonumber(ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".reliability")))
+               if relnum and relnum > tipnum then
+                       err_reliability = 1
+               end
+       end
+       -- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table
+       if ut.trim(sys.exec("uci get -p /var/state network." .. arg[1])) == "interface" then
+               local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. arg[1] .. ".ifname"))
+               if ifdev == "uci: Entry not found" or ifdev == "" then
+                       err_netcfg = 1
+                       err_route = 1
+               else
+                       local rtcheck = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $1 }'"))
+                       if rtcheck == "" then
+                               err_route = 1
+                       end
+               end
+       else
+               err_netcfg = 1
+               err_route = 1
+       end
+end
+
+function iface_warn() -- display warning messages at the top of the page
+       local warns, linebrk = "", ""
+       if err_reliability == 1 then
+               warns = "<font color=\"ff0000\"><strong>WARNING: this interface has a higher reliability requirement than there are tracking IP addresses!</strong></font>"
+               linebrk = "<br /><br />"
+       end
+       if err_route == 1 then
+               warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this interface has no default route in the main routing table!</strong></font>"
+               linebrk = "<br /><br />"
+       end
+       if err_netcfg == 1 then
+               warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this interface is configured incorrectly or not at all in /etc/config/network!</strong></font>"
+               linebrk = "<br /><br />"
+       end
+       if err_nomet == 1 then
+               warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this interface has no metric configured in /etc/config/network!</strong></font>"
+       elseif err_dupmet == 1 then
+               warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this and other interfaces have duplicate metrics configured in /etc/config/network!</strong></font>"
+       end
+       return warns
+end
+
+-- ------ interface configuration ------ --
+
+dsp = require "luci.dispatcher"
+sys = require "luci.sys"
+ut = require "luci.util"
+arg[1] = arg[1] or ""
+
+metcheck = ""
+metric_list = ""
+err_dupmet_list = ""
+err_rel_list = ""
+err_nomet = 0
+err_dupmet = 0
+err_route = 0
+err_netcfg = 0
+err_reliability = 0
+iface_check()
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Interface Configuration - " .. arg[1]),
+       translate(iface_warn()))
+       m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "interface")
+
+
+mwan_interface = m5:section(NamedSection, arg[1], "interface", "")
+       mwan_interface.addremove = false
+       mwan_interface.dynamic = false
+
+
+enabled = mwan_interface:option(ListValue, "enabled", translate("Enabled"))
+       enabled.default = "1"
+       enabled:value("1", translate("Yes"))
+       enabled:value("0", translate("No"))
+
+track_ip = mwan_interface:option(DynamicList, "track_ip", translate("Tracking IP"),
+       translate("This IP address will be pinged to dermine if the link is up or down. Leave blank to assume interface is always online"))
+       track_ip.datatype = "ipaddr"
+
+reliability = mwan_interface:option(Value, "reliability", translate("Tracking reliability"),
+       translate("Acceptable values: 1-100. This many Tracking IP addresses must respond for the link to be deemed up"))
+       reliability.datatype = "range(1, 100)"
+       reliability.default = "1"
+
+count = mwan_interface:option(ListValue, "count", translate("Ping count"))
+       count.default = "1"
+       count:value("1")
+       count:value("2")
+       count:value("3")
+       count:value("4")
+       count:value("5")
+
+timeout = mwan_interface:option(ListValue, "timeout", translate("Ping timeout"))
+       timeout.default = "2"
+       timeout:value("1", translate("1 second"))
+       timeout:value("2", translate("2 seconds"))
+       timeout:value("3", translate("3 seconds"))
+       timeout:value("4", translate("4 seconds"))
+       timeout:value("5", translate("5 seconds"))
+       timeout:value("6", translate("6 seconds"))
+       timeout:value("7", translate("7 seconds"))
+       timeout:value("8", translate("8 seconds"))
+       timeout:value("9", translate("9 seconds"))
+       timeout:value("10", translate("10 seconds"))
+
+interval = mwan_interface:option(ListValue, "interval", translate("Ping interval"))
+       interval.default = "5"
+       interval:value("1", translate("1 second"))
+       interval:value("3", translate("3 seconds"))
+       interval:value("5", translate("5 seconds"))
+       interval:value("10", translate("10 seconds"))
+       interval:value("20", translate("20 seconds"))
+       interval:value("30", translate("30 seconds"))
+       interval:value("60", translate("1 minute"))
+       interval:value("300", translate("5 minutes"))
+       interval:value("600", translate("10 minutes"))
+       interval:value("900", translate("15 minutes"))
+       interval:value("1800", translate("30 minutes"))
+       interval:value("3600", translate("1 hour"))
+
+down = mwan_interface:option(ListValue, "down", translate("Interface down"),
+       translate("Interface will be deemed down after this many failed ping tests"))
+       down.default = "3"
+       down:value("1")
+       down:value("2")
+       down:value("3")
+       down:value("4")
+       down:value("5")
+       down:value("6")
+       down:value("7")
+       down:value("8")
+       down:value("9")
+       down:value("10")
+
+up = mwan_interface:option(ListValue, "up", translate("Interface up"),
+       translate("Downed interface will be deemed up after this many successful ping tests"))
+       up.default = "3"
+       up:value("1")
+       up:value("2")
+       up:value("3")
+       up:value("4")
+       up:value("5")
+       up:value("6")
+       up:value("7")
+       up:value("8")
+       up:value("9")
+       up:value("10")
+
+metric = mwan_interface:option(DummyValue, "metric", translate("Metric"),
+       translate("This displays the metric assigned to this interface in /etc/config/network"))
+       metric.rawhtml = true
+       function metric.cfgvalue(self, s)
+               if err_nomet == 0 then
+                       return metcheck
+               else
+                       return "&#8212;"
+               end
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_member.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_member.lua
new file mode 100644 (file)
index 0000000..68b9549
--- /dev/null
@@ -0,0 +1,46 @@
+-- ------ member configuration ------ --
+
+ds = require "luci.dispatcher"
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Member Configuration"))
+       m5:append(Template("mwan3/mwan3_config_css"))
+
+
+mwan_member = m5:section(TypedSection, "member", translate("Members"),
+       translate("Members are profiles attaching a metric and weight to an MWAN3 interface<br />" ..
+       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
+       "Members may not share the same name as configured interfaces, policies or rules"))
+       mwan_member.addremove = true
+       mwan_member.dynamic = false
+       mwan_member.sectionhead = "Member"
+       mwan_member.sortable = true
+       mwan_member.template = "cbi/tblsection"
+       mwan_member.extedit = ds.build_url("admin", "network", "mwan3", "configuration", "member", "%s")
+       function mwan_member.create(self, section)
+               TypedSection.create(self, section)
+               m5.uci:save("mwan3")
+               luci.http.redirect(ds.build_url("admin", "network", "mwan3", "configuration", "member", section))
+       end
+
+
+interface = mwan_member:option(DummyValue, "interface", translate("Interface"))
+       interface.rawhtml = true
+       function interface.cfgvalue(self, s)
+               return self.map:get(s, "interface") or "&#8212;"
+       end
+
+metric = mwan_member:option(DummyValue, "metric", translate("Metric"))
+       metric.rawhtml = true
+       function metric.cfgvalue(self, s)
+               return self.map:get(s, "metric") or "1"
+       end
+
+weight = mwan_member:option(DummyValue, "weight", translate("Weight"))
+       weight.rawhtml = true
+       function weight.cfgvalue(self, s)
+               return self.map:get(s, "weight") or "1"
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_memberconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_memberconfig.lua
new file mode 100644 (file)
index 0000000..8ea7d98
--- /dev/null
@@ -0,0 +1,47 @@
+-- ------ extra functions ------ --
+
+function cbi_add_interface(field)
+       uci.cursor():foreach("mwan3", "interface",
+               function (section)
+                       field:value(section[".name"])
+               end
+       )
+end
+
+-- ------ member configuration ------ --
+
+dsp = require "luci.dispatcher"
+arg[1] = arg[1] or ""
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Member Configuration - ") .. arg[1])
+       m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "member")
+
+
+mwan_member = m5:section(NamedSection, arg[1], "member", "")
+       mwan_member.addremove = false
+       mwan_member.dynamic = false
+
+
+interface = mwan_member:option(Value, "interface", translate("Interface"))
+       cbi_add_interface(interface)
+
+metric = mwan_member:option(Value, "metric", translate("Metric"),
+       translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
+       metric.datatype = "range(1, 1000)"
+
+weight = mwan_member:option(Value, "weight", translate("Weight"),
+       translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
+       weight.datatype = "range(1, 1000)"
+
+
+-- ------ currently configured interfaces ------ --
+
+mwan_interface = m5:section(TypedSection, "interface", translate("Currently Configured Interfaces"))
+       mwan_interface.addremove = false
+       mwan_interface.dynamic = false
+       mwan_interface.sortable = false
+       mwan_interface.template = "cbi/tblsection"
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policy.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policy.lua
new file mode 100644 (file)
index 0000000..02471b9
--- /dev/null
@@ -0,0 +1,82 @@
+-- ------ extra functions ------ --
+
+function policy_check() -- check to see if any policy names exceed the maximum of 15 characters
+       uci.cursor():foreach("mwan3", "policy",
+               function (section)
+                       if string.len(section[".name"]) > 15 then
+                               toolong = 1
+                               err_name_list = err_name_list .. section[".name"] .. " "
+                       end
+               end
+       )
+end
+
+function policy_warn() -- display status and warning messages at the top of the page
+       if toolong == 1 then
+               return "<font color=\"ff0000\"><strong>WARNING: Some policies have names exceeding the maximum of 15 characters!</strong></font>"
+       else
+               return ""
+       end
+end
+
+-- ------ policy configuration ------ --
+
+ds = require "luci.dispatcher"
+sys = require "luci.sys"
+
+toolong = 0
+err_name_list = " "
+policy_check()
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Policy Configuration"),
+       translate(policy_warn()))
+       m5:append(Template("mwan3/mwan3_config_css"))
+
+
+mwan_policy = m5:section(TypedSection, "policy", translate("Policies"),
+       translate("Policies are profiles grouping one or more members controlling how MWAN3 distributes traffic<br />" ..
+       "Member interfaces with lower metrics are used first. Interfaces with the same metric load-balance<br />" ..
+       "Load-balanced member interfaces distribute more traffic out those with higher weights<br />" ..
+       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be 15 characters or less<br />" ..
+       "Policies may not share the same name as configured interfaces, members or rules"))
+       mwan_policy.addremove = true
+       mwan_policy.dynamic = false
+       mwan_policy.sectionhead = "Policy"
+       mwan_policy.sortable = true
+       mwan_policy.template = "cbi/tblsection"
+       mwan_policy.extedit = ds.build_url("admin", "network", "mwan3", "configuration", "policy", "%s")
+       function mwan_policy.create(self, section)
+               TypedSection.create(self, section)
+               m5.uci:save("mwan3")
+               luci.http.redirect(ds.build_url("admin", "network", "mwan3", "configuration", "policy", section))
+       end
+
+
+use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned"))
+       use_member.rawhtml = true
+       function use_member.cfgvalue(self, s)
+               local tab, str = self.map:get(s, "use_member"), ""
+               if tab then
+                       for k,v in pairs(tab) do
+                               str = str .. v .. "<br />"
+                       end
+                       return str
+               else
+                       return "&#8212;"
+               end
+               
+       end
+
+errors = mwan_policy:option(DummyValue, "errors", translate("Errors"))
+       errors.rawhtml = true
+       function errors.cfgvalue(self, s)
+               if not string.find(err_name_list, " " .. s .. " ") then
+                       return ""
+               else
+                       return "<span title=\"Name exceeds 15 characters\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
+               end
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policyconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policyconfig.lua
new file mode 100644 (file)
index 0000000..a6523ad
--- /dev/null
@@ -0,0 +1,58 @@
+-- ------ extra functions ------ --
+
+function policy_check() -- check to see if this policy's name exceed the maximum of 15 characters
+       polchar = string.len(arg[1])
+       if polchar > 15 then
+               toolong = 1
+       end
+end
+
+function policy_warn() -- display status and warning messages at the top of the page
+       if toolong == 1 then
+               return "<font color=\"ff0000\"><strong>WARNING: this policy's name is " .. polchar .. " characters exceeding the maximum of 15!</strong></font>"
+       else
+               return ""
+       end
+end
+
+function cbi_add_member(field)
+       uci.cursor():foreach("mwan3", "member",
+               function (section)
+                       field:value(section[".name"])
+               end
+       )
+end
+
+-- ------ policy configuration ------ --
+
+dsp = require "luci.dispatcher"
+arg[1] = arg[1] or ""
+
+toolong = 0
+policy_check()
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Policy Configuration - " .. arg[1]),
+       translate(policy_warn()))
+       m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "policy")
+
+
+mwan_policy = m5:section(NamedSection, arg[1], "policy", "")
+       mwan_policy.addremove = false
+       mwan_policy.dynamic = false
+
+
+use_member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
+       cbi_add_member(use_member)
+
+
+-- ------ currently configured members ------ --
+
+mwan_member = m5:section(TypedSection, "member", translate("Currently Configured Members"))
+       mwan_member.addremove = false
+       mwan_member.dynamic = false
+       mwan_member.sortable = false
+       mwan_member.template = "cbi/tblsection"
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_rule.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_rule.lua
new file mode 100644 (file)
index 0000000..efae81b
--- /dev/null
@@ -0,0 +1,109 @@
+-- ------ extra functions ------ --
+
+function rule_check() -- determine if rules needs a proper protocol configured
+       uci.cursor():foreach("mwan3", "rule",
+               function (section)
+                       local sport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. section[".name"] .. ".src_port"))
+                       local dport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. section[".name"] .. ".dest_port"))
+                       if sport ~= "" or dport ~= "" then -- ports configured
+                               local proto = ut.trim(sys.exec("uci get -p /var/state mwan3." .. section[".name"] .. ".proto"))
+                               if proto == "" or proto == "all" then -- no or improper protocol
+                                       err_proto_list = err_proto_list .. section[".name"] .. " "
+                               end
+                       end
+               end
+       )
+end
+
+function rule_warn() -- display warning messages at the top of the page
+       if err_proto_list ~= " " then
+               return "<font color=\"ff0000\"><strong>WARNING: some rules have a port configured with no or improper protocol specified! Please configure a specific protocol!</strong></font>"
+       else
+               return ""
+       end
+end
+
+-- ------ rule configuration ------ --
+
+dsp = require "luci.dispatcher"
+sys = require "luci.sys"
+ut = require "luci.util"
+
+err_proto = 0
+err_proto_list = " "
+rule_check()
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Traffic Rule Configuration"),
+       translate(rule_warn()))
+       m5:append(Template("mwan3/mwan3_config_css"))
+
+
+mwan_rule = m5:section(TypedSection, "rule", translate("Traffic Rules"),
+       translate("Rules specify which traffic will use a particular MWAN3 policy based on IP address, port or protocol<br />" ..
+       "Rules are matched from top to bottom. Rules below a matching rule are ignored. Traffic not matching any rule is routed using the main routing table<br />" ..
+       "Traffic destined for known (other than default) networks is handled by the main routing table. Traffic matching a rule, but all WAN interfaces for that policy are down will be blackholed<br />" ..
+       "Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
+       "Rules may not share the same name as configured interfaces, members or policies"))
+       mwan_rule.addremove = true
+       mwan_rule.anonymous = false
+       mwan_rule.dynamic = false
+       mwan_rule.sectionhead = "Rule"
+       mwan_rule.sortable = true
+       mwan_rule.template = "cbi/tblsection"
+       mwan_rule.extedit = dsp.build_url("admin", "network", "mwan3", "configuration", "rule", "%s")
+       function mwan_rule.create(self, section)
+               TypedSection.create(self, section)
+               m5.uci:save("mwan3")
+               luci.http.redirect(dsp.build_url("admin", "network", "mwan3", "configuration", "rule", section))
+       end
+
+
+src_ip = mwan_rule:option(DummyValue, "src_ip", translate("Source address"))
+       src_ip.rawhtml = true
+       function src_ip.cfgvalue(self, s)
+               return self.map:get(s, "src_ip") or "&#8212;"
+       end
+
+src_port = mwan_rule:option(DummyValue, "src_port", translate("Source port"))
+       src_port.rawhtml = true
+       function src_port.cfgvalue(self, s)
+               return self.map:get(s, "src_port") or "&#8212;"
+       end
+
+dest_ip = mwan_rule:option(DummyValue, "dest_ip", translate("Destination address"))
+       dest_ip.rawhtml = true
+       function dest_ip.cfgvalue(self, s)
+               return self.map:get(s, "dest_ip") or "&#8212;"
+       end
+
+dest_port = mwan_rule:option(DummyValue, "dest_port", translate("Destination port"))
+       dest_port.rawhtml = true
+       function dest_port.cfgvalue(self, s)
+               return self.map:get(s, "dest_port") or "&#8212;"
+       end
+
+proto = mwan_rule:option(DummyValue, "proto", translate("Protocol"))
+       proto.rawhtml = true
+       function proto.cfgvalue(self, s)
+               return self.map:get(s, "proto") or "all"
+       end
+
+use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned"))
+       use_policy.rawhtml = true
+       function use_policy.cfgvalue(self, s)
+               return self.map:get(s, "use_policy") or "&#8212;"
+       end
+
+errors = mwan_rule:option(DummyValue, "errors", translate("Errors"))
+       errors.rawhtml = true
+       function errors.cfgvalue(self, s)
+               if not string.find(err_proto_list, " " .. s .. " ") then
+                       return ""
+               else
+                       return "<span title=\"No protocol specified\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
+               end
+       end
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_ruleconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_ruleconfig.lua
new file mode 100644 (file)
index 0000000..e83fa62
--- /dev/null
@@ -0,0 +1,99 @@
+-- ------ extra functions ------ --
+
+function rule_check() -- determine if rule needs a protocol specified
+       local sport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".src_port"))
+       local dport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".dest_port"))
+       if sport ~= "" or dport ~= "" then -- ports configured
+               local proto = ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".proto"))
+               if proto == "" or proto == "all" then -- no or improper protocol
+                       err_proto = 1
+               end
+       end
+end
+
+function rule_warn() -- display warning message at the top of the page
+       if err_proto == 1 then
+               return "<font color=\"ff0000\"><strong>WARNING: this rule is incorrectly configured with no or improper protocol specified! Please configure a specific protocol!</strong></font>"
+       else
+               return ""
+       end
+end
+
+function cbi_add_policy(field)
+       uci.cursor():foreach("mwan3", "policy",
+               function (section)
+                       field:value(section[".name"])
+               end
+       )
+end
+
+function cbi_add_protocol(field)
+       local protos = ut.trim(sys.exec("cat /etc/protocols | grep '    # ' | awk -F' ' '{print $1}' | grep -vw -e 'ip' -e 'tcp' -e 'udp' -e 'icmp' -e 'esp' | grep -v 'ipv6' | sort | tr '\n' ' '"))
+       for p in string.gmatch(protos, "%S+") do
+               field:value(p)
+       end
+end
+
+-- ------ rule configuration ------ --
+
+dsp = require "luci.dispatcher"
+sys = require "luci.sys"
+ut = require "luci.util"
+arg[1] = arg[1] or ""
+
+err_proto = 0
+rule_check()
+
+
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Rule Configuration - ") .. arg[1],
+       translate(rule_warn()))
+       m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "rule")
+
+
+mwan_rule = m5:section(NamedSection, arg[1], "rule", "")
+       mwan_rule.addremove = false
+       mwan_rule.dynamic = false
+
+
+src_ip = mwan_rule:option(Value, "src_ip", translate("Source address"),
+       translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"))
+       src_ip.datatype = ipaddr
+
+src_port = mwan_rule:option(Value, "src_port", translate("Source port"),
+       translate("May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or as a portrange (eg \"1024:2048\") without quotes"))
+
+dest_ip = mwan_rule:option(Value, "dest_ip", translate("Destination address"),
+       translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"))
+       dest_ip.datatype = ipaddr
+
+dest_port = mwan_rule:option(Value, "dest_port", translate("Destination port"),
+       translate("May be entered as a single or multiple port(s) (eg \"22\" or \"80,443\") or as a portrange (eg \"1024:2048\") without quotes"))
+
+proto = mwan_rule:option(Value, "proto", translate("Protocol"),
+       translate("View the contents of /etc/protocols for protocol descriptions"))
+       proto.default = "all"
+       proto.rmempty = false
+       proto:value("all")
+       proto:value("ip")
+       proto:value("tcp")
+       proto:value("udp")
+       proto:value("icmp")
+       proto:value("esp")
+       cbi_add_protocol(proto)
+
+use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned"))
+       cbi_add_policy(use_policy)
+       use_policy:value("unreachable")
+       use_policy:value("default")
+
+
+-- ------ currently configured policies ------ --
+
+mwan_policy = m5:section(TypedSection, "policy", translate("Currently Configured Policies"))
+       mwan_policy.addremove = false
+       mwan_policy.dynamic = false
+       mwan_policy.sortable = false
+       mwan_policy.template = "cbi/tblsection"
+
+
+return m5
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan3.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan3.htm
new file mode 100644 (file)
index 0000000..f510f15
--- /dev/null
@@ -0,0 +1 @@
+<%+mwan3/mwan3_status%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_diagnostics.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_diagnostics.htm
new file mode 100644 (file)
index 0000000..6d9abcb
--- /dev/null
@@ -0,0 +1,134 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
+</ul>
+
+<%
+       local uci = require "luci.model.uci"
+
+       str = ""
+       uci.cursor():foreach("mwan3", "interface",
+               function (section)
+                       str = str .. section[".name"] .. " "
+               end
+       )
+%>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       var stxhr = new XHR();
+
+       function update_status(tool, alt)
+       {
+               var iface = document.getElementById('mwan3iface').value;
+               var output = document.getElementById('diag_output');
+
+               if (tool == "service")
+                       {
+                               output.innerHTML =
+                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
+                                       "Waiting for MWAN3 to " + alt + "..."
+                               ;
+                       }
+                       else
+                       {
+                               output.innerHTML =
+                                       '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
+                                       "Waiting for diagnostic results..."
+                               ;
+                       }
+
+               output.parentNode.style.display = 'block';
+               output.style.display = 'inline';
+
+               stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "mwan3", "advanced")%>/diag_display' + '/' + iface + '/' + tool + '/' + alt, null,
+                       function(x, st)
+                       {
+                               if (st.diagres)
+                               {
+                                       output.innerHTML = String.format('<pre id="diag_output_css">%h</pre>', st.diagres[0].diagresult);
+                               }
+                               else
+                               {
+                                       var temp = '';
+                                       var ncint = 'No diagnostic results returned';
+                                       temp = String.format(
+                                               '<pre id="diag_output_css"><strong>%s</strong></pre>',
+                                                       ncint
+                                       );
+                                       output.innerHTML = temp;
+                               }
+                       }
+               );
+       }
+//]]></script>
+
+<div id="mwan3_diagnostics" class="cbi-map">
+       <fieldset id="diag_select" class="cbi-section">
+               <legend><%:MWAN3 Interface Diagnostics%></legend>
+               <select id="mwan3iface">
+                       <% for z in str:gmatch("[^ ]+") do -%><option value="<%=z%>"><%=z%></option><%- end %>
+               </select>
+               <div id="buttoncss">
+                       <input type="button" value="<%:Ping default gateway%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'gateway')" />
+                       <input type="button" value="<%:Ping tracking IP%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'track_ip')" />
+                       <input type="button" value="<%:Check IP rules%>" class="cbi-button cbi-button-apply" onclick="update_status('rulechk', null)" />
+                       <input type="button" value="<%:Check routing table%>" class="cbi-button cbi-button-apply" onclick="update_status('routechk', null)" />
+                       <input type="button" value="<%:Hotplug ifup%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifup')" />
+                       <input type="button" value="<%:Hotplug ifdown%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifdown')" />
+               </div>
+       </fieldset>
+       <fieldset id="diag_select" class="cbi-section">
+               <legend><%:MWAN3 Service Control%></legend>
+               <div id="buttoncss">
+                       <input type="button" value="<%:Restart MWAN3%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'restart')" />
+                       <input type="button" value="<%:Stop MWAN3%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'stop')" />
+                       <input type="button" value="<%:Start MWAN3%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'start')" />
+               </div>
+       </fieldset>
+       <fieldset class="cbi-section" style="display:none">
+               <legend><%:Diagnostic Results%></legend>
+               <div id="diag_output"></div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin-left: 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  #mwan3_diagnostics {
+       background-color: #FFFFFF;
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+  #diag_select {
+       padding: 12px 20px 20px 20px;
+  }
+  #mwan3iface {
+       float: left;
+       margin: 8px 20px 0px 0px;
+  }
+  #buttoncss {
+       display: table;
+       float: left;
+       text-align: left;
+  }
+  .cbi-button {
+       margin: 8px 20px 0px 0px;
+       min-width: 153px;
+  }
+  #diag_output_css {
+       padding: 20px;
+       text-align: left;
+  }
+</style>
+
+<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_hotplug.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_hotplug.htm
new file mode 100644 (file)
index 0000000..e90942b
--- /dev/null
@@ -0,0 +1,23 @@
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
+</ul>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin: 0px 0px 0px 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  .cbi-section-node {
+       margin-top: 20px;
+  }
+  .cbi-section {
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_mwan3.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_mwan3.htm
new file mode 100644 (file)
index 0000000..d11bdd7
--- /dev/null
@@ -0,0 +1,23 @@
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
+</ul>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin: 0px 0px 0px 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  .cbi-section-node {
+       margin-top: 20px;
+  }
+  .cbi-section {
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_network.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_network.htm
new file mode 100644 (file)
index 0000000..59dd4fa
--- /dev/null
@@ -0,0 +1,23 @@
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
+</ul>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin: 0px 0px 0px 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  .cbi-section-node {
+       margin-top: 20px;
+  }
+  .cbi-section {
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_troubleshoot.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_troubleshoot.htm
new file mode 100644 (file)
index 0000000..1a92ebd
--- /dev/null
@@ -0,0 +1,77 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
+</ul>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "advanced", "tshoot_display")%>', null,
+               function(x, st)
+               {
+                       var tx = document.getElementById('mwan3_tshoot_text');
+                       if (st.mw3ver)
+                       {
+                               var temp = '';
+                               var mwanvers = 'Software versions : <br /><br />';
+                               var mwan3cnfg = '<br /><br />Output of &#34;cat /etc/config/mwan3&#34; : <br /><br />';
+                               var netcnfg = '<br /><br />Output of &#34;cat /etc/config/network&#34; : <br /><br />';
+                               var ifcnfg = '<br /><br />Output of &#34;ifconfig&#34; : <br /><br />';
+                               var iproute = '<br /><br />Output of &#34;route -n&#34; : <br /><br />';
+                               var iprulesh = '<br /><br />Output of &#34;ip rule show&#34; : <br /><br />';
+                               var routelisttbl = '<br /><br />Output of &#34;ip route list table 1-250&#34; : <br /><br />';
+                               var firewalldef = '<br /><br />Firewall default output policy (must be ACCEPT) : <br /><br />';
+                               var iptable = '<br /><br />Output of &#34;iptables -L -t mangle -v -n&#34; : <br /><br />';
+
+                               temp = String.format(
+                                       '<pre><span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s<span class="tsht">%s</span>%s</pre>',
+                                               mwanvers, st.mw3ver[0].mwan3v, mwan3cnfg, st.mwan3config[0].mwn3cfg, netcnfg, st.netconfig[0].netcfg, ifcnfg, st.ifconfig[0].ifcfg, iproute, st.rtshow[0].iprtshow, iprulesh, st.iprule[0].rule, routelisttbl, st.routelist[0].iprtlist, firewalldef, st.fidef[0].firedef, iptable, st.iptables[0].iptbls
+                               );
+                               tx.innerHTML = temp;
+                       }
+                       else
+                       {
+                               var temp = '';
+                               var terror = 'Error collecting troubleshooting information';
+                               temp = String.format(
+                                       '<strong>%s</strong>',
+                                               terror
+                               );
+                               tx.innerHTML = temp;
+                       }
+               }
+       );
+//]]></script>
+
+<div id="tshoot_div">
+       <fieldset class="cbi-section">
+               <legend><%:Troubleshooting Data%></legend>
+               <div id="mwan3_tshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
+       </fieldset>
+</div>
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin-left: 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  #tshoot_div {
+       background-color: #FFFFFF;
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+  #mwan3_tshoot_text {
+       padding: 20px;
+       text-align: left;
+  }
+  .tsht {
+       background-color: rgb(78, 186, 241);
+  }
+</style>
+
+<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_config_css.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_config_css.htm
new file mode 100644 (file)
index 0000000..303fa20
--- /dev/null
@@ -0,0 +1,34 @@
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin-left: 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  table td {  /*cells showing the configuration values*/
+       padding: 0px;
+       text-align: center;
+       vertical-align: middle;
+  }
+  table th {  /*column for configuration section name*/
+       padding: 0px;
+       text-align: center;
+       vertical-align: middle;
+  }
+  table tbody th {  /*column for configuration section name*/
+       padding: 0px;
+       vertical-align: middle;
+  }
+  .cbi-section-node table div {  /*rows*/
+       padding-top: 5px;
+  }
+  table.cbi-section-table td.cbi-section-table-cell {  /*sort buttons column*/
+       text-align: center;
+  }
+  .cbi-section h3 {
+       color: rgb(85, 85, 85);
+       font-family: Trebuchet MS,Verdana,sans-serif;
+       font-style: italic;
+       font-weight: normal;
+  }
+</style>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_detail.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_detail.htm
new file mode 100644 (file)
index 0000000..920a20b
--- /dev/null
@@ -0,0 +1,62 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview")%>"><%:Interface Status%></a></li>
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview/over_detail")%>"><%:Detailed Status%></a></li>
+</ul>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "overview", "detail_status")%>', null,
+               function(x, st)
+               {
+                       var tx = document.getElementById('mwan3_detail_text');
+                       if (st.mwan3dst)
+                       {
+                               var temp = '';
+                               temp = String.format(
+                                       '<pre>%s</pre>',
+                                               st.mwan3dst[0].detailstat
+                               );
+                               tx.innerHTML = temp;
+                       }
+                       else
+                       {
+                               var temp = '';
+                               var nslg = 'No detailed status information available';
+                               temp = String.format(
+                                       '<strong>%s</strong>',
+                                               nslg
+                               );
+                               tx.innerHTML = temp;
+                       }
+               }
+       );
+//]]></script>
+
+<div id="mwan3_detail_status">
+       <fieldset class="cbi-section">
+               <legend><%:MWAN3 Multi-WAN Detailed Status%></legend>
+               <div id="mwan3_detail_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin-left: 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  #mwan3_detail_status {
+       border: 1px dotted #555555;
+       background-color: #FFFFFF;
+       padding: 20px;
+  }
+  #mwan3_detail_text {
+       padding: 20px;
+       text-align: left;
+  }
+</style>
+
+<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_interface.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_interface.htm
new file mode 100644 (file)
index 0000000..2e846a7
--- /dev/null
@@ -0,0 +1,146 @@
+<%+header%>
+
+<ul class="cbi-tabmenu">
+       <li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview")%>"><%:Interface Status%></a></li>
+       <li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview/over_detail")%>"><%:Detailed Status%></a></li>
+</ul>
+
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "overview", "iface_status")%>', null,
+               function(x, st)
+               {
+                       var tx = document.getElementById('mwan3_status_text');
+                       if (st.wans)
+                       {
+                               var temp = '';
+
+                               for( var i = 0; i < st.wans.length; i++ )
+                               {
+                                       var stat = '';
+                                       var cssc = '';
+
+                                       switch (st.wans[i].status)
+                                       {
+                                               case 'on':
+                                                       stat = 'Online (tracking active)';
+                                                       cssc = 'wanon';
+                                                       break;
+
+                                               case 'nm':
+                                                       stat = 'Online (tracking off)';
+                                                       cssc = 'wanon';
+                                                       break;
+
+                                               case 'off':
+                                                       stat = 'Offline';
+                                                       cssc = 'wanoff';
+                                                       break;
+
+                                               case 'ne':
+                                                       stat = 'Disabled';
+                                                       cssc = 'wanoff';
+                                                       break;
+                                       }
+
+                                       temp += String.format(
+                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
+                                                       cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
+                                       );
+                               }
+                               tx.innerHTML = temp;
+                       }
+                       else
+                       {
+                               var temp = '';
+                               var ncint = 'No MWAN3 interfaces found';
+                               temp = String.format(
+                                       '<strong>%s</strong>',
+                                               ncint
+                               );
+                               tx.innerHTML = temp;
+                       }
+
+                       var tx = document.getElementById('mwan3_statuslog_text');
+                       if (st.mwan3log)
+                       {
+                               var temp = '';
+                               var mwan3lg = 'Last 50 MWAN3 systemlog entries. Newest entries sorted at the top :';
+
+                               temp = String.format(
+                                       '<pre>%s<br /><br />%s</pre>',
+                                               mwan3lg, st.mwan3log[0].mwanlog
+                               );
+                               tx.innerHTML = temp;
+                       }
+                       else
+                       {
+                               var temp = '';
+                               var nslg = 'No MWAN3 systemlog history found';
+                               temp = String.format(
+                                       '<strong>%s</strong>',
+                                               nslg
+                               );
+                               tx.innerHTML = temp;
+                       }
+               }
+       );
+//]]></script>
+
+<div id="mwan3_interface_status">
+       <fieldset id="interface_field" class="cbi-section">
+               <legend><%:MWAN3 Multi-WAN Interface Live Status%></legend>
+               <div id="mwan3_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
+       </fieldset>
+       <fieldset class="cbi-section">
+               <legend><%:MWAN3 Multi-WAN Interface Systemlog%></legend>
+               <div id="mwan3_statuslog_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
+       </fieldset>
+</div>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: none;
+       margin-left: 30px;
+       padding-right: 30px;
+       width: auto;
+  }
+  #mwan3_interface_status {
+       background-color: #FFFFFF;
+       border: 1px dotted #555555;
+       padding: 20px;
+  }
+  #interface_field {
+       padding: 12px 20px 20px 20px;
+  }
+  #mwan3_status_text {
+       display: table;
+       font-size: 14px;
+       margin: auto;
+       max-width: 1044px;
+       min-width: 246px;
+       width: 100%;
+  }
+  .wanon {
+       background-color: rgb(144, 240, 144);
+  }
+  .wanoff {
+       background-color: rgb(240, 144, 144);
+  }
+  .wanon, .wanoff {
+       border-radius: 60px;
+       box-shadow: 0px 2px 5px -3px;
+       float: left;
+       margin: 8px 3px 0px 3px;
+       min-height: 30px;
+       min-width: 235px;
+       padding: 5px 10px 8px 10px;
+       text-align: center;
+  }
+  #mwan3_statuslog_text {
+       padding: 20px;
+       text-align: left;
+  }
+</style>
+
+<%+footer%>
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_status.htm b/net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_status.htm
new file mode 100644 (file)
index 0000000..9315a85
--- /dev/null
@@ -0,0 +1,95 @@
+<script type="text/javascript">//<![CDATA[
+       XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "overview", "iface_status")%>', null,
+               function(x, st)
+               {
+                       var tx = document.getElementById('mwan3_status_text');
+                       if (st.wans)
+                       {
+                               var temp = '';
+
+                               for( var i = 0; i < st.wans.length; i++ )
+                               {
+                                       var stat = '';
+                                       var cssc = '';
+
+                                       switch (st.wans[i].status)
+                                       {
+                                               case 'on':
+                                                       stat = 'Online (tracking active)';
+                                                       cssc = 'wanon';
+                                                       break;
+
+                                               case 'nm':
+                                                       stat = 'Online (tracking off)';
+                                                       cssc = 'wanon';
+                                                       break;
+
+                                               case 'off':
+                                                       stat = 'Offline';
+                                                       cssc = 'wanoff';
+                                                       break;
+
+                                               case 'ne':
+                                                       stat = 'Disabled';
+                                                       cssc = 'wanoff';
+                                                       break;
+                                       }
+
+                                       temp += String.format(
+                                               '<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
+                                                       cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
+                                       );
+                               }
+                               tx.innerHTML = temp;
+                       }
+                       else
+                       {
+                               var temp = '';
+                               var ncint = 'No MWAN3 interfaces found';
+                               temp += String.format(
+                                       '<strong>%s</strong>',
+                                               ncint
+                               );
+                               tx.innerHTML = temp;
+                       }
+               }
+       );
+//]]></script>
+
+<fieldset id="interface_field" class="cbi-section">
+       <legend><%:MWAN3 Multi-WAN Interface Live Status%></legend>
+       <div id="mwan3_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
+</fieldset>
+
+<style type="text/css">
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
+       max-width: 1044px;
+  }
+  #interface_field {
+       padding: 12px 20px 20px 20px;
+  }
+  #mwan3_status_text {
+       display: table;
+       font-size: 14px;
+       margin: auto;
+       max-width: 1044px;
+       min-width: 246px;
+       width: 100%;
+  }
+  .wanon {
+       background-color: rgb(144, 240, 144);
+  }
+  .wanoff {
+       background-color: rgb(240, 144, 144);
+  }
+  .wanon, .wanoff {
+       border-radius: 60px;
+       box-shadow: 0px 2px 5px -3px;
+       float: left;
+       margin: 8px 3px 0px 3px;
+       min-height: 30px;
+       min-width: 235px;
+       padding: 5px 10px 8px 10px;
+       text-align: center;
+  }
+</style>
diff --git a/net/mwan3/Makefile b/net/mwan3/Makefile
new file mode 100644 (file)
index 0000000..9c3f064
--- /dev/null
@@ -0,0 +1,50 @@
+#
+# 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:=mwan3
+PKG_VERSION:=1.5
+PKG_RELEASE:=3
+PKG_MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
+PKG_LICENSE:=GPLv2
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mwan3
+   SECTION:=net
+   CATEGORY:=Network
+   SUBMENU:=Routing and Redirection
+   DEPENDS:=+ip +iptables +iptables-mod-conntrack-extra +iptables-mod-ipopt
+   TITLE:=Multiwan hotplug script with connection tracking support
+   MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
+   PKGARCH:=all
+endef
+
+define Package/mwan3/description
+Hotplug script which makes configuration of multiple WAN interfaces simple
+and manageable. With loadbalancing/failover support for up to 250 wan
+interfaces, connection tracking and an easy to manage traffic ruleset.
+endef
+
+define Package/mwan3/conffiles
+   /etc/config/mwan3
+endef
+
+define Build/Compile
+endef
+
+define Package/mwan3/install
+   $(CP) ./files/* $(1)
+endef
+
+define Package/mwan3/postinst
+   [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/mwan3 enable
+   exit 0
+endef
+
+$(eval $(call BuildPackage,mwan3))
diff --git a/net/mwan3/files/etc/config/mwan3 b/net/mwan3/files/etc/config/mwan3
new file mode 100644 (file)
index 0000000..53f2f98
--- /dev/null
@@ -0,0 +1,79 @@
+
+config interface 'wan'
+       option enabled '1'
+       list track_ip '8.8.4.4'
+       list track_ip '8.8.8.8'
+       list track_ip '208.67.222.222'
+       list track_ip '208.67.220.220'
+       option reliability '2'
+       option count '1'
+       option timeout '2'
+       option interval '5'
+       option down '3'
+       option up '8'
+
+config interface 'wan2'
+       option enabled '0'
+       list track_ip '8.8.8.8'
+       list track_ip '208.67.220.220'
+       option reliability '1'
+       option count '1'
+       option timeout '2'
+       option interval '5'
+       option down '3'
+       option up '8'
+
+config member 'wan_m1_w3'
+       option interface 'wan'
+       option metric '1'
+       option weight '3'
+
+config member 'wan_m2_w3'
+       option interface 'wan'
+       option metric '2'
+       option weight '3'
+
+config member 'wan2_m1_w2'
+       option interface 'wan2'
+       option metric '1'
+       option weight '2'
+
+config member 'wan2_m2_w2'
+       option interface 'wan2'
+       option metric '2'
+       option weight '2'
+
+config policy 'wan_only'
+       list use_member 'wan_m1_w3'
+
+config policy 'wan2_only'
+       list use_member 'wan2_m1_w2'
+
+config policy 'balanced'
+       list use_member 'wan_m1_w3'
+       list use_member 'wan2_m1_w2'
+
+config policy 'wan_wan2'
+       list use_member 'wan_m1_w3'
+       list use_member 'wan2_m2_w2'
+
+config policy 'wan2_wan'
+       list use_member 'wan_m2_w3'
+       list use_member 'wan2_m1_w2'
+
+config rule 'sticky_even'
+       option src_ip '0.0.0.0/0.0.0.1'
+       option dest_port '443'
+       option proto 'tcp'
+       option use_policy 'wan_wan2'
+
+config rule 'sticky_odd'
+       option src_ip '0.0.0.1/0.0.0.1'
+       option dest_port '443'
+       option proto 'tcp'
+       option use_policy 'wan2_wan'
+
+config rule 'default_rule'
+       option dest_ip '0.0.0.0/0'
+       option use_policy 'balanced'
+
diff --git a/net/mwan3/files/etc/hotplug.d/iface/15-mwan3 b/net/mwan3/files/etc/hotplug.d/iface/15-mwan3
new file mode 100644 (file)
index 0000000..ab2cd74
--- /dev/null
@@ -0,0 +1,327 @@
+#!/bin/sh
+
+mwan3_get_iface_id()
+{
+       let iface_count++
+       [ "$1" == "$INTERFACE" ] && iface_id=$iface_count
+}
+
+mwan3_set_general_iptables()
+{
+       if ! $IPT -S mwan3_ifaces &> /dev/null; then
+               $IPT -N mwan3_ifaces
+       fi
+
+       if ! $IPT -S mwan3_rules &> /dev/null; then
+               $IPT -N mwan3_rules
+       fi
+
+       if ! $IPT -S mwan3_connected &> /dev/null; then
+               $IPT -N mwan3_connected
+       fi
+
+       if ! $IPT -S mwan3_hook &> /dev/null; then
+               $IPT -N mwan3_hook
+               $IPT -A mwan3_hook -j CONNMARK --restore-mark --nfmask 0xff00 --ctmask 0xff00
+               $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_ifaces
+               $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_connected
+               $IPT -A mwan3_hook -m mark --mark 0x0/0xff00 -j mwan3_rules
+               $IPT -A mwan3_hook -j CONNMARK --save-mark --nfmask 0xff00 --ctmask 0xff00
+               $IPT -A mwan3_hook -m mark ! --mark 0xff00/0xff00 -j mwan3_connected
+       fi
+
+       if ! $IPT -S mwan3_output_hook &> /dev/null; then
+               $IPT -N mwan3_output_hook
+       fi
+
+       if ! $IPT -S PREROUTING | grep mwan3_hook &> /dev/null; then
+               $IPT -A PREROUTING -j mwan3_hook
+       fi
+
+       if ! $IPT -S OUTPUT | grep mwan3_hook &> /dev/null; then
+               $IPT -A OUTPUT -j mwan3_hook
+       fi
+
+       if ! $IPT -S OUTPUT | grep mwan3_output_hook &> /dev/null; then
+               $IPT -A OUTPUT -j mwan3_output_hook
+       fi
+
+       $IPT -F mwan3_rules
+}
+
+mwan3_set_connected_iptables()
+{
+       local connected_networks
+
+       if $IPT -S mwan3_connected &> /dev/null; then
+               $IPT -F mwan3_connected
+
+               for connected_networks in $($IP route | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
+                       $IPT -A mwan3_connected -d $connected_networks -j MARK --set-xmark 0xff00/0xff00
+               done
+
+               $IPT -I mwan3_connected -d 224.0.0.0/3 -j MARK --set-xmark 0xff00/0xff00
+               $IPT -I mwan3_connected -d 127.0.0.0/8 -j MARK --set-xmark 0xff00/0xff00
+       fi
+}
+
+mwan3_set_iface_iptables()
+{
+       local local_net local_nets
+
+       local_net=$($IP route list dev $DEVICE scope link | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}')
+
+       if ! $IPT -S mwan3_iface_$INTERFACE &> /dev/null; then
+               $IPT -N mwan3_iface_$INTERFACE
+       fi
+
+       $IPT -F mwan3_iface_$INTERFACE
+       $IPT -D mwan3_ifaces -i $DEVICE -m mark --mark 0x0/0xff00 -j mwan3_iface_$INTERFACE &> /dev/null
+
+       if [ $ACTION == "ifup" ]; then
+               if [ -n "$local_net" ]; then
+                       for local_nets in $local_net ; do
+                               if [ $ACTION == "ifup" ]; then
+                                       $IPT -I mwan3_iface_$INTERFACE -s $local_net -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE" -j MARK --set-xmark 0xff00/0xff00
+                               fi
+                       done
+               fi
+
+               $IPT -A mwan3_iface_$INTERFACE -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE" -j MARK --set-xmark $(($iface_id*256))/0xff00
+               $IPT -A mwan3_ifaces -i $DEVICE -m mark --mark 0x0/0xff00 -j mwan3_iface_$INTERFACE
+       fi
+
+       if [ $ACTION == "ifdown" ]; then
+               $IPT -X mwan3_iface_$INTERFACE
+       fi
+}
+
+mwan3_set_iface_route()
+{
+       $IP route flush table $iface_id
+       [ $ACTION == "ifup" ] && $IP route add table $iface_id default $route_args
+}
+
+mwan3_set_iface_rules()
+{
+       while [ -n "$($IP rule list | awk '$1 == "'$(($iface_id+1000)):'"')" ]; do
+               $IP rule del pref $(($iface_id+1000))
+       done
+
+       while [ -n "$($IP rule list | awk '$1 == "'$(($iface_id+2000)):'"')" ]; do
+               $IP rule del pref $(($iface_id+2000))
+       done
+
+       while [ -n "$($IP rule list | awk '$1 == "2254:"')" ]; do
+               $IP rule del pref 2254
+       done
+
+       [ $ACTION == "ifup" ] && $IP rule add pref $(($iface_id+1000)) iif $DEVICE lookup main
+       [ $ACTION == "ifup" ] && $IP rule add pref $(($iface_id+2000)) fwmark $(($iface_id*256))/0xff00 lookup $iface_id
+        $IP rule add pref 2254 fwmark 0xfe00/0xff00 unreachable                                   
+}
+
+mwan3_track()
+{
+       local track_ip track_ips reliability count timeout interval down up
+
+       mwan3_list_track_ips()
+       {
+               track_ips="$1 $track_ips"
+       }
+       config_list_foreach $INTERFACE track_ip mwan3_list_track_ips
+
+       if [ -n "$track_ips" ]; then
+               config_get reliability $INTERFACE reliability 1
+               config_get count $INTERFACE count 1
+               config_get timeout $INTERFACE timeout 4
+               config_get interval $INTERFACE interval 10
+               config_get down $INTERFACE down 5
+               config_get up $INTERFACE up 5
+
+               if ! $IPT -S mwan3_track_$INTERFACE &> /dev/null; then
+                       $IPT -N mwan3_track_$INTERFACE
+                       $IPT -A mwan3_output_hook -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_$INTERFACE
+               fi
+
+               $IPT -F mwan3_track_$INTERFACE
+
+               for track_ip in $track_ips; do
+                       $IPT -A mwan3_track_$INTERFACE -d $track_ip -j MARK --set-xmark 0xff00/0xff00
+               done
+
+               [ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $INTERFACE $DEVICE $reliability $count $timeout $interval $down $up $track_ips &
+       else
+               $IPT -D mwan3_output_hook -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_$INTERFACE &> /dev/null
+               $IPT -F mwan3_track_$INTERFACE &> /dev/null
+               $IPT -X mwan3_track_$INTERFACE &> /dev/null
+       fi
+}
+
+mwan3_set_policy()
+{
+       local iface_count iface_id INTERFACE metric probability weight
+
+       config_get INTERFACE $1 interface
+       config_get metric $1 metric 1
+       config_get weight $1 weight 1
+
+       [ -n "$INTERFACE" ] || return 0
+       
+       config_foreach mwan3_get_iface_id interface
+
+       [ -n "$iface_id" ] || return 0
+
+       if $IPT -S mwan3_iface_$INTERFACE &> /dev/null; then
+               if [ "$metric" -lt "$lowest_metric" ]; then
+
+                       total_weight=$weight
+                       $IPT -F mwan3_policy_$policy
+                       $IPT -A mwan3_policy_$policy -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE $weight $weight" -j MARK --set-xmark $(($iface_id*256))/0xff00
+
+                       lowest_metric=$metric
+
+               elif [ "$metric" -eq "$lowest_metric" ]; then
+
+                       total_weight=$(($total_weight+$weight))
+                       probability=$(($weight*1000/$total_weight))
+                       
+                       if [ "$probability" -lt 10 ]; then
+                               probability="0.00$probability"
+                               elif [ $probability -lt 100 ]; then
+                               probability="0.0$probability"
+                               elif [ $probability -lt 1000 ]; then
+                               probability="0.$probability"
+                       else
+                               probability="1"
+                       fi
+
+                       probability="-m statistic --mode random --probability $probability"
+                       
+                       $IPT -I mwan3_policy_$policy -m mark --mark 0x0/0xff00 $probability -m comment --comment "$INTERFACE $weight $total_weight" -j MARK --set-xmark $(($iface_id*256))/0xff00
+               fi
+       fi
+}
+
+mwan3_set_policies_iptables()
+{
+       local lowest_metric policy total_weight
+
+       policy=$1
+
+       if [ "$policy" != $(echo "$policy" | cut -c1-15) ]; then
+               $LOG warn "Policy $policy exceeds max of 15 chars. Not setting policy" && return 0
+       fi
+
+       if ! $IPT -S mwan3_policy_$policy &> /dev/null; then
+               $IPT -N mwan3_policy_$policy
+       fi
+
+       $IPT -F mwan3_policy_$policy
+       $IPT -A mwan3_policy_$policy -m mark --mark 0x0/0xff00 -m comment --comment "unreachable" -j MARK --set-xmark 0xfe00/0xff00
+
+       lowest_metric=256
+       total_weight=0
+
+       config_list_foreach $policy use_member mwan3_set_policy
+}
+
+mwan3_set_user_rules_iptables()
+{
+       local proto src_ip src_port dest_ip dest_port use_policy
+
+       config_get proto $1 proto all
+       config_get src_ip $1 src_ip 0.0.0.0/0
+       config_get src_port $1 src_port 0:65535
+       config_get dest_ip $1 dest_ip 0.0.0.0/0
+       config_get dest_port $1 dest_port 0:65535
+       config_get use_policy $1 use_policy
+
+       if [ -n "$use_policy" ]; then
+               if [ "$use_policy" == "default" ]; then
+                       use_policy="MARK --set-xmark 0xff00/0xff00"
+               elif [ "$use_policy" == "unreachable" ]; then
+                       use_policy="MARK --set-xmark 0xfe00/0xff00"
+               else
+                       use_policy="mwan3_policy_$use_policy"
+               fi
+
+               case $proto in
+                       tcp|udp)
+                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip -m multiport --sports $src_port -m multiport --dports $dest_port -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
+                       ;;
+                       *)
+                       $IPT -A mwan3_rules -p $proto -s $src_ip -d $dest_ip -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
+                       ;;
+               esac
+       fi
+}
+
+mwan3_ifupdown()
+{
+       local counter enabled iface_count iface_id route_args wan_metric
+
+       config_load mwan3
+       config_foreach mwan3_get_iface_id interface
+
+       [ -n "$iface_id" ] || return 0
+       [ "$iface_count" -le 250 ] || return 0
+       unset iface_count
+
+       config_get enabled $INTERFACE enabled 0
+
+       counter=0
+
+       if [ $ACTION == "ifup" ]; then
+               [ "$enabled" -eq 1 ] || return 0
+
+               while [ -z "$($IP route list dev $DEVICE default | head -1)" -a "$counter" -lt 10 ]; do
+                       sleep 1
+                       let counter++
+                       if [ "$counter" -ge 10 ]; then
+                               $LOG warn "Could not find gateway for interface $INTERFACE ($DEVICE)" && return 0
+                       fi
+               done
+
+               route_args=$($IP route list dev $DEVICE default | head -1 | sed '/.*via \([^ ]*\) .*$/!d;s//via \1/;q' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}')
+               route_args="nexthop $route_args dev $DEVICE"
+       fi
+
+       while [ "$(pgrep -f -o hotplug-call)" -ne $$ -a "$counter" -lt 60 ]; do
+               sleep 1
+               let counter++
+               if [ "$counter" -ge 60 ]; then
+                       $LOG warn "Timeout waiting for older hotplug processes to finish. $ACTION interface $INTERFACE ($DEVICE) aborted" && return 0
+               fi
+       done
+
+       $LOG notice "$ACTION interface $INTERFACE ($DEVICE)"
+
+       mwan3_set_general_iptables
+       mwan3_set_iface_iptables
+       mwan3_set_iface_route
+       mwan3_set_iface_rules
+
+       [ $ACTION == "ifup" ] && mwan3_track
+
+       config_foreach mwan3_set_policies_iptables policy
+       config_foreach mwan3_set_user_rules_iptables rule
+}
+
+[ -n "$DEVICE" ] || exit 0
+[ -n "$INTERFACE" ] || exit 0
+
+local IP IPT LOG
+
+IP="/usr/sbin/ip -4"
+IPT="/usr/sbin/iptables -t mangle -w"
+LOG="/usr/bin/logger -t mwan3 -p"
+
+case "$ACTION" in
+       ifup|ifdown)
+               mwan3_ifupdown
+               mwan3_set_connected_iptables
+       ;;
+esac
+
+exit 0
diff --git a/net/mwan3/files/etc/init.d/mwan3 b/net/mwan3/files/etc/init.d/mwan3
new file mode 100755 (executable)
index 0000000..981154c
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh /etc/rc.common
+START=99
+
+start() {
+       /usr/sbin/mwan3 start
+}
+
+stop() {
+       /usr/sbin/mwan3 stop
+}
+
+restart() {
+       stop
+       start
+}
+
+boot() {
+       return 0
+}
diff --git a/net/mwan3/files/usr/sbin/mwan3 b/net/mwan3/files/usr/sbin/mwan3
new file mode 100755 (executable)
index 0000000..3102728
--- /dev/null
@@ -0,0 +1,207 @@
+#!/bin/sh /etc/rc.common
+
+. /lib/network/config.sh
+
+extra_help() {
+       cat <<EOF
+
+       ifup <iface>    Start service on interface
+       ifdown <iface>  Stop service on interface
+       interfaces      Show interfaces status
+       policies        Show policies status
+       rules           Show rules status
+       status          Show all status
+EOF
+}
+
+EXTRA_COMMANDS="ifdown ifup interfaces policies rules status"
+EXTRA_HELP="$(extra_help)"
+IP="/usr/sbin/ip -4"
+IPT="/usr/sbin/iptables -t mangle -w"
+
+ifdown()
+{
+       local device
+
+       if [ -z "$1" ]; then
+               echo "Error: Expecting interface. Usage: mwan3 ifdown <interface>" && exit 0
+       fi
+
+       if [ -n "$2" ]; then
+               echo "Error: Too many arguments. Usage: mwan3 ifdown <interface>" && exit 0
+       fi
+
+       device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
+       
+       if [ -e /var/run/mwan3track-$1.pid ] ; then
+               kill $(cat /var/run/mwan3track-$1.pid)
+               rm /var/run/mwan3track-$1.pid
+       fi
+
+       if [ -n "$device" ] ; then
+               ACTION=ifdown INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
+       fi
+}
+
+ifup()
+{
+       local device enabled
+
+       config_load mwan3
+
+       if [ -z "$1" ]; then
+               echo "Expecting interface. Usage: mwan3 ifup <interface>" && exit 0
+       fi
+
+       if [ -n "$2" ]; then
+               echo "Too many arguments. Usage: mwan3 ifup <interface>" && exit 0
+       fi
+       
+       config_get enabled "$1" enabled 0
+
+       device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
+       
+       if [ -n "$device" ] ; then
+               [ "$enabled" -eq 1 ] && ACTION=ifup INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
+       fi
+}
+
+interfaces()
+{
+       local device enabled iface_id tracking
+
+       config_load mwan3
+
+       echo "Interface status:"
+       
+       check_iface_status()
+       {
+               device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
+
+               if [ -z "$device" ]; then
+                       echo "Interface $1 is unknown"
+                       return 0
+               fi
+
+               config_get enabled "$1" enabled 0
+               let iface_id++
+
+               if [ -n "$(ps -w | grep mwan3track | grep -v grep | sed '/.*\/usr\/sbin\/mwan3track \([^ ]*\) .*$/!d;s//\1/' | awk '$1 == ("'$1'")')" ]; then
+                       tracking="active"
+               else
+                       tracking="down"
+               fi
+
+               if [ -n "$($IP rule | awk '$5 == ("'$device'")')" -a -n "$($IPT -S mwan3_iface_$1 2> /dev/null)" -a -n "$($IP route list table $iface_id default dev $device 2> /dev/null)" ]; then
+                       if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
+                               echo "Interface $1 is online (tracking $tracking)"
+                       else
+                               echo "Interface $1 is online"
+                       fi
+               elif [ -n "$($IP rule | awk '$5 == ("'$device'")')" -o -n "$($IPT -S mwan3_iface_$1 2> /dev/null)" -o -n "$($IP route list table $iface_id default dev $device 2> /dev/null)" ]; then
+                       echo "Interface $1 error"
+               else
+                       if [ "$enabled" -eq 1 ]; then
+                               if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
+                                       echo "Interface $1 is offline (tracking $tracking)"
+                               else
+                                       echo "Interface $1 is offline"
+                               fi
+                       else
+                               echo "Interface $1 is disabled"
+                       fi
+               fi
+       }
+       config_foreach check_iface_status interface
+       echo -e
+}
+
+policies()
+{
+       local percent policy share total_weight weight iface
+
+       for policy in $($IPT -S | awk '{print $2}' | grep mwan3_policy_ | sort -u); do
+               echo "Policy $policy:" | sed 's/mwan3_policy_//g'
+
+               for iface in $($IPT -S $policy | cut -s -d'"' -f2 | awk '{print $1}'); do
+                       [ -n "$total_weight" ] || total_weight=$($IPT -S $policy | grep "$iface " | cut -s -d'"' -f2 | awk '{print $3}')
+               done
+
+               if [ ! -z "${total_weight##*[!0-9]*}" ]; then
+                       for iface in $($IPT -S $policy | cut -s -d'"' -f2 | awk '{print $1}'); do
+                               weight=$($IPT -S $policy | grep "$iface " | cut -s -d'"' -f2 | awk '{print $2}')
+                               percent=$(($weight*100/$total_weight))
+                               echo " $iface ($percent%)"
+                       done
+               else
+                       echo " $($IPT -S $policy | sed '/.*--comment \([^ ]*\) .*$/!d;s//\1/;q')"
+               fi
+
+               echo -e
+
+               unset iface
+               unset total_weight
+       done
+}
+rules()
+{
+       if [ -n "$($IPT -S mwan3_connected 2> /dev/null)" ]; then
+               echo "Known networks:"
+               echo "destination policy hits" | awk '{ printf "%-19s%-19s%-9s%s\n",$1,$2,$3}' | awk '1; {gsub(".","-")}1'
+               $IPT -L mwan3_connected -n -v 2> /dev/null | tail -n+3 | sed 's/mark.*//' | sed 's/mwan3_policy_//g' | awk '{printf "%-19s%-19s%-9s%s\n",$9,"default",$1}'
+               echo -e
+       fi
+
+       if [ -n "$($IPT -S mwan3_rules 2> /dev/null)" ]; then
+               echo "Active rules:"
+               echo "source destination proto src-port dest-port policy hits" | awk '{ printf "%-19s%-19s%-7s%-14s%-14s%-16s%-9s%s\n",$1,$2,$3,$4,$5,$6,$7}' | awk '1; {gsub(".","-")}1'
+               $IPT -L mwan3_rules -n -v 2> /dev/null | tail -n+3 | sed 's/mark.*//' | sed 's/mwan3_policy_//g' | awk '{ printf "%-19s%-19s%-7s%-14s%-14s%-16s%-9s%s\n",$8,$9,$4,$12,$15,$3,$1}'
+               echo -e
+       fi
+}
+
+status()
+{
+       interfaces
+       policies
+       rules
+}
+
+start()
+{
+       config_load mwan3
+       config_foreach ifup interface
+}
+
+stop()
+{
+       local route rule table
+
+       killall mwan3track &> /dev/null
+       rm /var/run/mwan3track-* &> /dev/null
+
+       for route in $($IP route list table all | sed 's/.*table \([^ ]*\) .*/\1/' |  awk '{print $1}' | awk '{for(i=1;i<=NF;i++) if($i+0>0) if($i+0<255) {print;break}}'); do
+               $IP route flush table $route &> /dev/null
+       done
+
+       for rule in $($IP rule list | egrep '^[1-2][0-9]{3}\:' | cut -d ':' -f 1); do
+               $IP rule del pref $rule &> /dev/null
+       done
+
+       $IPT -D PREROUTING -j mwan3_hook &> /dev/null
+       $IPT -D OUTPUT -j mwan3_hook &> /dev/null
+       $IPT -D OUTPUT -j mwan3_output_hook &> /dev/null
+
+       for table in $($IPT -S | awk '{print $2}' | grep mwan3 | sort -u); do
+               $IPT -F $table &> /dev/null
+       done
+
+       for table in $($IPT -S | awk '{print $2}' | grep mwan3 | sort -u); do
+               $IPT -X $table &> /dev/null
+       done
+}
+
+restart() {
+       stop
+       start
+}
diff --git a/net/mwan3/files/usr/sbin/mwan3track b/net/mwan3/files/usr/sbin/mwan3track
new file mode 100755 (executable)
index 0000000..c4d25e9
--- /dev/null
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+[ -z "$9" ] && echo "Error: should not be started manually" && exit 0
+
+if [ -e /var/run/mwan3track-$1.pid ] ; then
+       kill $(cat /var/run/mwan3track-$1.pid) &> /dev/null
+       rm /var/run/mwan3track-$1.pid &> /dev/null
+fi
+
+echo "$$" > /var/run/mwan3track-$1.pid
+
+score=$(($7+$8))
+track_ips=$(echo $* | cut -d ' ' -f 9-99)
+host_up_count=0
+lost=0
+
+while true; do
+
+       for track_ip in $track_ips; do
+               ping -I $2 -c $4 -W $5 -s 4 -q $track_ip &> /dev/null
+               if [ $? -eq 0 ]; then
+                       let host_up_count++
+               else
+                       let lost++
+               fi
+       done
+               
+       if [ $host_up_count -lt $3 ]; then
+               let score--
+
+               if [ $score -lt $8 ]; then score=0 ; fi
+               if [ $score -eq $8 ]; then
+
+                       logger -t mwan3track -p notice "Interface $1 ($2) is offline"
+                       env -i ACTION=ifdown INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
+                       score=0
+
+               fi
+
+       else
+
+               if [ $score -lt $(($7+$8)) ] && [ $lost -gt 0 ]; then
+
+                       logger -t mwan3track -p info "Lost $(($lost*$4)) ping(s) on interface $1 ($2)"
+
+               fi
+
+               let score++
+               lost=0
+
+               if [ $score -gt $8 ]; then score=$(($7+$8)); fi
+               if [ $score -eq $8 ]; then
+
+                       logger -t mwan3track -p notice "Interface $1 ($2) is online"
+                       env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
+                       rm /var/run/mwan3track-$1.pid
+                       exit 0
+               fi
+       fi
+
+       host_up_count=0
+       sleep $6
+done
+
+exit 1
diff --git a/net/ntpclient/Makefile b/net/ntpclient/Makefile
new file mode 100644 (file)
index 0000000..bca4b65
--- /dev/null
@@ -0,0 +1,57 @@
+#
+# 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:=ntpclient
+PKG_VERSION:=2010_365
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://doolittle.icarus.com/ntpclient/
+PKG_MD5SUM:=a64689398f2df8933ee0d8da246e9eaa
+
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-2010
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ntpclient
+  SUBMENU:=Time Synchronization
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=NTP (Network Time Protocol) client
+  URL:=http://doolittle.icarus.com/ntpclient/
+  DEPENDS:=+librt
+endef
+
+define Package/ntpclient/description
+       NTP client for setting system time from NTP servers.
+endef
+
+define Package/ntpclient/conffiles
+/etc/config/ntpclient
+endef
+
+MAKE_FLAGS += \
+       all adjtimex
+
+define Package/ntpclient/install
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+       $(INSTALL_DATA) ./files/ntpclient.hotplug $(1)/etc/hotplug.d/iface/20-ntpclient
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) ./files/ntpclient.config $(1)/etc/config/ntpclient
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/ntpclient $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/adjtimex $(1)/usr/sbin/
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/rate.awk $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,ntpclient))
diff --git a/net/ntpclient/files/ntpclient.config b/net/ntpclient/files/ntpclient.config
new file mode 100644 (file)
index 0000000..10be886
--- /dev/null
@@ -0,0 +1,23 @@
+config ntpserver
+       option hostname '0.openwrt.pool.ntp.org'
+       option port     '123'
+
+config ntpserver
+       option hostname '1.openwrt.pool.ntp.org'
+       option port     '123'
+
+config ntpserver
+       option hostname '2.openwrt.pool.ntp.org'
+       option port     '123'
+
+config ntpserver
+       option hostname '3.openwrt.pool.ntp.org'
+       option port     '123'
+
+config ntpdrift
+       option freq     '0'
+
+config ntpclient
+       option interval 600
+       #option count   10
+       #option interface wan
diff --git a/net/ntpclient/files/ntpclient.hotplug b/net/ntpclient/files/ntpclient.hotplug
new file mode 100644 (file)
index 0000000..cdf18ee
--- /dev/null
@@ -0,0 +1,78 @@
+#!/bin/sh
+# Copyright (C) 2006-2014 OpenWrt.org
+
+. /lib/functions.sh
+
+unset SERVER
+unset PORT
+unset INTERVAL
+unset COUNT
+unset INTERFACE_GLOBAL
+
+NTPC=`which ntpclient`
+
+check_server() {
+       local hostname
+       local port
+       local interface
+       [ -n "$SERVER" ] && return
+       config_get hostname $1 hostname
+       config_get port $1 port
+       config_get interface $1 interface
+
+       [ -z "$interface" ] && interface=$INTERFACE_GLOBAL
+
+       [ -n "$interface" ] && {
+               # $INTERFACE is passed from hotplug event
+               [ "$interface" = "$INTERFACE" ] || return
+       }
+
+       [ -z "$hostname" ] && return
+       $NTPC -c 1 -p ${port:-123} -i 2 -h $hostname > /dev/null && { SERVER=$hostname; PORT=${port:-123}; }
+}
+
+set_drift() {
+       config_get freq $1 freq
+       [ -n "$freq" ] && adjtimex -f $freq >/dev/null
+}
+
+start_ntpclient() {
+       config_foreach set_drift ntpdrift
+       config_foreach check_server ntpserver
+       [ -z "$SERVER" ] && exit 0
+       logger starting ntpclient
+       $NTPC ${COUNT:+-c $COUNT} ${INTERVAL:+-i $INTERVAL} -s -l -D -p $PORT -h $SERVER 2> /dev/null
+}
+
+stop_ntpclient() {
+       logger stopping ntpclient
+       killall ntpclient
+}
+
+load_settings() {
+       local interval
+       local count
+       local iface
+       
+       config_get interval $1 interval
+       config_get count $1 count
+       config_get interface $1 interface
+       
+       [ -n "$count" ] && COUNT=$count
+       [ -n "$interval" ] && INTERVAL=$interval
+       [ -n "$interface" ] && INTERFACE_GLOBAL=$interface
+}
+
+config_load ntpclient
+config_foreach load_settings ntpclient
+
+NTP_RUNNING=`ps  | grep $NTPC | grep -v grep`
+
+case "${ACTION:-ifup}" in
+       ifup)
+               [ -z "$NTP_RUNNING" ] && start_ntpclient 
+       ;;
+       ifdown)
+               [ -n "$NTP_RUNNING" ] && stop_ntpclient 
+       ;;
+esac
diff --git a/net/ntpclient/patches/100-daemon.patch b/net/ntpclient/patches/100-daemon.patch
new file mode 100644 (file)
index 0000000..aa35f96
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/ntpclient.c
++++ b/ntpclient.c
+@@ -611,7 +611,7 @@ int main(int argc, char *argv[]) {
+       ntpc.cross_check=1;
+       for (;;) {
+-              c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "st");
++              c = getopt( argc, argv, "c:" DEBUG_OPTION "f:g:h:i:lp:q:" REPLAY_OPTION "stD");
+               if (c == EOF) break;
+               switch (c) {
+                       case 'c':
+@@ -660,6 +660,10 @@ int main(int argc, char *argv[]) {
+                               (ntpc.cross_check)=0;
+                               break;
++                      case 'D':
++                              daemon(0, 0);
++                              break;
++
+                       default:
+                               usage(argv[0]);
+                               exit(1);
index 64646164f212dd688e11f575cf850d846771af7d..bfcf65cba88c04a77784eda840646e1b3d70d984 100644 (file)
@@ -12,6 +12,7 @@ PKG_VERSION:=20130804
 PKG_RELEASE:=1
 PKG_REV:=954f5029dfa17734dc408336ef710c192268e8a4
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=Beerware
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=git://erdgeist.org/opentracker
index a732722b43f21a8ea3e946c3c99c73b983357e70..6d6d201b6c2bebe2db90a6581ee88dd734aa911e 100644 (file)
@@ -14,7 +14,10 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://rsync.samba.org/ftp/rsync/src
 PKG_MD5SUM:=43bd6676f0b404326eee2d63be3cdcfe
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=GPL-3.0
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
diff --git a/net/smartsnmpd/Makefile b/net/smartsnmpd/Makefile
new file mode 100644 (file)
index 0000000..9be39cb
--- /dev/null
@@ -0,0 +1,75 @@
+#
+# 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:=smartsnmpd
+PKG_VERSION:=2014-08-13
+PKG_RELEASE=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/credosemi/smartsnmp.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=fb93473d895f058b2d8975d3cfa280ae2a8ae98d
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_MIRROR_MD5SUM:=
+
+
+PKG_MAINTAINER:=Xiongfei Guo <xfguo@credosemi.com>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/scons.mk
+
+define Package/smartsnmpd
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS+=+lua +liblua +libubox +libuci-lua +libubus-lua
+  TITLE:=Smart-SNMP (Agent)
+  URL:=https://github.com/credosemi/smartsnmp
+endef
+
+define Package/smartsnmpd/description
+smartsnmpd is an implementation of SNMP Agent. Its goal is "Easily
+writing boring SNMP MIB with Lua". This package add native support
+for OpenWrt. Include using ubus and uci to get system info/status. 
+And, it use libubox/uloop as low level event-driven library.
+endef
+
+SCONS_OPTIONS += --transport=uloop
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); \
+               $(SCONS_VARS) \
+               scons \
+                       prefix=/usr \
+                       $(SCONS_OPTIONS) \
+       )
+endef
+
+define Package/smartsnmpd/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/smartsnmpd $(1)/usr/sbin/smartsnmpd
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/build/smartsnmp/core.so $(1)/usr/lib/lua/smartsnmp/core.so
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/lualib/smartsnmp/*.lua $(1)/usr/lib/lua/smartsnmp/
+
+       $(INSTALL_DIR) $(1)/usr/lib/lua/smartsnmp/mibs
+       $(INSTALL_BIN) ./files/mibs/*.lua $(1)/usr/lib/lua/smartsnmp/mibs/
+       
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_DATA) ./files/smartsnmpd.conf $(1)/etc/config/smartsnmpd
+
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/smartsnmpd.init $(1)/etc/init.d/smartsnmpd
+endef
+
+$(eval $(call BuildPackage,smartsnmpd))
+
diff --git a/net/smartsnmpd/files/mibs/dummy.lua b/net/smartsnmpd/files/mibs/dummy.lua
new file mode 100644 (file)
index 0000000..e49ca68
--- /dev/null
@@ -0,0 +1,24 @@
+-- 
+-- This file is part of SmartSNMP
+-- Copyright (C) 2014, Credo Semiconductor Inc.
+-- 
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+-- 
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+-- 
+-- You should have received a copy of the GNU General Public License along
+-- with this program; if not, write to the Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-- 
+
+local mib = require "smartsnmp"
+
+local dummy = {}
+
+return dummy
diff --git a/net/smartsnmpd/files/mibs/interfaces.lua b/net/smartsnmpd/files/mibs/interfaces.lua
new file mode 100644 (file)
index 0000000..01cea6a
--- /dev/null
@@ -0,0 +1,125 @@
+-- 
+-- This file is part of SmartSNMP
+-- Copyright (C) 2014, Credo Semiconductor Inc.
+-- 
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+-- 
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+-- 
+-- You should have received a copy of the GNU General Public License along
+-- with this program; if not, write to the Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-- 
+
+local mib = require "smartsnmp"
+require "ubus"
+require "uloop"
+
+uloop.init()
+
+local conn = ubus.connect()
+if not conn then
+    error("Failed to connect to ubusd")
+end
+
+local if_cache = {}
+local if_status_cache = {}
+local if_index_cache = {}
+
+local last_load_time = os.time()
+local function need_to_reload()
+    if os.time() - last_load_time >= 3 then
+        last_load_time = os.time()
+        return true
+    else
+        return false
+    end
+end
+
+local function load_config()
+    if need_to_reload() == true then
+        if_cache = {}
+        if_status_cache = {}
+        if_index_cache = {}
+
+        -- if description
+        for k, v in pairs(conn:call("network.device", "status", {})) do
+            if_status_cache[k] = {}
+        end
+
+        for name_ in pairs(if_status_cache) do
+            for k, v in pairs(conn:call("network.device", "status", { name = name_ })) do
+                if k == 'mtu' then
+                    if_status_cache[name_].mtu = v
+                elseif k == 'macaddr' then
+                    if_status_cache[name_].macaddr = v
+                elseif k == 'up' then
+                    if v == true then            
+                        if_status_cache[name_].up = 1
+                    else
+                        if_status_cache[name_].up = 2
+                    end
+                elseif k == 'statistics' then
+                    for item, stat in pairs(v) do
+                        if item == 'rx_bytes' then
+                            if_status_cache[name_].in_octet = stat
+                        elseif item == 'tx_bytes' then
+                            if_status_cache[name_].out_octet = stat
+                        elseif item == 'rx_errors' then
+                            if_status_cache[name_].in_errors = stat
+                        elseif item == 'tx_errors' then
+                            if_status_cache[name_].out_errors = stat
+                        elseif item == 'rx_dropped' then
+                            if_status_cache[name_].in_discards = stat
+                        elseif item == 'tx_dropped' then
+                            if_status_cache[name_].out_discards = stat
+                        end
+                    end
+                end
+            end
+        end
+
+        if_cache['desc'] = {}
+        for name, status in pairs(if_status_cache) do
+            table.insert(if_cache['desc'], name)
+            for k, v in pairs(status) do
+                if if_cache[k] == nil then if_cache[k] = {} end
+                table.insert(if_cache[k], v)
+            end
+        end
+
+        -- if index
+        for i in ipairs(if_cache['desc']) do
+            table.insert(if_index_cache, i)
+        end
+    end
+end
+
+mib.module_methods.or_table_reg("1.3.6.1.2.1.2", "The MIB module for managing Interfaces implementations")
+
+local ifGroup = {
+    [1]  = mib.ConstInt(function () load_config() return #if_index_cache end),
+    [2] = {
+        [1] = {
+            [1] = mib.ConstIndex(function () load_config() return if_index_cache end),
+            [2] = mib.ConstString(function (i) load_config() return if_cache['desc'][i] end),
+            [4] = mib.ConstInt(function (i) load_config() return if_cache['mtu'][i] end),
+            [6] = mib.ConstString(function (i) load_config() return if_cache['macaddr'][i] end),
+            [8] = mib.ConstInt(function (i) load_config() return if_cache['up'][i] end),
+            [10] = mib.ConstCount(function (i) load_config() return if_cache['in_octet'][i] end),
+            [13] = mib.ConstCount(function (i) load_config() return if_cache['in_discards'][i] end),
+            [14] = mib.ConstCount(function (i) load_config() return if_cache['in_errors'][i] end),
+            [16] = mib.ConstCount(function (i) load_config() return if_cache['out_octet'][i] end),
+            [19] = mib.ConstCount(function (i) load_config() return if_cache['out_discards'][i] end),
+            [20] = mib.ConstCount(function (i) load_config() return if_cache['out_errors'][i] end),
+        }
+    }
+}
+
+return ifGroup
diff --git a/net/smartsnmpd/files/mibs/system.lua b/net/smartsnmpd/files/mibs/system.lua
new file mode 100644 (file)
index 0000000..5b0a4af
--- /dev/null
@@ -0,0 +1,176 @@
+-- 
+-- This file is part of SmartSNMP
+-- Copyright (C) 2014, Credo Semiconductor Inc.
+-- 
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+-- 
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+-- 
+-- You should have received a copy of the GNU General Public License along
+-- with this program; if not, write to the Free Software Foundation, Inc.,
+-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+-- 
+
+local mib = require "smartsnmp"
+local uci = require "uci"
+
+-- System config
+local context = uci.cursor("/etc/config", "/tmp/.uci")
+
+-- scalar index
+local sysDesc             = 1
+local sysObjectID         = 2
+local sysUpTime           = 3
+local sysContact          = 4
+local sysName             = 5
+local sysLocation         = 6
+local sysServices         = 7
+local sysORLastChange     = 8
+
+-- table index
+local sysORTable          = 9
+
+-- entry index
+local sysOREntry          = 1
+
+-- list index
+local sysORIndex          = 1
+local sysORID             = 2
+local sysORDesc           = 3
+local sysORUpTime         = 4
+
+local startup_time = 0
+local or_last_changed_time = 0
+
+local function mib_system_startup(time)
+    startup_time = time
+    or_last_changed_time = time
+end
+
+mib_system_startup(os.time())
+
+local sysGroup = {}
+local or_oid_cache = {}
+local or_index_cache = {}
+local or_table_cache = {}
+
+local or_table_reg = function (oid, desc)
+    local row = {}
+    row['oid'] = {}
+    for i in string.gmatch(oid, "%d") do
+        table.insert(row['oid'], tonumber(i))
+    end
+    row['desc'] = desc
+    row['uptime'] = os.time()
+    table.insert(or_table_cache, row)
+    
+    or_last_changed_time = os.time()
+
+    or_oid_cache[oid] = #or_table_cache
+
+    or_index_cache = {}
+    for i in ipairs(or_table_cache) do
+        table.insert(or_index_cache, i)
+    end
+end
+
+local or_table_unreg = function (oid)
+    local or_idx = or_oid_cache[oid]
+
+    if or_table_cache[or_idx] ~= nil then
+        table.remove(or_table_cache, or_idx)
+        or_last_changed_time = os.time()
+
+        or_index_cache = {}
+        for i in ipairs(or_table_cache) do
+            table.insert(or_index_cache, i)
+        end
+    end
+end
+
+local last_load_time = os.time()
+local function need_to_reload()
+    if os.difftime(os.time(), last_load_time) < 3 then
+        return false
+    else
+        last_load_time = os.time()
+        return true
+    end
+end
+
+local function load_config()
+    if need_to_reload() == true then
+        context:load("smartsnmpd")
+    end
+end
+
+context:load("smartsnmpd")
+
+local sysMethods = {
+    ["or_table_reg"] = or_table_reg, 
+    ["or_table_unreg"] = or_table_unreg
+}
+mib.module_method_register(sysMethods)
+
+sysGroup = {
+    rocommunity = 'public',
+    [sysDesc]         = mib.ConstString(function () load_config() return mib.sh_call("uname -a") end),
+    [sysObjectID]     = mib.ConstOid(function ()
+                                         load_config()
+                                         local oid
+                                         local objectid
+                                         context:foreach("smartsnmpd", "smartsnmpd", function (s)
+                                             objectid = s.objectid
+                                         end)
+                                         if objectid ~= nil then
+                                            oid = {}
+                                            for i in string.gmatch(objectid, "%d+") do
+                                                table.insert(oid, tonumber(i))
+                                            end
+                                         end
+                                         return oid
+                                     end),
+    [sysUpTime]       = mib.ConstTimeticks(function () load_config() return os.difftime(os.time(), startup_time) * 100 end),
+    [sysContact]      = mib.ConstString(function () 
+                                            load_config()
+                                            local contact
+                                            context:foreach("smartsnmpd", "smartsnmpd", function (s)
+                                                contact = s.contact
+                                            end)
+                                            return contact
+                                        end),
+    [sysName]         = mib.ConstString(function () load_config() return mib.sh_call("uname -n") end),
+    [sysLocation]     = mib.ConstString(function ()
+                                            load_config()
+                                            local location
+                                            context:foreach("smartsnmpd", "smartsnmpd", function (s)
+                                                location = s.location
+                                            end)
+                                            return location
+                                        end),
+    [sysServices]     = mib.ConstInt(function ()
+                                         load_config()
+                                         local services
+                                         context:foreach("smartsnmpd", "smartsnmpd", function (s)
+                                             services = tonumber(s.services)
+                                         end)
+                                         return services
+                                     end),
+    [sysORLastChange] = mib.ConstTimeticks(function () load_config() return os.difftime(os.time(), or_last_changed_time) * 100 end),
+    [sysORTable]      = {
+        [sysOREntry]  = {
+            [sysORIndex]  = mib.UnaIndex(function () load_config() return or_index_cache end),
+            [sysORID]     = mib.ConstOid(function (i) load_config() return or_table_cache[i].oid end),
+            [sysORDesc]   = mib.ConstString(function (i) load_config() return or_table_cache[i].desc end),
+            [sysORUpTime] = mib.ConstTimeticks(function (i) load_config() return os.difftime(os.time(), or_table_cache[i].uptime) * 100 end),
+        }
+    }
+}
+
+return sysGroup
diff --git a/net/smartsnmpd/files/smartsnmpd.conf b/net/smartsnmpd/files/smartsnmpd.conf
new file mode 100644 (file)
index 0000000..aace5a6
--- /dev/null
@@ -0,0 +1,21 @@
+config smartsnmpd
+       option port '161'
+       option ro_community 'public'
+       option rw_community 'private'
+       option mib_module_path 'mibs'
+       option objectid '1.2.3.4'
+       option contact 'Me <me@example.org>'
+       option location 'Shanghai'
+       option services '72'
+
+config smartsnmpd_module
+       option oid    "1.3.6.1.2.1.1" 
+       option module 'system'
+
+config smartsnmpd_module
+       option oid    "1.3.6.1.2.1.2" 
+       option module 'interfaces'
+
+config smartsnmpd_module
+       option oid    "1.3.6.1.1"     
+       option module 'dummy'
diff --git a/net/smartsnmpd/files/smartsnmpd.init b/net/smartsnmpd/files/smartsnmpd.init
new file mode 100755 (executable)
index 0000000..dbe3af8
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2014 OpenWrt.org
+
+START=97
+
+USE_PROCD=1
+PROG=/usr/sbin/smartsnmpd
+CONFIGFILE=/etc/smartsnmpd.conf
+
+smartsnmpd_mib_module() {
+       local cfg="$1"
+       config_get OID "$cfg" oid
+       config_get MODULE "$cfg" module
+       echo "    ['$OID'] = '$MODULE'," >> $CONFIGFILE
+}
+
+start_service() {
+       include /lib/functions
+
+       config_load smartsnmpd
+
+       procd_open_instance
+       procd_set_param command $PROG -c $CONFIGFILE
+       procd_set_param file $CONFIGFILE
+       procd_set_param respawn
+       procd_close_instance
+       
+       # before we can call xappend
+       mkdir -p $(dirname $CONFIGFILE)
+
+       echo "-- auto-generated config file from /etc/config/smartsnmpd" > $CONFIGFILE
+       
+       config_get PORT smartsnmpd port 161
+       echo "port = $PORT" >> $CONFIGFILE
+       
+       config_get RO_COMMUNITY smartsnmpd ro_community 'public'
+       config_get RW_COMMUNITY smartsnmpd rw_community 'private'
+       echo "ro_community = '$RO_COMMUNITY'" >> $CONFIGFILE
+       echo "rw_community = '$RW_COMMUNITY'" >> $CONFIGFILE
+
+       config_get MIB_MODULE_PATH smartsnmpd mib_module_path '/usr/lib/lua/smartsnmp/mibs/'
+       echo "mib_module_path = '$MIB_MODULE_PATH'" >> $CONFIGFILE
+
+       echo "mib_modules = {" >> $CONFIGFILE
+       config_foreach smartsnmpd_mib_module smartsnmpd_module 
+       echo "}" >> $CONFIGFILE
+}
diff --git a/net/socat/Makefile b/net/socat/Makefile
new file mode 100644 (file)
index 0000000..a0d1e51
--- /dev/null
@@ -0,0 +1,73 @@
+#
+# 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:=socat
+PKG_VERSION:=1.7.2.4
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://www.dest-unreach.org/socat/download
+PKG_MD5SUM:=69b8155dd442a6f24e28ef5407d868eb
+
+PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
+
+PKG_LICENSE:=GPL-2.0 OpenSSL
+PKG_LICENSE_FILE:=COPYING COPYING.OpenSSL
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/socat
+  SECTION:=net
+  CATEGORY:=Network
+  DEPENDS:=+libpthread +SOCAT_SSL:libopenssl
+  TITLE:=A multipurpose relay (SOcket CAT)
+  URL:=http://www.dest-unreach.org/socat/
+endef
+
+define Package/socat/description
+       SoCat (for SOcket CAT) establishes two bidirectional byte streams and
+       transfers data between them.
+       Data channels may be files, pipes, devices (terminal or modem, etc.), or
+       sockets (Unix, IPv4, IPv6, raw, UDP, TCP, SSL). It provides forking,
+       logging and tracing, different modes for interprocess communication and
+       many more options.
+endef
+
+define Package/socat/config
+config SOCAT_SSL
+        bool "SSL support"
+        depends on PACKAGE_socat
+        default n
+        help
+          Implements SSL support in socat (using libopenssl).
+endef
+
+CONFIGURE_ARGS += \
+       --disable-libwrap \
+       --disable-readline \
+       --enable-termios
+
+ifneq ($(CONFIG_SOCAT_SSL),y)
+  CONFIGURE_ARGS+= --disable-openssl
+endif
+
+CONFIGURE_VARS += \
+       sc_cv_termios_ispeed="no" \
+       sc_cv_sys_crdly_shift=9 \
+       sc_cv_sys_tabdly_shift=11 \
+       sc_cv_sys_csize_shift=4
+
+define Package/socat/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/socat $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,socat))
diff --git a/net/socat/patches/010-fix_cross_compiling_error.patch b/net/socat/patches/010-fix_cross_compiling_error.patch
new file mode 100644 (file)
index 0000000..059938b
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/configure.in
++++ b/configure.in
+@@ -41,7 +41,7 @@ AC_CHECK_PROG(AR, ar, ar, gar)
+ # fail
+ AC_LANG_COMPILER_REQUIRE()
+-if test "$CC" = "gcc"; then
++if test "$GCC" = yes; then
+    CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -Wno-parentheses"
+    ERRONWARN="-Werror -O0"
+ elif test "$CC" = "clang"; then
+--- a/configure
++++ b/configure
+@@ -3348,7 +3348,7 @@ fi
+-if test "$CC" = "gcc"; then
++if test "$GCC" = yes; then
+    CFLAGS="$CFLAGS -D_GNU_SOURCE -Wall -Wno-parentheses"
+    ERRONWARN="-Werror -O0"
+ elif test "$CC" = "clang"; then
index 043342fa7c47d684e42ee8fb4f9cb61b1da521df..9b13e7db5e417596837567b44ef4c9cd8f442f69 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://rutschle.net/tech/
 PKG_MD5SUM:=c6e7d1cb0adb15f6efe480e36d98c560
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -23,7 +25,7 @@ define Package/sslh
   SUBMENU:=Routing and Redirection
   TITLE:=SSL/SSH multiplexer
   URL:=http://rutschle.net/tech/sslh.shtml
-  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
+  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 endef
 
 define Package/sslh/conffiles
diff --git a/net/strongswan/Config.in b/net/strongswan/Config.in
new file mode 100644 (file)
index 0000000..5bb78ae
--- /dev/null
@@ -0,0 +1,16 @@
+menu "Configuration"
+       depends on PACKAGE_strongswan
+
+# --with-routing-table
+config STRONGSWAN_ROUTING_TABLE
+       string
+       prompt "Set the IPsec routing table ID"
+       default "220"
+
+#  --with-routing-table-prio
+config STRONGSWAN_ROUTING_TABLE_PRIO
+       string
+       prompt "Set the IPsec routing table priority"
+       default "220"
+
+endmenu
diff --git a/net/strongswan/Makefile b/net/strongswan/Makefile
new file mode 100644 (file)
index 0000000..8039951
--- /dev/null
@@ -0,0 +1,503 @@
+#
+# 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:=strongswan
+PKG_VERSION:=5.2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
+PKG_MD5SUM:=5cee4ee1a6ccb74400758b3ace54d46e
+PKG_LICENSE:=GPL-2.0+
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+
+PKG_MOD_AVAILABLE:= \
+       addrblock \
+       aes \
+       af-alg \
+       agent \
+       attr \
+       attr-sql \
+       blowfish \
+       ccm \
+       cmac \
+       constraints \
+       coupling \
+       ctr \
+       curl \
+       des \
+       dhcp \
+       dnskey \
+       duplicheck \
+       eap-identity \
+       eap-md5 \
+       eap-mschapv2 \
+       eap-radius \
+       farp \
+       fips-prf \
+       gcm \
+       gcrypt \
+       gmp \
+       ha \
+       hmac \
+       kernel-libipsec \
+       kernel-netlink \
+       ldap \
+       led \
+       load-tester \
+       nonce \
+       md4 \
+       md5 \
+       mysql \
+       openssl \
+       padlock \
+       pem \
+       pgp \
+       pkcs1 \
+       pkcs8 \
+       pkcs11 \
+       pubkey \
+       random \
+       resolve \
+       revocation \
+       sha1 \
+       sha2 \
+       smp \
+       socket-default \
+       socket-dynamic \
+       sql \
+       sqlite \
+       stroke \
+       test-vectors \
+       unity \
+       uci \
+       updown \
+       whitelist \
+       x509 \
+       xauth-eap \
+       xauth-generic \
+       xcbc
+
+PKG_CONFIG_DEPENDS:= \
+       CONFIG_STRONGSWAN_ROUTING_TABLE \
+       CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO \
+       $(patsubst %,CONFIG_PACKAGE_strongswan-mod-%,$(PKG_MOD_AVAILABLE)) \
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/strongswan/Default
+  SUBMENU:=VPN
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=StrongSwan
+  URL:=http://www.strongswan.org/
+endef
+
+define Package/strongswan/description/Default
+ StrongSwan is an OpenSource IPsec implementation for the Linux operating system.
+endef
+
+define Package/strongswan
+$(call Package/strongswan/Default)
+  DEPENDS:= +libpthread +ip \
+       +kmod-crypto-authenc \
+       +kmod-ipsec +kmod-ipsec4 +kmod-ipsec6 \
+       +kmod-ipt-ipsec +iptables-mod-ipsec
+endef
+
+define Package/strongswan/config
+  source "$(SOURCE)/Config.in"
+endef
+
+define Package/strongswan/description
+$(call Package/strongswan/description/Default)
+ This package contains shared libraries and scripts.
+endef
+
+define Package/strongswan-full
+$(call Package/strongswan/Default)
+  TITLE+= (full)
+  DEPENDS:= +strongswan \
+       +strongswan-charon \
+       +strongswan-mod-addrblock \
+       +strongswan-mod-aes \
+       +strongswan-mod-af-alg \
+       +strongswan-mod-agent \
+       +strongswan-mod-attr \
+       +strongswan-mod-attr-sql \
+       +strongswan-mod-blowfish \
+       +strongswan-mod-ccm \
+       +strongswan-mod-cmac \
+       +strongswan-mod-constraints \
+       +strongswan-mod-coupling \
+       +strongswan-mod-ctr \
+       +strongswan-mod-curl \
+       +strongswan-mod-des \
+       +strongswan-mod-dhcp \
+       +strongswan-mod-dnskey \
+       +strongswan-mod-duplicheck \
+       +strongswan-mod-eap-identity \
+       +strongswan-mod-eap-md5 \
+       +strongswan-mod-eap-mschapv2 \
+       +strongswan-mod-eap-radius \
+       +strongswan-mod-farp \
+       +strongswan-mod-fips-prf \
+       +strongswan-mod-gcm \
+       +strongswan-mod-gcrypt \
+       +strongswan-mod-gmp \
+       +strongswan-mod-ha \
+       +strongswan-mod-hmac \
+       +strongswan-mod-kernel-netlink \
+       +strongswan-mod-ldap \
+       +strongswan-mod-led \
+       +strongswan-mod-load-tester \
+       +strongswan-mod-nonce \
+       +strongswan-mod-md4 \
+       +strongswan-mod-md5 \
+       +strongswan-mod-mysql \
+       +strongswan-mod-openssl \
+       +TARGET_x86:strongswan-mod-padlock \
+       +strongswan-mod-pem \
+       +strongswan-mod-pgp \
+       +strongswan-mod-pkcs1 \
+       +strongswan-mod-pkcs8 \
+       +strongswan-mod-pkcs11 \
+       +strongswan-mod-pubkey \
+       +strongswan-mod-random \
+       +strongswan-mod-resolve \
+       +strongswan-mod-revocation \
+       +strongswan-mod-sha1 \
+       +strongswan-mod-sha2 \
+       +strongswan-mod-smp \
+       +strongswan-mod-socket-default \
+       +strongswan-mod-sql \
+       +strongswan-mod-sqlite \
+       +strongswan-mod-stroke \
+       +strongswan-mod-test-vectors \
+       +strongswan-mod-uci \
+       +strongswan-mod-unity \
+       +strongswan-mod-updown \
+       +strongswan-mod-whitelist \
+       +strongswan-mod-x509 \
+       +strongswan-mod-xauth-eap \
+       +strongswan-mod-xauth-generic \
+       +strongswan-mod-xcbc \
+       +strongswan-utils \
+       @DEVEL
+endef
+
+define Package/strongswan-full/description
+$(call Package/strongswan/description/Default)
+ This meta-package contains dependencies for all of the strongswan plugins
+ except kernel-libipsec,
+ socket-dynamic and which are ommitted in favor of the kernel-netlink and
+ socket-default plugins.
+endef
+
+
+define Package/strongswan-default
+$(call Package/strongswan/Default)
+  TITLE+= (default)
+  DEPENDS:= +strongswan \
+       +strongswan-charon \
+       +strongswan-mod-aes \
+       +strongswan-mod-attr \
+       +strongswan-mod-constraints \
+       +strongswan-mod-des \
+       +strongswan-mod-dnskey \
+       +strongswan-mod-fips-prf \
+       +strongswan-mod-gmp \
+       +strongswan-mod-hmac \
+       +strongswan-mod-kernel-netlink \
+       +strongswan-mod-md5 \
+       +strongswan-mod-nonce \
+       +strongswan-mod-pem \
+       +strongswan-mod-pgp \
+       +strongswan-mod-pkcs1 \
+       +strongswan-mod-pubkey \
+       +strongswan-mod-random \
+       +strongswan-mod-resolve \
+       +strongswan-mod-revocation \
+       +strongswan-mod-sha1 \
+       +strongswan-mod-sha2 \
+       +strongswan-mod-socket-default \
+       +strongswan-mod-stroke \
+       +strongswan-mod-updown \
+       +strongswan-mod-x509 \
+       +strongswan-mod-xauth-generic \
+       +strongswan-mod-xcbc \
+       +strongswan-utils
+endef
+
+define Package/strongswan-default/description
+$(call Package/strongswan/description/Default)
+ This meta-package contains only dependencies to match upstream defaults.
+endef
+
+define Package/strongswan-minimal
+$(call Package/strongswan/Default)
+  TITLE+= (minimal)
+  DEPENDS:= +strongswan \
+       +strongswan-charon \
+       +strongswan-mod-aes \
+       +strongswan-mod-gmp \
+       +strongswan-mod-hmac \
+       +strongswan-mod-kernel-netlink \
+       +strongswan-mod-nonce \
+       +strongswan-mod-pubkey \
+       +strongswan-mod-random \
+       +strongswan-mod-sha1 \
+       +strongswan-mod-socket-default \
+       +strongswan-mod-stroke \
+       +strongswan-mod-updown \
+       +strongswan-mod-x509 \
+       +strongswan-mod-xcbc
+endef
+
+define Package/strongswan-minimal/description
+$(call Package/strongswan/description/Default)
+ This meta-package contains only dependencies for a minimal IKEv2 setup.
+endef
+
+define Package/strongswan-charon
+$(call Package/strongswan/Default)
+  TITLE+= IKEv1/IKEv2 keying daemon
+  DEPENDS:= +strongswan
+endef
+
+define Package/strongswan-charon/description
+$(call Package/strongswan/description/Default)
+ This package contains charon, an IKEv2 keying daemon.
+endef
+
+define Package/strongswan-utils
+$(call Package/strongswan/Default)
+  TITLE+= utilities
+  DEPENDS:= +strongswan
+endef
+
+define Package/strongswan-utils/description
+$(call Package/strongswan/description/Default)
+ This package contains the pki & scepclient utilities.
+endef
+
+define BuildPlugin
+  define Package/strongswan-mod-$(1)
+    $$(call Package/strongswan/Default)
+    TITLE:= StrongSwan $(2) plugin
+    DEPENDS:= +strongswan $(3)
+  endef
+
+  strongswan_mod_conf=$(wildcard $(PKG_INSTALL_DIR)/etc/strongswan.d/charon/$(1).conf)
+  define Package/strongswan-mod-$(1)/install
+       $(INSTALL_DIR) $$(1)/etc/strongswan.d/charon
+       $(if $(call strongswan_mod_conf,$(1)), \
+               $(INSTALL_DATA) \
+                       $(call strongswan_mod_conf,$(1)) \
+                       $$(1)/etc/strongswan.d/charon/ \
+       )
+       $(INSTALL_DIR) $$(1)/usr/lib/ipsec/plugins
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-$(1).so \
+               $$(1)/usr/lib/ipsec/plugins/
+       $(call Plugin/$(1)/install,$$(1))
+  endef
+
+  Package/strongswan-mod-$(1)/conffiles=$(patsubst $(PKG_INSTALL_DIR)%,%,$(call strongswan_mod_conf,$(1)))
+
+  $$(eval $$(call BuildPackage,strongswan-mod-$(1)))
+endef
+
+CONFIGURE_ARGS+= \
+       --disable-scripts \
+       --disable-static \
+       --disable-fast \
+       --with-systemdsystemunitdir=no \
+       $(if $(CONFIG_PACKAGE_strongswan-utils),--enable-pki --enable-scepclient,--disable-pki --disable-scepclient) \
+       --with-random-device=/dev/random \
+       --with-urandom-device=/dev/urandom \
+       --with-routing-table="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE))" \
+       --with-routing-table-prio="$(call qstrip,$(CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO))" \
+       $(foreach m,$(PKG_MOD_AVAILABLE), \
+         $(if $(CONFIG_PACKAGE_strongswan-mod-$(m)),--enable-$(m),--disable-$(m)) \
+       )
+
+EXTRA_LDFLAGS+= -Wl,-rpath-link,$(STAGING_DIR)/usr/lib
+
+define Package/strongswan/conffiles
+/etc/ipsec.conf
+/etc/ipsec.secrets
+/etc/ipsec.user
+/etc/strongswan.conf
+endef
+
+define Package/strongswan/install
+       $(INSTALL_DIR) $(1)/etc
+       $(CP) $(PKG_INSTALL_DIR)/etc/strongswan.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{libstrongswan.so.*,libhydra.so.*} $(1)/usr/lib/ipsec/
+       $(INSTALL_CONF) ./files/ipsec.secrets $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/ipsec.init $(1)/etc/init.d/ipsec
+endef
+
+define Package/strongswan-default/install
+       true
+endef
+
+define Package/strongswan-full/install
+       true
+endef
+
+define Package/strongswan-minimal/install
+       true
+endef
+
+define Package/strongswan-charon/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/charon $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libcharon.so.* $(1)/usr/lib/ipsec/
+endef
+
+define Package/strongswan-utils/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ipsec $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pki $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/scepclient $(1)/usr/lib/ipsec/
+endef
+
+define Plugin/duplicheck/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/duplicheck $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-duplicheck.so $(1)/usr/lib/ipsec/plugins/
+endef
+
+define Plugin/eap-radius/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libradius.so.* $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-eap-radius.so $(1)/usr/lib/ipsec/plugins/
+endef
+
+define Plugin/attr-sql/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/pool $(1)/usr/lib/ipsec/
+endef
+
+define Plugin/stroke/install
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/aacerts
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/acerts
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/cacerts
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/certs
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/crls
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/ocspcerts
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/private
+       $(INSTALL_DIR) $(1)/etc/ipsec.d/reqs
+
+       $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/ipsec.conf $(1)/etc/
+
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{starter,stroke} $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-stroke.so $(1)/usr/lib/ipsec/plugins/
+endef
+
+define Plugin/updown/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/{_updown,_updown_espmark} $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-updown.so $(1)/usr/lib/ipsec/plugins/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) ./files/ipsec.user $(1)/etc/
+endef
+
+define Plugin/whitelist/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec/plugins
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/whitelist $(1)/usr/lib/ipsec/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/plugins/libstrongswan-whitelist.so $(1)/usr/lib/ipsec/plugins/
+endef
+
+define Plugin/kernel-libipsec/install
+       $(INSTALL_DIR) $(1)/usr/lib/ipsec
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/ipsec/libipsec.so.* $(1)/usr/lib/ipsec/
+endef
+
+$(eval $(call BuildPackage,strongswan))
+$(eval $(call BuildPackage,strongswan-default))
+$(eval $(call BuildPackage,strongswan-full))
+$(eval $(call BuildPackage,strongswan-minimal))
+$(eval $(call BuildPackage,strongswan-charon))
+$(eval $(call BuildPackage,strongswan-utils))
+$(eval $(call BuildPlugin,addrblock,RFC 3779 address block constraint support,))
+$(eval $(call BuildPlugin,aes,AES crypto,))
+$(eval $(call BuildPlugin,af-alg,AF_ALG crypto interface to Linux Crypto API,+kmod-crypto-user))
+$(eval $(call BuildPlugin,agent,SSH agent signing,))
+$(eval $(call BuildPlugin,attr,file based config,))
+$(eval $(call BuildPlugin,attr-sql,SQL based config,+strongswan-mod-sql))
+$(eval $(call BuildPlugin,blowfish,Blowfish crypto,))
+$(eval $(call BuildPlugin,ccm,CCM AEAD wrapper crypto,))
+$(eval $(call BuildPlugin,cmac,CMAC crypto,))
+$(eval $(call BuildPlugin,constraints,advanced X509 constraint checking,))
+$(eval $(call BuildPlugin,coupling,IKEv2 plugin to couple peer certificates permanently to authentication,))
+$(eval $(call BuildPlugin,ctr,Counter Mode wrapper crypto,))
+$(eval $(call BuildPlugin,curl,cURL fetcher plugin,+PACKAGE_strongswan-mod-curl:libcurl))
+$(eval $(call BuildPlugin,des,DES crypto,))
+$(eval $(call BuildPlugin,dhcp,DHCP based attribute provider,))
+$(eval $(call BuildPlugin,dnskey,DNS RR key decoding,))
+$(eval $(call BuildPlugin,duplicheck,advanced duplicate checking,))
+$(eval $(call BuildPlugin,eap-identity,EAP identity helper,))
+$(eval $(call BuildPlugin,eap-md5,EAP MD5 (CHAP) EAP auth,))
+$(eval $(call BuildPlugin,eap-mschapv2,EAP MS-CHAPv2 EAP auth,+strongswan-mod-md4 +strongswan-mod-des))
+$(eval $(call BuildPlugin,eap-radius,EAP RADIUS auth,))
+$(eval $(call BuildPlugin,farp,fake arp respsonses,))
+$(eval $(call BuildPlugin,fips-prf,FIPS PRF crypto,+strongswan-mod-sha1))
+$(eval $(call BuildPlugin,gcm,GCM AEAD wrapper crypto,))
+$(eval $(call BuildPlugin,gcrypt,libgcrypt,+PACKAGE_strongswan-mod-gcrypt:libgcrypt))
+$(eval $(call BuildPlugin,gmp,libgmp,+PACKAGE_strongswan-mod-gmp:libgmp))
+$(eval $(call BuildPlugin,ha,high availability cluster,))
+$(eval $(call BuildPlugin,hmac,HMAC crypto,))
+$(eval $(call BuildPlugin,kernel-libipsec,libipsec kernel interface,))
+$(eval $(call BuildPlugin,kernel-netlink,netlink kernel interface,))
+$(eval $(call BuildPlugin,ldap,LDAP,+PACKAGE_strongswan-mod-ldap:libopenldap))
+$(eval $(call BuildPlugin,led,LED blink on IKE activity,))
+$(eval $(call BuildPlugin,load-tester,load testing,))
+$(eval $(call BuildPlugin,nonce,nonce genereation,))
+$(eval $(call BuildPlugin,md4,MD4 crypto,))
+$(eval $(call BuildPlugin,md5,MD5 crypto,))
+$(eval $(call BuildPlugin,mysql,MySQL database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-mysql:libmysqlclient-r))
+$(eval $(call BuildPlugin,openssl,OpenSSL crypto,+PACKAGE_strongswan-mod-openssl:libopenssl))
+$(eval $(call BuildPlugin,padlock,VIA PadLock crypto,@TARGET_x86))
+$(eval $(call BuildPlugin,pem,PEM decoding,))
+$(eval $(call BuildPlugin,pgp,PGP key decoding,))
+$(eval $(call BuildPlugin,pkcs1,PKCS1 key decoding,))
+$(eval $(call BuildPlugin,pkcs8,PKCS8 key decoding,))
+$(eval $(call BuildPlugin,pkcs11,PKCS11 key decoding,))
+$(eval $(call BuildPlugin,pubkey,raw public key,))
+$(eval $(call BuildPlugin,random,RNG,))
+$(eval $(call BuildPlugin,resolve,DNS resolver,))
+$(eval $(call BuildPlugin,revocation,X509 CRL/OCSP revocation,))
+$(eval $(call BuildPlugin,sha1,SHA1 crypto,))
+$(eval $(call BuildPlugin,sha2,SHA2 crypto,))
+$(eval $(call BuildPlugin,smp,SMP configuration and control interface,+PACKAGE_strongswan-mod-smp:libxml2))
+$(eval $(call BuildPlugin,socket-default,default socket implementation for charon,))
+$(eval $(call BuildPlugin,socket-dynamic,dynamic socket implementation for charon,))
+$(eval $(call BuildPlugin,sql,SQL database interface,))
+$(eval $(call BuildPlugin,sqlite,SQLite database interface,+strongswan-mod-sql +PACKAGE_strongswan-mod-sqlite:libsqlite3))
+$(eval $(call BuildPlugin,stroke,Stroke,+strongswan-utils))
+$(eval $(call BuildPlugin,test-vectors,crypto test vectors,))
+$(eval $(call BuildPlugin,uci,UCI config interface,+PACKAGE_strongswan-mod-uci:libuci))
+$(eval $(call BuildPlugin,unity,Cisco Unity extension,))
+$(eval $(call BuildPlugin,updown,updown firewall,))
+$(eval $(call BuildPlugin,whitelist,peer identity whitelisting,))
+$(eval $(call BuildPlugin,x509,x509 certificate,))
+$(eval $(call BuildPlugin,xauth-eap,EAP XAuth backend,))
+$(eval $(call BuildPlugin,xauth-generic,generic XAuth backend,))
+$(eval $(call BuildPlugin,xcbc,xcbc crypto,))
diff --git a/net/strongswan/files/ipsec.init b/net/strongswan/files/ipsec.init
new file mode 100644 (file)
index 0000000..391a2ae
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh /etc/rc.common
+
+START=90
+STOP=10
+
+start() {
+       ipsec start
+}
+
+stop() {
+       ipsec stop
+}
+
+restart() {
+       ipsec restart
+}
+
+reload() {
+       ipsec update
+}
diff --git a/net/strongswan/files/ipsec.secrets b/net/strongswan/files/ipsec.secrets
new file mode 100644 (file)
index 0000000..ddd4956
--- /dev/null
@@ -0,0 +1 @@
+# /etc/ipsec.secrets - strongSwan IPsec secrets file
diff --git a/net/strongswan/files/ipsec.user b/net/strongswan/files/ipsec.user
new file mode 100644 (file)
index 0000000..4351ace
--- /dev/null
@@ -0,0 +1,6 @@
+# This file is interpreted as shell script.
+# Put your custom ip rules here, they will
+# be executed with each call to the script
+# /usr/lib/ipsec/_updown which by default
+# strongswan executes.
+
diff --git a/net/strongswan/patches/201-kmodloader.patch b/net/strongswan/patches/201-kmodloader.patch
new file mode 100644 (file)
index 0000000..7d46156
--- /dev/null
@@ -0,0 +1,28 @@
+--- a/src/starter/netkey.c
++++ b/src/starter/netkey.c
+@@ -31,7 +31,7 @@ bool starter_netkey_init(void)
+               /* af_key module makes the netkey proc interface visible */
+               if (stat(PROC_MODULES, &stb) == 0)
+               {
+-                      ignore_result(system("modprobe -qv af_key"));
++                      ignore_result(system("modprobe af_key 2>&1 >/dev/null"));
+               }
+               /* now test again */
+@@ -45,11 +45,11 @@ bool starter_netkey_init(void)
+       /* make sure that all required IPsec modules are loaded */
+       if (stat(PROC_MODULES, &stb) == 0)
+       {
+-              ignore_result(system("modprobe -qv ah4"));
+-              ignore_result(system("modprobe -qv esp4"));
+-              ignore_result(system("modprobe -qv ipcomp"));
+-              ignore_result(system("modprobe -qv xfrm4_tunnel"));
+-              ignore_result(system("modprobe -qv xfrm_user"));
++              ignore_result(system("modprobe ah4 2>&1 >/dev/null"));
++              ignore_result(system("modprobe esp4 2>&1 >/dev/null"));
++              ignore_result(system("modprobe ipcomp 2>&1 >/dev/null"));
++              ignore_result(system("modprobe xfrm4_tunnel 2>&1 >/dev/null"));
++              ignore_result(system("modprobe xfrm_user 2>&1 >/dev/null"));
+       }
+       DBG2(DBG_APP, "found netkey IPsec stack");
diff --git a/net/strongswan/patches/203-uci.patch b/net/strongswan/patches/203-uci.patch
new file mode 100644 (file)
index 0000000..274ea86
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/src/libcharon/plugins/uci/uci_parser.c
++++ b/src/libcharon/plugins/uci/uci_parser.c
+@@ -78,7 +78,7 @@ METHOD(enumerator_t, section_enumerator_
+               if (uci_lookup(this->ctx, &element, this->package,
+                                          this->current->name, "name") == UCI_OK)
+               {       /* use "name" attribute as config name if available ... */
+-                      *value = uci_to_option(element)->value;
++                      *value = uci_to_option(element)->v.string;
+               }
+               else
+               {       /* ... or the section name becomes config name */
+@@ -93,7 +93,7 @@ METHOD(enumerator_t, section_enumerator_
+               if (value && uci_lookup(this->ctx, &element, this->package,
+                                                 this->current->name, this->keywords[i]) == UCI_OK)
+               {
+-                      *value = uci_to_option(element)->value;
++                      *value = uci_to_option(element)->v.string;
+               }
+       }
+       va_end(args);
diff --git a/net/strongswan/patches/300-include-ipsec-user-script.patch b/net/strongswan/patches/300-include-ipsec-user-script.patch
new file mode 100644 (file)
index 0000000..d96e844
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/src/_updown/_updown.in
++++ b/src/_updown/_updown.in
+@@ -16,11 +16,9 @@
+ # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ # for more details.
+-# CAUTION:  Installing a new version of strongSwan will install a new
+-# copy of this script, wiping out any custom changes you make.  If
+-# you need changes, make a copy of this under another name, and customize
+-# that, and use the (left/right)updown parameters in ipsec.conf to make
+-# strongSwan use yours instead of this default one.
++# Add your custom ip rules to the /etc/ipsec.user file if you need that functionality.
++
++[ -e /etc/ipsec.user ] && . /etc/ipsec.user "$1"
+ # things that this script gets (from ipsec_pluto(8) man page)
+ #
index f94af51acc0e32a62494df552c33ca4d5607fe5f..8efa9e72aa5e4aa6e1ca42ef8a6e54dde8da31db 100644 (file)
@@ -18,6 +18,7 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=GPL-2.0
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
 
index fa03eb86393e8cedd1f15710967a1858a55d9be9..566b500ed4c1fb08de18987d2130aeef583a0aa6 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tinyproxy
 PKG_VERSION:=1.8.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://www.banu.com/pub/tinyproxy/1.8/
diff --git a/net/tinyproxy/patches/CVE-2012-3505-tiniproxy-randomized-hashmaps.patch b/net/tinyproxy/patches/CVE-2012-3505-tiniproxy-randomized-hashmaps.patch
new file mode 100644 (file)
index 0000000..4737b8b
--- /dev/null
@@ -0,0 +1,101 @@
+--- a/src/child.c
++++ b/src/child.c
+@@ -20,6 +20,9 @@
+  * processing incoming connections.
+  */
++#include <stdlib.h>
++#include <time.h>
++
+ #include "main.h"
+ #include "child.h"
+@@ -196,6 +199,7 @@ static void child_main (struct child_s *
+         }
+         ptr->connects = 0;
++      srand(time(NULL));
+         while (!config.quit) {
+                 ptr->status = T_WAITING;
+--- a/src/hashmap.c
++++ b/src/hashmap.c
+@@ -25,6 +25,8 @@
+  * don't try to free the data, or realloc the memory. :)
+  */
++#include <stdlib.h>
++
+ #include "main.h"
+ #include "hashmap.h"
+@@ -50,6 +52,7 @@ struct hashbucket_s {
+ };
+ struct hashmap_s {
++        uint32_t seed;
+         unsigned int size;
+         hashmap_iter end_iterator;
+@@ -65,7 +68,7 @@ struct hashmap_s {
+  *
+  * If any of the arguments are invalid a negative number is returned.
+  */
+-static int hashfunc (const char *key, unsigned int size)
++static int hashfunc (const char *key, unsigned int size, uint32_t seed)
+ {
+         uint32_t hash;
+@@ -74,7 +77,7 @@ static int hashfunc (const char *key, un
+         if (size == 0)
+                 return -ERANGE;
+-        for (hash = tolower (*key++); *key != '\0'; key++) {
++        for (hash = seed; *key != '\0'; key++) {
+                 uint32_t bit = (hash & 1) ? (1 << (sizeof (uint32_t) - 1)) : 0;
+                 hash >>= 1;
+@@ -104,6 +107,7 @@ hashmap_t hashmap_create (unsigned int n
+         if (!ptr)
+                 return NULL;
++      ptr->seed = (uint32_t)rand();
+         ptr->size = nbuckets;
+         ptr->buckets = (struct hashbucket_s *) safecalloc (nbuckets,
+                                                            sizeof (struct
+@@ -201,7 +205,7 @@ hashmap_insert (hashmap_t map, const cha
+         if (!data || len < 1)
+                 return -ERANGE;
+-        hash = hashfunc (key, map->size);
++        hash = hashfunc (key, map->size, map->seed);
+         if (hash < 0)
+                 return hash;
+@@ -382,7 +386,7 @@ ssize_t hashmap_search (hashmap_t map, c
+         if (map == NULL || key == NULL)
+                 return -EINVAL;
+-        hash = hashfunc (key, map->size);
++        hash = hashfunc (key, map->size, map->seed);
+         if (hash < 0)
+                 return hash;
+@@ -416,7 +420,7 @@ ssize_t hashmap_entry_by_key (hashmap_t
+         if (!map || !key || !data)
+                 return -EINVAL;
+-        hash = hashfunc (key, map->size);
++        hash = hashfunc (key, map->size, map->seed);
+         if (hash < 0)
+                 return hash;
+@@ -451,7 +455,7 @@ ssize_t hashmap_remove (hashmap_t map, c
+         if (map == NULL || key == NULL)
+                 return -EINVAL;
+-        hash = hashfunc (key, map->size);
++        hash = hashfunc (key, map->size, map->seed);
+         if (hash < 0)
+                 return hash;
diff --git a/net/tinyproxy/patches/CVE-2012-3505-tinyproxy-limit-headers.patch b/net/tinyproxy/patches/CVE-2012-3505-tinyproxy-limit-headers.patch
new file mode 100644 (file)
index 0000000..b8023ab
--- /dev/null
@@ -0,0 +1,44 @@
+--- a/src/reqs.c
++++ b/src/reqs.c
+@@ -610,6 +610,11 @@ add_header_to_connection (hashmap_t hash
+         return hashmap_insert (hashofheaders, header, sep, len);
+ }
++/* define max number of headers. big enough to handle legitimate cases,
++ * but limited to avoid DoS 
++ */
++#define MAX_HEADERS 10000
++
+ /*
+  * Read all the headers from the stream
+  */
+@@ -617,6 +622,7 @@ static int get_all_headers (int fd, hash
+ {
+         char *line = NULL;
+         char *header = NULL;
++      int count;
+         char *tmp;
+         ssize_t linelen;
+         ssize_t len = 0;
+@@ -625,7 +631,7 @@ static int get_all_headers (int fd, hash
+         assert (fd >= 0);
+         assert (hashofheaders != NULL);
+-        for (;;) {
++        for (count = 0; count < MAX_HEADERS; count++) {
+                 if ((linelen = readline (fd, &line)) <= 0) {
+                         safefree (header);
+                         safefree (line);
+@@ -691,6 +697,12 @@ static int get_all_headers (int fd, hash
+                 safefree (line);
+         }
++
++      /* if we get there, this is we reached MAX_HEADERS count.
++         bail out with error */
++      safefree (header);
++      safefree (line);
++      return -1;
+ }
+ /*
diff --git a/net/umurmur/Makefile b/net/umurmur/Makefile
new file mode 100644 (file)
index 0000000..d57e9e0
--- /dev/null
@@ -0,0 +1,107 @@
+#
+# 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:=umurmur
+PKG_VERSION:=0.2.15
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://github.com/fatbob313/umurmur.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=f66c0c3d630aaff1c4d589bc4d884067f00b6529
+
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Martin Johansson <martin@fatbob.nu>
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/umurmur/Default
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=Instant Messaging
+  TITLE:=uMurmur
+  DEPENDS:=+libconfig +libprotobuf-c
+  URL:=http://code.google.com/p/umurmur
+  MAINTAINER:=Martin Johansson <martin@fatbob.nu>
+endef
+
+define Package/umurmur/Default/description
+  Minimalistic Mumble server daemon.
+endef
+
+define Package/umurmur-openssl
+  $(call Package/umurmur/Default)
+  TITLE+= (with OpenSSL support)
+  DEPENDS+= +libopenssl
+  VARIANT:=openssl
+endef
+
+define Package/umurmur-openssl/description
+  $(call Package/umurmur/Default/description)
+  Uses OpenSSL library for SSL and crypto.
+endef
+
+define Package/umurmur-polarssl
+  $(call Package/umurmur/Default)
+  TITLE+= (with PolarSSL support)
+  DEPENDS+= +libpolarssl
+  VARIANT:=polarssl
+endef
+
+define Package/umurmur-polarssl/description
+  $(call Package/umurmur/Default/description)
+  Uses the PolarSSL library for SSL and crypto.
+endef
+
+define Build/Compile
+       CC="$(TARGET_CC)" \
+       CFLAGS="$(TARGET_CFLAGS)" \
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       $(MAKE) -C $(PKG_BUILD_DIR)/src all
+endef
+
+define Build/Configure
+       cd $(PKG_BUILD_DIR) && ./autogen.sh
+       $(call Build/Configure/Default)
+endef
+
+define Package/umurmur-openssl/conffiles
+/etc/umurmur.conf
+endef
+
+Package/umurmur-polarssl/conffiles = $(Package/umurmur-openssl/conffiles)
+
+define Package/umurmur-openssl/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/umurmurd $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc
+       $(INSTALL_CONF) $(PKG_BUILD_DIR)/openwrt/files/umurmur.conf $(1)/etc/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/openwrt/files/umurmur.init $(1)/etc/init.d/umurmur
+       $(INSTALL_DIR) $(1)/etc/umurmur
+endef
+
+Package/umurmur-polarssl/install = $(Package/umurmur-openssl/install)
+
+ifeq ($(BUILD_VARIANT),openssl)
+  CONFIGURE_ARGS += \
+       --with-ssl=openssl
+endif
+
+ifeq ($(BUILD_VARIANT),polarssl)
+  CONFIGURE_ARGS += \
+       --with-ssl=polarssl
+endif
+
+$(eval $(call BuildPackage,umurmur-openssl))
+$(eval $(call BuildPackage,umurmur-polarssl))
diff --git a/net/unbound/Makefile b/net/unbound/Makefile
new file mode 100644 (file)
index 0000000..55867ee
--- /dev/null
@@ -0,0 +1,176 @@
+#
+# 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:=unbound
+PKG_VERSION:=1.4.22
+PKG_RELEASE:=1
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILE:=LICENSE
+PKG_MAINTAINER:=Michael Hanselmann <public@hansmi.ch>
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.unbound.net/downloads
+PKG_MD5SUM:=59728c74fef8783f8bad1d7451eba97f
+
+PKG_BUILD_DEPENDS:=libexpat
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/unbound/Default
+  TITLE:=A validating, recursive & caching DNS resolver
+  URL:=http://www.unbound.net/
+  DEPENDS:=+libopenssl
+endef
+
+define Package/unbound
+  $(call Package/unbound/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE+= (daemon)
+  DEPENDS+= +libunbound
+endef
+
+define Package/unbound/description
+  This package contains the Unbound daemon.
+endef
+
+define Package/unbound-anchor
+  $(call Package/unbound/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE+= (anchor utility)
+  DEPENDS+= +unbound +libexpat
+endef
+
+define Package/unbound-anchor/description
+  This package contains the Unbound anchor utility.
+endef
+
+define Package/unbound-control
+  $(call Package/unbound/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE+= (control utility)
+  DEPENDS+= +unbound
+endef
+
+define Package/unbound-control/description
+  This package contains the Unbound control utility.
+endef
+
+define Package/unbound-control-setup
+  $(call Package/unbound/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE+= (control setup utility)
+  DEPENDS+= +unbound-control +openssl-util
+endef
+
+define Package/unbound-control-setup/description
+  This package contains the Unbound control setup utility.
+endef
+
+define Package/unbound-host
+  $(call Package/unbound/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  SUBMENU:=IP Addresses and Names
+  TITLE+= (DNS lookup utility)
+  DEPENDS+= +libunbound
+endef
+
+define Package/unbound-host/description
+  This package contains the Unbound DNS lookup utility.
+endef
+
+define Package/libunbound
+  $(call Package/unbound/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE+= (library)
+endef
+
+define Package/libunbound/description
+  This package contains the Unbound shared library.
+endef
+
+CONFIGURE_ARGS += \
+       --disable-ecdsa \
+       --disable-gost \
+       --enable-allsymbols \
+       --with-libexpat="$(STAGING_DIR)/usr" \
+       --with-ssl="$(STAGING_DIR)/usr" \
+       --without-pthreads
+
+define Package/unbound/conffiles
+/etc/unbound/unbound.conf
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/unbound.h $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.{so*,a,la} $(1)/usr/lib/
+endef
+
+define Package/unbound/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/sbin/unbound \
+               $(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf \
+               $(1)/usr/sbin/
+       $(INSTALL_DIR) $(1)/etc/unbound
+       $(INSTALL_CONF) \
+               $(PKG_INSTALL_DIR)/etc/unbound/unbound.conf \
+               $(1)/etc/unbound/
+       $(INSTALL_CONF) ./files/root.key $(1)/etc/unbound/
+       $(INSTALL_CONF) ./files/named.cache $(1)/etc/unbound/
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
+endef
+
+define Package/unbound-anchor/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-anchor $(1)/usr/sbin/
+endef
+
+define Package/unbound-control/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control $(1)/usr/sbin/
+endef
+
+define Package/unbound-control-setup/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-control-setup $(1)/usr/sbin/
+endef
+
+define Package/unbound-host/install
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/sbin/unbound-host $(1)/usr/sbin/
+endef
+
+define Package/libunbound/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libunbound.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,unbound))
+$(eval $(call BuildPackage,unbound-anchor))
+$(eval $(call BuildPackage,unbound-control))
+$(eval $(call BuildPackage,unbound-control-setup))
+$(eval $(call BuildPackage,unbound-host))
+$(eval $(call BuildPackage,libunbound))
diff --git a/net/unbound/files/named.cache b/net/unbound/files/named.cache
new file mode 100644 (file)
index 0000000..442b515
--- /dev/null
@@ -0,0 +1,89 @@
+;       This file holds the information on root name servers needed to
+;       initialize cache of Internet domain name servers
+;       (e.g. reference this file in the "cache  .  <file>"
+;       configuration file of BIND domain name servers).
+;
+;       This file is made available by InterNIC 
+;       under anonymous FTP as
+;           file                /domain/named.cache
+;           on server           FTP.INTERNIC.NET
+;       -OR-                    RS.INTERNIC.NET
+;
+;       last update:    Mar 26, 2014
+;       related version of root zone:   2014032601
+;
+; formerly NS.INTERNIC.NET
+;
+.                        3600000  IN  NS    A.ROOT-SERVERS.NET.
+A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
+A.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:BA3E::2:30
+;
+; FORMERLY NS1.ISI.EDU
+;
+.                        3600000      NS    B.ROOT-SERVERS.NET.
+B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201
+;
+; FORMERLY C.PSI.NET
+;
+.                        3600000      NS    C.ROOT-SERVERS.NET.
+C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
+C.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2::C
+;
+; FORMERLY TERP.UMD.EDU
+;
+.                        3600000      NS    D.ROOT-SERVERS.NET.
+D.ROOT-SERVERS.NET.      3600000      A     199.7.91.13
+D.ROOT-SERVERS.NET.     3600000      AAAA  2001:500:2D::D
+;
+; FORMERLY NS.NASA.GOV
+;
+.                        3600000      NS    E.ROOT-SERVERS.NET.
+E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
+;
+; FORMERLY NS.ISC.ORG
+;
+.                        3600000      NS    F.ROOT-SERVERS.NET.
+F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
+F.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:2F::F
+;
+; FORMERLY NS.NIC.DDN.MIL
+;
+.                        3600000      NS    G.ROOT-SERVERS.NET.
+G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
+;
+; FORMERLY AOS.ARL.ARMY.MIL
+;
+.                        3600000      NS    H.ROOT-SERVERS.NET.
+H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
+H.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:1::803F:235
+;
+; FORMERLY NIC.NORDU.NET
+;
+.                        3600000      NS    I.ROOT-SERVERS.NET.
+I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
+I.ROOT-SERVERS.NET.      3600000      AAAA  2001:7FE::53
+;
+; OPERATED BY VERISIGN, INC.
+;
+.                        3600000      NS    J.ROOT-SERVERS.NET.
+J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30
+J.ROOT-SERVERS.NET.      3600000      AAAA  2001:503:C27::2:30
+;
+; OPERATED BY RIPE NCC
+;
+.                        3600000      NS    K.ROOT-SERVERS.NET.
+K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
+K.ROOT-SERVERS.NET.      3600000      AAAA  2001:7FD::1
+;
+; OPERATED BY ICANN
+;
+.                        3600000      NS    L.ROOT-SERVERS.NET.
+L.ROOT-SERVERS.NET.      3600000      A     199.7.83.42
+L.ROOT-SERVERS.NET.      3600000      AAAA  2001:500:3::42
+;
+; OPERATED BY WIDE
+;
+.                        3600000      NS    M.ROOT-SERVERS.NET.
+M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
+M.ROOT-SERVERS.NET.      3600000      AAAA  2001:DC3::35
+; End of File
diff --git a/net/unbound/files/root.key b/net/unbound/files/root.key
new file mode 100644 (file)
index 0000000..2ad6641
--- /dev/null
@@ -0,0 +1 @@
+. IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5
diff --git a/net/unbound/files/unbound.init b/net/unbound/files/unbound.init
new file mode 100755 (executable)
index 0000000..4e700e4
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh /etc/rc.common
+#Copyright (C) 2010 Ondrej Caletka <o.caletka@sh.cvut.cz>
+START=61
+
+start () {
+       unbound
+}
+
+stop () {
+       PIDFILE='/var/run/unbound.pid'
+       if [ -f $PIDFILE ] ; then
+               kill $(cat $PIDFILE)
+       fi
+}
diff --git a/net/unbound/patches/001-conf.patch b/net/unbound/patches/001-conf.patch
new file mode 100644 (file)
index 0000000..6300e51
--- /dev/null
@@ -0,0 +1,154 @@
+--- a/doc/example.conf.in
++++ b/doc/example.conf.in
+@@ -38,6 +38,8 @@ server:
+       # interface: 192.0.2.154
+       # interface: 192.0.2.154@5003
+       # interface: 2001:DB8::5
++      interface: 0.0.0.0
++      interface: ::0
+       # enable this feature to copy the source address of queries to reply.
+       # Socket options are not supported on all platforms. experimental. 
+@@ -57,6 +59,7 @@ server:
+       # port range that can be open simultaneously.  About double the
+       # num-queries-per-thread, or, use as many as the OS will allow you.
+       # outgoing-range: 4096
++      outgoing-range: 60
+       # permit unbound to use this port number or port range for
+       # making outgoing queries, using an outgoing interface.
+@@ -73,9 +76,11 @@ server:
+       # number of outgoing simultaneous tcp buffers to hold per thread.
+       # outgoing-num-tcp: 10
++      outgoing-num-tcp: 1
+       # number of incoming simultaneous tcp buffers to hold per thread.
+       # incoming-num-tcp: 10
++      incoming-num-tcp: 1
+       # buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
+       # 0 is system default.  Use 4m to catch query spikes for busy servers.
+@@ -99,18 +104,22 @@ server:
+       # buffer size for handling DNS data. No messages larger than this
+       # size can be sent or received, by UDP or TCP. In bytes.
+       # msg-buffer-size: 65552
++      msg-buffer-size: 8192
+       # the amount of memory to use for the message cache.
+       # plain value in bytes or you can append k, m or G. default is "4Mb". 
+       # msg-cache-size: 4m
++      msg-cache-size: 100k
+       # the number of slabs to use for the message cache.
+       # the number of slabs must be a power of 2.
+       # more slabs reduce lock contention, but fragment memory usage.
+       # msg-cache-slabs: 4
++      msg-cache-slabs: 1
+       # the number of queries that a thread gets to service.
+       # num-queries-per-thread: 1024
++      num-queries-per-thread: 30
+       # if very busy, 50% queries run to completion, 50% get timeout in msec
+       # jostle-timeout: 200
+@@ -121,11 +130,13 @@ server:
+       # the amount of memory to use for the RRset cache.
+       # plain value in bytes or you can append k, m or G. default is "4Mb". 
+       # rrset-cache-size: 4m
++      rrset-cache-size: 100k
+       # the number of slabs to use for the RRset cache.
+       # the number of slabs must be a power of 2.
+       # more slabs reduce lock contention, but fragment memory usage.
+       # rrset-cache-slabs: 4
++      rrset-cache-slabs: 1
+       # the time to live (TTL) value lower bound, in seconds. Default 0.
+       # If more than an hour could easily give trouble due to stale data.
+@@ -143,9 +154,11 @@ server:
+       # the number of slabs must be a power of 2.
+       # more slabs reduce lock contention, but fragment memory usage.
+       # infra-cache-slabs: 4
++      infra-cache-slabs: 1
+       # the maximum number of hosts that are cached (roundtrip, EDNS, lame).
+       # infra-cache-numhosts: 10000
++      infra-cache-numhosts: 200
+       # Enable IPv4, "yes" or "no".
+       # do-ip4: yes
+@@ -178,6 +191,8 @@ server:
+       # access-control: ::0/0 refuse
+       # access-control: ::1 allow
+       # access-control: ::ffff:127.0.0.1 allow
++      access-control: 0.0.0.0/0 allow
++      access-control: ::0/0 allow
+       # if given, a chroot(2) is done to the given directory.
+       # i.e. you can chroot to the working directory, for example,
+@@ -208,6 +223,7 @@ server:
+       # and the given username is assumed. Default is user "unbound".
+       # If you give "" no privileges are dropped.
+       # username: "@UNBOUND_USERNAME@"
++      username: ""
+       # the working directory. The relative files in this config are 
+       # relative to this directory. If you give "" the working directory
+@@ -230,10 +246,12 @@ server:
+       # the pid file. Can be an absolute path outside of chroot/work dir.
+       # pidfile: "@UNBOUND_PIDFILE@"
++      pidfile: "/var/run/unbound.pid"
+       # file to read root hints from.
+       # get one from ftp://FTP.INTERNIC.NET/domain/named.cache
+       # root-hints: ""
++      root-hints: "/etc/unbound/named.cache"
+       # enable to not answer id.server and hostname.bind queries.
+       # hide-identity: no
+@@ -256,12 +274,15 @@ server:
+       #       positive value: fetch that many targets opportunistically.
+       # Enclose the list of numbers between quotes ("").
+       # target-fetch-policy: "3 2 1 0 0"
++      target-fetch-policy: "2 1 0 0 0 0"
+       # Harden against very small EDNS buffer sizes. 
+       # harden-short-bufsize: no
++      harden-short-bufsize: yes
+       # Harden against unseemly large queries.
+       # harden-large-queries: no
++      harden-large-queries: yes
+       # Harden against out of zone rrsets, to avoid spoofing attempts. 
+       # harden-glue: yes
+@@ -342,7 +363,7 @@ server:
+       # you start unbound (i.e. in the system boot scripts).  And enable:
+       # Please note usage of unbound-anchor root anchor is at your own risk
+       # and under the terms of our LICENSE (see that file in the source).
+-      # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
++      auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
+       # File with DLV trusted keys. Same format as trust-anchor-file.
+       # There can be only one DLV configured, it is trusted from root down.
+@@ -428,15 +449,18 @@ server:
+       # the amount of memory to use for the key cache.
+       # plain value in bytes or you can append k, m or G. default is "4Mb". 
+       # key-cache-size: 4m
++      key-cache-size: 100k
+       # the number of slabs to use for the key cache.
+       # the number of slabs must be a power of 2.
+       # more slabs reduce lock contention, but fragment memory usage.
+       # key-cache-slabs: 4
++      key-cache-slabs: 1
+       # the amount of memory to use for the negative cache (used for DLV).
+       # plain value in bytes or you can append k, m or G. default is "1Mb". 
+       # neg-cache-size: 1m
++      neg-cache-size: 10k
+       # By default, for a number of zones a small default 'nothing here'
+       # reply is built-in.  Query traffic is thus blocked.  If you
index 64bbc758bb70057e67aa804eb487eb6c5a7b9a0d..c132622014c342ccceed4bd8d80b08b996f0be24 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://eden-feed.erg.abdn.ac.uk/wavemon/stable-releases
 PKG_MD5SUM:=c60e25feb8b1785cf14371556f0613f4
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 
@@ -22,7 +24,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/wavemon
   SECTION:=net
   CATEGORY:=Network
-  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
+  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
   TITLE:=N-curses based wireless network devices monitor
   DEPENDS:=+libncurses +libpthread
   SUBMENU:=wireless
index a791c06dd7f69686cc2a9a6707f4b91f38cbe6f0..c03dffcb36de728ed32b4ba86cba41cbbc5d3fda 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
 PKG_MD5SUM:=7a279d5ac5594919124d5526e7143e28
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=GPL-3.0+
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 
index 9d725191c77edf8fad990f312ec4095aa926978d..65c5368c915438a978dacde2bd63b9af4d1b840f 100644 (file)
@@ -9,11 +9,13 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=xinetd
 PKG_VERSION:=2.3.15
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.xinetd.org
 PKG_MD5SUM:=77358478fd58efa6366accae99b8b04c
+PKG_LICENSE:=xinetd
+PKG_LICENSE_FILES:=COPYRIGHT
 
 PKG_INSTALL:=1
 
@@ -24,7 +26,7 @@ define Package/xinetd
   CATEGORY:=Network
   TITLE:=A powerful and secure super-server
   URL:=http://www.xinetd.org/
-  MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
+  PKG_MAINTAINER:=Jonathan McCrohan <jmccrohan@gmail.com>
 endef
 
 define Package/xinetd/description
diff --git a/net/xinetd/patches/004-ident-bind.patch b/net/xinetd/patches/004-ident-bind.patch
new file mode 100644 (file)
index 0000000..ddabab8
--- /dev/null
@@ -0,0 +1,42 @@
+xinetd: socket bind: Invalid argument (errno = 22) when using USERID on ipv6
+
+Use right size of addresses in bind() call. Also use getpeername addresses when
+connecting to ident service to prevent address family mismatch between socket(),
+bind() and connect() calls.
+
+Author: Jan Safranek <jsafrane@redhat.com>
+Reviewed-By: Adam Tkac <atkac@redhat.com>
+
+#diff -up xinetd-2.3.14/xinetd/ident.c.orig xinetd-2.3.14/xinetd/ident.c
+--- a/xinetd/ident.c
++++ b/xinetd/ident.c
+@@ -97,7 +98,13 @@ idresult_e log_remote_user( const struct
+    }
+    CLEAR( sin_contact );
+-   sin_remote = *CONN_XADDRESS( SERVER_CONNECTION( serp ) ) ;
++
++   sin_len = sizeof( sin_remote );
++   if ( getpeername( SERVER_FD( serp ), &sin_remote.sa, &sin_len ) == -1 )
++   {
++      msg( LOG_ERR, func, "(%d) getpeername: %m", getpid() ) ;
++      return( IDR_ERROR ) ;
++   }
+    sin_contact = sin_remote;
+    memcpy( &sin_bind, &sin_local, sizeof(sin_bind) ) ;
+    local_port = 0;
+@@ -121,7 +128,13 @@ idresult_e log_remote_user( const struct
+       msg( LOG_ERR, func, "socket creation: %m" ) ;
+       return( IDR_ERROR ) ;
+    }
+-   if ( bind(sd, &sin_bind.sa, sizeof(sin_bind.sa)) == -1 )
++
++   if ( sin_bind.sa.sa_family == AF_INET ) 
++      sin_len = sizeof( sin_bind.sa_in ) ;
++   else
++      sin_len = sizeof( sin_bind.sa_in6 ) ;
++
++   if ( bind(sd, &sin_bind.sa, sin_len) == -1 )
+    { 
+       msg( LOG_ERR, func, "socket bind: %m" ) ;
+       (void) Sclose( sd ) ;
index 4e108ab809d64ad10a69d9f6a9f0bcde64ae6ff9..2a1c4a5df320f1fa20bc3f5a6940b2109291c685 100644 (file)
@@ -11,6 +11,8 @@ PKG_NAME:=xl2tpd
 PKG_VERSION:=1.3.6
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=LICENSE
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
 
@@ -65,7 +67,7 @@ define Package/xl2tpd/install
        $(INSTALL_DATA) ./files/options.xl2tpd $(1)/etc/ppp/
 
        $(INSTALL_DIR) $(1)/lib/netifd/proto
-       $(INSTALL_BIN) ./files/l2tpv2.sh $(1)/lib/netifd/proto
+       $(INSTALL_BIN) ./files/l2tp.sh $(1)/lib/netifd/proto
 endef
 
 $(eval $(call BuildPackage,xl2tpd))
diff --git a/net/xl2tpd/files/l2tp.sh b/net/xl2tpd/files/l2tp.sh
new file mode 100644 (file)
index 0000000..867234d
--- /dev/null
@@ -0,0 +1,107 @@
+#!/bin/sh
+
+[ -x /usr/sbin/xl2tpd ] || exit 0
+
+[ -n "$INCLUDE_ONLY" ] || {
+       . /lib/functions.sh
+       . ../netifd-proto.sh
+       init_proto "$@"
+}
+
+proto_l2tp_init_config() {
+       proto_config_add_string "username"
+       proto_config_add_string "password"
+       proto_config_add_string "keepalive"
+       proto_config_add_string "pppd_options"
+       proto_config_add_boolean "ipv6"
+       proto_config_add_int "mtu"
+       proto_config_add_string "server"
+       available=1
+       no_device=1
+}
+
+proto_l2tp_setup() {
+       local config="$1"
+       local iface="$2"
+       local optfile="/tmp/l2tp/options.${config}"
+
+       local ip serv_addr server
+       json_get_var server server && {
+               for ip in $(resolveip -t 5 "$server"); do
+                       ( proto_add_host_dependency "$config" "$ip" )
+                       serv_addr=1
+               done
+       }
+       [ -n "$serv_addr" ] || {
+               echo "Could not resolve server address"
+               sleep 5
+               proto_setup_failed "$config"
+               exit 1
+       }
+
+       if [ ! -p /var/run/xl2tpd/l2tp-control ]; then
+               /etc/init.d/xl2tpd start
+       fi
+
+       json_get_vars ipv6 demand keepalive username password pppd_options
+       [ "$ipv6" = 1 ] || ipv6=""
+       if [ "${demand:-0}" -gt 0 ]; then
+               demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
+       else
+               demand="persist"
+       fi
+
+       [ -n "$mtu" ] || json_get_var mtu mtu
+
+       local interval="${keepalive##*[, ]}"
+       [ "$interval" != "$keepalive" ] || interval=5
+
+       mkdir -p /tmp/l2tp
+
+       echo "${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}}" > "${optfile}"
+       echo "usepeerdns" >> "${optfile}"
+       echo "nodefaultroute" >> "${optfile}"
+       echo "${username:+user \"$username\" password \"$password\"}" >> "${optfile}"
+       echo "ipparam \"$config\"" >> "${optfile}"
+       echo "ifname \"l2tp-$config\"" >> "${optfile}"
+       echo "ip-up-script /lib/netifd/ppp-up" >> "${optfile}"
+       echo "ipv6-up-script /lib/netifd/ppp-up" >> "${optfile}"
+       echo "ip-down-script /lib/netifd/ppp-down" >> "${optfile}"
+       echo "ipv6-down-script /lib/netifd/ppp-down" >> "${optfile}"
+       # Don't wait for LCP term responses; exit immediately when killed.
+       echo "lcp-max-terminate 0" >> "${optfile}"
+       echo "${ipv6:++ipv6} ${pppd_options}" >> "${optfile}"
+       echo "${mtu:+mtu $mtu mru $mtu}" >> "${optfile}"
+
+       xl2tpd-control add l2tp-${config} pppoptfile=${optfile} lns=${server} redial=yes redial timeout=20
+       xl2tpd-control connect l2tp-${config}
+}
+
+proto_l2tp_teardown() {
+       local interface="$1"
+       local optfile="/tmp/l2tp/options.${interface}"
+
+       case "$ERROR" in
+               11|19)
+                       proto_notify_error "$interface" AUTH_FAILED
+                       proto_block_restart "$interface"
+               ;;
+               2)
+                       proto_notify_error "$interface" INVALID_OPTIONS
+                       proto_block_restart "$interface"
+               ;;
+       esac
+
+       xl2tpd-control disconnect l2tp-${interface}
+       # Wait for interface to go down
+        while [ -d /sys/class/net/l2tp-${interface} ]; do
+               sleep 1
+       done
+
+       xl2tpd-control remove l2tp-${interface}
+       rm -f ${optfile}
+}
+
+[ -n "$INCLUDE_ONLY" ] || {
+       add_protocol l2tp
+}
diff --git a/net/xl2tpd/files/l2tpv2.sh b/net/xl2tpd/files/l2tpv2.sh
deleted file mode 100644 (file)
index 6466cf0..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/bin/sh
-
-[ -x /usr/sbin/xl2tpd ] || exit 0
-
-[ -n "$INCLUDE_ONLY" ] || {
-       . /lib/functions.sh
-       . ../netifd-proto.sh
-       init_proto "$@"
-}
-
-proto_l2tpv2_init_config() {
-       proto_config_add_string "username"
-       proto_config_add_string "password"
-       proto_config_add_string "keepalive"
-       proto_config_add_string "pppd_options"
-       proto_config_add_boolean "ipv6"
-       proto_config_add_int "mtu"
-       proto_config_add_string "server"
-       available=1
-       no_device=1
-}
-
-proto_l2tpv2_setup() {
-       local config="$1"
-       local iface="$2"
-       local optfile="/tmp/l2tp/options.${config}"
-
-       local ip serv_addr server
-       json_get_var server server && {
-               for ip in $(resolveip -t 5 "$server"); do
-                       ( proto_add_host_dependency "$config" "$ip" )
-                       serv_addr=1
-               done
-       }
-       [ -n "$serv_addr" ] || {
-               echo "Could not resolve server address"
-               sleep 5
-               proto_setup_failed "$config"
-               exit 1
-       }
-
-       if [ ! -p /var/run/xl2tpd/l2tp-control ]; then
-               /etc/init.d/xl2tpd start
-       fi
-
-       json_get_vars ipv6 demand keepalive username password pppd_options
-       [ "$ipv6" = 1 ] || ipv6=""
-       if [ "${demand:-0}" -gt 0 ]; then
-               demand="precompiled-active-filter /etc/ppp/filter demand idle $demand"
-       else
-               demand="persist"
-       fi
-
-       [ -n "$mtu" ] || json_get_var mtu mtu
-
-       local interval="${keepalive##*[, ]}"
-       [ "$interval" != "$keepalive" ] || interval=5
-
-       mkdir -p /tmp/l2tp
-
-       echo "${keepalive:+lcp-echo-interval $interval lcp-echo-failure ${keepalive%%[, ]*}}" > "${optfile}"
-       echo "usepeerdns" >> "${optfile}"
-       echo "nodefaultroute" >> "${optfile}"
-       echo "${username:+user \"$username\" password \"$password\"}" >> "${optfile}"
-       echo "ipparam \"$config\"" >> "${optfile}"
-       echo "ifname \"l2tp-$config\"" >> "${optfile}"
-       echo "ip-up-script /lib/netifd/ppp-up" >> "${optfile}"
-       echo "ipv6-up-script /lib/netifd/ppp-up" >> "${optfile}"
-       echo "ip-down-script /lib/netifd/ppp-down" >> "${optfile}"
-       echo "ipv6-down-script /lib/netifd/ppp-down" >> "${optfile}"
-       # Don't wait for LCP term responses; exit immediately when killed.
-       echo "lcp-max-terminate 0" >> "${optfile}"
-       echo "${ipv6:++ipv6} ${pppd_options}" >> "${optfile}"
-       echo "${mtu:+mtu $mtu mru $mtu}" >> "${optfile}"
-
-       xl2tpd-control add l2tp-${config} pppoptfile=${optfile} lns=${server} redial=yes redial timeout=20
-       xl2tpd-control connect l2tp-${config}
-}
-
-proto_l2tpv2_teardown() {
-       local interface="$1"
-       local optfile="/tmp/l2tp/options.${interface}"
-
-       case "$ERROR" in
-               11|19)
-                       proto_notify_error "$interface" AUTH_FAILED
-                       proto_block_restart "$interface"
-               ;;
-               2)
-                       proto_notify_error "$interface" INVALID_OPTIONS
-                       proto_block_restart "$interface"
-               ;;
-       esac
-
-       xl2tpd-control disconnect l2tp-${interface}
-       # Wait for interface to go down
-        while [ -d /sys/class/net/l2tp-${interface} ]; do
-               sleep 1
-       done
-
-       xl2tpd-control remove l2tp-${interface}
-       rm -f ${optfile}
-}
-
-[ -n "$INCLUDE_ONLY" ] || {
-       add_protocol l2tpv2
-}
index d342bc92f2b5536335372a6b959aff5aa6197b2d..e7057e5e9db9078ffef962c06e3167384e88e7b3 100644 (file)
@@ -19,7 +19,7 @@ PKG_FIXUP:=autoreconf
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-PKG_LICENSE:=LGPLv2
+PKG_LICENSE:=LGPL-2.0
 PKG_LICENSE_FILES:=COPYING LICENSE
 
 include $(INCLUDE_DIR)/package.mk
index 184ca9bf99801548bbb8f33cdc914abaab304e0a..e6b62633a5bce03319fc2aefadf9827796f1c6ad 100644 (file)
@@ -14,6 +14,8 @@ PKG_RELEASE:=2
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://www.musicpd.org/download/mpc/0
 PKG_MD5SUM:=d4f37e7e6b32c804a870192d1eb86199
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
 include $(INCLUDE_DIR)/package.mk
index 1571b256aedb449dd8d7ddf42a2c235b7d07bf71..a3e99d2f18429c3efd822f41e15ca114c4f788f8 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011 OpenWrt.org
+# Copyright (C) 2011-2014 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -14,6 +14,8 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
 PKG_MD5SUM:=c43749838612f4860465e83ed62ca38e
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=GPL LICENSE
 
 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_BUILD_DEPENDS:=intltool/host
index 6977a777cc2f1633e663dc68e0b341bb5357d5be..8fa571325773145de12215ff0be3b175e584d747 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/sox
 PKG_MD5SUM:=ff9ca6aca972549de0e80e8e30ed379c
 
-PKG_LICENSE:=LGPLv2.1 GPLv2
+PKG_LICENSE:=LGPL-2.1 GPL-2.0
 PKG_LICENSE_FILES:=COPYING LICENSE.LGPL LICENSE.GPL
 
 PKG_INSTALL:=1
index 7b42c8533f1da2ee82dbfa3a4b2cee960ffb1833..d4da42461508304c40318f1f31237047a73b49b9 100644 (file)
@@ -20,6 +20,7 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_INSTALL:=1
+PKG_LICENSE:=LGPL-2.1 GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
 
index 48c75f09550df4bada1893b5590c005035ec2724..43d90177f9d8c0a2f6ceb09fa39b57884b820083 100644 (file)
@@ -20,6 +20,7 @@ PKG_SOURCE_VERSION:=$(PKG_REV)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
 PKG_INSTALL:=1
+PKG_LICENSE:=LGPL-2.1 GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
 
diff --git a/utils/bash/Makefile b/utils/bash/Makefile
new file mode 100644 (file)
index 0000000..be80dff
--- /dev/null
@@ -0,0 +1,69 @@
+#
+# 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:=bash
+PKG_VERSION:=4.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/bash
+PKG_MD5SUM:=81348932d5da294953e15d4814c74dd1
+
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bash
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=The GNU Bourne Again SHell
+  DEPENDS:=+libncurses
+  URL:=http://www.gnu.org/software/bash/
+endef
+
+define Package/bash/description
+  Bash is an sh-compatible command language interpreter that executes
+  commands read from the standard input or from a file. Bash also
+  incorporates useful features from the Korn and C shells (ksh and csh).
+endef
+
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               --without-bash-malloc \
+                --bindir=/bin \
+       )
+endef
+
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR)/builtins LDFLAGS_FOR_BUILD= mkbuiltins
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               SHELL="/bin/bash" \
+               all install
+endef
+
+define Package/bash/postinst
+#!/bin/sh
+grep bash $${IPKG_INSTROOT}/etc/shells || \
+       echo "/bin/bash" >> $${IPKG_INSTROOT}/etc/shells
+       echo "/bin/rbash" >> $${IPKG_INSTROOT}/etc/shells
+endef
+
+define Package/bash/install
+       $(INSTALL_DIR) $(1)/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/bash $(1)/bin/
+       ln -sf bash $(1)/bin/rbash
+endef
+
+
+$(eval $(call BuildPackage,bash))
diff --git a/utils/bash/patches/001-compile-fix.patch b/utils/bash/patches/001-compile-fix.patch
new file mode 100644 (file)
index 0000000..7efa97b
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/execute_cmd.c
++++ b/execute_cmd.c
+@@ -2369,7 +2369,11 @@ execute_pipeline (command, asynchronous,
+   /* If the `lastpipe' option is set with shopt, and job control is not
+      enabled, execute the last element of non-async pipelines in the
+      current shell environment. */
+-  if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
++  if (lastpipe_opt &&
++#if defined(JOB_CONTROL)
++               job_control == 0 && 
++#endif
++               asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
+     {
+       lstdin = move_to_high_fd (0, 1, -1);
+       if (lstdin > 0)
diff --git a/utils/bash/patches/002-force-internal-readline.patch b/utils/bash/patches/002-force-internal-readline.patch
new file mode 100644 (file)
index 0000000..050e476
--- /dev/null
@@ -0,0 +1,24 @@
+--- a/configure
++++ b/configure
+@@ -5430,8 +5430,7 @@ if test $opt_readline = yes; then
+               # static version specified as -llibname to override the
+               # dynamic version
+               case "${host_os}" in
+-              darwin[89]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;;
+-              *)              READLINE_LIB=-lreadline ;;
++              *) READLINE_LIB='${READLINE_LIBRARY}' ;;
+               esac
+       fi
+ else
+--- a/configure.ac
++++ b/configure.ac
+@@ -578,8 +578,7 @@ if test $opt_readline = yes; then
+               # static version specified as -llibname to override the
+               # dynamic version
+               case "${host_os}" in
+-              darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;;
+-              *)              READLINE_LIB=-lreadline ;;
++              *) READLINE_LIB='${READLINE_LIBRARY}' ;;
+               esac
+       fi
+ else
diff --git a/utils/bash/patches/101-upstream-bash43-001.patch b/utils/bash/patches/101-upstream-bash43-001.patch
new file mode 100644 (file)
index 0000000..3231273
--- /dev/null
@@ -0,0 +1,49 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-001
+
+Bug-Reported-by:       NBaH <nbah@sfr.fr>
+Bug-Reference-ID:      <ler0b5$iu9$1@speranza.aioe.org>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00092.html
+
+Bug-Description:
+
+A missing check for a valid option prevented `test -R' from working.  There
+is another problem that causes bash to look up the wrong variable name when
+processing the argument to `test -R'.
+
+Patch (apply with `patch -p0'):
+
+--- a/test.c
++++ b/test.c
+@@ -646,8 +646,8 @@ unary_test (op, arg)
+       return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE);
+     case 'R':
+-      v = find_variable (arg);
+-      return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE);
++      v = find_variable_noref (arg);
++      return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE);
+     }
+   /* We can't actually get here, but this shuts up gcc. */
+@@ -723,6 +723,7 @@ test_unop (op)
+     case 'o': case 'p': case 'r': case 's': case 't':
+     case 'u': case 'v': case 'w': case 'x': case 'z':
+     case 'G': case 'L': case 'O': case 'S': case 'N':
++    case 'R':
+       return (1);
+     }
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 0
++#define PATCHLEVEL 1
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/102-upstream-bash43-002.patch b/utils/bash/patches/102-upstream-bash43-002.patch
new file mode 100644 (file)
index 0000000..35421e8
--- /dev/null
@@ -0,0 +1,49 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-002
+
+Bug-Reported-by:       Moe Tunes <moetunes42@gmail.com>
+Bug-Reference-ID:      <53103F49.3070100@gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00086.html
+
+Bug-Description:
+
+A change to save state while running the DEBUG trap caused pipelines to hang
+on systems which need process group synchronization while building pipelines.
+
+Patch (apply with `patch -p0'):
+
+--- a/trap.c
++++ b/trap.c
+@@ -920,7 +920,8 @@ _run_trap_internal (sig, tag)
+       subst_assign_varlist = 0;
+ #if defined (JOB_CONTROL)
+-      save_pipeline (1);      /* XXX only provides one save level */
++      if (sig != DEBUG_TRAP)  /* run_debug_trap does this */
++      save_pipeline (1);      /* XXX only provides one save level */
+ #endif
+       /* If we're in a function, make sure return longjmps come here, too. */
+@@ -940,7 +941,8 @@ _run_trap_internal (sig, tag)
+       trap_exit_value = last_command_exit_value;
+ #if defined (JOB_CONTROL)
+-      restore_pipeline (1);
++      if (sig != DEBUG_TRAP)  /* run_debug_trap does this */
++      restore_pipeline (1);
+ #endif
+       subst_assign_varlist = save_subst_varlist;
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 1
++#define PATCHLEVEL 2
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/103-upstream-bash43-003.patch b/utils/bash/patches/103-upstream-bash43-003.patch
new file mode 100644 (file)
index 0000000..7c9e56b
--- /dev/null
@@ -0,0 +1,39 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-003
+
+Bug-Reported-by:       Anatol Pomozov <anatol.pomozov@gmail.com>
+Bug-Reference-ID:      <CAOMFOmXy3mT2So5GQ5F-smCVArQuAeBwZ2QKzgCtMeXJoDeYOQ@mail.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html
+
+Bug-Description:
+
+When in callback mode, some readline commands can cause readline to seg
+fault by passing invalid contexts to callback functions.
+
+Patch (apply with `patch -p0'):
+
+--- a/lib/readline/readline.c
++++ b/lib/readline/readline.c
+@@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt)
+     r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
+   RL_CHECK_SIGNALS ();
+-  if (r == 0)                 /* success! */
++  /* We only treat values < 0 specially to simulate recursion. */
++  if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */
+     {
+       _rl_keyseq_chain_dispose ();
+       RL_UNSETSTATE (RL_STATE_MULTIKEY);
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 2
++#define PATCHLEVEL 3
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/104-upstream-bash43-004.patch b/utils/bash/patches/104-upstream-bash43-004.patch
new file mode 100644 (file)
index 0000000..40ac35f
--- /dev/null
@@ -0,0 +1,38 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-004
+
+Bug-Reported-by:       Daan van Rossum <daan@flash.uchicago.edu>
+Bug-Reference-ID:      <20140307072523.GA14250@flash.uchicago.edu>
+Bug-Reference-URL:     
+
+Bug-Description:
+
+The `.' command in vi mode cannot undo multi-key commands beginning with
+`c', `d', and `y' (command plus motion specifier).
+
+Patch (apply with `patch -p0'):
+
+--- a/lib/readline/readline.c
++++ b/lib/readline/readline.c
+@@ -965,7 +965,7 @@ _rl_dispatch_subseq (key, map, got_subse
+ #if defined (VI_MODE)
+   if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap &&
+       key != ANYOTHERKEY &&
+-      rl_key_sequence_length == 1 &&  /* XXX */
++      _rl_dispatching_keymap == vi_movement_keymap &&
+       _rl_vi_textmod_command (key))
+     _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign);
+ #endif
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 3
++#define PATCHLEVEL 4
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/105-upstream-bash43-005.patch b/utils/bash/patches/105-upstream-bash43-005.patch
new file mode 100644 (file)
index 0000000..1cc5473
--- /dev/null
@@ -0,0 +1,50 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-005
+
+Bug-Reported-by:       David Sines <dave.gma@googlemail.com>
+Bug-Reference-ID:      <CAO3BAa_CK_Rgkhdfzs+NJ4KFYdB9qW3pvXQK0xLCi6GMmDU8bw@mail.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00037.html
+
+Bug-Description:
+
+When in Posix mode, bash did not correctly interpret the ANSI-C-style
+$'...' quoting mechanism when performing pattern substitution word
+expansions within double quotes.
+
+Patch (apply with `patch -p0'):
+
+--- a/parse.y
++++ b/parse.y
+@@ -3398,7 +3398,7 @@ parse_matched_pair (qc, open, close, len
+          within a double-quoted ${...} construct "an even number of
+          unescaped double-quotes or single-quotes, if any, shall occur." */
+       /* This was changed in Austin Group Interp 221 */
+-      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
++      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
+       continue;
+       /* Could also check open == '`' if we want to parse grouping constructs
+--- a/y.tab.c
++++ b/y.tab.c
+@@ -5710,7 +5710,7 @@ parse_matched_pair (qc, open, close, len
+          within a double-quoted ${...} construct "an even number of
+          unescaped double-quotes or single-quotes, if any, shall occur." */
+       /* This was changed in Austin Group Interp 221 */
+-      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
++      if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'')
+       continue;
+       /* Could also check open == '`' if we want to parse grouping constructs
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 4
++#define PATCHLEVEL 5
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/106-upstream-bash43-006.patch b/utils/bash/patches/106-upstream-bash43-006.patch
new file mode 100644 (file)
index 0000000..c5f52b1
--- /dev/null
@@ -0,0 +1,39 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-006
+
+Bug-Reported-by:       Eduardo A . Bustamante Lopez <dualbus@gmail.com>
+Bug-Reference-ID:      <20140228170013.GA16015@dualbus.me>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00091.html
+
+Bug-Description:
+
+A shell that started with job control active but was not interactive left
+the terminal in the wrong process group when exiting, causing its parent
+shell to get a stop signal when it attempted to read from the terminal.
+
+Patch (apply with `patch -p0'):
+
+--- a/jobs.c
++++ b/jobs.c
+@@ -4374,7 +4374,7 @@ without_job_control ()
+ void
+ end_job_control ()
+ {
+-  if (interactive_shell)              /* XXX - should it be interactive? */
++  if (interactive_shell || job_control)               /* XXX - should it be just job_control? */
+     {
+       terminate_stopped_jobs ();
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 5
++#define PATCHLEVEL 6
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/107-upstream-bash43-007.patch b/utils/bash/patches/107-upstream-bash43-007.patch
new file mode 100644 (file)
index 0000000..8578bd4
--- /dev/null
@@ -0,0 +1,45 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-007
+
+Bug-Reported-by:       geir.hauge@gmail.com
+Bug-Reference-ID:      <20140318093650.B181C1C5B0B@gina.itea.ntnu.no>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00095.html
+
+Bug-Description:
+
+Using compound assignments for associative arrays like
+
+assoc=( [x]= [y]=bar )
+
+left the value corresponding to the key `x' NULL.  This caused subsequent
+lookups to interpret it as unset.
+
+Patch (apply with `patch -p0'):
+
+--- a/arrayfunc.c
++++ b/arrayfunc.c
+@@ -597,6 +597,11 @@ assign_compound_array_list (var, nlist,
+       if (assoc_p (var))
+       {
+         val = expand_assignment_string_to_string (val, 0);
++        if (val == 0)
++          {
++            val = (char *)xmalloc (1);
++            val[0] = '\0';    /* like do_assignment_internal */
++          }
+         free_val = 1;
+       }
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 6
++#define PATCHLEVEL 7
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/108-upstream-bash43-008.patch b/utils/bash/patches/108-upstream-bash43-008.patch
new file mode 100644 (file)
index 0000000..2402021
--- /dev/null
@@ -0,0 +1,148 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-008
+
+Bug-Reported-by:       Stephane Chazelas <stephane.chazelas@gmail.com>
+Bug-Reference-ID:      <20140318135901.GB22158@chaz.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00098.html
+
+Bug-Description:
+
+Some extended glob patterns incorrectly matched filenames with a leading
+dot, regardless of the setting of the `dotglob' option.
+
+Patch (apply with `patch -p0'):
+
+--- a/lib/glob/gmisc.c
++++ b/lib/glob/gmisc.c
+@@ -210,6 +210,7 @@ extglob_pattern_p (pat)
+     case '+':
+     case '!':
+     case '@':
++    case '?':
+       return (pat[1] == LPAREN);
+     default:
+       return 0;
+--- a/lib/glob/glob.c
++++ b/lib/glob/glob.c
+@@ -179,42 +179,50 @@ extglob_skipname (pat, dname, flags)
+      char *pat, *dname;
+      int flags;
+ {
+-  char *pp, *pe, *t;
+-  int n, r;
++  char *pp, *pe, *t, *se;
++  int n, r, negate;
++  negate = *pat == '!';
+   pp = pat + 2;
+-  pe = pp + strlen (pp) - 1;  /*(*/
+-  if (*pe != ')')
+-    return 0;
+-  if ((t = strchr (pp, '|')) == 0)    /* easy case first */
++  se = pp + strlen (pp) - 1;          /* end of string */
++  pe = glob_patscan (pp, se, 0);      /* end of extglob pattern (( */
++  /* we should check for invalid extglob pattern here */
++  /* if pe != se we have more of the pattern at the end of the extglob
++     pattern. Check the easy case first ( */
++  if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
+     {
+       *pe = '\0';
++#if defined (HANDLE_MULTIBYTE)
++      r = mbskipname (pp, dname, flags);
++#else
+       r = skipname (pp, dname, flags);        /*(*/
++#endif
+       *pe = ')';
+       return r;
+     }
++
++  /* check every subpattern */
+   while (t = glob_patscan (pp, pe, '|'))
+     {
+       n = t[-1];
+       t[-1] = '\0';
++#if defined (HANDLE_MULTIBYTE)
++      r = mbskipname (pp, dname, flags);
++#else
+       r = skipname (pp, dname, flags);
++#endif
+       t[-1] = n;
+       if (r == 0)     /* if any pattern says not skip, we don't skip */
+         return r;
+       pp = t;
+     } /*(*/
+-  if (pp == pe)               /* glob_patscan might find end of pattern */
++  /* glob_patscan might find end of pattern */
++  if (pp == se)
+     return r;
+-  *pe = '\0';
+-#  if defined (HANDLE_MULTIBYTE)
+-  r = mbskipname (pp, dname, flags);  /*(*/
+-#  else
+-  r = skipname (pp, dname, flags);    /*(*/
+-#  endif
+-  *pe = ')';
+-  return r;
++  /* but if it doesn't then we didn't match a leading dot */
++  return 0;
+ }
+ #endif
+@@ -277,20 +285,23 @@ wextglob_skipname (pat, dname, flags)
+      int flags;
+ {
+ #if EXTENDED_GLOB
+-  wchar_t *pp, *pe, *t, n;
+-  int r;
++  wchar_t *pp, *pe, *t, n, *se;
++  int r, negate;
++  negate = *pat == L'!';
+   pp = pat + 2;
+-  pe = pp + wcslen (pp) - 1;  /*(*/
+-  if (*pe != L')')
+-    return 0;
+-  if ((t = wcschr (pp, L'|')) == 0)
++  se = pp + wcslen (pp) - 1;  /*(*/
++  pe = glob_patscan_wc (pp, se, 0);
++
++  if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0)
+     {
+       *pe = L'\0';
+       r = wchkname (pp, dname); /*(*/
+       *pe = L')';
+       return r;
+     }
++
++  /* check every subpattern */
+   while (t = glob_patscan_wc (pp, pe, '|'))
+     {
+       n = t[-1];
+@@ -305,10 +316,8 @@ wextglob_skipname (pat, dname, flags)
+   if (pp == pe)               /* glob_patscan_wc might find end of pattern */
+     return r;
+-  *pe = L'\0';
+-  r = wchkname (pp, dname);   /*(*/
+-  *pe = L')';
+-  return r;
++  /* but if it doesn't then we didn't match a leading dot */
++  return 0;
+ #else
+   return (wchkname (pat, dname));
+ #endif
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 7
++#define PATCHLEVEL 8
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/109-upstream-bash43-009.patch b/utils/bash/patches/109-upstream-bash43-009.patch
new file mode 100644 (file)
index 0000000..f222bd6
--- /dev/null
@@ -0,0 +1,51 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-009
+
+Bug-Reported-by:       Matthias Klose <doko@debian.org>
+Bug-Reference-ID:      <53346FC8.6090005@debian.org>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00171.html
+
+Bug-Description:
+
+There is a problem with unsigned sign extension when attempting to reallocate
+the input line when it is fewer than 3 characters long and there has been a
+history expansion.  The sign extension causes the shell to not reallocate the
+line, which results in a segmentation fault when it writes past the end.
+
+Patch (apply with `patch -p0'):
+
+--- a/parse.y
++++ b/parse.y
+@@ -2424,7 +2424,7 @@ shell_getc (remove_quoted_newline)
+        not already end in an EOF character.  */
+       if (shell_input_line_terminator != EOF)
+       {
+-        if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
++        if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
+           shell_input_line = (char *)xrealloc (shell_input_line,
+                                       1 + (shell_input_line_size += 2));
+--- a/y.tab.c
++++ b/y.tab.c
+@@ -4736,7 +4736,7 @@ shell_getc (remove_quoted_newline)
+        not already end in an EOF character.  */
+       if (shell_input_line_terminator != EOF)
+       {
+-        if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3)
++        if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size))
+           shell_input_line = (char *)xrealloc (shell_input_line,
+                                       1 + (shell_input_line_size += 2));
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 8
++#define PATCHLEVEL 9
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/110-upstream-bash43-010.patch b/utils/bash/patches/110-upstream-bash43-010.patch
new file mode 100644 (file)
index 0000000..22d9f1b
--- /dev/null
@@ -0,0 +1,145 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-010
+
+Bug-Reported-by:       Albert Shih <Albert.Shih@obspm.fr>
+Bug-Reference-ID:      Wed, 5 Mar 2014 23:01:40 +0100
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00028.html
+
+Bug-Description:
+
+Patch (apply with `patch -p0'):
+
+This patch changes the behavior of programmable completion to compensate
+for two assumptions made by the bash-completion package.  Bash-4.3 changed
+to dequote the argument to programmable completion only under certain
+circumstances, to make the behavior of compgen more consistent when run
+from the command line -- closer to the behavior when run by a shell function
+run as part of programmable completion.  Bash-completion can pass quoted
+arguments to compgen when the original word to be completed was not quoted,
+expecting programmable completion to dequote the word before attempting
+completion.
+
+This patch fixes two cases:
+
+1.  An empty string that bash-completion passes to compgen as a quoted null
+    string ('').
+
+2.  An unquoted word that bash-completion quotes using single quotes or
+    backslashes before passing it to compgen.
+
+In these cases, since readline did not detect a quote character in the original
+word to be completed, bash-4.3 
+
+--- a/externs.h
++++ b/externs.h
+@@ -324,6 +324,7 @@ extern char *sh_un_double_quote __P((cha
+ extern char *sh_backslash_quote __P((char *, const char *, int));
+ extern char *sh_backslash_quote_for_double_quotes __P((char *));
+ extern int sh_contains_shell_metas __P((char *));
++extern int sh_contains_quotes __P((char *));
+ /* declarations for functions defined in lib/sh/spell.c */
+ extern int spname __P((char *, char *));
+--- a/lib/sh/shquote.c
++++ b/lib/sh/shquote.c
+@@ -311,3 +311,17 @@ sh_contains_shell_metas (string)
+   return (0);
+ }
++
++int
++sh_contains_quotes (string)
++     char *string;
++{
++  char *s;
++
++  for (s = string; s && *s; s++)
++    {
++      if (*s == '\'' || *s == '"' || *s == '\\')
++      return 1;
++    }
++  return 0;
++}
+--- a/pcomplete.c
++++ b/pcomplete.c
+@@ -183,6 +183,7 @@ ITEMLIST it_variables = { LIST_DYNAMIC,
+ COMPSPEC *pcomp_curcs;
+ const char *pcomp_curcmd;
++const char *pcomp_curtxt;
+ #ifdef DEBUG
+ /* Debugging code */
+@@ -753,6 +754,32 @@ pcomp_filename_completion_function (text
+            quoted strings. */
+         dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
+       }
++      /* Intended to solve a mismatched assumption by bash-completion.  If
++       the text to be completed is empty, but bash-completion turns it into
++       a quoted string ('') assuming that this code will dequote it before
++       calling readline, do the dequoting. */
++      else if (iscompgen && iscompleting &&
++             pcomp_curtxt && *pcomp_curtxt == 0 &&
++             text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && 
++             rl_filename_dequoting_function)
++      dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
++      /* Another mismatched assumption by bash-completion.  If compgen is being
++               run as part of bash-completion, and the argument to compgen is not
++               the same as the word originally passed to the programmable completion
++               code, dequote the argument if it has quote characters.  It's an
++               attempt to detect when bash-completion is quoting its filename
++               argument before calling compgen. */
++      /* We could check whether gen_shell_function_matches is in the call
++       stack by checking whether the gen-shell-function-matches tag is in
++       the unwind-protect stack, but there's no function to do that yet.
++       We could simply check whether we're executing in a function by
++       checking variable_context, and may end up doing that. */
++      else if (iscompgen && iscompleting && rl_filename_dequoting_function &&
++             pcomp_curtxt && text &&
++             STREQ (pcomp_curtxt, text) == 0 &&
++             variable_context &&
++             sh_contains_quotes (text))       /* guess */
++      dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character);
+       else
+       dfn = savestring (text);
+     }
+@@ -1522,7 +1549,7 @@ gen_progcomp_completions (ocmd, cmd, wor
+      COMPSPEC **lastcs;
+ {
+   COMPSPEC *cs, *oldcs;
+-  const char *oldcmd;
++  const char *oldcmd, *oldtxt;
+   STRINGLIST *ret;
+   cs = progcomp_search (ocmd);
+@@ -1545,14 +1572,17 @@ gen_progcomp_completions (ocmd, cmd, wor
+   oldcs = pcomp_curcs;
+   oldcmd = pcomp_curcmd;
++  oldtxt = pcomp_curtxt;
+   pcomp_curcs = cs;
+   pcomp_curcmd = cmd;
++  pcomp_curtxt = word;
+   ret = gen_compspec_completions (cs, cmd, word, start, end, foundp);
+   pcomp_curcs = oldcs;
+   pcomp_curcmd = oldcmd;
++  pcomp_curtxt = oldtxt;
+   /* We need to conditionally handle setting *retryp here */
+   if (retryp)
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 9
++#define PATCHLEVEL 10
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/111-upstream-bash43-011.patch b/utils/bash/patches/111-upstream-bash43-011.patch
new file mode 100644 (file)
index 0000000..b4c181a
--- /dev/null
@@ -0,0 +1,40 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-011
+
+Bug-Reported-by:       Egmont Koblinger <egmont@gmail.com>
+Bug-Reference-ID:      <CAGWcZk+bU5Jo1M+tutGvL-250UBE9DXjpeJVofYJSFcqFEVfMg@mail.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00153.html
+
+Bug-Description:
+
+The signal handling changes to bash and readline (to avoid running any code
+in a signal handler context) cause the cursor to be placed on the wrong
+line of a multi-line command after a ^C interrupts editing.
+
+Patch (apply with `patch -p0'):
+
+--- a/lib/readline/display.c
++++ b/lib/readline/display.c
+@@ -2677,7 +2677,8 @@ _rl_clean_up_for_exit ()
+ {
+   if (_rl_echoing_p)
+     {
+-      _rl_move_vert (_rl_vis_botlin);
++      if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */
++      _rl_move_vert (_rl_vis_botlin);
+       _rl_vis_botlin = 0;
+       fflush (rl_outstream);
+       rl_restart_output (1, 0);
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 10
++#define PATCHLEVEL 11
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/112-upstream-bash43-012.patch b/utils/bash/patches/112-upstream-bash43-012.patch
new file mode 100644 (file)
index 0000000..8fd2ea6
--- /dev/null
@@ -0,0 +1,38 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-012
+
+Bug-Reported-by:       Eduardo A. Bustamante López<dualbus@gmail.com>
+Bug-Reference-ID:      <5346B54C.4070205@case.edu>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00051.html
+
+Bug-Description:
+
+When a SIGCHLD trap runs a command containing a shell builtin while
+a script is running `wait' to wait for all running children to complete,
+the SIGCHLD trap will not be run once for each child that terminates.
+
+Patch (apply with `patch -p0'):
+
+--- a/jobs.c
++++ b/jobs.c
+@@ -3597,6 +3597,7 @@ run_sigchld_trap (nchild)
+   unwind_protect_int (jobs_list_frozen);
+   unwind_protect_pointer (the_pipeline);
+   unwind_protect_pointer (subst_assign_varlist);
++  unwind_protect_pointer (this_shell_builtin);
+   /* We have to add the commands this way because they will be run
+      in reverse order of adding.  We don't want maybe_set_sigchld_trap ()
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 11
++#define PATCHLEVEL 12
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/113-upstream-bash43-013.patch b/utils/bash/patches/113-upstream-bash43-013.patch
new file mode 100644 (file)
index 0000000..63c6c1e
--- /dev/null
@@ -0,0 +1,52 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-013
+
+Bug-Reported-by:       <Trond.Endrestol@ximalas.info>
+Bug-Reference-ID:      <alpine.BSF.2.03.1404192114310.1973@enterprise.ximalas.info>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00069.html
+
+Bug-Description:
+
+Using reverse-i-search when horizontal scrolling is enabled does not redisplay
+the entire line containing the successful search results.
+
+Patch (apply with `patch -p0'):
+--- a/lib/readline/display.c
++++ b/lib/readline/display.c
+@@ -1637,7 +1637,7 @@ update_line (old, new, current_line, oma
+   /* If we are changing the number of invisible characters in a line, and
+      the spot of first difference is before the end of the invisible chars,
+      lendiff needs to be adjusted. */
+-  if (current_line == 0 && !_rl_horizontal_scroll_mode &&
++  if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */
+       current_invis_chars != visible_wrap_offset)
+     {
+       if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
+@@ -1825,8 +1825,13 @@ update_line (old, new, current_line, oma
+             else
+               _rl_last_c_pos += bytes_to_insert;
++            /* XXX - we only want to do this if we are at the end of the line
++               so we move there with _rl_move_cursor_relative */
+             if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new)))
+-              goto clear_rest_of_line;
++              {
++                _rl_move_cursor_relative (ne-new, new);
++                goto clear_rest_of_line;
++              }
+           }
+       }
+       /* Otherwise, print over the existing material. */
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 12
++#define PATCHLEVEL 13
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/114-upstream-bash43-014.patch b/utils/bash/patches/114-upstream-bash43-014.patch
new file mode 100644 (file)
index 0000000..99e16b9
--- /dev/null
@@ -0,0 +1,95 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-014
+
+Bug-Reported-by:       Greg Wooledge <wooledg@eeg.ccf.org>
+Bug-Reference-ID:      <20140418202123.GB7660@eeg.ccf.org>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/help-bash/2014-04/msg00004.html
+
+Bug-Description:
+
+Under certain circumstances, $@ is expanded incorrectly in contexts where
+word splitting is not performed.
+
+Patch (apply with `patch -p0'):
+--- a/subst.c
++++ b/subst.c
+@@ -3248,8 +3248,10 @@ cond_expand_word (w, special)
+   if (w->word == 0 || w->word[0] == '\0')
+     return ((char *)NULL);
++  expand_no_split_dollar_star = 1;
+   w->flags |= W_NOSPLIT2;
+   l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0);
++  expand_no_split_dollar_star = 0;
+   if (l)
+     {
+       if (special == 0)                       /* LHS */
+@@ -7847,6 +7849,10 @@ param_expand (string, sindex, quoted, ex
+        We also want to make sure that splitting is done no matter what --
+        according to POSIX.2, this expands to a list of the positional
+        parameters no matter what IFS is set to. */
++      /* XXX - what to do when in a context where word splitting is not
++       performed? Even when IFS is not the default, posix seems to imply
++       that we behave like unquoted $* ?  Maybe we should use PF_NOSPLIT2
++       here. */
+       temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted);
+       tflag |= W_DOLLARAT;
+@@ -8816,6 +8822,7 @@ finished_with_string:
+   else
+     {
+       char *ifs_chars;
++      char *tstring;
+       ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL;
+@@ -8830,11 +8837,36 @@ finished_with_string:
+        regardless of what else has happened to IFS since the expansion. */
+       if (split_on_spaces)
+       list = list_string (istring, " ", 1);   /* XXX quoted == 1? */
++      /* If we have $@ (has_dollar_at != 0) and we are in a context where we
++       don't want to split the result (W_NOSPLIT2), and we are not quoted,
++       we have already separated the arguments with the first character of
++       $IFS.  In this case, we want to return a list with a single word
++       with the separator possibly replaced with a space (it's what other
++       shells seem to do).
++       quoted_dollar_at is internal to this function and is set if we are
++       passed an argument that is unquoted (quoted == 0) but we encounter a
++       double-quoted $@ while expanding it. */
++      else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2))
++      {
++        /* Only split and rejoin if we have to */
++        if (*ifs_chars && *ifs_chars != ' ')
++          {
++            list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
++            tstring = string_list (list);
++          }
++        else
++          tstring = istring;
++        tword = make_bare_word (tstring);
++        if (tstring != istring)
++          free (tstring);
++        goto set_word_flags;
++      }
+       else if (has_dollar_at && ifs_chars)
+       list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1);
+       else
+       {
+         tword = make_bare_word (istring);
++set_word_flags:
+         if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED))
+           tword->flags |= W_QUOTED;
+         if (word->flags & W_ASSIGNMENT)
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 13
++#define PATCHLEVEL 14
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/115-upstream-bash43-015.patch b/utils/bash/patches/115-upstream-bash43-015.patch
new file mode 100644 (file)
index 0000000..ae8be2d
--- /dev/null
@@ -0,0 +1,48 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-015
+
+Bug-Reported-by:       Clark Wang <dearvoid@gmail.com>
+Bug-Reference-ID:      <CADv8-og2TOSoabXeNVXVGaXN3tEMHnYVq1rwOLe5meaRPSGRig@mail.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00095.html
+
+Bug-Description:
+
+When completing directory names, the directory name is dequoted twice.
+This causes problems for directories with single and double quotes in
+their names.
+
+Patch (apply with `patch -p0'):
+--- a/bashline.c
++++ b/bashline.c
+@@ -4167,9 +4167,16 @@ bash_directory_completion_matches (text)
+   int qc;
+   qc = rl_dispatching ? rl_completion_quote_character : 0;  
+-  dfn = bash_dequote_filename ((char *)text, qc);
++  /* If rl_completion_found_quote != 0, rl_completion_matches will call the
++     filename dequoting function, causing the directory name to be dequoted
++     twice. */
++  if (rl_dispatching && rl_completion_found_quote == 0)
++    dfn = bash_dequote_filename ((char *)text, qc);
++  else
++    dfn = (char *)text;
+   m1 = rl_completion_matches (dfn, rl_filename_completion_function);
+-  free (dfn);
++  if (dfn != text)
++    free (dfn);
+   if (m1 == 0 || m1[0] == 0)
+     return m1;
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 14
++#define PATCHLEVEL 15
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/116-upstream-bash43-016.patch b/utils/bash/patches/116-upstream-bash43-016.patch
new file mode 100644 (file)
index 0000000..3ce37f6
--- /dev/null
@@ -0,0 +1,121 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-016
+
+Bug-Reported-by:       Pierre Gaston <pierre.gaston@gmail.com>
+Bug-Reference-ID:      <CAPSX3sTCD61k1VQLJ5r-LWzEt+e7Xc-fxXmwn2u8EA5gJJej8Q@mail.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00100.html
+
+Bug-Description:
+
+An extended glob pattern containing a slash (`/') causes the globbing code
+to misinterpret it as a directory separator.
+
+Patch (apply with `patch -p0'):
+--- a/lib/glob/glob.c
++++ b/lib/glob/glob.c
+@@ -123,6 +123,8 @@ static char **glob_dir_to_array __P((cha
+ extern char *glob_patscan __P((char *, char *, int));
+ extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int));
++extern char *glob_dirscan __P((char *, int));
++
+ /* Compile `glob_loop.c' for single-byte characters. */
+ #define CHAR  unsigned char
+ #define INT   int
+@@ -187,6 +189,9 @@ extglob_skipname (pat, dname, flags)
+   se = pp + strlen (pp) - 1;          /* end of string */
+   pe = glob_patscan (pp, se, 0);      /* end of extglob pattern (( */
+   /* we should check for invalid extglob pattern here */
++  if (pe == 0)
++    return 0;
++
+   /* if pe != se we have more of the pattern at the end of the extglob
+      pattern. Check the easy case first ( */
+   if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0)
+@@ -1015,7 +1020,7 @@ glob_filename (pathname, flags)
+ {
+   char **result;
+   unsigned int result_size;
+-  char *directory_name, *filename, *dname;
++  char *directory_name, *filename, *dname, *fn;
+   unsigned int directory_len;
+   int free_dirname;                   /* flag */
+   int dflags;
+@@ -1031,6 +1036,18 @@ glob_filename (pathname, flags)
+   /* Find the filename.  */
+   filename = strrchr (pathname, '/');
++#if defined (EXTENDED_GLOB)
++  if (filename && extended_glob)
++    {
++      fn = glob_dirscan (pathname, '/');
++#if DEBUG_MATCHING
++      if (fn != filename)
++      fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename);
++#endif
++      filename = fn;
++    }
++#endif
++
+   if (filename == NULL)
+     {
+       filename = pathname;
+--- a/lib/glob/gmisc.c
++++ b/lib/glob/gmisc.c
+@@ -42,6 +42,8 @@
+ #define WLPAREN         L'('
+ #define WRPAREN         L')'
++extern char *glob_patscan __P((char *, char *, int));
++
+ /* Return 1 of the first character of WSTRING could match the first
+    character of pattern WPAT.  Wide character version. */
+ int
+@@ -375,3 +377,34 @@ bad_bracket:
+   return matlen;
+ }
++
++/* Skip characters in PAT and return the final occurrence of DIRSEP.  This
++   is only called when extended_glob is set, so we have to skip over extglob
++   patterns x(...) */
++char *
++glob_dirscan (pat, dirsep)
++     char *pat;
++     int dirsep;
++{
++  char *p, *d, *pe, *se;
++
++  d = pe = se = 0;
++  for (p = pat; p && *p; p++)
++    {
++      if (extglob_pattern_p (p))
++      {
++        if (se == 0)
++          se = p + strlen (p) - 1;
++        pe = glob_patscan (p + 2, se, 0);
++        if (pe == 0)
++          continue;
++        else if (*pe == 0)
++          break;
++        p = pe - 1;   /* will do increment above */
++        continue;
++      }
++      if (*p ==  dirsep)
++      d = p;
++    }
++  return d;
++}
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 15
++#define PATCHLEVEL 16
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/117-upstream-bash43-017.patch b/utils/bash/patches/117-upstream-bash43-017.patch
new file mode 100644 (file)
index 0000000..9c7eecc
--- /dev/null
@@ -0,0 +1,41 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-017
+
+Bug-Reported-by:       Dan Douglas <ormaaj@gmail.com>
+Bug-Reference-ID:      <7781746.RhfoTROLxF@smorgbox>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00026.html
+
+Bug-Description:
+
+The code that creates local variables should not clear the `invisible'
+attribute when returning an existing local variable.  Let the code that
+actually assigns a value clear it.
+
+Patch (apply with `patch -p0'):
+--- a/variables.c
++++ b/variables.c
+@@ -2197,10 +2197,7 @@ make_local_variable (name)
+   /* local foo; local foo;  is a no-op. */
+   old_var = find_variable (name);
+   if (old_var && local_p (old_var) && old_var->context == variable_context)
+-    {
+-      VUNSETATTR (old_var, att_invisible);    /* XXX */
+-      return (old_var);
+-    }
++    return (old_var);
+   was_tmpvar = old_var && tempvar_p (old_var);
+   /* If we're making a local variable in a shell function, the temporary env
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 16
++#define PATCHLEVEL 17
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/118-upstream-bash43-018.patch b/utils/bash/patches/118-upstream-bash43-018.patch
new file mode 100644 (file)
index 0000000..095ca93
--- /dev/null
@@ -0,0 +1,38 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-018
+
+Bug-Reported-by:       Geir Hauge <geir.hauge@gmail.com>
+Bug-Reference-ID:      <CAO-BiTLOvfPXDypg61jcBausADrxUKJejakV2WTWP26cW0=rgA@mail.gmail.com>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00040.html
+
+Bug-Description:
+
+When assigning an array variable using the compound assignment syntax,
+but using `declare' with the rhs of the compound assignment quoted, the
+shell did not mark the variable as visible after successfully performing
+the assignment.
+
+Patch (apply with `patch -p0'):
+--- a/arrayfunc.c
++++ b/arrayfunc.c
+@@ -179,6 +179,7 @@ bind_array_var_internal (entry, ind, key
+     array_insert (array_cell (entry), ind, newval);
+   FREE (newval);
++  VUNSETATTR (entry, att_invisible);  /* no longer invisible */
+   return (entry);
+ }
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 17
++#define PATCHLEVEL 18
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/119-upstream-bash43-019.patch b/utils/bash/patches/119-upstream-bash43-019.patch
new file mode 100644 (file)
index 0000000..2d0fa44
--- /dev/null
@@ -0,0 +1,75 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-019
+
+Bug-Reported-by:       John Lenton
+Bug-Reference-ID:
+Bug-Reference-URL:     https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1317476
+
+Bug-Description:
+
+The -t timeout option to `read' does not work when the -e option is used.
+
+Patch (apply with `patch -p0'):
+
+--- a/lib/readline/input.c
++++ b/lib/readline/input.c
+@@ -534,8 +534,16 @@ rl_getc (stream)
+       return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
+       else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM)
+       return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF);
++      /* keyboard-generated signals of interest */
+       else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT)
+         RL_CHECK_SIGNALS ();
++      /* non-keyboard-generated signals of interest */
++      else if (_rl_caught_signal == SIGALRM
++#if defined (SIGVTALRM)
++              || _rl_caught_signal == SIGVTALRM
++#endif
++            )
++        RL_CHECK_SIGNALS ();
+       if (rl_signal_event_hook)
+       (*rl_signal_event_hook) ();
+--- a/builtins/read.def
++++ b/builtins/read.def
+@@ -442,7 +442,10 @@ read_builtin (list)
+       add_unwind_protect (reset_alarm, (char *)NULL);
+ #if defined (READLINE)
+       if (edit)
+-      add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
++      {
++        add_unwind_protect (reset_attempted_completion_function, (char *)NULL);
++        add_unwind_protect (bashline_reset_event_hook, (char *)NULL);
++      }
+ #endif
+       falarm (tmsec, tmusec);
+     }
+@@ -1021,6 +1024,7 @@ edit_line (p, itext)
+   old_attempted_completion_function = rl_attempted_completion_function;
+   rl_attempted_completion_function = (rl_completion_func_t *)NULL;
++  bashline_set_event_hook ();
+   if (itext)
+     {
+       old_startup_hook = rl_startup_hook;
+@@ -1032,6 +1036,7 @@ edit_line (p, itext)
+   rl_attempted_completion_function = old_attempted_completion_function;
+   old_attempted_completion_function = (rl_completion_func_t *)NULL;
++  bashline_reset_event_hook ();
+   if (ret == 0)
+     return ret;
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 18
++#define PATCHLEVEL 19
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/120-upstream-bash43-020.patch b/utils/bash/patches/120-upstream-bash43-020.patch
new file mode 100644 (file)
index 0000000..abf0c30
--- /dev/null
@@ -0,0 +1,93 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-020
+
+Bug-Reported-by:       Jared Yanovich <slovichon@gmail.com>
+Bug-Reference-ID:      <20140417073654.GB26875@nightderanger.psc.edu>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00065.html
+
+Bug-Description:
+
+When PS2 contains a command substitution, here-documents entered in an
+interactive shell can sometimes cause a segmentation fault.
+
+Patch (apply with `patch -p0'):
+
+--- a/shell.h
++++ b/shell.h
+@@ -168,7 +168,8 @@ typedef struct _sh_parser_state_t {
+   /* flags state affecting the parser */
+   int expand_aliases;
+   int echo_input_at_read;
+-  
++  int need_here_doc;
++
+ } sh_parser_state_t;
+ typedef struct _sh_input_line_state_t {
+--- a/parse.y
++++ b/parse.y
+@@ -2642,7 +2642,7 @@ gather_here_documents ()
+   int r;
+   r = 0;
+-  while (need_here_doc)
++  while (need_here_doc > 0)
+     {
+       parser_state |= PST_HEREDOC;
+       make_here_document (redir_stack[r++], line_number);
+@@ -6075,6 +6075,7 @@ save_parser_state (ps)
+   ps->expand_aliases = expand_aliases;
+   ps->echo_input_at_read = echo_input_at_read;
++  ps->need_here_doc = need_here_doc;
+   ps->token = token;
+   ps->token_buffer_size = token_buffer_size;
+@@ -6123,6 +6124,7 @@ restore_parser_state (ps)
+   expand_aliases = ps->expand_aliases;
+   echo_input_at_read = ps->echo_input_at_read;
++  need_here_doc = ps->need_here_doc;
+   FREE (token);
+   token = ps->token;
+--- a/y.tab.c
++++ b/y.tab.c
+@@ -4954,7 +4954,7 @@ gather_here_documents ()
+   int r;
+   r = 0;
+-  while (need_here_doc)
++  while (need_here_doc > 0)
+     {
+       parser_state |= PST_HEREDOC;
+       make_here_document (redir_stack[r++], line_number);
+@@ -8387,6 +8387,7 @@ save_parser_state (ps)
+   ps->expand_aliases = expand_aliases;
+   ps->echo_input_at_read = echo_input_at_read;
++  ps->need_here_doc = need_here_doc;
+   ps->token = token;
+   ps->token_buffer_size = token_buffer_size;
+@@ -8435,6 +8436,7 @@ restore_parser_state (ps)
+   expand_aliases = ps->expand_aliases;
+   echo_input_at_read = ps->echo_input_at_read;
++  need_here_doc = ps->need_here_doc;
+   FREE (token);
+   token = ps->token;
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 19
++#define PATCHLEVEL 20
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/121-upstream-bash43-021.patch b/utils/bash/patches/121-upstream-bash43-021.patch
new file mode 100644 (file)
index 0000000..b7367a0
--- /dev/null
@@ -0,0 +1,46 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-021
+
+Bug-Reported-by:       Jared Yanovich <slovichon@gmail.com>
+Bug-Reference-ID:      <20140625225019.GJ17044@nightderanger.psc.edu>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00070.html
+
+Bug-Description:
+
+When the readline `revert-all-at-newline' option is set, pressing newline
+when the current line is one retrieved from history results in a double free
+and a segmentation fault.
+
+Patch (apply with `patch -p0'):
+
+--- a/lib/readline/misc.c
++++ b/lib/readline/misc.c
+@@ -461,6 +461,7 @@ _rl_revert_all_lines ()
+           saved_undo_list = 0;
+         /* Set up rl_line_buffer and other variables from history entry */
+         rl_replace_from_history (entry, 0);   /* entry->line is now current */
++        entry->data = 0;                      /* entry->data is now current undo list */
+         /* Undo all changes to this history entry */
+         while (rl_undo_list)
+           rl_do_undo ();
+@@ -468,7 +469,6 @@ _rl_revert_all_lines ()
+            the timestamp. */
+         FREE (entry->line);
+         entry->line = savestring (rl_line_buffer);
+-        entry->data = 0;
+       }
+       entry = previous_history ();
+     }
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 20
++#define PATCHLEVEL 21
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/122-upstream-bash43-022.patch b/utils/bash/patches/122-upstream-bash43-022.patch
new file mode 100644 (file)
index 0000000..1ee8f13
--- /dev/null
@@ -0,0 +1,47 @@
+                            BASH PATCH REPORT
+                            =================
+
+Bash-Release:  4.3
+Patch-ID:      bash43-022
+
+Bug-Reported-by:       scorp.dev.null@gmail.com
+Bug-Reference-ID:      <E1WxXw8-0007iE-Bi@pcm14>
+Bug-Reference-URL:     http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html
+
+Bug-Description:
+
+Using nested pipelines within loops with the `lastpipe' option set can result
+in a segmentation fault.
+
+Patch (apply with `patch -p0'):
+
+--- a/execute_cmd.c
++++ b/execute_cmd.c
+@@ -2413,7 +2413,16 @@ execute_pipeline (command, asynchronous,
+ #endif
+       lstdin = wait_for (lastpid);
+ #if defined (JOB_CONTROL)
+-      exec_result = job_exit_status (lastpipe_jid);
++      /* If wait_for removes the job from the jobs table, use result of last
++       command as pipeline's exit status as usual.  The jobs list can get
++       frozen and unfrozen at inconvenient times if there are multiple pipelines
++       running simultaneously. */
++      if (INVALID_JOB (lastpipe_jid) == 0)
++      exec_result = job_exit_status (lastpipe_jid);
++      else if (pipefail_opt)
++      exec_result = exec_result | lstdin;     /* XXX */
++      /* otherwise we use exec_result */
++        
+ #endif
+       unfreeze_jobs_list ();
+     }
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -25,6 +25,6 @@
+    regexp `^#define[  ]*PATCHLEVEL', since that's what support/mkversion.sh
+    looks for to find the patch level (for the sccs version string). */
+-#define PATCHLEVEL 21
++#define PATCHLEVEL 22
+ #endif /* _PATCHLEVEL_H_ */
diff --git a/utils/bash/patches/129-no_doc.patch b/utils/bash/patches/129-no_doc.patch
new file mode 100644 (file)
index 0000000..3e7be42
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -741,10 +741,8 @@ reconfig: force
+ #     $(MAKE) -f $(srcdir)/Makefile $(MFLAGS) srcdir=$(srcdir)
+ doc documentation:  force
+-      @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) )
+ info dvi ps: force
+-      @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) CFLAGS='$(CCFLAGS)' $@ )
+ force:
index dc3e16dc258c39bf567a94ae3e4119dcfda3d899..1d8c1739a45d7ba3de70b647cf0cdbfe78dd6d9a 100644 (file)
@@ -15,6 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4091
 PKG_MD5SUM:=a227a20a0dd034cd4bb7400806a0a2d0
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=libtool
 PKG_INSTALL:=1
index cdaaaec5f313bc79d284574b036941a777b39e40..5f6ca650f0c0e3657cf00a40dba5d692018dc71d 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/haserl
 PKG_MD5SUM:=a9decddb508944d56f71dd2f821e2ec5
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=GPL-2.0
 
 include $(INCLUDE_DIR)/package.mk
 
index 3ff98137724f5f5362774e464f6a4c690a770ca4..2e23e23bba387a925ce849a7f1e1382ac8dd0365 100644 (file)
@@ -11,6 +11,8 @@ PKG_NAME:=mktorrent
 PKG_VERSION:=1.0
 PKG_RELEASE:=1
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.sourceforge.net/$(PKG_NAME)/
diff --git a/utils/mysql/Makefile b/utils/mysql/Makefile
new file mode 100644 (file)
index 0000000..16312b3
--- /dev/null
@@ -0,0 +1,187 @@
+#
+# 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
+include $(INCLUDE_DIR)/uclibc++.mk
+
+PKG_NAME:=mysql
+PKG_VERSION:=5.1.73
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=\
+       http://mysql.he.net/Downloads/MySQL-5.1/ \
+       http://www.linorg.usp.br/mysql/Downloads/MySQL-5.1/ \
+       http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/ \
+       http://mirror.switch.ch/ftp/mirror/mysql/Downloads/MySQL-5.1/
+
+PKG_MD5SUM:=887f869bcc757957067b9198f707f32f
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
+PKG_LICENSE:=GPL-2.0
+
+PKG_BUILD_DEPENDS:=libncurses libreadline
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+PKG_FIXUP:=libtool
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmysqlclient/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=$(CXX_DEPENDS) +zlib
+  TITLE:=MySQL client library
+  URL:=http://dev.mysql.com/
+endef
+
+define Package/mysql-server
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libmysqlclient +libpthread +libncursesw +libreadline
+  TITLE:=MySQL Server
+  URL:=http://dev.mysql.com/
+  SUBMENU:=database
+endef
+
+define Package/libmysqlclient
+  $(call Package/libmysqlclient/Default)
+endef
+
+define Package/libmysqlclient-r
+  $(call Package/libmysqlclient/Default)
+  TITLE += threadsafe
+  DEPENDS+= +libpthread
+endef
+
+TARGET_CXX=g++-uc
+
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --enable-thread-safe-client \
+       --disable-assembler \
+       --with-pthread \
+       --with-server \
+       --without-mysqlmanager \
+       --with-mysqld-user=root \
+       --with-unix-socket-path=/tmp \
+       --without-libwrap \
+       --with-low-memory \
+       --without-embedded-server \
+       --without-query-cache \
+       --without-ssl \
+       --without-docs \
+       --without-man \
+       --without-readline \
+       --without-debug \
+       --with-named-thread-libs=-lpthread
+
+CONFIGURE_VARS += \
+       mysql_cv_compress=yes \
+       mysql_cv_gethostname_style=glibc2 \
+       mysql_cv_gcc_atomic_builtins=yes \
+       mysql_cv_gcc_atomic_builtins_pthread_t=yes \
+       ac_cv_c_stack_direction=-1
+
+define Build/Compile
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="include" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all
+       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="include" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+       g++ -I $(PKG_BUILD_DIR)/include \
+               -o $(PKG_BUILD_DIR)/sql/gen_lex_hash \
+               $(PKG_BUILD_DIR)/sql/gen_lex_hash.cc
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)/libmysql" \
+               CC="g++" \
+               CFLAGS="$(HOST_CFLAGS)" \
+               CPPFLAGS="$(HOST_CFLAGS)" \
+               LDFLAGS="$(HOST_LDFLAGS)" \
+               conf_to_src
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="libmysql" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all
+       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="libmysql" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="libmysql_r" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all
+       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="libmysql_r" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+               SUBDIRS="scripts" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               bin_SCRIPTS="mysql_config" \
+               install
+       +$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all
+       $(MAKE) -C "$(PKG_BUILD_DIR)" \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               install
+endef
+
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
+       ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
+       # NOTE: needed for MySQL-Python
+       $(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
+       rm -f $(1)/usr/lib/mysql/libmysqlclient.la
+endef
+
+define Package/libmysqlclient/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient.so.* $(1)/usr/lib/
+endef
+define Package/libmysqlclient-r/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql/libmysqlclient_r.so.* $(1)/usr/lib/
+endef
+
+define Package/mysql-server/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/mysqld $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_install_db $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/etc/init.d/
+       $(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
+       $(INSTALL_CONF) conf/my.cnf $(1)/etc/
+       $(INSTALL_DIR) $(1)/usr/share/mysql
+       $(INSTALL_DIR) $(1)/usr/share/mysql/english
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/english/errmsg.sys $(1)/usr/share/mysql/english
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/fill_help_tables.sql $(1)/usr/share/mysql/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables.sql $(1)/usr/share/mysql/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql/mysql_system_tables_data.sql $(1)/usr/share/mysql/
+endef
+
+define Package/mysql-server/conffiles
+/etc/my.cnf
+endef
+
+$(eval $(call BuildPackage,mysql-server))
+$(eval $(call BuildPackage,libmysqlclient))
+$(eval $(call BuildPackage,libmysqlclient-r))
diff --git a/utils/mysql/conf/my.cnf b/utils/mysql/conf/my.cnf
new file mode 100644 (file)
index 0000000..ec2ade2
--- /dev/null
@@ -0,0 +1,54 @@
+[client]
+port           = 3306
+socket         = /var/run/mysqld.sock
+
+[mysqld]
+user           = root
+socket         = /var/run/mysqld.sock
+port           = 3306
+basedir                = /usr
+
+############ Don't put this on the NAND #############
+# Figure out where you are going to put the databases
+# And run mysql_install_db --force
+datadir                = /mnt/data/mysql/
+
+######### This should also not go on the NAND #######
+tmpdir         = /mnt/data/tmp/
+
+skip-external-locking
+
+bind-address           = 127.0.0.1
+
+# Fine Tuning
+key_buffer             = 16M
+max_allowed_packet     = 16M
+thread_stack           = 192K
+thread_cache_size       = 8
+
+# Here you can see queries with especially long duration
+#log_slow_queries      = /var/log/mysql/mysql-slow.log
+#long_query_time = 2
+#log-queries-not-using-indexes
+
+# The following can be used as easy to replay backup logs or for replication.
+#server-id             = 1
+#log_bin                       = /var/log/mysql/mysql-bin.log
+#expire_logs_days      = 10
+#max_binlog_size         = 100M
+#binlog_do_db          = include_database_name
+#binlog_ignore_db      = include_database_name
+
+
+[mysqldump]
+quick
+quote-names
+max_allowed_packet     = 16M
+
+[mysql]
+#no-auto-rehash        # faster start of mysql but no tab completition
+
+[isamchk]
+key_buffer             = 16M
+
+
diff --git a/utils/mysql/files/mysqld.init b/utils/mysql/files/mysqld.init
new file mode 100644 (file)
index 0000000..48e6189
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2010-2011 OpenWrt.org
+
+START=95
+STOP=10
+
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+SERVICE_STOP_TIME=9
+
+error() {
+       echo "${initscript}:" "$@" 1>&2
+}
+
+start() {
+       local datadir=$(sed -n -e "s/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" /etc/my.cnf)
+       if [ ! -d "$datadir" ]; then
+               error "Error: datadir '$datadir' in /etc/my.cnf doesn't exist"
+               return 1
+       fi
+       if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
+               error "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables"
+               return 1
+       fi
+       service_start /usr/bin/mysqld
+}
+
+stop() {
+       service_stop /usr/bin/mysqld
+}
diff --git a/utils/mysql/patches/100-fix_hostname.patch b/utils/mysql/patches/100-fix_hostname.patch
new file mode 100644 (file)
index 0000000..faedc27
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/scripts/mysql_install_db.sh
++++ b/scripts/mysql_install_db.sh
+@@ -322,7 +322,7 @@ then
+ fi
+ # Try to determine the hostname
+-hostname=`@HOSTNAME@`
++hostname=`cat /proc/sys/kernel/hostname`
+ # Check if hostname is valid
+ if test "$cross_bootstrap" -eq 0 -a "$in_rpm" -eq 0 -a "$force" -eq 0
diff --git a/utils/mysql/patches/110-cross_compile.patch b/utils/mysql/patches/110-cross_compile.patch
new file mode 100644 (file)
index 0000000..85d2591
--- /dev/null
@@ -0,0 +1,179 @@
+--- a/storage/innodb_plugin/plug.in
++++ b/storage/innodb_plugin/plug.in
+@@ -56,10 +56,8 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin,  [
+   esac
+   AC_SUBST(INNODB_DYNAMIC_CFLAGS)
+-  AC_MSG_CHECKING(whether GCC atomic builtins are available)
+-  # either define HAVE_IB_GCC_ATOMIC_BUILTINS or not
+-  AC_TRY_RUN(
+-    [
++  AC_CACHE_CHECK([whether GCC atomic builtins are available],
++               [mysql_cv_gcc_atomic_builtins], [AC_TRY_RUN([
+       int main()
+       {
+       long    x;
+@@ -96,21 +94,18 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin,  [
+       return(0);
+       }
+-    ],
+-    [
+-      AC_DEFINE([HAVE_IB_GCC_ATOMIC_BUILTINS], [1],
+-                [GCC atomic builtins are available])
+-      AC_MSG_RESULT(yes)
+-    ],
+-    [
+-      AC_MSG_RESULT(no)
+-    ]
+-  )
++    ], [mysql_cv_gcc_atomic_builtins=yes],
++       [mysql_cv_gcc_atomic_builtins=no],
++       [mysql_cv_gcc_atomic_builtins=no])])
++
++  if test "x$mysql_cv_gcc_atomic_builtins" = xyes; then
++    AC_DEFINE(HAVE_IB_GCC_ATOMIC_BUILTINS, 1,
++              [Define to 1 if compiler provides atomic builtins.])
++  fi
+-  AC_MSG_CHECKING(whether pthread_t can be used by GCC atomic builtins)
+-  # either define HAVE_IB_ATOMIC_PTHREAD_T_GCC or not
+-  AC_TRY_RUN(
+-    [
++
++  AC_CACHE_CHECK([whether pthread_t can be used by GCC atomic builtins],
++               [mysql_cv_gcc_atomic_builtins_pthread_t], [AC_TRY_RUN([
+       #include <pthread.h>
+       #include <string.h>
+@@ -127,16 +122,14 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin,  [
+         return(0);
+       }
+-    ],
+-    [
+-      AC_DEFINE([HAVE_IB_ATOMIC_PTHREAD_T_GCC], [1],
+-                [pthread_t can be used by GCC atomic builtins])
+-      AC_MSG_RESULT(yes)
+-    ],
+-    [
+-      AC_MSG_RESULT(no)
+-    ]
+-  )
++    ], [mysql_cv_gcc_atomic_builtins_pthread_t=yes],
++       [mysql_cv_gcc_atomic_builtins_pthread_t=no],
++       [mysql_cv_gcc_atomic_builtins_pthread_t=no])])
++
++  if test "x$mysql_cv_gcc_atomic_builtins_pthread_t" = xyes; then
++    AC_DEFINE(HAVE_IB_ATOMIC_PTHREAD_T_GCC, 1,
++              [Define to 1 if pthread_t can be used by GCC atomic builtins])
++  fi
+   AC_MSG_CHECKING(whether Solaris libc atomic functions are available)
+   # Define HAVE_IB_SOLARIS_ATOMICS if _all_ of the following
+@@ -156,7 +149,6 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin,  [
+     AC_DEFINE([HAVE_IB_SOLARIS_ATOMICS], [1],
+       [Define to 1 if Solaris libc atomic functions are available]
+     )
+-  fi
+   AC_MSG_CHECKING(whether pthread_t can be used by Solaris libc atomic functions)
+   # either define HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS or not
+@@ -230,6 +222,8 @@ MYSQL_PLUGIN_ACTIONS(innodb_plugin,  [
+       AC_MSG_RESULT(no)
+     ]
+   )
++  fi
++
+   ])
+ # vim: set ft=config:
+--- a/sql/gen_lex_hash.cc
++++ b/sql/gen_lex_hash.cc
+@@ -344,55 +344,6 @@ void print_find_structs()
+ }
+-static void usage(int version)
+-{
+-  printf("%s  Ver 3.6 Distrib %s, for %s (%s)\n",
+-       my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+-  if (version)
+-    return;
+-  puts(ORACLE_WELCOME_COPYRIGHT_NOTICE("2000"));
+-  puts("This program generates a perfect hashing function for the sql_lex.cc");
+-  printf("Usage: %s [OPTIONS]\n\n", my_progname);
+-  my_print_help(my_long_options);
+-}
+-
+-
+-extern "C" my_bool
+-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
+-             char *argument __attribute__((unused)))
+-{
+-  switch(optid) {
+-  case 'V':
+-    usage(1);
+-    exit(0);
+-  case 'I':
+-  case '?':
+-    usage(0);
+-    exit(0);
+-  case '#':
+-    DBUG_PUSH(argument ? argument : default_dbug_option);
+-    break;
+-  }
+-  return 0;
+-}
+-
+-
+-static int get_options(int argc, char **argv)
+-{
+-  int ho_error;
+-
+-  if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option)))
+-    exit(ho_error);
+-
+-  if (argc >= 1)
+-  {
+-    usage(0);
+-     exit(1);
+-  }
+-  return(0);
+-}
+-
+-
+ int check_dup_symbols(SYMBOL *s1, SYMBOL *s2)
+ {
+   if (s1->length!=s2->length || strncmp(s1->name,s2->name,s1->length))
+@@ -443,12 +394,6 @@ int check_duplicates()
+ int main(int argc,char **argv)
+ {
+-  MY_INIT(argv[0]);
+-  DBUG_PROCESS(argv[0]);
+-
+-  if (get_options(argc,(char **) argv))
+-    exit(1);
+-
+   /* Broken up to indicate that it's not advice to you, gentle reader. */
+   printf("/*\n\n  Do " "not " "edit " "this " "file " "directly!\n\n*/\n");
+@@ -549,7 +494,6 @@ static SYMBOL *get_hash_symbol(const cha
+   }\n\
+ }\n"
+ );
+-  my_end(0);
+   exit(0);
+ }
+--- a/sql/Makefile.am
++++ b/sql/Makefile.am
+@@ -26,7 +26,6 @@ INCLUDES =           @ZLIB_INCLUDES@ \
+ WRAPLIBS=             @WRAPLIBS@
+ SUBDIRS =             share
+ libexec_PROGRAMS =    mysqld
+-EXTRA_PROGRAMS =      gen_lex_hash
+ bin_PROGRAMS =                mysql_tzinfo_to_sql
+ noinst_LTLIBRARIES=   libndb.la \
diff --git a/utils/ntfs-3g/Makefile b/utils/ntfs-3g/Makefile
new file mode 100644 (file)
index 0000000..c1fddff
--- /dev/null
@@ -0,0 +1,217 @@
+#
+# 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:=ntfs-3g
+PKG_RELEASE:=1
+
+PKG_VERSION:=2014.2.15
+PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
+PKG_MD5SUM:=f11d563816249d730a00498983485f3a
+
+PKG_LICENSE:=GPL-2.0 LGPL-2.0
+PKG_LICENSE_FILE:=COPYING COPYING.LIB
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+# release contains fuseext/int hint
+PKG_RELEASE:=$(PKG_RELEASE)$(if $(CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE),-fuseext,-fuseint)
+
+# define build dir, respect fuseext/int
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/ntfs-3g/common
+  SECTION:=utils
+  CATEGORY:=Utilities
+  URL:=http://www.tuxera.com
+  SUBMENU:=Filesystem
+  TITLE:=Stable Read/Write NTFS Driver
+  MAINTAINER:=Bud <wrt_buddhay@gmx.net>
+endef
+
+define Package/ntfs-3g
+  $(call Package/ntfs-3g/common)
+  DEPENDS+= +kmod-fuse +PACKAGE_NTFS-3G_USE_LIBFUSE:libfuse +libpthread
+endef
+
+define Package/ntfs-3g/description
+  Ntfs-3g is a NTFS driver, which can create, remove, rename,
+  move files, directories, hard links, and streams. It can read
+  and write files, including streams and sparse files. It can
+  handle special files like symbolic links, devices, and FIFOs.
+  Moreover it can also read transparently compressed files.
+
+  Contains:
+   - ntfs-3g
+   - ntfs-3g.probe
+   - mount.ntfs-3g (symlink to ntfs-3g)
+
+endef
+
+define Package/ntfs-3g/config
+config PACKAGE_NTFS-3G_USE_LIBFUSE
+       bool "use external FUSE library, selects package libfuse"
+       depends on PACKAGE_ntfs-3g
+       ---help---
+       Ntfs-3g by default uses a minimalized lite version of FUSE.
+       If libfuse is part of your filesystem anyway (because of sshfs, owfs
+       etc.) it makes sense to activate this option and save some kilobytes
+       of space.
+
+endef
+
+define Package/ntfs-3g-low
+  $(call Package/ntfs-3g/common)
+  TITLE:=lowntfs-3g (alternative using the fuse low-level interface)
+  DEPENDS+= +ntfs-3g
+endef
+
+define Package/ntfs-3g-low/description
+  Contains:
+   - lowntfs-3g
+   - mount.lowntfs-3g (symlink to lowntfs-3g)
+
+  A driver variant using the fuse low-level interface missing some of the
+  enhanced functionality for streams or the like. You might want to check:
+  http://www.tuxera.com/community/ntfs-3g-manual/
+
+endef
+
+define Package/ntfs-3g-utils
+  $(call Package/ntfs-3g/common)
+  TITLE:=ntfs-3g utilities (ntfs-3g.secaudit, ntfs-3g.usermap)
+  DEPENDS+= +ntfs-3g
+endef
+
+define Package/ntfs-3g-utils/description
+  Additional ntfs-3g utilities. Not included by default for size
+  considerations. All binaries except ntfs-3g, ntfs-3g.probe.
+
+  Currently:
+   - ntfs-3g.secaudit
+   - ntfs-3g.usermap
+
+endef
+
+# TODO: write a proper description
+# new in 2001.4.12
+define Package/ntfsprogs_ntfs-3g
+  $(call Package/ntfs-3g/common)
+  TITLE:=ntfsprogs (ntfs-3g)
+  DEPENDS+= +ntfs-3g +libgcrypt +libuuid
+endef
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-uuid
+
+# configure/make according selection
+ifdef CONFIG_PACKAGE_NTFS-3G_USE_LIBFUSE
+       CONFIGURE_ARGS += --with-fuse=external
+       TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include/fuse $(TARGET_CPPFLAGS)
+else
+       CONFIGURE_ARGS += --with-fuse=internal
+       TARGET_CPPFLAGS:=-I../include/fuse-lite $(TARGET_CPPFLAGS)
+endif
+
+# enable disable ntfsprogs
+ifneq ($(CONFIG_PACKAGE_ntfsprogs_ntfs-3g)$(SDK)$(DEVELOPER),)
+       CONFIGURE_ARGS += --enable-ntfsprogs
+else
+       CONFIGURE_ARGS += --disable-ntfsprogs
+endif
+
+# redefine prepare to extract to our build dir
+# apply patches
+define Build/Prepare
+       rm -rf $(PKG_BUILD_DIR)/
+       mkdir -p $(PKG_BUILD_DIR)/
+       $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
+       $(Build/Patch)
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include
+       $(CP)   $(PKG_INSTALL_DIR)/usr/include/ntfs-3g $(1)/usr/include/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP)   $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.{la,a,so*} $(1)/usr/lib/
+endef
+
+define Package/ntfs-3g/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ntfs-3g{,.probe} $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
+       $(INSTALL_DIR) $(1)/sbin
+       $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
+endef
+
+define Package/ntfs-3g/postinst
+#!/bin/sh
+FILE="$${IPKG_INSTROOT}/etc/filesystems"
+ID="ntfs-3g"
+
+if ! [ -f '/etc/filesystems' ]; then
+       echo "Create '$$FILE'."
+       touch "$$FILE"
+fi
+
+if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
+       echo "Add '$$ID' to known filesystems."
+       echo "$$ID" >> "$$FILE"
+fi
+
+endef
+
+define Package/ntfs-3g-low/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lowntfs-3g $(1)/usr/bin/
+       $(INSTALL_DIR) $(1)/sbin
+       $(CP) $(PKG_INSTALL_DIR)/sbin/mount.lowntfs-3g $(1)/sbin/
+endef
+
+define Package/ntfs-3g-low/postinst
+#!/bin/sh
+FILE="$${IPKG_INSTROOT}/etc/filesystems"
+ID="lowntfs-3g"
+
+if ! [ -f '/etc/filesystems' ]; then
+       echo "Create '$$FILE'."
+       touch "$$FILE"
+fi
+
+if ! grep -q -e '^ntfs-3g$$' "$$FILE"; then
+       echo "Add '$$ID' to known filesystems."
+       echo "$$ID" >> "$$FILE"
+fi
+
+endef
+
+define Package/ntfs-3g-utils/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -name ntfs-3g.probe ! -name ntfs-3g -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
+endef
+
+define Package/ntfsprogs_ntfs-3g/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(CP) $(PKG_INSTALL_DIR)/sbin/mkfs.ntfs $(1)/sbin/
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(FIND) $(PKG_INSTALL_DIR)/usr/bin/ -type f ! -regex '.*[^/]*ntfs-3g[^/]*' -exec $(INSTALL_BIN) {} $(1)/usr/bin/ \;
+       $(INSTALL_DIR) $(1)/usr/sbin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,ntfs-3g))
+$(eval $(call BuildPackage,ntfs-3g-low))
+$(eval $(call BuildPackage,ntfs-3g-utils))
+$(eval $(call BuildPackage,ntfsprogs_ntfs-3g))
index a31d38ae2fe27cfa7dce0d9b66eacea09abf7180..f17357055f0eb5d8a0991b36b11f2f4d9ae0fb5a 100644 (file)
@@ -10,6 +10,8 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=opensc
 PKG_VERSION:=20140317
 PKG_RELEASE:=1
+PKG_LICENSE:=LGPL-2.1+
+PKG_LICENSE_FILES:=COPYING
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 
 PKG_RELEASE=$(PKG_SOURCE_VERSION)
index 5ff3a14ebcd2ca4649c9b32b204f068170d0d87a..df0cdeaecd08884f2c7da0c2c095a6e3e64f8fd9 100644 (file)
@@ -15,6 +15,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/3991
 PKG_MD5SUM:=73502ca4ba6526727f9f49c63d805408
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
 
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
diff --git a/utils/picocom/Makefile b/utils/picocom/Makefile
new file mode 100644 (file)
index 0000000..b5251b4
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# 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:=picocom
+PKG_VERSION:=1.7
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://picocom.googlecode.com/files
+PKG_MD5SUM:=8eaba1d31407e8408674d6e57af447ef
+
+PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_LICENSE:=GPL-2.0+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/picocom
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=A minimal dumb-terminal emulation program
+  URL:=http://code.google.com/p/picocom/
+  SUBMENU:=Terminal
+endef
+
+define Package/picocom/description
+ minimal dumb-terminal emulation program
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) \
+               CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" \
+               picocom
+endef
+
+define Package/picocom/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_BUILD_DIR)/picocom $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,picocom))
diff --git a/utils/pv/Makefile b/utils/pv/Makefile
new file mode 100644 (file)
index 0000000..cbe44e5
--- /dev/null
@@ -0,0 +1,46 @@
+#
+# Copyright (C) 2008 David Cooper
+# 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:=pv
+PKG_VERSION:=1.5.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://www.ivarch.com/programs/sources/
+PKG_MD5SUM:=efe8e9e4cad5f3264a32258a63bf2c8e
+PKG_LICENSE:=Artistic-2.0
+PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/pv
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Shell pipeline element to meter data passing through
+  URL:=http://www.ivarch.com/programs/pv.shtml
+endef
+
+define Package/pv/description
+ Pipe Viewer is a terminal-based tool for monitoring the progress of data
+ through a pipeline. It can be inserted into any normal pipeline between
+ two processes to give a visual indication of how quickly data is passing
+ through, how long it has taken, how near to completion it is, and an
+ estimate of how long it will be until completion.
+endef
+
+define Package/pv/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pv $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,pv))
+
index dc665bf78bfea59661f8ed4c0316293ae6d030fc..8e91f9b36cdabf7764a30c02a50f0999776f35e1 100644 (file)
@@ -8,13 +8,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=shadow
-PKG_VERSION:=4.1.5.1
-PKG_RELEASE:=4
+PKG_VERSION:=4.2.1
+PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases
-PKG_MD5SUM:=a00449aa439c69287b6d472191dc2247
+PKG_MD5SUM:=2bfafe7d4962682d31b5eba65dba4fc8
 PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_LICENSE:=BSD-3-Clause
 
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
@@ -35,7 +36,8 @@ CONFIGURE_ARGS += \
        --without-acl \
        --without-attr \
        --without-tcb \
-       --without-nscd
+       --without-nscd \
+       --disable-subordinate-ids \
 
 define Package/shadow/Default
   SECTION:=utils
index f21eee1bf99fdb2e4987f9d5d60d7196bf4e468e..a16dad26ad35122aa13e7449586bb9eda65eced5 100644 (file)
@@ -1,9 +1,7 @@
-diff --git a/etc/login.defs b/etc/login.defs
-index 5b6fab3..79eeccf 100644
 --- a/etc/login.defs
 +++ b/etc/login.defs
 @@ -111,7 +111,7 @@ NOLOGINS_FILE      /etc/nologin
- # command is "-su".  If not defined, then "ps" would display the
+ # command as "-su".  If not defined, then ps(1) will display the
  # name of the shell actually being run, e.g. something like "-sh".
  #
 -SU_NAME               su
index 7a6f38e792529d35bac41005e085e23965123344..a7ef1f74ddd08670bc0549b47a3c1ecd42fd04e1 100644 (file)
@@ -1,10 +1,10 @@
 --- a/configure.in
 +++ b/configure.in
-@@ -195,7 +195,6 @@ AC_DEFINE_UNQUOTED(PASSWD_PROGRAM, "$sha
- dnl XXX - quick hack, should disappear before anyone notices :).
+@@ -197,7 +197,6 @@ dnl XXX - quick hack, should disappear b
  AC_DEFINE(USE_SYSLOG, 1, [Define to use syslog().])
- AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.])
--AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])
+ if test "$ac_cv_func_ruserok" = "yes"; then
+       AC_DEFINE(RLOGIN, 1, [Define if login should support the -r flag for rlogind.])
+-      AC_DEFINE(RUSEROK, 0, [Define to the ruserok() "success" return value (0 or 1).])
+ fi
  
  AC_ARG_ENABLE(shadowgrp,
-       [AC_HELP_STRING([--enable-shadowgrp], [enable shadow group support @<:@default=yes@:>@])],
diff --git a/utils/shadow/patches/003-fix-disabling-subids.patch b/utils/shadow/patches/003-fix-disabling-subids.patch
new file mode 100644 (file)
index 0000000..bbc65c7
--- /dev/null
@@ -0,0 +1,32 @@
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -1361,6 +1361,7 @@ static void process_flags (int argc, cha
+               exit (E_UID_IN_USE);
+       }
++#ifdef ENABLE_SUBIDS
+       if (   (vflg || Vflg)
+           && !is_sub_uid) {
+               fprintf (stderr,
+@@ -1376,6 +1377,7 @@ static void process_flags (int argc, cha
+                        Prog, sub_gid_dbname (), "-w", "-W");
+               exit (E_USAGE);
+       }
++#endif
+ }
+ /*
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,7 +52,10 @@ usbin_PROGRAMS = \
+ noinst_PROGRAMS = id sulogin
+ suidbins       = su
+-suidubins      = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
++suidubins      = chage chfn chsh expiry gpasswd newgrp passwd
++if ENABLE_SUBIDS
++      suidubins += newuidmap newgidmap
++endif
+ if ACCT_TOOLS_SETUID
+       suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
+ endif
index f5086c9d7c9bddefe5041a1ecb424d4776e607a9..d33917c60c0a72c19db627b462fedbf95a3cde1e 100644 (file)
@@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/uclibc++.mk
 
 PKG_NAME:=smartmontools
-PKG_VERSION:=6.2
+PKG_VERSION:=6.3
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/smartmontools
-PKG_MD5SUM:=d44f84081a12cef79cd17f78044351fc
+PKG_MD5SUM:=2ea0c62206e110192a97b59291b17f54
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=GPL-2.0+
 
 include $(INCLUDE_DIR)/package.mk
 
index de5681f4f0797ed5dbc2e5c3cd9165d26b266438..4855d6d3182fc036f37ec08392d6259446452c84 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/tmux
 PKG_MD5SUM:=b07601711f96f1d260b390513b509a2d
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
+PKG_LICENSE:=ISC
 
 PKG_INSTALL:=1
 
diff --git a/utils/watchcat/Makefile b/utils/watchcat/Makefile
new file mode 100644 (file)
index 0000000..7459794
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2010 segal.di.ubi.pt
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=watchcat
+PKG_VERSION:=1
+PKG_RELEASE:=5
+
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/watchcat
+  SECTION:=utils
+  CATEGORY:=Utilities
+  TITLE:=Enable the configuration of programed reboots
+endef
+
+define Package/watchcat/description
+Allows to configure a periodically reboot, or after loosing internet connectivity. Configured trough UCI /etc/config/system.
+endef
+
+define Package/watchcat/conffiles
+/etc/config/system
+endef
+
+define Build/Compile
+endef
+
+define Package/watchcat/install
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/initd_watchcat $(1)/etc/init.d/watchcat
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) ./files/watchcat.sh $(1)/usr/bin/watchcat.sh
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) ./files/uci_defaults_watchcat $(1)/etc/uci-defaults/50-watchcat
+endef
+
+$(eval $(call BuildPackage,watchcat))
diff --git a/utils/watchcat/files/initd_watchcat b/utils/watchcat/files/initd_watchcat
new file mode 100644 (file)
index 0000000..36e353f
--- /dev/null
@@ -0,0 +1,108 @@
+#!/bin/sh /etc/rc.common
+
+START=97
+
+PIDFILE="/tmp/run/watchcat"
+
+append_string() {
+       local varname="$1"; local add="$2"; local separator="${3:- }"; local actual
+       eval "actual=\$$varname"
+
+       new="${actual:+$actual$separator}$add"
+       eval "$varname=\$new"
+}
+
+timetoseconds() {
+       local time=$1
+       unset seconds
+
+       { [ "$time" -ge 1 ] 2> /dev/null && seconds="$time"; } || \
+       { [ "${time%s}" -ge 1 ] 2> /dev/null && seconds="${time%s}"; } || \
+       { [ "${time%m}" -ge 1 ] 2> /dev/null && seconds=$((${time%m}*60)); } || \
+       { [ "${time%h}" -ge 1 ] 2> /dev/null && seconds=$((${time%h}*3600)); } || \
+       { [ "${time%d}" -ge 1 ] 2> /dev/null && seconds=$((${time%d}*86400)); }
+}
+
+load_watchcat() {
+       config_get period       $1 period
+       config_get mode         $1 mode         "allways"
+       config_get pinghosts    $1 pinghosts    "8.8.8.8"
+       config_get pingperiod   $1 pingperiod
+       config_get forcedelay   $1 forcedelay   "0"
+
+       error=""
+
+       timetoseconds "$period"
+       period="$seconds"
+       [ "$period" -ge 1 ] \
+               || append_string "error" 'period is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
+       [ "$mode" = "allways" -o "$mode" = "ping" ] \
+               || append_string "error" "mode must be 'allways' or 'ping'" "; "
+       [ -n "$pinghosts" -o "$mode" = "allways" ] \
+               || append_string "error" "pinghosts must be set when in 'ping' mode" "; "
+       [ "$mode" = "ping" ] && {
+               if [ -n "$pingperiod" ]
+               then
+                       timetoseconds "$pingperiod"
+                       pingperiod="$seconds"
+                       if [ "$pingperiod" -ge 0 ]
+                       then
+                               [ "$pingperiod" -le "$period" ] \
+                                       || append_string "error" "pingperiod must be less than period" "; "
+                       else
+                               append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
+                       fi
+               else
+                       pingperiod="$((period/20))"
+               fi
+       }
+       [ "$pingperiod" -lt "$period" -o "$mode" = "allways" ] \
+               || append_string "error" "pingperiod is not recognized" "; "
+       [ "$forcedelay" -ge 0 ] \
+               || append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; "
+
+       [ -n "$error" ] && { logger -p user.err -t "watchcat" "reboot program $1 not started - $error"; return; }
+
+       if [ "$mode" = "allways" ]
+       then
+               /usr/bin/watchcat.sh "allways" "$period" "$forcedelay" &
+               logger -p user.info -t "wathchat" "started task (mode=$mode;period=$period;forcedelay=$forcedelay)" 
+       else
+               /usr/bin/watchcat.sh "period" "$period" "$forcedelay" "$pinghosts" "$pingperiod" &
+               logger -p user.info -t "wathchat" "started task (mode=$mode;period=$period;pinghosts=$pinghosts;pingperiod=$pingperiod;forcedelay=$forcedelay)" 
+       fi
+
+       echo $! >> "${PIDFILE}.pids"
+}
+
+stop() {
+       if [ -f "${PIDFILE}.pids" ]
+       then
+               logger -p user.info -t "watchcat" "stopping all tasks"
+
+               while read pid
+               do
+                       kill "$pid"
+               done < "${PIDFILE}.pids"
+
+               rm "${PIDFILE}.pids"
+
+               logger -p user.info -t "watchcat" "all tasks stopped"
+       else
+               logger -p user.info -t "watchcat" "no tasks running"
+       fi
+}
+
+start() {
+       [ -f "${PIDFILE}.pids" ] && stop
+
+       config_load system
+       if [ -n "$(uci show system.@watchcat[0])" ] # at least one watchcat section exists
+       then
+               logger -p user.info -t "watchcat" "starting all tasks"
+               config_foreach load_watchcat watchcat
+               logger -p user.info -t "watchcat" "all tasks started"
+       else
+               logger -p user.info -t "watchcat" "no tasks defined"
+       fi
+}
diff --git a/utils/watchcat/files/uci_defaults_watchcat b/utils/watchcat/files/uci_defaults_watchcat
new file mode 100644 (file)
index 0000000..49def81
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+uci -q show system.@watchcat[0] || {
+       uci add system watchcat
+       uci set system.@watchcat[0].period=6h
+       uci set system.@watchcat[0].mode=ping
+       uci set system.@watchcat[0].pinghosts=8.8.8.8
+       uci set system.@watchcat[0].forcedelay=30
+       uci commit
+}
diff --git a/utils/watchcat/files/watchcat.sh b/utils/watchcat/files/watchcat.sh
new file mode 100644 (file)
index 0000000..304ef27
--- /dev/null
@@ -0,0 +1,74 @@
+#!/bin/sh
+#
+# Copyright (C) 2010 segal.di.ubi.pt
+#
+# This is free software, licensed under the GNU General Public License v2.
+#
+
+mode="$1"
+
+shutdown_now() {
+       local forcedelay="$1"
+
+       reboot &
+
+       [ "$forcedelay" -ge 1 ] && {
+               sleep "$forcedelay"
+
+               echo b > /proc/sysrq-trigger # Will immediately reboot the system without syncing or unmounting your disks.
+       }
+}
+
+watchcat_allways() {
+       local period="$1"; local forcedelay="$2"
+
+       sleep "$period" && shutdown_now "$forcedelay"
+}
+
+watchcat_ping() {
+       local period="$1"; local forcedelay="$2"; local pinghosts="$3"; local pingperiod="$4"
+
+       time_now="$(cat /proc/uptime)"
+       time_now="${time_now%%.*}"
+       time_lastcheck="$time_now"
+       time_lastcheck_withinternet="$time_now"
+
+       while true
+       do
+               # account for the time ping took to return. With a ping time of 5s, ping might take more than that, so it is important to avoid even more delay.
+               time_now="$(cat /proc/uptime)"
+               time_now="${time_now%%.*}"
+               time_diff="$((time_now-time_lastcheck))"
+
+               [ "$time_diff" -lt "$pingperiod" ] && {
+                       sleep_time="$((pingperiod-time_diff))"
+                       sleep "$sleep_time"
+               }
+
+               time_now="$(cat /proc/uptime)"
+               time_now="${time_now%%.*}"
+               time_lastcheck="$time_now"
+
+               for host in "$pinghosts"
+               do
+                       if ping -c 1 "$host" &> /dev/null
+                       then
+                               time_lastcheck_withinternet="$time_now"
+                       else
+                               time_diff="$((time_now-time_lastcheck_withinternet))"
+                               logger -p daemon.info -t "watchcat[$$]" "no internet connectivity for $time_diff seconds. Reseting when reaching $period"
+                       fi
+               done
+
+               time_diff="$((time_now-time_lastcheck_withinternet))"
+               [ "$time_diff" -ge "$period" ] && shutdown_now "$forcedelay"
+
+       done
+}
+
+       if [ "$mode" = "allways" ]
+       then
+               watchcat_allways "$2" "$3"
+       else
+               watchcat_ping "$2" "$3" "$4" "$5"
+       fi