Browse Source

Merge branch 'master' into license-updates

Signed-off-by: Ian Leonard <antonlacon@gmail.com>

Conflicts:
	devel/patch/Makefile
	multimedia/minidlna/Makefile
Ian Leonard 10 years ago
parent
commit
f5a1d1bba6
100 changed files with 97671 additions and 2689 deletions
  1. 6
    5
      README.md
  2. 2
    2
      devel/patch/Makefile
  3. 1
    1
      ipv6/aiccu/files/aiccu.sh
  4. 1
    0
      lang/luabitop/Makefile
  5. 1
    0
      lang/luaposix/Makefile
  6. 110
    0
      libs/cyrus-sasl/Makefile
  7. 2
    2
      libs/gnutls/Makefile
  8. 0
    28
      libs/gnutls/patches/0001-nn-hash.patch
  9. 0
    98
      libs/gsm/Makefile
  10. 0
    428
      libs/gsm/patches/001-debian-libsgm-1.0.10-13.patch
  11. 2
    1
      libs/libaudiofile/Makefile
  12. 1
    0
      libs/libftdi/Makefile
  13. 1
    0
      libs/libftdi1/Makefile
  14. 5
    16
      libs/libjpeg/Makefile
  15. 0
    11
      libs/libjpeg/patches/001-allow-ccache.patch
  16. 0
    1896
      libs/libjpeg/patches/200-crop.patch
  17. 0
    15
      libs/libjpeg/patches/300-CVE-2013-6629.patch
  18. 8
    4
      libs/liboil/Makefile
  19. 75
    0
      libs/libsoup/Makefile
  20. 4
    1
      libs/libssh2/Makefile
  21. 3
    0
      libs/libuecc/Makefile
  22. 6
    3
      libs/libxslt/Makefile
  23. 2
    0
      libs/nacl/Makefile
  24. 150
    0
      libs/openldap/Makefile
  25. 19
    0
      libs/openldap/files/ldap.init
  26. 323
    0
      libs/openldap/patches/001-automake-compat.patch
  27. 26
    0
      libs/openldap/patches/020-autofs-schema.patch
  28. 22
    0
      libs/openldap/patches/750-no-strip.patch
  29. 4
    1
      libs/tiff/Makefile
  30. 31
    0
      libs/tiff/patches/010-CVE-2012-4564.patch
  31. 146
    0
      libs/tiff/patches/011-CVE-2013-1960.patch
  32. 768
    0
      libs/tiff/patches/012-CVE-2013-1961.patch
  33. 17
    0
      libs/tiff/patches/013-CVE-2013-4231.patch
  34. 18
    0
      libs/tiff/patches/014-CVE-2013-4232.patch
  35. 18
    0
      libs/tiff/patches/015-CVE-2013-4244.patch
  36. 37
    0
      libs/tiff/patches/016-CVE-2013-4243.patch
  37. 81
    0
      libs/vips/Makefile
  38. 91228
    0
      libs/vips/patches/001-no_cpp.patch
  39. 238
    0
      multimedia/gst1-plugins-bad/Makefile
  40. 45
    0
      multimedia/gst1-plugins-bad/patches/000-gettext.patch
  41. 242
    0
      multimedia/gst1-plugins-base/Makefile
  42. 36
    0
      multimedia/gst1-plugins-base/patches/001-no_docs.patch
  43. 38
    0
      multimedia/gst1-plugins-base/patches/002-no_tests.patch
  44. 49
    0
      multimedia/gst1-plugins-base/patches/003-no_translations.patch
  45. 202
    0
      multimedia/gst1-plugins-good/Makefile
  46. 22
    0
      multimedia/gst1-plugins-good/patches/001-no_docs.patch
  47. 22
    0
      multimedia/gst1-plugins-good/patches/002-no_tests.patch
  48. 33
    0
      multimedia/gst1-plugins-good/patches/003-no_translations.patch
  49. 142
    0
      multimedia/gst1-plugins-ugly/Makefile
  50. 24
    0
      multimedia/gst1-plugins-ugly/patches/001-no_docs.patch
  51. 24
    0
      multimedia/gst1-plugins-ugly/patches/002-no_tests.patch
  52. 35
    0
      multimedia/gst1-plugins-ugly/patches/003-no_translations.patch
  53. 195
    0
      multimedia/gstreamer1/Makefile
  54. 37
    0
      multimedia/gstreamer1/patches/001-no_docs.patch
  55. 39
    0
      multimedia/gstreamer1/patches/002-no_tests.patch
  56. 48
    0
      multimedia/gstreamer1/patches/003-no_translations.patch
  57. 2
    0
      multimedia/minidlna/Makefile
  58. 12
    0
      multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch
  59. 1
    1
      multimedia/mjpg-streamer/Makefile
  60. 63
    0
      net/dhcpcd/Makefile
  61. 24
    0
      net/dhcpcd/files/dhcpcd.init
  62. 5
    2
      net/ethtool/Makefile
  63. 0
    166
      net/ethtool/patches/100-ixp4xx.patch
  64. 3
    0
      net/fastd/Makefile
  65. 9
    8
      net/freeradius2/Makefile
  66. 45
    0
      net/horst/Makefile
  67. 40
    0
      net/mwan3-luci/Makefile
  68. 38
    0
      net/mwan3-luci/files/etc/hotplug.d/iface/16-mwan3custombak
  69. 14
    0
      net/mwan3-luci/files/etc/uci-defaults/mwan3
  70. 355
    0
      net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua
  71. 55
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_hotplug.lua
  72. 32
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_mwan3.lua
  73. 32
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_network.lua
  74. 266
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interface.lua
  75. 191
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interfaceconfig.lua
  76. 46
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_member.lua
  77. 47
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_memberconfig.lua
  78. 82
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policy.lua
  79. 58
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policyconfig.lua
  80. 109
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_rule.lua
  81. 99
    0
      net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_ruleconfig.lua
  82. 1
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan3.htm
  83. 134
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_diagnostics.htm
  84. 23
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_hotplug.htm
  85. 23
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_mwan3.htm
  86. 23
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_network.htm
  87. 77
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_troubleshoot.htm
  88. 34
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_config_css.htm
  89. 62
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_detail.htm
  90. 146
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_interface.htm
  91. 95
    0
      net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_status.htm
  92. 48
    0
      net/mwan3/Makefile
  93. 79
    0
      net/mwan3/files/etc/config/mwan3
  94. 328
    0
      net/mwan3/files/etc/hotplug.d/iface/15-mwan3
  95. 20
    0
      net/mwan3/files/etc/init.d/mwan3
  96. 208
    0
      net/mwan3/files/usr/sbin/mwan3
  97. 65
    0
      net/mwan3/files/usr/sbin/mwan3track
  98. 86
    0
      net/netatalk/Makefile
  99. 2
    0
      net/netatalk/files/AppleVolumes.default
  100. 0
    0
      net/netatalk/files/afpd.conf

+ 6
- 5
README.md View File

@@ -1,4 +1,4 @@
1
-# OpenWRT packages feed
1
+# OpenWrt packages feed
2 2
 
3 3
 ## Description
4 4
 
@@ -6,10 +6,11 @@ This is the OpenWrt "packages"-feed containing community-maintained packages.
6 6
 
7 7
 ## Usage
8 8
 
9
-This feed is enabled by default. To install all its package definitions:
10
-
11
-Run: ./scripts/feeds update packages
12
-Run: ./scripts/feeds install -a -p packages
9
+This feed is enabled by default. To install all its package definitions, run:
10
+```
11
+./scripts/feeds update packages
12
+./scripts/feeds install -a -p packages
13
+```
13 14
 
14 15
 ## License
15 16
 

+ 2
- 2
devel/patch/Makefile View File

@@ -11,9 +11,9 @@ PKG_NAME:=patch
11 11
 PKG_VERSION:=2.7.1
12 12
 PKG_RELEASE:=1
13 13
 
14
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=@GNU/patch
16
-PKG_MD5SUM:=95dd8d7e41dcbcecdd5cd88ef915378d
16
+PKG_MD5SUM:=e9ae5393426d3ad783a300a338c09b72
17 17
 PKG_LICENSE:=GPL-3.0+
18 18
 PKG_LICENSE_FILES:=COPYING
19 19
 

+ 1
- 1
ipv6/aiccu/files/aiccu.sh View File

@@ -34,7 +34,7 @@ proto_aiccu_setup() {
34 34
 	echo "ipv6_interface $link"   >> "$CFGFILE"
35 35
 	[ -n "$server" ] && echo "server $server" >> "$CFGFILE"
36 36
 	[ -n "$protocol" ] && echo "protocol $protocol" >> "$CFGFILE"
37
-	[ -n "$tunnel_id" ] && echo "tunnel_id $tunnel_id"	  >> "$CFGFILE"
37
+	[ -n "$tunnelid" ] && echo "tunnel_id $tunnelid"	  >> "$CFGFILE"
38 38
 	[ -n "$requiretls" ] && echo "requiretls $requiretls"	   >> "$CFGFILE"
39 39
 	[ "$nat" == 1 ] && echo "behindnat true"     >> "$CFGFILE"
40 40
 	[ "$heartbeat"	== 1 ] && echo "makebeats true" >> "$CFGFILE"

+ 1
- 0
lang/luabitop/Makefile View File

@@ -18,6 +18,7 @@ PKG_SOURCE:=$(_BASENAME)-$(PKG_VERSION).tar.gz
18 18
 PKG_SOURCE_URL:=http://bitop.luajit.org/download/
19 19
 PKG_MD5SUM:=d0c1080fe0c844e8477279668e2d0d06
20 20
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(_BASENAME)-$(PKG_VERSION)
21
+PKG_LICENSE:=MIT
21 22
 
22 23
 include $(INCLUDE_DIR)/package.mk
23 24
 

+ 1
- 0
lang/luaposix/Makefile View File

@@ -18,6 +18,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-release-$(PKG_VERSION)
18 18
 PKG_REMOVE_FILES:=aclocal.m4
19 19
 PKG_FIXUP:=autoreconf
20 20
 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com>
21
+PKG_LICENSE:=MIT
21 22
 
22 23
 include $(INCLUDE_DIR)/package.mk
23 24
 

+ 110
- 0
libs/cyrus-sasl/Makefile View File

@@ -0,0 +1,110 @@
1
+#
2
+# Copyright (C) 2006-2008 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=cyrus-sasl
11
+PKG_VERSION:=2.1.26
12
+PKG_RELEASE:=2
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=ftp://ftp.cyrusimap.org/cyrus-sasl/
16
+PKG_MD5SUM:=a7f4e5e559a0e37b3ffc438c9456e425
17
+
18
+PKG_LICENSE:=BSD-4c BSD
19
+PKG_LICENSE_FILES:=COPYING cmulocal/COPYING saslauthd/COPYING
20
+
21
+PKG_FIXUP:=autoreconf
22
+PKG_MACRO_PATHS:=cmulocal config ../cmulocal ../config
23
+PKG_AUTOMAKE_PATHS:=. saslauthd sasldb
24
+PKG_REMOVE_FILES:=aclocal.m4 saslauthd/aclocal.m4 config/libtool.m4
25
+
26
+include $(INCLUDE_DIR)/package.mk
27
+
28
+define Package/libsasl2
29
+  SECTION:=libs
30
+  CATEGORY:=Libraries
31
+  TITLE:=A general purpose authentication library
32
+  URL:=http://asg.web.cmu.edu/sasl/
33
+  DEPENDS:=libopenssl
34
+endef
35
+
36
+TARGET_CFLAGS += $(FPIC)
37
+CONFIGURE_ARGS += \
38
+	--enable-shared \
39
+	--enable-static \
40
+	--disable-sample \
41
+	--enable-staticdlopen \
42
+	--disable-java \
43
+	--disable-alwaystrue \
44
+	--disable-checkapop \
45
+	--enable-cram \
46
+	--enable-digest \
47
+	--without-auth-sasldb \
48
+	--disable-otp \
49
+	--disable-srp \
50
+	--disable-srp-setpass \
51
+	--disable-krb4 \
52
+	--disable-gssapi \
53
+	--disable-gss_mutexes \
54
+	--enable-plain \
55
+	--enable-anon \
56
+	--disable-login \
57
+	--disable-ntlm \
58
+	--disable-sql \
59
+	--disable-ldapdb \
60
+	--without-dblib \
61
+	--without-gdbm \
62
+	--with-devrandom="/dev/urandom" \
63
+	--without-pam \
64
+	--without-saslauthd \
65
+	--without-authdaemond \
66
+	--without-pwcheck \
67
+	--with-ipctype=unix \
68
+	--with-openssl="$(STAGING_DIR)/usr" \
69
+	--without-des \
70
+	--without-opie \
71
+	--without-ldap \
72
+	--without-mysql \
73
+	--without-pgsql \
74
+	--without-sqlite \
75
+	--without-rc4 \
76
+	--without-dmalloc \
77
+	--without-sfio \
78
+	--disable-sample
79
+
80
+define Build/Compile
81
+	$(MAKE) -C $(PKG_BUILD_DIR)/include \
82
+		CC="$(HOSTCC)" \
83
+		LINK="$(HOSTCC) -o makemd5 -lc" \
84
+		CFLAGS="" \
85
+		CPPFLAGS="" \
86
+		makemd5
87
+	$(MAKE) -C $(PKG_BUILD_DIR) \
88
+		DESTDIR="$(PKG_INSTALL_DIR)" \
89
+		all install
90
+endef
91
+
92
+define Build/InstallDev
93
+	$(INSTALL_DIR) $(1)/usr/include/
94
+	$(CP) $(PKG_INSTALL_DIR)/usr/include/sasl $(1)/usr/include/
95
+	$(INSTALL_DIR) $(1)/usr/lib/
96
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsasl2.{a,so*} $(1)/usr/lib/
97
+	ln -sf libsasl2.a $(1)/usr/lib/libsasl.a
98
+	ln -sf libsasl2.so $(1)/usr/lib/libsasl.so
99
+	$(INSTALL_DIR) $(1)/usr/lib/sasl2
100
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/sasl2/lib*.{a,so*} $(1)/usr/lib/sasl2/
101
+endef
102
+
103
+define Package/libsasl2/install
104
+	$(INSTALL_DIR) $(1)/usr/lib/
105
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsasl2.so.* $(1)/usr/lib/
106
+	$(INSTALL_DIR) $(1)/usr/lib/sasl2
107
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/sasl2/lib*.so.* $(1)/usr/lib/sasl2/
108
+endef
109
+
110
+$(eval $(call BuildPackage,libsasl2))

+ 2
- 2
libs/gnutls/Makefile View File

@@ -8,12 +8,12 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=gnutls
11
-PKG_VERSION:=3.2.15
11
+PKG_VERSION:=3.2.16
12 12
 PKG_RELEASE:=1
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 15
 PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2
16
-PKG_MD5SUM:=ec3b06f80e312137386c5d322183ca5a
16
+PKG_MD5SUM:=d9a3fb49121b49bc332bfe9c3f49b005
17 17
 PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
18 18
 
19 19
 PKG_INSTALL:=1

+ 0
- 28
libs/gnutls/patches/0001-nn-hash.patch View File

@@ -1,28 +0,0 @@
1
-diff --git a/lib/accelerated/x86/x86-common.h b/lib/accelerated/x86/x86-common.h
2
-index 03fc8de..647c7d6 100644
3
---- a/lib/accelerated/x86/x86-common.h
4
-+++ b/lib/accelerated/x86/x86-common.h
5
-@@ -29,11 +29,13 @@ extern unsigned int _gnutls_x86_cpuid_s[4];
6
- void gnutls_cpuid(unsigned int func, unsigned int *ax, unsigned int *bx,
7
- 		  unsigned int *cx, unsigned int *dx);
8
- 
9
--#ifdef ASM_X86_32
10
-+# ifdef ASM_X86_32
11
- unsigned int gnutls_have_cpuid(void);
12
--#else
13
--#define gnutls_have_cpuid() 1
14
--#endif				/* ASM_X86_32 */
15
-+# else
16
-+#  define gnutls_have_cpuid() 1
17
-+# endif				/* ASM_X86_32 */
18
-+
19
-+#endif
20
- 
21
- #define NN_HASH(name, update_func, digest_func, NAME) {	\
22
-  #name,						\
23
-@@ -44,5 +46,3 @@ unsigned int gnutls_have_cpuid(void);
24
-  (nettle_hash_update_func *) update_func,	\
25
-  (nettle_hash_digest_func *) digest_func	\
26
- } 
27
--
28
--#endif

+ 0
- 98
libs/gsm/Makefile View File

@@ -1,98 +0,0 @@
1
-#
2
-# Copyright (C) 2006-2014 OpenWrt.org
3
-#
4
-# This is free software, licensed under the GNU General Public License v2.
5
-# See /LICENSE for more information.
6
-#
7
-
8
-include $(TOPDIR)/rules.mk
9
-
10
-PKG_NAME:=gsm
11
-PKG_VERSION:=1.0.13
12
-PKG_RELEASE:=1
13
-
14
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
-PKG_SOURCE_URL:=http://user.cs.tu-berlin.de/~jutta/gsm/
16
-PKG_MD5SUM:=c1ba392ce61dc4aff1c29ea4e92f6df4
17
-
18
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
19
-
20
-PKG_LICENSE:=FREE
21
-PKG_LICENSE_FILES:=COPYRIGHT
22
-
23
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-1.0-pl13
24
-
25
-include $(INCLUDE_DIR)/package.mk
26
-
27
-define Package/gsm/Default
28
-  TITLE:=GSM transcoding
29
-  URL:=http://user.cs.tu-berlin.de/~jutta/toast.html
30
-endef
31
-
32
-define Package/gsm/description/Default
33
- An implementation of the European GSM 06.10 provisional standard
34
- for full-rate speech transcoding, prI-ETS 300 036, which uses
35
- RPE/LTP (residual pulse excitation/long term prediction) coding
36
- at 13 kbit/s.
37
-endef
38
-
39
-define Package/libgsm
40
-$(call Package/gsm/Default)
41
-  SECTION:=libs
42
-  CATEGORY:=Libraries
43
-  TITLE+= library
44
-endef
45
-
46
-define Package/libgsm/description
47
-$(call Package/gsm/description/Default)
48
- This package contains a shared GSM transcoding library, used by other
49
- programs.
50
-endef
51
-
52
-define Package/gsm-utils
53
-$(call Package/gsm/Default)
54
-  SECTION:=utils
55
-  CATEGORY:=Utilities
56
-  DEPENDS:=+libgsm
57
-  TITLE+= utilities
58
-endef
59
-
60
-define Package/gsm-utils/description
61
-$(call Package/gsm/description/Default)
62
- This package contains GSM transcoding utilities.
63
-endef
64
-
65
-define Build/Configure
66
-endef
67
-
68
-TARGET_CFLAGS += $(FPIC)
69
-
70
-define Build/Compile
71
-	$(MAKE) -C $(PKG_BUILD_DIR) \
72
-		$(TARGET_CONFIGURE_OPTS) \
73
-		LD="$(TARGET_CC)" \
74
-		COPTS="$(TARGET_CFLAGS)" \
75
-		INSTALL_ROOT="$(PKG_INSTALL_DIR)" \
76
-		all install
77
-endef
78
-
79
-define Package/libgsm/install
80
-	$(INSTALL_DIR) $(1)/usr/lib
81
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgsm.so.* $(1)/usr/lib/
82
-endef
83
-
84
-define Package/gsm-utils/install
85
-	$(INSTALL_DIR) $(1)/usr/bin
86
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/toast $(1)/usr/bin/
87
-	(cd $(1)/usr/bin; ln -sf toast untoast; ln -sf toast tcat)
88
-endef
89
-
90
-define Build/InstallDev
91
-	$(INSTALL_DIR) $(1)/usr/include/gsm
92
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/gsm.h $(1)/usr/include/gsm/
93
-	$(INSTALL_DIR) $(1)/usr/lib
94
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgsm.{a,so*} $(1)/usr/lib/
95
-endef
96
-
97
-$(eval $(call BuildPackage,libgsm))
98
-$(eval $(call BuildPackage,gsm-utils))

+ 0
- 428
libs/gsm/patches/001-debian-libsgm-1.0.10-13.patch View File

@@ -1,428 +0,0 @@
1
---- a/Makefile
2
-+++ b/Makefile
3
-@@ -8,10 +8,12 @@ SASR	= -DSASR
4
- ######### Define SASR if >> is a signed arithmetic shift (-1 >> 1 == -1)
5
- 
6
- # MULHACK = -DUSE_FLOAT_MUL
7
-+MULHACK =
8
- ######### Define this if your host multiplies floats faster than integers,
9
- ######### e.g. on a SPARCstation.
10
- 
11
- # FAST	= -DFAST
12
-+FAST	=
13
- ######### Define together with USE_FLOAT_MUL to enable the GSM library's
14
- ######### approximation option for incorrect, but good-enough results.
15
- 
16
-@@ -22,8 +24,8 @@ LTP_CUT	=
17
- ######### both integer and floating point multiplications.
18
- ######### This flag is still in the experimental stage.
19
- 
20
--WAV49	= -DWAV49
21
--# WAV49	=
22
-+# WAV49	= -DWAV49
23
-+WAV49	=
24
- ######### Define to enable the GSM library's option to pack GSM frames 
25
- ######### in the style used by the WAV #49 format.  If you want to write
26
- ######### a tool that produces .WAV files which contain GSM-encoded data,
27
-@@ -44,7 +46,8 @@ WAV49	= -DWAV49
28
- # CCFLAGS 	= -c -O
29
- 
30
- CC		= gcc -ansi -pedantic
31
--CCFLAGS 	= -c -O2 -DNeedFunctionPrototypes=1
32
-+COPTS		= -O2
33
-+CCFLAGS 	= -c $(COPTS) -DNeedFunctionPrototypes=1
34
- 
35
- LD 		= $(CC)
36
- 
37
-@@ -78,10 +81,10 @@ INSTALL_ROOT	=
38
- # Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of
39
- # this directory.
40
- 
41
--GSM_INSTALL_ROOT = $(INSTALL_ROOT)
42
-+GSM_INSTALL_ROOT = $(INSTALL_ROOT)/usr
43
- GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib
44
--GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc
45
--GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3
46
-+GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include
47
-+GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3
48
- 
49
- 
50
- # Where do you want to install the toast binaries and their manpage?
51
-@@ -89,14 +92,14 @@ GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/ma
52
- # Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside
53
- # of this directory.
54
- 
55
--TOAST_INSTALL_ROOT	  = $(INSTALL_ROOT)
56
-+TOAST_INSTALL_ROOT	  = $(INSTALL_ROOT)/usr
57
- TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin
58
--TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1
59
-+TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1
60
- 
61
- #  Other tools
62
- 
63
- SHELL		= /bin/sh
64
--LN		= ln
65
-+LN		= ln -s
66
- BASENAME 	= basename
67
- AR		= ar
68
- ARFLAGS		= cr
69
-@@ -126,7 +129,7 @@ INC	= $(ROOT)/inc
70
- 
71
- # Flags
72
- 
73
--# DEBUG	= -DNDEBUG
74
-+DEBUG	= -DNDEBUG
75
- ######### Remove -DNDEBUG to enable assertions.
76
- 
77
- CFLAGS	= $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \
78
-@@ -140,6 +143,7 @@ LFLAGS	= $(LDFLAGS) $(LDINC)
79
- # Targets
80
- 
81
- LIBGSM	= $(LIB)/libgsm.a
82
-+LIBGSMSO= $(LIB)/libgsm.so
83
- 
84
- TOAST	= $(BIN)/toast
85
- UNTOAST	= $(BIN)/untoast
86
-@@ -258,6 +262,9 @@ STUFF = 	ChangeLog			\
87
- 
88
- GSM_INSTALL_TARGETS =	\
89
- 		$(GSM_INSTALL_LIB)/libgsm.a		\
90
-+		$(GSM_INSTALL_LIB)/libgsm.so		\
91
-+		$(GSM_INSTALL_LIB)/libgsm.so.1		\
92
-+		$(GSM_INSTALL_LIB)/libgsm.so.1.0.10	\
93
- 		$(GSM_INSTALL_INC)/gsm.h		\
94
- 		$(GSM_INSTALL_MAN)/gsm.3		\
95
- 		$(GSM_INSTALL_MAN)/gsm_explode.3	\
96
-@@ -279,7 +286,7 @@ TOAST_INSTALL_TARGETS =	\
97
- 
98
- # Target rules
99
- 
100
--all:		$(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST)
101
-+all:		$(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST)
102
- 		@-echo $(ROOT): Done.
103
- 
104
- tst:		$(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result
105
-@@ -299,6 +306,11 @@ install:	toastinstall gsminstall
106
- 
107
- # The basic API: libgsm
108
- 
109
-+$(LIBGSMSO):	$(LIB) $(GSM_OBJECTS)
110
-+		$(LD) -o $@.1.0.10 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc
111
-+		ln -fs libgsm.so.1.0.10 lib/libgsm.so.1
112
-+		ln -fs libgsm.so.1.0.10 lib/libgsm.so
113
-+
114
- $(LIBGSM):	$(LIB) $(GSM_OBJECTS)
115
- 		-rm $(RMFLAGS) $(LIBGSM)
116
- 		$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)
117
-@@ -308,15 +320,15 @@ $(LIBGSM):	$(LIB) $(GSM_OBJECTS)
118
- # Toast, Untoast and Tcat -- the compress-like frontends to gsm.
119
- 
120
- $(TOAST):	$(BIN) $(TOAST_OBJECTS) $(LIBGSM)
121
--		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB)
122
-+		$(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB)
123
- 
124
- $(UNTOAST):	$(BIN) $(TOAST)
125
- 		-rm $(RMFLAGS) $(UNTOAST)
126
--		$(LN) $(TOAST) $(UNTOAST)
127
-+		$(LN) toast $(UNTOAST)
128
- 
129
- $(TCAT):	$(BIN) $(TOAST)
130
- 		-rm $(RMFLAGS) $(TCAT)
131
--		$(LN) $(TOAST) $(TCAT)
132
-+		$(LN) toast $(TCAT)
133
- 
134
- 
135
- # The local bin and lib directories
136
-@@ -351,53 +363,66 @@ toastuninstall:
137
- 		fi
138
- 
139
- $(TOAST_INSTALL_BIN)/toast:	$(TOAST)
140
--		-rm $@
141
--		cp $(TOAST) $@
142
-+		mkdir -p $(TOAST_INSTALL_BIN)
143
-+		cp -f $(TOAST) $@
144
- 		chmod 755 $@
145
- 
146
- $(TOAST_INSTALL_BIN)/untoast:	$(TOAST_INSTALL_BIN)/toast
147
--		-rm $@
148
--		ln $? $@
149
-+		mkdir -p $(TOAST_INSTALL_BIN)
150
-+		ln -sf $? $@
151
- 
152
- $(TOAST_INSTALL_BIN)/tcat:	$(TOAST_INSTALL_BIN)/toast
153
--		-rm $@
154
--		ln $? $@
155
-+		mkdir -p $(TOAST_INSTALL_BIN)
156
-+		ln -sf $? $@
157
- 
158
- $(TOAST_INSTALL_MAN)/toast.1:	$(MAN)/toast.1
159
--		-rm $@
160
--		cp $? $@
161
-+		mkdir -p $(TOAST_INSTALL_MAN)
162
-+		cp -f $? $@
163
- 		chmod 444 $@
164
- 
165
- $(GSM_INSTALL_MAN)/gsm.3:	$(MAN)/gsm.3
166
--		-rm $@
167
--		cp $? $@
168
-+		mkdir -p $(GSM_INSTALL_MAN)
169
-+		cp -f $? $@
170
- 		chmod 444 $@
171
- 
172
- $(GSM_INSTALL_MAN)/gsm_option.3:	$(MAN)/gsm_option.3
173
--		-rm $@
174
--		cp $? $@
175
-+		mkdir -p $(GSM_INSTALL_MAN)
176
-+		cp -f $? $@
177
- 		chmod 444 $@
178
- 
179
- $(GSM_INSTALL_MAN)/gsm_explode.3:	$(MAN)/gsm_explode.3
180
--		-rm $@
181
--		cp $? $@
182
-+		mkdir -p $(GSM_INSTALL_MAN)
183
-+		cp -f $? $@
184
- 		chmod 444 $@
185
- 
186
- $(GSM_INSTALL_MAN)/gsm_print.3:	$(MAN)/gsm_print.3
187
--		-rm $@
188
--		cp $? $@
189
-+		mkdir -p $(GSM_INSTALL_MAN)
190
-+		cp -f $? $@
191
- 		chmod 444 $@
192
- 
193
- $(GSM_INSTALL_INC)/gsm.h:	$(INC)/gsm.h
194
--		-rm $@
195
--		cp $? $@
196
-+		mkdir -p $(GSM_INSTALL_INC)
197
-+		cp -f $? $@
198
- 		chmod 444 $@
199
- 
200
- $(GSM_INSTALL_LIB)/libgsm.a:	$(LIBGSM)
201
--		-rm $@
202
--		cp $? $@
203
-+		mkdir -p $(GSM_INSTALL_LIB)
204
-+		cp -f $? $@
205
- 		chmod 444 $@
206
- 
207
-+$(GSM_INSTALL_LIB)/libgsm.so:	$(LIBGSMSO)
208
-+		mkdir -p $(GSM_INSTALL_LIB)
209
-+		cp -f $? $@
210
-+
211
-+$(GSM_INSTALL_LIB)/libgsm.so.1:	$(LIBGSMSO)
212
-+		mkdir -p $(GSM_INSTALL_LIB)
213
-+		cp -f $? $@
214
-+
215
-+$(GSM_INSTALL_LIB)/libgsm.so.1.0.10:	$(LIBGSMSO)
216
-+		mkdir -p $(GSM_INSTALL_LIB)
217
-+		cp -f $? $@
218
-+		chmod 755 $@
219
-+
220
- 
221
- # Distribution
222
- 
223
-@@ -426,7 +451,9 @@ semi-clean:
224
- 
225
- clean:	semi-clean
226
- 		-rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add		\
227
--			$(TOAST) $(TCAT) $(UNTOAST)	\
228
-+			$(LIBGSMSO) $(LIB)/libgsm.so.1.0.10	\
229
-+			$(LIB)libgsm.so.1			\
230
-+			$(TOAST) $(TCAT) $(UNTOAST)		\
231
- 			$(ROOT)/gsm-1.0.tar.Z
232
- 
233
- 
234
---- a/inc/config.h
235
-+++ b/inc/config.h
236
-@@ -9,8 +9,8 @@
237
- #ifndef	CONFIG_H
238
- #define	CONFIG_H
239
- 
240
--/*efine	SIGHANDLER_T	int 		/* signal handlers are void	*/
241
--/*efine HAS_SYSV_SIGNAL	1		/* sigs not blocked/reset?	*/
242
-+/*efine	SIGHANDLER_T	int 		*//* signal handlers are void	*/
243
-+/*efine HAS_SYSV_SIGNAL	1		*//* sigs not blocked/reset?	*/
244
- 
245
- #define	HAS_STDLIB_H	1		/* /usr/include/stdlib.h	*/
246
- #define	HAS_LIMITS_H	1		/* /usr/include/limits.h	*/
247
-@@ -22,16 +22,16 @@
248
- #define	HAS_CHMOD 	1		/* chmod syscall		*/
249
- #define	HAS_FCHOWN 	1		/* fchown syscall		*/
250
- #define	HAS_CHOWN 	1		/* chown syscall		*/
251
--/*efine	HAS__FSETMODE 	1		/* _fsetmode -- set file mode	*/
252
-+/*efine	HAS__FSETMODE 	1		*//* _fsetmode -- set file mode	*/
253
- 
254
- #define	HAS_STRING_H 	1		/* /usr/include/string.h 	*/
255
--/*efine	HAS_STRINGS_H	1		/* /usr/include/strings.h 	*/
256
-+/*efine	HAS_STRINGS_H	1		*//* /usr/include/strings.h 	*/
257
- 
258
- #define	HAS_UNISTD_H	1		/* /usr/include/unistd.h	*/
259
- #define	HAS_UTIME	1		/* POSIX utime(path, times)	*/
260
--/*efine	HAS_UTIMES	1		/* use utimes()	syscall instead	*/
261
-+/*efine	HAS_UTIMES	1		*//* use utimes()	syscall instead	*/
262
- #define	HAS_UTIME_H	1		/* UTIME header file		*/
263
- #define	HAS_UTIMBUF	1		/* struct utimbuf		*/
264
--/*efine	HAS_UTIMEUSEC   1		/* microseconds in utimbuf?	*/
265
-+/*efine	HAS_UTIMEUSEC   1		*//* microseconds in utimbuf?	*/
266
- 
267
- #endif	/* CONFIG_H */
268
---- a/inc/gsm.h
269
-+++ b/inc/gsm.h
270
-@@ -54,6 +54,10 @@ typedef gsm_byte 		gsm_frame[33];		/* 33
271
- #define	GSM_OPT_FRAME_INDEX	5
272
- #define	GSM_OPT_FRAME_CHAIN	6
273
- 
274
-+#ifdef __cplusplus
275
-+extern "C" {
276
-+#endif
277
-+
278
- extern gsm  gsm_create 	GSM_P((void));
279
- extern void gsm_destroy GSM_P((gsm));	
280
- 
281
-@@ -66,6 +70,10 @@ extern int  gsm_decode  GSM_P((gsm, gsm_
282
- extern int  gsm_explode GSM_P((gsm, gsm_byte   *, gsm_signal *));
283
- extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte   *));
284
- 
285
-+#ifdef __cplusplus
286
-+}
287
-+#endif
288
-+
289
- #undef	GSM_P
290
- 
291
- #endif	/* GSM_H */
292
---- a/inc/toast.h
293
-+++ b/inc/toast.h
294
-@@ -16,11 +16,12 @@
295
- 
296
- #include <stdio.h>
297
- #include <ctype.h>
298
-+#include <pthread.h>
299
- #include <signal.h>
300
- 
301
- #include <errno.h>
302
--#ifndef	HAS_ERRNO_DECL
303
--	 extern int	errno;
304
-+#ifndef errno
305
-+ extern int	errno;
306
- #endif
307
- 
308
- #ifdef	HAS_LIMITS_H
309
-@@ -37,6 +38,10 @@
310
- # endif
311
- #endif
312
- 
313
-+#ifdef  HAS_STDIO_H
314
-+# include <stdio.h>
315
-+#endif
316
-+
317
- #include "gsm.h"
318
- 
319
- #ifndef	S_ISREG
320
---- a/src/code.c
321
-+++ b/src/code.c
322
-@@ -9,8 +9,8 @@
323
- #include	"config.h"
324
- 
325
- 
326
--#ifdef	HAS_STDLIB_H
327
--#include	<stdlib.h>
328
-+#ifdef	HAS_STRING_H
329
-+#include	<string.h>
330
- #else
331
- #	include "proto.h"
332
- 	extern char	* memcpy P((char *, char *, int));
333
---- a/src/debug.c
334
-+++ b/src/debug.c
335
-@@ -49,7 +49,7 @@ void gsm_debug_longwords P4( (name, from
336
- 	fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
337
- 	while (from <= to) {
338
- 
339
--		fprintf(stderr, "%d ", ptr[ from ] );
340
-+		fprintf(stderr, "%ld ", ptr[ from ] );
341
- 		from++;
342
- 		if (nprinted++ >= 7) {
343
- 			nprinted = 0;
344
-@@ -63,14 +63,14 @@ void gsm_debug_longword P2(  (name, valu
345
- 	char		* name,
346
- 	longword	  value	)
347
- {
348
--	fprintf(stderr, "%s: %d\n", name, (long)value );
349
-+	fprintf(stderr, "%s: %ld\n", name, (long)value );
350
- }
351
- 
352
- void gsm_debug_word P2(  (name, value),
353
- 	char	* name,
354
- 	word	  value	)
355
- {
356
--	fprintf(stderr, "%s: %d\n", name, (long)value);
357
-+	fprintf(stderr, "%s: %ld\n", name, (long)value);
358
- }
359
- 
360
- #endif
361
---- a/src/toast.c
362
-+++ b/src/toast.c
363
-@@ -251,8 +251,8 @@ static char * emalloc P1((len), size_t l
364
- {
365
- 	char * s;
366
- 	if (!(s = malloc(len))) {
367
--		fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n",
368
--			progname, len);
369
-+		fprintf(stderr, "%s: failed to malloc %ld bytes -- abort\n",
370
-+			progname, (long) len);
371
- 		onintr();
372
- 		exit(1);
373
- 	}
374
-@@ -270,7 +270,7 @@ static char* normalname P3((name, want, 
375
- 	maxlen = strlen(name) + 1 + strlen(want) + strlen(cut);
376
- 	p = strcpy(emalloc(maxlen), name);
377
- 
378
--	if (s = suffix(p, cut)) strcpy(s, want);
379
-+	if ((s = suffix(p, cut))) strcpy(s, want);
380
- 	else if (*want && !suffix(p, want)) strcat(p, want);
381
- 
382
- 	return p;
383
-@@ -386,7 +386,7 @@ static void update_times P0()
384
- 		ut[0] = instat.st_atime;
385
- 		ut[1] = instat.st_mtime;
386
- 
387
--		(void) utime(outname, ut);
388
-+		(void) utime(outname, (struct utimbuf *)ut);
389
- 
390
- #endif	/* UTIMBUF */
391
- 	}
392
-@@ -416,7 +416,7 @@ static int okay_as_input P3((name,f,st),
393
- 	}
394
- 	if (st->st_nlink > 1 && !f_cat && !f_precious) {
395
- 		fprintf(stderr, 
396
--		      "%s: \"%s\" has %s other link%s -- unchanged.\n",
397
-+		      "%s: \"%s\" has %d other link%s -- unchanged.\n",
398
- 			progname,name,st->st_nlink - 1,"s" + (st->st_nlink<=2));
399
- 		return 0;
400
- 	}
401
-@@ -585,8 +585,8 @@ static int process_decode P0()
402
- 
403
- 		if (cc != sizeof(s)) {
404
- 			if (cc >= 0) fprintf(stderr,
405
--			"%s: incomplete frame (%d byte%s missing) from %s\n",
406
--					progname, sizeof(s) - cc,
407
-+			"%s: incomplete frame (%ld byte%s missing) from %s\n",
408
-+					progname, (long) sizeof(s) - cc,
409
- 					"s" + (sizeof(s) - cc == 1),
410
- 					inname ? inname : "stdin" );
411
- 			gsm_destroy(r);
412
-@@ -624,8 +624,6 @@ static int process_decode P0()
413
- 
414
- static int process P1((name), char * name)
415
- {
416
--	int step = 0;
417
--
418
- 	out     = (FILE *)0;
419
- 	in      = (FILE *)0;
420
- 
421
-@@ -779,7 +777,6 @@ int main P2((ac, av), int ac, char **av)
422
- 	case 'h': help();    exit(0);
423
- 
424
- 	default: 
425
--	usage:
426
- 		fprintf(stderr,
427
- 	"Usage: %s [-fcpdhvuaslFC] [files...] (-h for help)\n",
428
- 			progname);

+ 2
- 1
libs/libaudiofile/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=audiofile
11 11
 PKG_VERSION:=0.3.6
12
-PKG_RELEASE:=2
12
+PKG_RELEASE:=3
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:= \
@@ -40,6 +40,7 @@ endef
40 40
 CONFIGURE_ARGS+= \
41 41
 	--enable-shared \
42 42
 	--enable-static \
43
+	--disable-examples \
43 44
 	--with-build-cc="$(HOSTCC)" \
44 45
 
45 46
 TARGET_CFLAGS+= $(FPIC)

+ 1
- 0
libs/libftdi/Makefile View File

@@ -20,6 +20,7 @@ PKG_LICENSE:=LGPL-2.0
20 20
 PKG_LICENSE_FILES:=COPYING.LIB
21 21
 
22 22
 PKG_INSTALL:=1
23
+PKG_USE_MIPS16:=0
23 24
 
24 25
 include $(INCLUDE_DIR)/package.mk
25 26
 include $(INCLUDE_DIR)/cmake.mk

+ 1
- 0
libs/libftdi1/Makefile View File

@@ -20,6 +20,7 @@ PKG_LICENSE:=LGPL-2.0
20 20
 PKG_LICENSE_FILES:=COPYING.LIB
21 21
 
22 22
 PKG_INSTALL:=1
23
+PKG_USE_MIPS16:=0
23 24
 
24 25
 include $(INCLUDE_DIR)/package.mk
25 26
 include $(INCLUDE_DIR)/cmake.mk

+ 5
- 16
libs/libjpeg/Makefile View File

@@ -8,12 +8,12 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=jpeg
11
-PKG_VERSION:=6b
11
+PKG_VERSION:=9a
12 12
 PKG_RELEASE:=1
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)src.v$(PKG_VERSION).tar.gz
15
-PKG_SOURCE_URL:=@SF/libjpeg
16
-PKG_MD5SUM:=dbd5f3b47ed13132f04c685d608a7547
15
+PKG_SOURCE_URL:=http://www.ijg.org/files
16
+PKG_MD5SUM:=3353992aecaee1805ef4109aadd433e7
17 17
 
18 18
 PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
19 19
 PKG_LICENSE:=IJG
@@ -55,26 +55,15 @@ HOST_CONFIGURE_ARGS += \
55 55
 	--enable-shared \
56 56
 	--enable-static \
57 57
 
58
-define Build/Prepare
59
-	$(call Build/Prepare/Default)
60
-	(cd $(PKG_BUILD_DIR); \
61
-		rm -f ltconfig ltmain.sh libtool; \
62
-		ln -s `which true` ltconfig; \
63
-		ln -s $(STAGING_DIR)/host/bin/libtool libtool; \
64
-	)
65
-endef
66
-
67 58
 define Build/Compile
68
-	$(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/{include,lib,bin,man/man1}
69 59
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
70 60
 		LIBTOOL="./libtool --tag=CC" \
71 61
 		prefix="$(PKG_INSTALL_DIR)/usr" \
72 62
 		exec_prefix="$(PKG_INSTALL_DIR)/usr" \
73 63
 		all
74 64
 	$(MAKE) -C $(PKG_BUILD_DIR) \
75
-		prefix="$(PKG_INSTALL_DIR)/usr" \
76
-		exec_prefix="$(PKG_INSTALL_DIR)/usr" \
77
-		install install-headers install-lib
65
+		DESTDIR="$(PKG_INSTALL_DIR)" \
66
+		install
78 67
 endef
79 68
 
80 69
 define Build/InstallDev

+ 0
- 11
libs/libjpeg/patches/001-allow-ccache.patch View File

@@ -1,11 +0,0 @@
1
---- a/makefile.cfg
2
-+++ b/makefile.cfg
3
-@@ -168,7 +168,7 @@ libjpeg.a: @A2K_DEPS@ $(LIBOBJECTS)
4
- 
5
- # with libtool:
6
- libjpeg.la: @A2K_DEPS@ $(LIBOBJECTS)
7
--	$(LIBTOOL) --mode=link $(CC) -o libjpeg.la $(LIBOBJECTS) \
8
-+	$(LIBTOOL) --mode=link "$(CC)" -o libjpeg.la $(LIBOBJECTS) \
9
- 		-rpath $(libdir) -version-info $(JPEG_LIB_VERSION)
10
- 
11
- # sample programs:

+ 0
- 1896
libs/libjpeg/patches/200-crop.patch
File diff suppressed because it is too large
View File


+ 0
- 15
libs/libjpeg/patches/300-CVE-2013-6629.patch View File

@@ -1,15 +0,0 @@
1
---- a/jdmarker.c
2
-+++ b/jdmarker.c
3
-@@ -342,6 +342,12 @@ get_sos (j_decompress_ptr cinfo)
4
-     
5
-     TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
6
- 	     compptr->dc_tbl_no, compptr->ac_tbl_no);
7
-+
8
-+    /* This CSi (cc) should differ from the previous CSi */
9
-+    for (ci = 0; ci < i; ci++) {
10
-+      if (cinfo->cur_comp_info[ci] == compptr)
11
-+        ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
12
-+    }
13
-   }
14
- 
15
-   /* Collect the additional scan parameters Ss, Se, Ah/Al. */

+ 8
- 4
libs/liboil/Makefile View File

@@ -1,5 +1,5 @@
1 1
 # 
2
-# Copyright (C) 2007-2010 OpenWrt.org
2
+# Copyright (C) 2007-2014 OpenWrt.org
3 3
 #
4 4
 # This is free software, licensed under the GNU General Public License v2.
5 5
 # See /LICENSE for more information.
@@ -9,16 +9,20 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=liboil
11 11
 PKG_VERSION:=0.3.17
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/
16 16
 PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701
17 17
 
18
+PKG_LICENSE:=FREE
19
+PKG_LICENSE_FILE:=COPYING
20
+
18 21
 PKG_FIXUP:=autoreconf
19 22
 PKG_INSTALL:=1
20 23
 
21 24
 include $(INCLUDE_DIR)/package.mk
25
+include $(INCLUDE_DIR)/nls.mk
22 26
 
23 27
 define Package/liboil
24 28
   SECTION:=libs
@@ -26,7 +30,7 @@ define Package/liboil
26 30
   TITLE:=simple functions optimized for various CPUs
27 31
   URL:=http://liboil.freedesktop.org/wiki/
28 32
   MAINTAINER:=W. Michael Petullo <mike@flyn.org>
29
-  DEPENDS:=+librt
33
+  DEPENDS:=+librt $(ICONV_DEPENDS) $(INTL_DEPENDS)
30 34
 endef
31 35
 
32 36
 define Package/liboil/description
@@ -42,7 +46,7 @@ CONFIGURE_ARGS += \
42 46
 	--enable-shared \
43 47
 	--enable-static \
44 48
 
45
-TARGET_CFLAGS += $(FPIC)
49
+TARGET_CFLAGS += $(FPIC) $(if $(ICONV_FULL),-liconv) $(if $(INTL_FULL),-lintl)
46 50
 
47 51
 # XXX: VFP_CFLAGS is set to '-mfpu=vfp' on arm by configure, but that breaks 
48 52
 # final linking stages, so override it until we find why

+ 75
- 0
libs/libsoup/Makefile View File

@@ -0,0 +1,75 @@
1
+# 
2
+# Copyright (C) 2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=libsoup
11
+PKG_VERSION:=2.44.2
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.44
16
+PKG_MD5SUM:=92aa3667357157e8f3489bcca287f2fa
17
+
18
+PKG_LICENSE:=GPL-2.0
19
+PKG_LICENSE_FILE:=COPYING
20
+
21
+PKG_FIXUP:=autoreconf
22
+PKG_INSTALL:=1
23
+
24
+include $(INCLUDE_DIR)/package.mk
25
+include $(INCLUDE_DIR)/nls.mk
26
+
27
+TARGET_LDFLAGS+=\
28
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib $(if $(ICONV_FULL),-liconv)
29
+
30
+define Package/libsoup
31
+  SECTION:=libs
32
+  CATEGORY:=Libraries
33
+  TITLE:=libsoup
34
+  URL:=http://live.gnome.org/LibSoup
35
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
36
+  DEPENDS:=+glib2 +libxml2 +libgnutls +libsqlite3 $(ICONV_DEPENDS) $(INTL_DEPENDS)
37
+endef
38
+
39
+define Build/Configure
40
+	$(call Build/Configure/Default, \
41
+		--enable-ssl \
42
+		--disable-glibtest \
43
+		--without-apache-httpd \
44
+		--without-gnome \
45
+	)
46
+endef
47
+
48
+define package/libsoup/decription
49
+Libsoup is an HTTP library implementation in C
50
+endef
51
+
52
+define Build/InstallDev
53
+	$(INSTALL_DIR) $(1)/usr/{lib/pkgconfig,include/libsoup-2.4/libsoup}
54
+
55
+	$(CP) \
56
+		$(PKG_INSTALL_DIR)/usr/lib/libsoup-2.4.{so*,la,a} \
57
+		$(1)/usr/lib/
58
+
59
+	$(INSTALL_DATA) \
60
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
61
+		$(1)/usr/lib/pkgconfig/
62
+
63
+	$(INSTALL_DATA) \
64
+		$(PKG_INSTALL_DIR)/usr/include/libsoup-2.4/libsoup/*.h \
65
+		$(1)/usr/include/libsoup-2.4/libsoup/
66
+endef
67
+
68
+define Package/libsoup/install
69
+	$(INSTALL_DIR) $(1)/usr/lib
70
+	$(CP) \
71
+		$(PKG_INSTALL_DIR)/usr/lib/libsoup-2.4.so* \
72
+		$(1)/usr/lib/
73
+endef
74
+
75
+$(eval $(call BuildPackage,libsoup))

+ 4
- 1
libs/libssh2/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=libssh2
11 11
 PKG_VERSION:=1.4.3
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://www.libssh2.org/download
@@ -17,6 +17,9 @@ PKG_MD5SUM:=071004c60c5d6f90354ad1b701013a0b
17 17
 
18 18
 PKG_INSTALL:=1
19 19
 
20
+PKG_LICENSE:=BSD
21
+PKG_LICENSE_FILES:=COPYING
22
+
20 23
 include $(INCLUDE_DIR)/package.mk
21 24
 
22 25
 define Package/libssh2

+ 3
- 0
libs/libuecc/Makefile View File

@@ -16,6 +16,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 16
 PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/71
17 17
 PKG_MD5SUM:=7f44df5dc69cb8686947562e2a11eea9
18 18
 
19
+PKG_LICENSE:=BSD-2-Clause
20
+PKG_LICENSE_FILE:=COPYRIGHT
21
+
19 22
 include $(INCLUDE_DIR)/package.mk
20 23
 include $(INCLUDE_DIR)/cmake.mk
21 24
 

+ 6
- 3
libs/libxslt/Makefile View File

@@ -9,14 +9,17 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=libxslt
11 11
 PKG_VERSION:=1.1.28
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:= \
16
-¨	http://xmlsoft.org/sources/ \
16
+	http://xmlsoft.org/sources/ \
17 17
 	ftp://fr.rpmfind.net/pub/libxml/
18 18
 PKG_MD5SUM:=9667bf6f9310b957254fdcf6596600b7
19 19
 
20
+PKG_LICENSE:=MIT
21
+PKG_LICENSE_FILES:=COPYING
22
+
20 23
 PKG_MAINTAINER:=Jiri Slachta <slachta@cesnet.cz>
21 24
 
22 25
 PKG_FIXUP:=autoreconf
@@ -45,7 +48,7 @@ define Package/libexslt
45 48
 endef
46 49
 
47 50
 define Package/libexslt/description
48
- A extention for XSLT.
51
+ An extension for XSLT.
49 52
 endef
50 53
 
51 54
 define Package/xsltproc

+ 2
- 0
libs/nacl/Makefile View File

@@ -16,6 +16,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 16
 PKG_SOURCE_URL:=http://hyperelliptic.org/nacl
17 17
 PKG_MD5SUM:=7efb5715561c3d10dafd3fa97b4f2d20
18 18
 
19
+PKG_LICENSE:=PublicDomain
20
+
19 21
 include $(INCLUDE_DIR)/package.mk
20 22
 
21 23
 define Package/nacl

+ 150
- 0
libs/openldap/Makefile View File

@@ -0,0 +1,150 @@
1
+#
2
+# Copyright (C) 2006-2012 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=openldap
11
+PKG_VERSION:=2.4.39
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15
+PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
16
+	ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
17
+	ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
18
+	ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
19
+PKG_MD5SUM:=b0d5ee4b252c841dec6b332d679cf943
20
+
21
+PKG_FIXUP:=autoreconf
22
+
23
+include $(INCLUDE_DIR)/package.mk
24
+
25
+define Package/openldap/Default
26
+  TITLE:=LDAP implementation
27
+  URL:=http://www.openldap.org/
28
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
29
+endef
30
+
31
+define Package/openldap/Default/description
32
+	OpenLDAP Software is an open source implementation of the
33
+	Lightweight Directory Access Protocol (LDAP).
34
+endef
35
+
36
+define Package/libopenldap
37
+  $(call Package/openldap/Default)
38
+  SECTION:=libs
39
+  CATEGORY:=Libraries
40
+  DEPENDS:=+libopenssl +libsasl2 +libpthread
41
+  TITLE+= (libraries)
42
+endef
43
+
44
+define Package/libopenldap/description
45
+	$(call Package/openldap/Default/description)
46
+	This package contains the shared LDAP client libraries, needed by other programs.
47
+endef
48
+
49
+define Package/libopenldap/conffiles
50
+/etc/openldap/ldap.conf
51
+endef
52
+
53
+define Package/openldap-utils
54
+  $(call Package/openldap/Default)
55
+  SECTION:=utils
56
+  CATEGORY:=Utilities
57
+  DEPENDS:=+libopenldap
58
+  TITLE+= (utilities)
59
+endef
60
+
61
+define Package/openldap-utils/description
62
+	$(call Package/openldap/Default/description)
63
+	This package contains client programs required to access LDAP servers.
64
+endef
65
+
66
+define Package/openldap-server
67
+  $(call Package/openldap/Default)
68
+  SECTION:=net
69
+  CATEGORY:=Network
70
+  DEPENDS:=+libopenldap +libuuid
71
+  TITLE+= (server)
72
+endef
73
+
74
+define Package/openldap-server/description
75
+	$(call Package/openldap/Default/description)
76
+	This package contains server programs required to provide LDAP services.
77
+endef
78
+
79
+define Package/openldap-server/conffiles
80
+/etc/openldap/slapd.conf
81
+endef
82
+
83
+TARGET_CFLAGS += $(FPIC) -lpthread
84
+
85
+CONFIGURE_ARGS += \
86
+	--enable-shared \
87
+	--enable-static \
88
+	--disable-debug \
89
+	--enable-dynamic \
90
+	--enable-syslog \
91
+	--disable-local \
92
+	--disable-slurpd \
93
+	--with-cyrus-sasl \
94
+	--without-fetch \
95
+	--with-threads \
96
+	--with-tls \
97
+	--with-yielding_select="yes" \
98
+	--without-cyrus-sasl \
99
+	--without-threads \
100
+	--without-tls \
101
+	--enable-null \
102
+	--disable-bdb \
103
+	--disable-hdb \
104
+	--disable-monitor \
105
+	--disable-relay
106
+
107
+define Build/Compile
108
+	$(MAKE) -C $(PKG_BUILD_DIR) \
109
+		DESTDIR="$(PKG_INSTALL_DIR)" \
110
+		HOSTCC="$(HOSTCC)" \
111
+		depend all install
112
+endef
113
+
114
+define Build/InstallDev
115
+	$(INSTALL_DIR) $(1)/usr/include
116
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(1)/usr/include/
117
+	$(INSTALL_DIR) $(1)/usr/lib/
118
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(1)/usr/lib/
119
+endef
120
+
121
+define Package/libopenldap/install
122
+	$(INSTALL_DIR) $(1)/etc/openldap
123
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
124
+	$(INSTALL_DIR) $(1)/usr/lib
125
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
126
+endef
127
+
128
+define Package/openldap-utils/install
129
+	$(INSTALL_DIR) $(1)/usr/bin
130
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
131
+endef
132
+
133
+define Package/openldap-server/install
134
+	$(INSTALL_DIR) $(1)/etc/init.d
135
+	$(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap
136
+	$(INSTALL_DIR) $(1)/etc/openldap/schema
137
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/
138
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/slapd.conf $(1)/etc/openldap/
139
+	$(INSTALL_DIR) $(1)/usr/sbin
140
+	# XXX: OpenLDAP installs slapd into libexecdir, not sbindir:
141
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/
142
+	# XXX: switch default backend to ldif, since bdb is disabled
143
+	$(SED) 's|^\(database\)\([ \t]\+\)bdb|\1\2ldif|g' \
144
+	    -e 's|^\(index\)|#\1|g' \
145
+	    $(1)/etc/openldap/slapd.conf
146
+endef
147
+
148
+$(eval $(call BuildPackage,libopenldap))
149
+$(eval $(call BuildPackage,openldap-utils))
150
+$(eval $(call BuildPackage,openldap-server))

+ 19
- 0
libs/openldap/files/ldap.init View File

@@ -0,0 +1,19 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2009-2011 OpenWrt.org
3
+
4
+START=60
5
+
6
+SERVICE_USE_PID=1
7
+
8
+start() {
9
+	mkdir -m 0755 -p /var/openldap-data
10
+	service_start /usr/sbin/slapd
11
+}
12
+
13
+stop() {
14
+	service_stop /usr/sbin/slapd
15
+}
16
+
17
+reload() {
18
+	service_reload /usr/sbin/slapd
19
+}

+ 323
- 0
libs/openldap/patches/001-automake-compat.patch View File

@@ -0,0 +1,323 @@
1
+--- /dev/null
2
++++ b/Makefile.am
3
+@@ -0,0 +1 @@
4
++SUBDIRS = include libraries clients servers tests doc
5
+--- a/libraries/Makefile.in
6
++++ b/libraries/Makefile.in
7
+@@ -13,6 +13,8 @@
8
+ ## top-level directory of the distribution or, alternatively, at
9
+ ## <http://www.OpenLDAP.org/license.html>.
10
+ 
11
++SHELL = @SHELL@
12
++
13
+ SUBDIRS= \
14
+ 	liblutil \
15
+ 	liblber \
16
+--- a/libraries/liblber/Makefile.in
17
++++ b/libraries/liblber/Makefile.in
18
+@@ -13,6 +13,8 @@
19
+ ## top-level directory of the distribution or, alternatively, at
20
+ ## <http://www.OpenLDAP.org/license.html>.
21
+ 
22
++SHELL = @SHELL@
23
++
24
+ LIBRARY = liblber.la
25
+ 
26
+ NT_SRCS = nt_err.c
27
+--- a/libraries/libldap/Makefile.in
28
++++ b/libraries/libldap/Makefile.in
29
+@@ -13,6 +13,8 @@
30
+ ## top-level directory of the distribution or, alternatively, at
31
+ ## <http://www.OpenLDAP.org/license.html>.
32
+ 
33
++SHELL = @SHELL@
34
++
35
+ LIBRARY = libldap.la
36
+ 
37
+ PROGRAMS = apitest dntest ftest ltest urltest
38
+--- a/libraries/libldap_r/Makefile.in
39
++++ b/libraries/libldap_r/Makefile.in
40
+@@ -13,6 +13,8 @@
41
+ ## top-level directory of the distribution or, alternatively, at
42
+ ## <http://www.OpenLDAP.org/license.html>.
43
+ 
44
++SHELL = @SHELL@
45
++
46
+ LIBRARY = libldap_r.la
47
+ 
48
+ PROGRAMS = apitest ltest
49
+--- a/libraries/liblunicode/Makefile.in
50
++++ b/libraries/liblunicode/Makefile.in
51
+@@ -13,6 +13,8 @@
52
+ ## top-level directory of the distribution or, alternatively, at
53
+ ## <http://www.OpenLDAP.org/license.html>.
54
+ 
55
++SHELL = @SHELL@
56
++
57
+ LIBRARY = liblunicode.a
58
+ 
59
+ XXDIR = $(srcdir)/ucdata/
60
+--- a/libraries/liblutil/Makefile.in
61
++++ b/libraries/liblutil/Makefile.in
62
+@@ -13,6 +13,8 @@
63
+ ## top-level directory of the distribution or, alternatively, at
64
+ ## <http://www.OpenLDAP.org/license.html>.
65
+ 
66
++SHELL = @SHELL@
67
++
68
+ LIBRARY	= liblutil.a
69
+ PROGRAM = testavl
70
+ 
71
+--- a/libraries/librewrite/Makefile.in
72
++++ b/libraries/librewrite/Makefile.in
73
+@@ -16,6 +16,8 @@
74
+ ## Copyright 2000-2001 Pierangelo Masarati <ando@sys-net.it>
75
+ ##
76
+ 
77
++SHELL = @SHELL@
78
++
79
+ SRCS = config.c context.c info.c ldapmap.c map.c params.c rule.c \
80
+ 	session.c subst.c var.c xmap.c \
81
+ 	parse.c rewrite.c
82
+--- a/clients/tools/Makefile.in
83
++++ b/clients/tools/Makefile.in
84
+@@ -13,6 +13,8 @@
85
+ ## top-level directory of the distribution or, alternatively, at
86
+ ## <http://www.OpenLDAP.org/license.html>.
87
+ 
88
++SHELL = @SHELL@
89
++
90
+ SRCS	= ldapsearch.c ldapmodify.c ldapdelete.c ldapmodrdn.c \
91
+ 		ldappasswd.c ldapwhoami.c ldapcompare.c \
92
+ 		ldapexop.c ldapurl.c common.c
93
+--- a/servers/slapd/Makefile.in
94
++++ b/servers/slapd/Makefile.in
95
+@@ -13,6 +13,8 @@
96
+ ## top-level directory of the distribution or, alternatively, at
97
+ ## <http://www.OpenLDAP.org/license.html>.
98
+ 
99
++SHELL = @SHELL@
100
++
101
+ SLAPTOOLS=slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema
102
+ PROGRAMS=slapd $(SLAPTOOLS)
103
+ XPROGRAMS=sslapd libbackends.a .backend liboverlays.a
104
+--- a/servers/slapd/overlays/Makefile.in
105
++++ b/servers/slapd/overlays/Makefile.in
106
+@@ -13,6 +13,8 @@
107
+ ## top-level directory of the distribution or, alternatively, at
108
+ ## <http://www.OpenLDAP.org/license.html>.
109
+ 
110
++SHELL = @SHELL@
111
++
112
+ SRCS = overlays.c \
113
+ 	accesslog.c \
114
+ 	auditlog.c \
115
+--- a/tests/progs/Makefile.in
116
++++ b/tests/progs/Makefile.in
117
+@@ -13,6 +13,8 @@
118
+ ## top-level directory of the distribution or, alternatively, at
119
+ ## <http://www.OpenLDAP.org/license.html>.
120
+ 
121
++SHELL = @SHELL@
122
++
123
+ PROGRAMS = slapd-tester slapd-search slapd-read slapd-addel slapd-modrdn \
124
+ 		slapd-modify slapd-bind slapd-mtread ldif-filter
125
+ 
126
+--- a/servers/slapd/back-bdb/Makefile.in
127
++++ b/servers/slapd/back-bdb/Makefile.in
128
+@@ -13,6 +13,8 @@
129
+ ## top-level directory of the distribution or, alternatively, at
130
+ ## <http://www.OpenLDAP.org/license.html>.
131
+ 
132
++SHELL = @SHELL@
133
++
134
+ SRCS = init.c tools.c config.c \
135
+ 	add.c bind.c compare.c delete.c modify.c modrdn.c search.c \
136
+ 	extended.c referral.c operational.c \
137
+--- a/servers/slapd/back-dnssrv/Makefile.in
138
++++ b/servers/slapd/back-dnssrv/Makefile.in
139
+@@ -18,6 +18,8 @@
140
+ #  The DNSSRV backend was written by Kurt D. Zeilenga.
141
+ #
142
+ 
143
++SHELL = @SHELL@
144
++
145
+ SRCS	= init.c bind.c search.c config.c referral.c
146
+ OBJS	= init.lo bind.lo search.lo config.lo referral.lo
147
+ 
148
+--- a/servers/slapd/back-hdb/Makefile.in
149
++++ b/servers/slapd/back-hdb/Makefile.in
150
+@@ -15,6 +15,8 @@
151
+ #
152
+ ## Copyright 2003 Howard Chu @ Symas Corp. See master COPYRIGHT file for terms.
153
+ 
154
++SHELL = @SHELL@
155
++
156
+ XXDIR = $(srcdir)/../back-bdb
157
+ 
158
+ XXSRCS = init.c tools.c config.c \
159
+--- a/servers/slapd/back-ldap/Makefile.in
160
++++ b/servers/slapd/back-ldap/Makefile.in
161
+@@ -13,6 +13,8 @@
162
+ ## top-level directory of the distribution or, alternatively, at
163
+ ## <http://www.OpenLDAP.org/license.html>.
164
+ 
165
++SHELL = @SHELL@
166
++
167
+ SRCS	= init.c config.c search.c bind.c unbind.c add.c compare.c \
168
+ 		delete.c modify.c modrdn.c extended.c chain.c \
169
+ 		distproc.c monitor.c pbind.c
170
+--- a/servers/slapd/back-ldif/Makefile.in
171
++++ b/servers/slapd/back-ldif/Makefile.in
172
+@@ -13,6 +13,8 @@
173
+ ## top-level directory of the distribution or, alternatively, at
174
+ ## <http://www.OpenLDAP.org/license.html>.
175
+ 
176
++SHELL = @SHELL@
177
++
178
+ SRCS = ldif.c
179
+ OBJS = ldif.lo
180
+ 
181
+--- a/servers/slapd/back-mdb/Makefile.in
182
++++ b/servers/slapd/back-mdb/Makefile.in
183
+@@ -13,6 +13,8 @@
184
+ ## top-level directory of the distribution or, alternatively, at
185
+ ## <http://www.OpenLDAP.org/license.html>.
186
+ 
187
++SHELL = @SHELL@
188
++
189
+ SRCS = init.c tools.c config.c \
190
+ 	add.c bind.c compare.c delete.c modify.c modrdn.c search.c \
191
+ 	extended.c operational.c \
192
+--- a/servers/slapd/back-meta/Makefile.in
193
++++ b/servers/slapd/back-meta/Makefile.in
194
+@@ -13,6 +13,8 @@
195
+ ## top-level directory of the distribution or, alternatively, at
196
+ ## <http://www.OpenLDAP.org/license.html>.
197
+ 
198
++SHELL = @SHELL@
199
++
200
+ SRCS	= init.c config.c search.c bind.c unbind.c add.c compare.c \
201
+ 		delete.c modify.c modrdn.c suffixmassage.c map.c \
202
+ 		conn.c candidates.c dncache.c
203
+--- a/servers/slapd/back-monitor/Makefile.in
204
++++ b/servers/slapd/back-monitor/Makefile.in
205
+@@ -13,6 +13,8 @@
206
+ ## top-level directory of the distribution or, alternatively, at
207
+ ## <http://www.OpenLDAP.org/license.html>.
208
+ 
209
++SHELL = @SHELL@
210
++
211
+ SRCS = init.c search.c compare.c modify.c bind.c \
212
+ 	operational.c \
213
+ 	cache.c entry.c \
214
+--- a/servers/slapd/back-ndb/Makefile.in
215
++++ b/servers/slapd/back-ndb/Makefile.in
216
+@@ -17,6 +17,8 @@
217
+ ## This work was initially developed by Howard Chu for inclusion
218
+ ## in OpenLDAP Software. This work was sponsored by MySQL.
219
+ 
220
++SHELL = @SHELL@
221
++
222
+ SRCS = init.cpp tools.cpp config.cpp ndbio.cpp \
223
+ 	add.cpp bind.cpp compare.cpp delete.cpp modify.cpp modrdn.cpp search.cpp
224
+ 
225
+--- a/servers/slapd/back-null/Makefile.in
226
++++ b/servers/slapd/back-null/Makefile.in
227
+@@ -13,6 +13,8 @@
228
+ ## top-level directory of the distribution or, alternatively, at
229
+ ## <http://www.OpenLDAP.org/license.html>.
230
+ 
231
++SHELL = @SHELL@
232
++
233
+ SRCS = null.c
234
+ OBJS = null.lo
235
+ 
236
+--- a/servers/slapd/back-passwd/Makefile.in
237
++++ b/servers/slapd/back-passwd/Makefile.in
238
+@@ -13,6 +13,8 @@
239
+ ## top-level directory of the distribution or, alternatively, at
240
+ ## <http://www.OpenLDAP.org/license.html>.
241
+ 
242
++SHELL = @SHELL@
243
++
244
+ SRCS	= search.c config.c init.c
245
+ OBJS	= search.lo config.lo init.lo
246
+ 
247
+--- a/servers/slapd/back-perl/Makefile.in
248
++++ b/servers/slapd/back-perl/Makefile.in
249
+@@ -14,6 +14,8 @@
250
+ ## top-level directory of the distribution or, alternatively, at
251
+ ## <http://www.OpenLDAP.org/license.html>.
252
+ 
253
++SHELL = @SHELL@
254
++
255
+ SRCS	= init.c search.c close.c config.c bind.c compare.c \
256
+ 		modify.c add.c modrdn.c delete.c
257
+ OBJS	= init.lo search.lo close.lo config.lo bind.lo compare.lo \
258
+--- a/servers/slapd/back-relay/Makefile.in
259
++++ b/servers/slapd/back-relay/Makefile.in
260
+@@ -13,6 +13,8 @@
261
+ ## top-level directory of the distribution or, alternatively, at
262
+ ## <http://www.OpenLDAP.org/license.html>.
263
+ 
264
++SHELL = @SHELL@
265
++
266
+ SRCS	= init.c op.c
267
+ OBJS	= init.lo op.lo
268
+ 
269
+--- a/servers/slapd/back-shell/Makefile.in
270
++++ b/servers/slapd/back-shell/Makefile.in
271
+@@ -13,6 +13,8 @@
272
+ ## top-level directory of the distribution or, alternatively, at
273
+ ## <http://www.OpenLDAP.org/license.html>.
274
+ 
275
++SHELL = @SHELL@
276
++
277
+ SRCS	= init.c config.c fork.c search.c bind.c unbind.c add.c \
278
+ 		delete.c modify.c modrdn.c compare.c result.c
279
+ OBJS	= init.lo config.lo fork.lo search.lo bind.lo unbind.lo add.lo \
280
+--- a/servers/slapd/back-sock/Makefile.in
281
++++ b/servers/slapd/back-sock/Makefile.in
282
+@@ -17,6 +17,8 @@
283
+ ## This work was initially developed by Brian Candler for inclusion
284
+ ## in OpenLDAP Software.
285
+ 
286
++SHELL = @SHELL@
287
++
288
+ SRCS	= init.c config.c opensock.c search.c bind.c unbind.c add.c \
289
+ 		delete.c modify.c modrdn.c compare.c result.c
290
+ OBJS	= init.lo config.lo opensock.lo search.lo bind.lo unbind.lo add.lo \
291
+--- a/servers/slapd/back-sql/Makefile.in
292
++++ b/servers/slapd/back-sql/Makefile.in
293
+@@ -13,6 +13,8 @@
294
+ ## top-level directory of the distribution or, alternatively, at
295
+ ## <http://www.OpenLDAP.org/license.html>.
296
+ 
297
++SHELL = @SHELL@
298
++
299
+ SRCS	= init.c config.c search.c bind.c compare.c operational.c \
300
+ 		entry-id.c schema-map.c sql-wrap.c modify.c util.c \
301
+ 		add.c delete.c modrdn.c api.c
302
+--- a/servers/slapd/shell-backends/Makefile.in
303
++++ b/servers/slapd/shell-backends/Makefile.in
304
+@@ -13,6 +13,8 @@
305
+ ## top-level directory of the distribution or, alternatively, at
306
+ ## <http://www.OpenLDAP.org/license.html>.
307
+ 
308
++SHELL = @SHELL@
309
++
310
+ PROGRAMS = passwd-shell
311
+ 
312
+ SRCS = passwd-shell.c shellutil.c
313
+--- a/servers/slapd/slapi/Makefile.in
314
++++ b/servers/slapd/slapi/Makefile.in
315
+@@ -14,6 +14,8 @@
316
+ ## top-level directory of the distribution or, alternatively, at
317
+ ## <http://www.OpenLDAP.org/license.html>.
318
+ 
319
++SHELL = @SHELL@
320
++
321
+ LIBRARY = libslapi.la
322
+ 
323
+ #all-common: $(LIBRARY) $(PROGRAMS)

+ 26
- 0
libs/openldap/patches/020-autofs-schema.patch View File

@@ -0,0 +1,26 @@
1
+--- /dev/null
2
++++ b/servers/slapd/schema/autofs.schema
3
+@@ -0,0 +1,23 @@
4
++attributetype ( 1.3.6.1.1.1.1.31 NAME 'automountMapName'
5
++	DESC 'Automount map name'
6
++	EQUALITY caseExactMatch
7
++	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
8
++
9
++attributetype ( 1.3.6.1.1.1.1.32 NAME 'automountKey'
10
++	DESC 'Automount key value'
11
++	EQUALITY caseExactMatch
12
++	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
13
++
14
++attributetype ( 1.3.6.1.1.1.1.33 NAME 'automountInformation'
15
++	DESC 'Automount information'
16
++	EQUALITY caseExactMatch
17
++	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
18
++
19
++objectclass ( 1.3.6.1.1.1.2.16 NAME 'automountMap' SUP top STRUCTURAL
20
++	MUST ( automountMapName )
21
++	MAY ( description ) )
22
++
23
++objectclass ( 1.3.6.1.1.1.2.17 NAME 'automount' SUP top STRUCTURAL
24
++	DESC 'Automount'
25
++	MUST ( automountKey $ automountInformation )
26
++	MAY description )

+ 22
- 0
libs/openldap/patches/750-no-strip.patch View File

@@ -0,0 +1,22 @@
1
+--- a/clients/tools/Makefile.in
2
++++ b/clients/tools/Makefile.in
3
+@@ -122,7 +122,7 @@ install-local:	FORCE
4
+ 	-$(MKDIR) $(DESTDIR)$(bindir)
5
+ 	@(								\
6
+ 	    for prg in $(PROGRAMS); do					\
7
+-		$(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 $$prg$(EXEEXT)	\
8
++		$(LTINSTALL) $(INSTALLFLAGS) -m 755 $$prg$(EXEEXT)	\
9
+ 		    $(DESTDIR)$(bindir);				\
10
+ 	    done							\
11
+ 	)
12
+--- a/servers/slapd/Makefile.in
13
++++ b/servers/slapd/Makefile.in
14
+@@ -380,7 +380,7 @@ install-local-srv: install-slapd install
15
+ install-slapd: FORCE
16
+ 	-$(MKDIR) $(DESTDIR)$(libexecdir)
17
+ 	-$(MKDIR) $(DESTDIR)$(localstatedir)/run
18
+-	$(LTINSTALL) $(INSTALLFLAGS) $(STRIP) -m 755 \
19
++	$(LTINSTALL) $(INSTALLFLAGS) -m 755 \
20
+ 		slapd$(EXEEXT) $(DESTDIR)$(libexecdir)
21
+ 	@for i in $(SUBDIRS); do \
22
+ 	    if test -d $$i && test -f $$i/Makefile ; then \

+ 4
- 1
libs/tiff/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=tiff
11 11
 PKG_VERSION:=4.0.3
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=3
13 13
 
14 14
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15 15
 PKG_SOURCE_URL:=http://download.osgeo.org/libtiff
@@ -18,6 +18,9 @@ PKG_MD5SUM:=051c1068e6a0627f461948c365290410
18 18
 PKG_FIXUP:=autoreconf
19 19
 PKG_REMOVE_FILES:=autogen.sh aclocal.m4
20 20
 
21
+PKG_LICENSE:=BSD
22
+PKG_LICENSE_FILES:=COPYRIGHT
23
+
21 24
 PKG_INSTALL:=1
22 25
 
23 26
 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_libtiffxx

+ 31
- 0
libs/tiff/patches/010-CVE-2012-4564.patch View File

@@ -0,0 +1,31 @@
1
+Index: tiff-4.0.3/tools/ppm2tiff.c
2
+===================================================================
3
+--- tiff-4.0.3.orig/tools/ppm2tiff.c	2013-06-23 10:36:50.779629492 -0400
4
++++ tiff-4.0.3/tools/ppm2tiff.c	2013-06-23 10:36:50.775629494 -0400
5
+@@ -89,6 +89,7 @@
6
+ 	int c;
7
+ 	extern int optind;
8
+ 	extern char* optarg;
9
++	tmsize_t scanline_size;
10
+ 
11
+ 	if (argc < 2) {
12
+ 	    fprintf(stderr, "%s: Too few arguments\n", argv[0]);
13
+@@ -237,8 +238,16 @@
14
+ 	}
15
+ 	if (TIFFScanlineSize(out) > linebytes)
16
+ 		buf = (unsigned char *)_TIFFmalloc(linebytes);
17
+-	else
18
+-		buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
19
++	else {
20
++		scanline_size = TIFFScanlineSize(out);
21
++		if (scanline_size != 0)
22
++			buf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));
23
++		else {
24
++			fprintf(stderr, "%s: scanline size overflow\n",infile);
25
++			(void) TIFFClose(out);
26
++			exit(-2);
27
++			}
28
++		}
29
+ 	if (resolution > 0) {
30
+ 		TIFFSetField(out, TIFFTAG_XRESOLUTION, resolution);
31
+ 		TIFFSetField(out, TIFFTAG_YRESOLUTION, resolution);

+ 146
- 0
libs/tiff/patches/011-CVE-2013-1960.patch View File

@@ -0,0 +1,146 @@
1
+Index: tiff-4.0.3/tools/tiff2pdf.c
2
+===================================================================
3
+--- tiff-4.0.3.orig/tools/tiff2pdf.c	2013-06-23 10:36:50.979629486 -0400
4
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-06-23 10:36:50.975629486 -0400
5
+@@ -3341,33 +3341,56 @@
6
+ 	uint32 height){
7
+ 
8
+ 	tsize_t i=0;
9
+-	uint16 ri =0;
10
+-	uint16 v_samp=1;
11
+-	uint16 h_samp=1;
12
+-	int j=0;
13
+-	
14
+-	i++;
15
+-	
16
+-	while(i<(*striplength)){
17
++
18
++	while (i < *striplength) {
19
++		tsize_t datalen;
20
++		uint16 ri;
21
++		uint16 v_samp;
22
++		uint16 h_samp;
23
++		int j;
24
++		int ncomp;
25
++
26
++		/* marker header: one or more FFs */
27
++		if (strip[i] != 0xff)
28
++			return(0);
29
++		i++;
30
++		while (i < *striplength && strip[i] == 0xff)
31
++			i++;
32
++		if (i >= *striplength)
33
++			return(0);
34
++		/* SOI is the only pre-SOS marker without a length word */
35
++		if (strip[i] == 0xd8)
36
++			datalen = 0;
37
++		else {
38
++			if ((*striplength - i) <= 2)
39
++				return(0);
40
++			datalen = (strip[i+1] << 8) | strip[i+2];
41
++			if (datalen < 2 || datalen >= (*striplength - i))
42
++				return(0);
43
++		}
44
+ 		switch( strip[i] ){
45
+-			case 0xd8:
46
+-				/* SOI - start of image */
47
++			case 0xd8:	/* SOI - start of image */
48
+ 				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), 2);
49
+ 				*bufferoffset+=2;
50
+-				i+=2;
51
+ 				break;
52
+-			case 0xc0:
53
+-			case 0xc1:
54
+-			case 0xc3:
55
+-			case 0xc9:
56
+-			case 0xca:
57
++			case 0xc0:	/* SOF0 */
58
++			case 0xc1:	/* SOF1 */
59
++			case 0xc3:	/* SOF3 */
60
++			case 0xc9:	/* SOF9 */
61
++			case 0xca:	/* SOF10 */
62
+ 				if(no==0){
63
+-					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
64
+-					for(j=0;j<buffer[*bufferoffset+9];j++){
65
+-						if( (buffer[*bufferoffset+11+(2*j)]>>4) > h_samp) 
66
+-							h_samp = (buffer[*bufferoffset+11+(2*j)]>>4);
67
+-						if( (buffer[*bufferoffset+11+(2*j)] & 0x0f) > v_samp) 
68
+-							v_samp = (buffer[*bufferoffset+11+(2*j)] & 0x0f);
69
++					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
70
++					ncomp = buffer[*bufferoffset+9];
71
++					if (ncomp < 1 || ncomp > 4)
72
++						return(0);
73
++					v_samp=1;
74
++					h_samp=1;
75
++					for(j=0;j<ncomp;j++){
76
++						uint16 samp = buffer[*bufferoffset+11+(3*j)];
77
++						if( (samp>>4) > h_samp) 
78
++							h_samp = (samp>>4);
79
++						if( (samp & 0x0f) > v_samp) 
80
++							v_samp = (samp & 0x0f);
81
+ 					}
82
+ 					v_samp*=8;
83
+ 					h_samp*=8;
84
+@@ -3381,45 +3404,43 @@
85
+                                           (unsigned char) ((height>>8) & 0xff);
86
+ 					buffer[*bufferoffset+6]=
87
+                                             (unsigned char) (height & 0xff);
88
+-					*bufferoffset+=strip[i+2]+2;
89
+-					i+=strip[i+2]+2;
90
+-
91
++					*bufferoffset+=datalen+2;
92
++					/* insert a DRI marker */
93
+ 					buffer[(*bufferoffset)++]=0xff;
94
+ 					buffer[(*bufferoffset)++]=0xdd;
95
+ 					buffer[(*bufferoffset)++]=0x00;
96
+ 					buffer[(*bufferoffset)++]=0x04;
97
+ 					buffer[(*bufferoffset)++]=(ri >> 8) & 0xff;
98
+ 					buffer[(*bufferoffset)++]= ri & 0xff;
99
+-				} else {
100
+-					i+=strip[i+2]+2;
101
+ 				}
102
+ 				break;
103
+-			case 0xc4:
104
+-			case 0xdb:
105
+-				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
106
+-				*bufferoffset+=strip[i+2]+2;
107
+-				i+=strip[i+2]+2;
108
++			case 0xc4: /* DHT */
109
++			case 0xdb: /* DQT */
110
++				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
111
++				*bufferoffset+=datalen+2;
112
+ 				break;
113
+-			case 0xda:
114
++			case 0xda: /* SOS */
115
+ 				if(no==0){
116
+-					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), strip[i+2]+2);
117
+-					*bufferoffset+=strip[i+2]+2;
118
+-					i+=strip[i+2]+2;
119
++					_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), datalen+2);
120
++					*bufferoffset+=datalen+2;
121
+ 				} else {
122
+ 					buffer[(*bufferoffset)++]=0xff;
123
+ 					buffer[(*bufferoffset)++]=
124
+                                             (unsigned char)(0xd0 | ((no-1)%8));
125
+-					i+=strip[i+2]+2;
126
+ 				}
127
+-				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i-1]), (*striplength)-i-1);
128
+-				*bufferoffset+=(*striplength)-i-1;
129
++				i += datalen + 1;
130
++				/* copy remainder of strip */
131
++				_TIFFmemcpy(&(buffer[*bufferoffset]), &(strip[i]), *striplength - i);
132
++				*bufferoffset+= *striplength - i;
133
+ 				return(1);
134
+ 			default:
135
+-				i+=strip[i+2]+2;
136
++				/* ignore any other marker */
137
++				break;
138
+ 		}
139
++		i += datalen + 1;
140
+ 	}
141
+-	
142
+ 
143
++	/* failed to find SOS marker */
144
+ 	return(0);
145
+ }
146
+ #endif

+ 768
- 0
libs/tiff/patches/012-CVE-2013-1961.patch View File

@@ -0,0 +1,768 @@
1
+Index: tiff-4.0.3/contrib/dbs/xtiff/xtiff.c
2
+===================================================================
3
+--- tiff-4.0.3.orig/contrib/dbs/xtiff/xtiff.c	2013-06-23 10:36:51.163629483 -0400
4
++++ tiff-4.0.3/contrib/dbs/xtiff/xtiff.c	2013-06-23 10:36:51.147629484 -0400
5
+@@ -512,9 +512,9 @@
6
+     Arg args[1];
7
+ 
8
+     if (tfMultiPage)
9
+-        sprintf(buffer, "%s - page %d", fileName, tfDirectory);
10
++        snprintf(buffer, sizeof(buffer), "%s - page %d", fileName, tfDirectory);
11
+     else
12
+-        strcpy(buffer, fileName);
13
++        snprintf(buffer, sizeof(buffer), "%s", fileName);
14
+     XtSetArg(args[0], XtNlabel, buffer);
15
+     XtSetValues(labelWidget, args, 1);
16
+ }
17
+Index: tiff-4.0.3/libtiff/tif_dirinfo.c
18
+===================================================================
19
+--- tiff-4.0.3.orig/libtiff/tif_dirinfo.c	2013-06-23 10:36:51.163629483 -0400
20
++++ tiff-4.0.3/libtiff/tif_dirinfo.c	2013-06-23 10:36:51.147629484 -0400
21
+@@ -711,7 +711,7 @@
22
+ 	 * note that this name is a special sign to TIFFClose() and
23
+ 	 * _TIFFSetupFields() to free the field
24
+ 	 */
25
+-	sprintf(fld->field_name, "Tag %d", (int) tag);
26
++	snprintf(fld->field_name, 32, "Tag %d", (int) tag);
27
+ 
28
+ 	return fld;    
29
+ }
30
+Index: tiff-4.0.3/libtiff/tif_codec.c
31
+===================================================================
32
+--- tiff-4.0.3.orig/libtiff/tif_codec.c	2013-06-23 10:36:51.163629483 -0400
33
++++ tiff-4.0.3/libtiff/tif_codec.c	2013-06-23 10:36:51.151629482 -0400
34
+@@ -108,7 +108,8 @@
35
+ 	const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
36
+         char compression_code[20];
37
+         
38
+-        sprintf( compression_code, "%d", tif->tif_dir.td_compression );
39
++        snprintf(compression_code, sizeof(compression_code), "%d",
40
++		 tif->tif_dir.td_compression );
41
+ 	TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
42
+                      "%s compression support is not configured", 
43
+                      c ? c->name : compression_code );
44
+Index: tiff-4.0.3/tools/tiffdither.c
45
+===================================================================
46
+--- tiff-4.0.3.orig/tools/tiffdither.c	2013-06-23 10:36:51.163629483 -0400
47
++++ tiff-4.0.3/tools/tiffdither.c	2013-06-23 10:36:51.151629482 -0400
48
+@@ -260,7 +260,7 @@
49
+ 		TIFFSetField(out, TIFFTAG_FILLORDER, fillorder);
50
+ 	else
51
+ 		CopyField(TIFFTAG_FILLORDER, shortv);
52
+-	sprintf(thing, "Dithered B&W version of %s", argv[optind]);
53
++	snprintf(thing, sizeof(thing), "Dithered B&W version of %s", argv[optind]);
54
+ 	TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
55
+ 	CopyField(TIFFTAG_PHOTOMETRIC, shortv);
56
+ 	CopyField(TIFFTAG_ORIENTATION, shortv);
57
+Index: tiff-4.0.3/tools/rgb2ycbcr.c
58
+===================================================================
59
+--- tiff-4.0.3.orig/tools/rgb2ycbcr.c	2013-06-23 10:36:51.163629483 -0400
60
++++ tiff-4.0.3/tools/rgb2ycbcr.c	2013-06-23 10:36:51.151629482 -0400
61
+@@ -332,7 +332,8 @@
62
+ 	TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
63
+ 	{ char buf[2048];
64
+ 	  char *cp = strrchr(TIFFFileName(in), '/');
65
+-	  sprintf(buf, "YCbCr conversion of %s", cp ? cp+1 : TIFFFileName(in));
66
++	  snprintf(buf, sizeof(buf), "YCbCr conversion of %s",
67
++		   cp ? cp+1 : TIFFFileName(in));
68
+ 	  TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, buf);
69
+ 	}
70
+ 	TIFFSetField(out, TIFFTAG_SOFTWARE, TIFFGetVersion());
71
+Index: tiff-4.0.3/tools/tiff2pdf.c
72
+===================================================================
73
+--- tiff-4.0.3.orig/tools/tiff2pdf.c	2013-06-23 10:36:51.163629483 -0400
74
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-06-23 10:36:51.151629482 -0400
75
+@@ -3630,7 +3630,9 @@
76
+ 	char buffer[16];
77
+ 	int buflen=0;
78
+ 	
79
+-	buflen=sprintf(buffer, "%%PDF-%u.%u ", t2p->pdf_majorversion&0xff, t2p->pdf_minorversion&0xff);
80
++	buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",
81
++			  t2p->pdf_majorversion&0xff,
82
++			  t2p->pdf_minorversion&0xff);
83
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
84
+ 	written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
85
+ 
86
+@@ -3644,10 +3646,10 @@
87
+ tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
88
+ 
89
+ 	tsize_t written=0;
90
+-	char buffer[16];
91
++	char buffer[32];
92
+ 	int buflen=0;
93
+ 
94
+-	buflen=sprintf(buffer, "%lu", (unsigned long)number);
95
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
96
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen );
97
+ 	written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
98
+ 
99
+@@ -3686,13 +3688,13 @@
100
+ 	written += t2pWriteFile(output, (tdata_t) "/", 1);
101
+ 	for (i=0;i<namelen;i++){
102
+ 		if ( ((unsigned char)name[i]) < 0x21){
103
+-			sprintf(buffer, "#%.2X", name[i]);
104
++			snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
105
+ 			buffer[sizeof(buffer) - 1] = '\0';
106
+ 			written += t2pWriteFile(output, (tdata_t) buffer, 3);
107
+ 			nextchar=1;
108
+ 		}
109
+ 		if ( ((unsigned char)name[i]) > 0x7E){
110
+-			sprintf(buffer, "#%.2X", name[i]);
111
++			snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
112
+ 			buffer[sizeof(buffer) - 1] = '\0';
113
+ 			written += t2pWriteFile(output, (tdata_t) buffer, 3);
114
+ 			nextchar=1;
115
+@@ -3700,57 +3702,57 @@
116
+ 		if (nextchar==0){
117
+ 			switch (name[i]){
118
+ 				case 0x23:
119
+-					sprintf(buffer, "#%.2X", name[i]);
120
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
121
+ 					buffer[sizeof(buffer) - 1] = '\0';
122
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
123
+ 					break;
124
+ 				case 0x25:
125
+-					sprintf(buffer, "#%.2X", name[i]);
126
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
127
+ 					buffer[sizeof(buffer) - 1] = '\0';
128
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
129
+ 					break;
130
+ 				case 0x28:
131
+-					sprintf(buffer, "#%.2X", name[i]);
132
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
133
+ 					buffer[sizeof(buffer) - 1] = '\0';
134
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
135
+ 					break;
136
+ 				case 0x29:
137
+-					sprintf(buffer, "#%.2X", name[i]); 
138
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
139
+ 					buffer[sizeof(buffer) - 1] = '\0';
140
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
141
+ 					break;
142
+ 				case 0x2F:
143
+-					sprintf(buffer, "#%.2X", name[i]); 
144
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
145
+ 					buffer[sizeof(buffer) - 1] = '\0';
146
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
147
+ 					break;
148
+ 				case 0x3C:
149
+-					sprintf(buffer, "#%.2X", name[i]); 
150
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
151
+ 					buffer[sizeof(buffer) - 1] = '\0';
152
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
153
+ 					break;
154
+ 				case 0x3E:
155
+-					sprintf(buffer, "#%.2X", name[i]);
156
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
157
+ 					buffer[sizeof(buffer) - 1] = '\0';
158
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
159
+ 					break;
160
+ 				case 0x5B:
161
+-					sprintf(buffer, "#%.2X", name[i]); 
162
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
163
+ 					buffer[sizeof(buffer) - 1] = '\0';
164
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
165
+ 					break;
166
+ 				case 0x5D:
167
+-					sprintf(buffer, "#%.2X", name[i]);
168
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]);
169
+ 					buffer[sizeof(buffer) - 1] = '\0';
170
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
171
+ 					break;
172
+ 				case 0x7B:
173
+-					sprintf(buffer, "#%.2X", name[i]); 
174
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
175
+ 					buffer[sizeof(buffer) - 1] = '\0';
176
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
177
+ 					break;
178
+ 				case 0x7D:
179
+-					sprintf(buffer, "#%.2X", name[i]); 
180
++					snprintf(buffer, sizeof(buffer), "#%.2X", name[i]); 
181
+ 					buffer[sizeof(buffer) - 1] = '\0';
182
+ 					written += t2pWriteFile(output, (tdata_t) buffer, 3);
183
+ 					break;
184
+@@ -3865,14 +3867,14 @@
185
+ tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){
186
+ 	
187
+ 	tsize_t written=0;
188
+-	char buffer[16];
189
++	char buffer[32];
190
+ 	int buflen=0;
191
+ 	
192
+ 	written += t2pWriteFile(output, (tdata_t) "/Length ", 8);
193
+ 	if(len!=0){
194
+ 		written += t2p_write_pdf_stream_length(len, output);
195
+ 	} else {
196
+-		buflen=sprintf(buffer, "%lu", (unsigned long)number);
197
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
198
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
199
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
200
+ 	}
201
+@@ -3913,10 +3915,10 @@
202
+ tsize_t t2p_write_pdf_stream_length(tsize_t len, TIFF* output){
203
+ 
204
+ 	tsize_t written=0;
205
+-	char buffer[16];
206
++	char buffer[32];
207
+ 	int buflen=0;
208
+ 
209
+-	buflen=sprintf(buffer, "%lu", (unsigned long)len);
210
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)len);
211
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
212
+ 	written += t2pWriteFile(output, (tdata_t) "\n", 1);
213
+ 
214
+@@ -3930,7 +3932,7 @@
215
+ tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
216
+ {
217
+ 	tsize_t written = 0;
218
+-	char buffer[16];
219
++	char buffer[32];
220
+ 	int buflen = 0;
221
+ 
222
+ 	written += t2pWriteFile(output, 
223
+@@ -3969,7 +3971,6 @@
224
+ 		written += t2p_write_pdf_string(t2p->pdf_datetime, output);
225
+ 	}
226
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Producer ", 11);
227
+-	_TIFFmemset((tdata_t)buffer, 0x00, sizeof(buffer));
228
+ 	snprintf(buffer, sizeof(buffer), "libtiff / tiff2pdf - %d", TIFFLIB_VERSION);
229
+ 	written += t2p_write_pdf_string(buffer, output);
230
+ 	written += t2pWriteFile(output, (tdata_t) "\n", 1);
231
+@@ -4110,7 +4111,7 @@
232
+ {
233
+ 	tsize_t written=0;
234
+ 	tdir_t i=0;
235
+-	char buffer[16];
236
++	char buffer[32];
237
+ 	int buflen=0;
238
+ 
239
+ 	int page=0;
240
+@@ -4118,7 +4119,7 @@
241
+ 		(tdata_t) "<< \n/Type /Pages \n/Kids [ ", 26);
242
+ 	page = t2p->pdf_pages+1;
243
+ 	for (i=0;i<t2p->tiff_pagecount;i++){
244
+-		buflen=sprintf(buffer, "%d", page);
245
++		buflen=snprintf(buffer, sizeof(buffer), "%d", page);
246
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
247
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
248
+ 		if ( ((i+1)%8)==0 ) {
249
+@@ -4133,8 +4134,7 @@
250
+ 		}
251
+ 	}
252
+ 	written += t2pWriteFile(output, (tdata_t) "] \n/Count ", 10);
253
+-	_TIFFmemset(buffer, 0x00, 16);
254
+-	buflen=sprintf(buffer, "%d", t2p->tiff_pagecount);
255
++	buflen=snprintf(buffer, sizeof(buffer), "%d", t2p->tiff_pagecount);
256
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
257
+ 	written += t2pWriteFile(output, (tdata_t) " \n>> \n", 6);
258
+ 
259
+@@ -4149,28 +4149,28 @@
260
+ 
261
+ 	unsigned int i=0;
262
+ 	tsize_t written=0;
263
+-	char buffer[16];
264
++	char buffer[256];
265
+ 	int buflen=0;
266
+ 
267
+ 	written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24);
268
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_pages);
269
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
270
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
271
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
272
+ 	written += t2pWriteFile(output, (tdata_t) "/MediaBox [", 11); 
273
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x1);
274
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x1);
275
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
276
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
277
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y1);
278
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y1);
279
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
280
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
281
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.x2);
282
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.x2);
283
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
284
+ 	written += t2pWriteFile(output, (tdata_t) " ", 1); 
285
+-	buflen=sprintf(buffer, "%.4f",t2p->pdf_mediabox.y2);
286
++	buflen=snprintf(buffer, sizeof(buffer), "%.4f",t2p->pdf_mediabox.y2);
287
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
288
+ 	written += t2pWriteFile(output, (tdata_t) "] \n", 3); 
289
+ 	written += t2pWriteFile(output, (tdata_t) "/Contents ", 10);
290
+-	buflen=sprintf(buffer, "%lu", (unsigned long)(object + 1));
291
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(object + 1));
292
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
293
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
294
+ 	written += t2pWriteFile(output, (tdata_t) "/Resources << \n", 15);
295
+@@ -4178,15 +4178,13 @@
296
+ 		written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
297
+ 		for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i++){
298
+ 			written += t2pWriteFile(output, (tdata_t) "/Im", 3);
299
+-			buflen = sprintf(buffer, "%u", t2p->pdf_page+1);
300
++			buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
301
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
302
+ 			written += t2pWriteFile(output, (tdata_t) "_", 1);
303
+-			buflen = sprintf(buffer, "%u", i+1);
304
++			buflen = snprintf(buffer, sizeof(buffer), "%u", i+1);
305
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
306
+ 			written += t2pWriteFile(output, (tdata_t) " ", 1);
307
+-			buflen = sprintf(
308
+-				buffer, 
309
+-				"%lu", 
310
++			buflen = snprintf(buffer, sizeof(buffer), "%lu",
311
+ 				(unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); 
312
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
313
+ 			written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
314
+@@ -4198,12 +4196,10 @@
315
+ 	} else {
316
+ 			written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
317
+ 			written += t2pWriteFile(output, (tdata_t) "/Im", 3);
318
+-			buflen = sprintf(buffer, "%u", t2p->pdf_page+1);
319
++			buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
320
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
321
+ 			written += t2pWriteFile(output, (tdata_t) " ", 1);
322
+-			buflen = sprintf(
323
+-				buffer, 
324
+-				"%lu", 
325
++			buflen = snprintf(buffer, sizeof(buffer), "%lu",
326
+ 				(unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra)); 
327
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
328
+ 			written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
329
+@@ -4212,9 +4208,7 @@
330
+ 	if(t2p->tiff_transferfunctioncount != 0) {
331
+ 		written += t2pWriteFile(output, (tdata_t) "/ExtGState <<", 13);
332
+ 		t2pWriteFile(output, (tdata_t) "/GS1 ", 5);
333
+-		buflen = sprintf(
334
+-			buffer, 
335
+-			"%lu", 
336
++		buflen = snprintf(buffer, sizeof(buffer), "%lu",
337
+ 			(unsigned long)(object + 3)); 
338
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
339
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
340
+@@ -4587,7 +4581,7 @@
341
+ 	if(t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount>0){ 
342
+ 		for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount; i++){
343
+ 			box=t2p->tiff_tiles[t2p->pdf_page].tiles_tiles[i].tile_box;
344
+-			buflen=sprintf(buffer, 
345
++			buflen=snprintf(buffer, sizeof(buffer), 
346
+ 				"q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d_%ld Do Q\n", 
347
+ 				t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
348
+ 				box.mat[0],
349
+@@ -4602,7 +4596,7 @@
350
+ 		}
351
+ 	} else {
352
+ 		box=t2p->pdf_imagebox;
353
+-		buflen=sprintf(buffer, 
354
++		buflen=snprintf(buffer, sizeof(buffer), 
355
+ 			"q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n", 
356
+ 			t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
357
+ 			box.mat[0],
358
+@@ -4627,59 +4621,48 @@
359
+ 												TIFF* output){
360
+ 
361
+ 	tsize_t written=0;
362
+-	char buffer[16];
363
++	char buffer[32];
364
+ 	int buflen=0;
365
+ 
366
+ 	written += t2p_write_pdf_stream_dict(0, t2p->pdf_xrefcount+1, output); 
367
+ 	written += t2pWriteFile(output, 
368
+ 		(tdata_t) "/Type /XObject \n/Subtype /Image \n/Name /Im", 
369
+ 		42);
370
+-	buflen=sprintf(buffer, "%u", t2p->pdf_page+1);
371
++	buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
372
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
373
+ 	if(tile != 0){
374
+ 		written += t2pWriteFile(output, (tdata_t) "_", 1);
375
+-		buflen=sprintf(buffer, "%lu", (unsigned long)tile);
376
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)tile);
377
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
378
+ 	}
379
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Width ", 8);
380
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
381
+ 	if(tile==0){
382
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_width);
383
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_width);
384
+ 	} else {
385
+ 		if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
386
+-			buflen=sprintf(
387
+-				buffer, 
388
+-				"%lu", 
389
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
390
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
391
+ 		} else {
392
+-			buflen=sprintf(
393
+-				buffer, 
394
+-				"%lu", 
395
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
396
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
397
+ 		}
398
+ 	}
399
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
400
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Height ", 9);
401
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
402
+ 	if(tile==0){
403
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->tiff_length);
404
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_length);
405
+ 	} else {
406
+ 		if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
407
+-			buflen=sprintf(
408
+-				buffer, 
409
+-				"%lu", 
410
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
411
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
412
+ 		} else {
413
+-			buflen=sprintf(
414
+-				buffer, 
415
+-				"%lu", 
416
++			buflen=snprintf(buffer, sizeof(buffer), "%lu",
417
+ 				(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
418
+ 		}
419
+ 	}
420
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
421
+ 	written += t2pWriteFile(output, (tdata_t) "\n/BitsPerComponent ", 19);
422
+-	_TIFFmemset((tdata_t)buffer, 0x00, 16);
423
+-	buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample);
424
++	buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
425
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
426
+ 	written += t2pWriteFile(output, (tdata_t) "\n/ColorSpace ", 13);
427
+ 	written += t2p_write_pdf_xobject_cs(t2p, output);
428
+@@ -4723,11 +4706,10 @@
429
+ 		t2p->pdf_colorspace ^= T2P_CS_PALETTE;
430
+ 		written += t2p_write_pdf_xobject_cs(t2p, output);
431
+ 		t2p->pdf_colorspace |= T2P_CS_PALETTE;
432
+-		buflen=sprintf(buffer, "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
433
++		buflen=snprintf(buffer, sizeof(buffer), "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
434
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
435
+ 		written += t2pWriteFile(output, (tdata_t) " ", 1);
436
+-		_TIFFmemset(buffer, 0x00, 16);
437
+-		buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_palettecs ); 
438
++		buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_palettecs ); 
439
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
440
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ]\n", 7);
441
+ 		return(written);
442
+@@ -4761,10 +4743,10 @@
443
+ 			X_W /= Y_W;
444
+ 			Z_W /= Y_W;
445
+ 			Y_W = 1.0F;
446
+-			buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
447
++			buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
448
+ 			written += t2pWriteFile(output, (tdata_t) buffer, buflen);
449
+ 			written += t2pWriteFile(output, (tdata_t) "/Range ", 7);
450
+-			buflen=sprintf(buffer, "[%d %d %d %d] \n", 
451
++			buflen=snprintf(buffer, sizeof(buffer), "[%d %d %d %d] \n", 
452
+ 				t2p->pdf_labrange[0], 
453
+ 				t2p->pdf_labrange[1], 
454
+ 				t2p->pdf_labrange[2], 
455
+@@ -4780,26 +4762,26 @@
456
+ tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){
457
+ 
458
+ 	tsize_t written=0;
459
+-	char buffer[16];
460
++	char buffer[32];
461
+ 	int buflen=0;
462
+ 
463
+ 	written += t2pWriteFile(output, (tdata_t) "<< /Type /ExtGState \n/TR ", 25);
464
+ 	if(t2p->tiff_transferfunctioncount == 1){
465
+-		buflen=sprintf(buffer, "%lu",
466
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
467
+ 			       (unsigned long)(t2p->pdf_xrefcount + 1));
468
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
469
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
470
+ 	} else {
471
+ 		written += t2pWriteFile(output, (tdata_t) "[ ", 2);
472
+-		buflen=sprintf(buffer, "%lu",
473
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
474
+ 			       (unsigned long)(t2p->pdf_xrefcount + 1));
475
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
476
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
477
+-		buflen=sprintf(buffer, "%lu",
478
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
479
+ 			       (unsigned long)(t2p->pdf_xrefcount + 2));
480
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
481
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
482
+-		buflen=sprintf(buffer, "%lu",
483
++		buflen=snprintf(buffer, sizeof(buffer), "%lu",
484
+ 			       (unsigned long)(t2p->pdf_xrefcount + 3));
485
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
486
+ 		written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
487
+@@ -4821,7 +4803,7 @@
488
+ 	written += t2pWriteFile(output, (tdata_t) "/FunctionType 0 \n", 17);
489
+ 	written += t2pWriteFile(output, (tdata_t) "/Domain [0.0 1.0] \n", 19);
490
+ 	written += t2pWriteFile(output, (tdata_t) "/Range [0.0 1.0] \n", 18);
491
+-	buflen=sprintf(buffer, "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
492
++	buflen=snprintf(buffer, sizeof(buffer), "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
493
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
494
+ 	written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19);
495
+ 	written += t2p_write_pdf_stream_dict(((tsize_t)1)<<(t2p->tiff_bitspersample+1), 0, output);
496
+@@ -4848,7 +4830,7 @@
497
+ tsize_t t2p_write_pdf_xobject_calcs(T2P* t2p, TIFF* output){
498
+ 
499
+ 	tsize_t written=0;
500
+-	char buffer[128];
501
++	char buffer[256];
502
+ 	int buflen=0;
503
+ 	
504
+ 	float X_W=0.0;
505
+@@ -4916,16 +4898,16 @@
506
+ 	written += t2pWriteFile(output, (tdata_t) "<< \n", 4);
507
+ 	if(t2p->pdf_colorspace & T2P_CS_CALGRAY){
508
+ 		written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12);
509
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
510
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
511
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
512
+ 		written += t2pWriteFile(output, (tdata_t) "/Gamma 2.2 \n", 12);
513
+ 	}
514
+ 	if(t2p->pdf_colorspace & T2P_CS_CALRGB){
515
+ 		written += t2pWriteFile(output, (tdata_t) "/WhitePoint ", 12);
516
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
517
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f] \n", X_W, Y_W, Z_W);
518
+ 		written += t2pWriteFile(output, (tdata_t) buffer, buflen);
519
+ 		written += t2pWriteFile(output, (tdata_t) "/Matrix ", 8);
520
+-		buflen=sprintf(buffer, "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", 
521
++		buflen=snprintf(buffer, sizeof(buffer), "[%.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f %.4f] \n", 
522
+ 			X_R, Y_R, Z_R, 
523
+ 			X_G, Y_G, Z_G, 
524
+ 			X_B, Y_B, Z_B); 
525
+@@ -4944,11 +4926,11 @@
526
+ tsize_t t2p_write_pdf_xobject_icccs(T2P* t2p, TIFF* output){
527
+ 
528
+ 	tsize_t written=0;
529
+-	char buffer[16];
530
++	char buffer[32];
531
+ 	int buflen=0;
532
+ 	
533
+ 	written += t2pWriteFile(output, (tdata_t) "[/ICCBased ", 11);
534
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_icccs);
535
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_icccs);
536
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
537
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R] \n", 7);
538
+ 
539
+@@ -4958,11 +4940,11 @@
540
+ tsize_t t2p_write_pdf_xobject_icccs_dict(T2P* t2p, TIFF* output){
541
+ 
542
+ 	tsize_t written=0;
543
+-	char buffer[16];
544
++	char buffer[32];
545
+ 	int buflen=0;
546
+ 	
547
+ 	written += t2pWriteFile(output, (tdata_t) "/N ", 3);
548
+-	buflen=sprintf(buffer, "%u \n", t2p->tiff_samplesperpixel);
549
++	buflen=snprintf(buffer, sizeof(buffer), "%u \n", t2p->tiff_samplesperpixel);
550
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
551
+ 	written += t2pWriteFile(output, (tdata_t) "/Alternate ", 11);
552
+ 	t2p->pdf_colorspace ^= T2P_CS_ICCBASED;
553
+@@ -5027,7 +5009,7 @@
554
+ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output){
555
+ 
556
+ 	tsize_t written=0;
557
+-	char buffer[16];
558
++	char buffer[32];
559
+ 	int buflen=0;
560
+ 
561
+ 	if(t2p->pdf_compression==T2P_COMPRESS_NONE){
562
+@@ -5042,41 +5024,33 @@
563
+ 			written += t2pWriteFile(output, (tdata_t) "<< /K -1 ", 9);
564
+ 			if(tile==0){
565
+ 				written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
566
+-				buflen=sprintf(buffer, "%lu",
567
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
568
+ 					       (unsigned long)t2p->tiff_width);
569
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
570
+ 				written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
571
+-				buflen=sprintf(buffer, "%lu",
572
++				buflen=snprintf(buffer, sizeof(buffer), "%lu",
573
+ 					       (unsigned long)t2p->tiff_length);
574
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
575
+ 			} else {
576
+ 				if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
577
+ 					written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
578
+-					buflen=sprintf(
579
+-						buffer, 
580
+-						"%lu", 
581
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
582
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
583
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
584
+ 				} else {
585
+ 					written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
586
+-					buflen=sprintf(
587
+-						buffer, 
588
+-						"%lu", 
589
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
590
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
591
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
592
+ 				}
593
+ 				if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
594
+ 					written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
595
+-					buflen=sprintf(
596
+-						buffer, 
597
+-						"%lu", 
598
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
599
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
600
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
601
+ 				} else {
602
+ 					written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
603
+-					buflen=sprintf(
604
+-						buffer, 
605
+-						"%lu", 
606
++					buflen=snprintf(buffer, sizeof(buffer), "%lu",
607
+ 						(unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
608
+ 					written += t2pWriteFile(output, (tdata_t) buffer, buflen);
609
+ 				}
610
+@@ -5103,21 +5077,17 @@
611
+ 			if(t2p->pdf_compressionquality%100){
612
+ 				written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13);
613
+ 				written += t2pWriteFile(output, (tdata_t) "<< /Predictor ", 14);
614
+-				_TIFFmemset(buffer, 0x00, 16);
615
+-				buflen=sprintf(buffer, "%u", t2p->pdf_compressionquality%100);
616
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_compressionquality%100);
617
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
618
+ 				written += t2pWriteFile(output, (tdata_t) " /Columns ", 10);
619
+-				_TIFFmemset(buffer, 0x00, 16);
620
+-				buflen = sprintf(buffer, "%lu",
621
++				buflen = snprintf(buffer, sizeof(buffer), "%lu",
622
+ 						 (unsigned long)t2p->tiff_width);
623
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
624
+ 				written += t2pWriteFile(output, (tdata_t) " /Colors ", 9);
625
+-				_TIFFmemset(buffer, 0x00, 16);
626
+-				buflen=sprintf(buffer, "%u", t2p->tiff_samplesperpixel);
627
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_samplesperpixel);
628
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
629
+ 				written += t2pWriteFile(output, (tdata_t) " /BitsPerComponent ", 19);
630
+-				_TIFFmemset(buffer, 0x00, 16);
631
+-				buflen=sprintf(buffer, "%u", t2p->tiff_bitspersample);
632
++				buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
633
+ 				written += t2pWriteFile(output, (tdata_t) buffer, buflen);
634
+ 				written += t2pWriteFile(output, (tdata_t) ">>\n", 3);
635
+ 			}
636
+@@ -5137,16 +5107,16 @@
637
+ tsize_t t2p_write_pdf_xreftable(T2P* t2p, TIFF* output){
638
+ 
639
+ 	tsize_t written=0;
640
+-	char buffer[21];
641
++	char buffer[64];
642
+ 	int buflen=0;
643
+ 	uint32 i=0;
644
+ 
645
+ 	written += t2pWriteFile(output, (tdata_t) "xref\n0 ", 7);
646
+-	buflen=sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
647
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
648
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
649
+ 	written += t2pWriteFile(output, (tdata_t) " \n0000000000 65535 f \n", 22);
650
+ 	for (i=0;i<t2p->pdf_xrefcount;i++){
651
+-		sprintf(buffer, "%.10lu 00000 n \n",
652
++		snprintf(buffer, sizeof(buffer), "%.10lu 00000 n \n",
653
+ 			(unsigned long)t2p->pdf_xrefoffsets[i]);
654
+ 		written += t2pWriteFile(output, (tdata_t) buffer, 20);
655
+ 	}
656
+@@ -5170,17 +5140,14 @@
657
+ 		snprintf(t2p->pdf_fileid + i, 9, "%.8X", rand());
658
+ 
659
+ 	written += t2pWriteFile(output, (tdata_t) "trailer\n<<\n/Size ", 17);
660
+-	buflen = sprintf(buffer, "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
661
++	buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
662
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
663
+-	_TIFFmemset(buffer, 0x00, 32);	
664
+ 	written += t2pWriteFile(output, (tdata_t) "\n/Root ", 7);
665
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_catalog);
666
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_catalog);
667
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
668
+-	_TIFFmemset(buffer, 0x00, 32);	
669
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n/Info ", 12);
670
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_info);
671
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_info);
672
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
673
+-	_TIFFmemset(buffer, 0x00, 32);	
674
+ 	written += t2pWriteFile(output, (tdata_t) " 0 R \n/ID[<", 11);
675
+ 	written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
676
+ 				sizeof(t2p->pdf_fileid) - 1);
677
+@@ -5188,9 +5155,8 @@
678
+ 	written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
679
+ 				sizeof(t2p->pdf_fileid) - 1);
680
+ 	written += t2pWriteFile(output, (tdata_t) ">]\n>>\nstartxref\n", 16);
681
+-	buflen=sprintf(buffer, "%lu", (unsigned long)t2p->pdf_startxref);
682
++	buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_startxref);
683
+ 	written += t2pWriteFile(output, (tdata_t) buffer, buflen);
684
+-	_TIFFmemset(buffer, 0x00, 32);	
685
+ 	written += t2pWriteFile(output, (tdata_t) "\n%%EOF\n", 7);
686
+ 
687
+ 	return(written);
688
+Index: tiff-4.0.3/tools/tiff2ps.c
689
+===================================================================
690
+--- tiff-4.0.3.orig/tools/tiff2ps.c	2013-06-23 10:36:51.163629483 -0400
691
++++ tiff-4.0.3/tools/tiff2ps.c	2013-06-23 10:36:51.155629481 -0400
692
+@@ -1781,8 +1781,8 @@
693
+ 		imageOp = "imagemask";
694
+ 
695
+ 	(void)strcpy(im_x, "0");
696
+-	(void)sprintf(im_y, "%lu", (long) h);
697
+-	(void)sprintf(im_h, "%lu", (long) h);
698
++	(void)snprintf(im_y, sizeof(im_y), "%lu", (long) h);
699
++	(void)snprintf(im_h, sizeof(im_h), "%lu", (long) h);
700
+ 	tile_width = w;
701
+ 	tile_height = h;
702
+ 	if (TIFFIsTiled(tif)) {
703
+@@ -1803,7 +1803,7 @@
704
+ 		}
705
+ 		if (tile_height < h) {
706
+ 			fputs("/im_y 0 def\n", fd);
707
+-			(void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
708
++			(void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
709
+ 		}
710
+ 	} else {
711
+ 		repeat_count = tf_numberstrips;
712
+@@ -1815,7 +1815,7 @@
713
+ 			fprintf(fd, "/im_h %lu def\n",
714
+ 			    (unsigned long) tile_height);
715
+ 			(void)strcpy(im_h, "im_h");
716
+-			(void)sprintf(im_y, "%lu im_y sub", (unsigned long) h);
717
++			(void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
718
+ 		}
719
+ 	}
720
+ 
721
+Index: tiff-4.0.3/tools/tiffcrop.c
722
+===================================================================
723
+--- tiff-4.0.3.orig/tools/tiffcrop.c	2013-06-23 10:36:51.163629483 -0400
724
++++ tiff-4.0.3/tools/tiffcrop.c	2013-06-23 10:36:51.159629481 -0400
725
+@@ -2077,7 +2077,7 @@
726
+         return 1;
727
+         }
728
+ 
729
+-      sprintf (filenum, "-%03d%s", findex, export_ext);
730
++      snprintf(filenum, sizeof(filenum), "-%03d%s", findex, export_ext);
731
+       filenum[14] = '\0';
732
+       strncat (exportname, filenum, 15);
733
+       }
734
+@@ -2230,8 +2230,8 @@
735
+ 
736
+           /* dump.infilename is guaranteed to be NUL termimated and have 20 bytes 
737
+              fewer than PATH_MAX */ 
738
+-          memset (temp_filename, '\0', PATH_MAX + 1);              
739
+-          sprintf (temp_filename, "%s-read-%03d.%s", dump.infilename, dump_images,
740
++          snprintf(temp_filename, sizeof(temp_filename), "%s-read-%03d.%s",
741
++		   dump.infilename, dump_images,
742
+                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
743
+           if ((dump.infile = fopen(temp_filename, dump.mode)) == NULL)
744
+             {
745
+@@ -2249,8 +2249,8 @@
746
+ 
747
+           /* dump.outfilename is guaranteed to be NUL termimated and have 20 bytes 
748
+              fewer than PATH_MAX */ 
749
+-          memset (temp_filename, '\0', PATH_MAX + 1);              
750
+-          sprintf (temp_filename, "%s-write-%03d.%s", dump.outfilename, dump_images,
751
++          snprintf(temp_filename, sizeof(temp_filename), "%s-write-%03d.%s",
752
++		   dump.outfilename, dump_images,
753
+                   (dump.format == DUMP_TEXT) ? "txt" : "raw");
754
+           if ((dump.outfile = fopen(temp_filename, dump.mode)) == NULL)
755
+             {
756
+Index: tiff-4.0.3/tools/tiff2bw.c
757
+===================================================================
758
+--- tiff-4.0.3.orig/tools/tiff2bw.c	2013-06-23 10:36:51.163629483 -0400
759
++++ tiff-4.0.3/tools/tiff2bw.c	2013-06-23 10:36:51.159629481 -0400
760
+@@ -205,7 +205,7 @@
761
+ 		}
762
+ 	}
763
+ 	TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
764
+-	sprintf(thing, "B&W version of %s", argv[optind]);
765
++	snprintf(thing, sizeof(thing), "B&W version of %s", argv[optind]);
766
+ 	TIFFSetField(out, TIFFTAG_IMAGEDESCRIPTION, thing);
767
+ 	TIFFSetField(out, TIFFTAG_SOFTWARE, "tiff2bw");
768
+ 	outbuf = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(out));

+ 17
- 0
libs/tiff/patches/013-CVE-2013-4231.patch View File

@@ -0,0 +1,17 @@
1
+Description: Buffer overflow in gif2tiff
2
+Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2450
3
+Bug-Debian: http://bugs.debian.org/719303
4
+
5
+Index: tiff-4.0.3/tools/gif2tiff.c
6
+===================================================================
7
+--- tiff-4.0.3.orig/tools/gif2tiff.c	2013-08-22 11:46:11.960846910 -0400
8
++++ tiff-4.0.3/tools/gif2tiff.c	2013-08-22 11:46:11.956846910 -0400
9
+@@ -333,6 +333,8 @@
10
+     int status = 1;
11
+ 
12
+     datasize = getc(infile);
13
++    if (datasize > 12)
14
++	return 0;
15
+     clear = 1 << datasize;
16
+     eoi = clear + 1;
17
+     avail = clear + 2;

+ 18
- 0
libs/tiff/patches/014-CVE-2013-4232.patch View File

@@ -0,0 +1,18 @@
1
+Description: use after free in tiff2pdf
2
+Bug: http://bugzilla.maptools.org/show_bug.cgi?id=2449
3
+Bug-Debian: http://bugs.debian.org/719303
4
+
5
+Index: tiff-4.0.3/tools/tiff2pdf.c
6
+===================================================================
7
+--- tiff-4.0.3.orig/tools/tiff2pdf.c	2013-08-22 11:46:37.292847242 -0400
8
++++ tiff-4.0.3/tools/tiff2pdf.c	2013-08-22 11:46:37.292847242 -0400
9
+@@ -2461,7 +2461,8 @@
10
+ 					(unsigned long) t2p->tiff_datasize, 
11
+ 					TIFFFileName(input));
12
+ 				t2p->t2p_error = T2P_ERR_ERROR;
13
+-			  _TIFFfree(buffer);
14
++				_TIFFfree(buffer);
15
++				return(0);
16
+ 			} else {
17
+ 				buffer=samplebuffer;
18
+ 				t2p->tiff_datasize *= t2p->tiff_samplesperpixel;

+ 18
- 0
libs/tiff/patches/015-CVE-2013-4244.patch View File

@@ -0,0 +1,18 @@
1
+Description: OOB write in gif2tiff
2
+Bug-Redhat: https://bugzilla.redhat.com/show_bug.cgi?id=996468
3
+
4
+Index: tiff-4.0.3/tools/gif2tiff.c
5
+===================================================================
6
+--- tiff-4.0.3.orig/tools/gif2tiff.c	2013-08-24 11:17:13.546447901 -0400
7
++++ tiff-4.0.3/tools/gif2tiff.c	2013-08-24 11:17:13.546447901 -0400
8
+@@ -400,6 +400,10 @@
9
+     }
10
+ 
11
+     if (oldcode == -1) {
12
++        if (code >= clear) {
13
++            fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
14
++            return 0;
15
++        }
16
+ 	*(*fill)++ = suffix[code];
17
+ 	firstchar = oldcode = code;
18
+ 	return 1;

+ 37
- 0
libs/tiff/patches/016-CVE-2013-4243.patch View File

@@ -0,0 +1,37 @@
1
+Index: tiff/tools/gif2tiff.c
2
+===================================================================
3
+--- tiff.orig/tools/gif2tiff.c
4
++++ tiff/tools/gif2tiff.c
5
+@@ -280,6 +280,10 @@ readgifimage(char* mode)
6
+         fprintf(stderr, "no colormap present for image\n");
7
+         return (0);
8
+     }
9
++    if (width == 0 || height == 0) {
10
++        fprintf(stderr, "Invalid value of width or height\n");
11
++        return(0);
12
++    }
13
+     if ((raster = (unsigned char*) _TIFFmalloc(width*height+EXTRAFUDGE)) == NULL) {
14
+         fprintf(stderr, "not enough memory for image\n");
15
+         return (0);
16
+@@ -404,6 +408,10 @@ process(register int code, unsigned char
17
+             fprintf(stderr, "bad input: code=%d is larger than clear=%d\n",code, clear);
18
+             return 0;
19
+         }
20
++        if (*fill >= raster + width*height) {
21
++            fprintf(stderr, "raster full before eoi code\n");
22
++            return 0;
23
++        }
24
+ 	*(*fill)++ = suffix[code];
25
+ 	firstchar = oldcode = code;
26
+ 	return 1;
27
+@@ -434,6 +442,10 @@ process(register int code, unsigned char
28
+     }
29
+     oldcode = incode;
30
+     do {
31
++        if (*fill >= raster + width*height) {
32
++            fprintf(stderr, "raster full before eoi code\n");
33
++            return 0;
34
++        }
35
+ 	*(*fill)++ = *--stackp;
36
+     } while (stackp > stack);
37
+     return 1;

+ 81
- 0
libs/vips/Makefile View File

@@ -0,0 +1,81 @@
1
+#
2
+# Copyright (C) 2010-2012 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=vips
11
+PKG_VERSION:=7.38.5
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
15
+PKG_SOURCE_URL:=http://www.vips.ecs.soton.ac.uk/supported/7.38/
16
+PKG_MD5SUM:=768d1c0f50c5b2794bcab68383af33ee
17
+PKG_FIXUP:=autoreconf
18
+
19
+include $(INCLUDE_DIR)/package.mk
20
+include $(INCLUDE_DIR)/nls.mk
21
+
22
+PKG_INSTALL=1
23
+
24
+define Package/vips
25
+  $(call Package/vips/Default)
26
+  SECTION:=multimedia
27
+  CATEGORY:=Multimedia
28
+  TITLE:=An image manipulation library
29
+  URL:=http://www.vips.ecs.soton.ac.uk/
30
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
31
+  DEPENDS:=+glib2 +libexif +libjpeg +libpng +libxml2 $(INTL_DEPENDS)
32
+endef
33
+
34
+TARGET_LDFLAGS+= \
35
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
36
+
37
+CONFIGURE_ARGS += \
38
+	--disable-cxx \
39
+	--disable-threads \
40
+	--without-cfitsio \
41
+	--without-fftw \
42
+	--without-lcms \
43
+	--without-magick \
44
+	--without-matio \
45
+	--without-OpenEXR \
46
+	--without-orc \
47
+	--without-pangoft2 \
48
+	--without-python \
49
+	--without-tiff \
50
+	--without-v4l \
51
+	--without-x \
52
+	--without-zip \
53
+	--with-jpeg \
54
+	--with-libexif \
55
+	--with-png \
56
+
57
+define Build/InstallDev
58
+	$(INSTALL_DIR) $(1)/usr/include/vips
59
+	$(CP) \
60
+		$(PKG_INSTALL_DIR)/usr/include/* \
61
+		$(1)/usr/include/
62
+
63
+	$(INSTALL_DIR) $(1)/usr/lib/
64
+	$(CP) \
65
+		$(PKG_INSTALL_DIR)/usr/lib/*.so* \
66
+		$(1)/usr/lib/
67
+
68
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
69
+	$(INSTALL_DATA) \
70
+		$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
71
+		$(1)/usr/lib/pkgconfig/
72
+endef
73
+
74
+define Package/vips/install
75
+	$(INSTALL_DIR) $(1)/usr/lib/
76
+	$(CP) \
77
+		$(PKG_INSTALL_DIR)/usr/lib/*.so* \
78
+		$(1)/usr/lib/
79
+endef
80
+
81
+$(eval $(call BuildPackage,vips))

+ 91228
- 0
libs/vips/patches/001-no_cpp.patch
File diff suppressed because it is too large
View File


+ 238
- 0
multimedia/gst1-plugins-bad/Makefile View File

@@ -0,0 +1,238 @@
1
+#
2
+# Copyright (C) 2011-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=gst1-plugins-bad
11
+PKG_VERSION:=1.2.3
12
+PKG_RELEASE:=2
13
+
14
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
15
+
16
+PKG_LICENSE:=LGPLv2 GPLv2
17
+PKG_LICENSE_FILE:=COPYING.LIB COPYING
18
+
19
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
20
+PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
21
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
22
+PKG_MD5SUM:=cfd6f303c8df2740b27cc63b945decef
23
+
24
+PKG_BUILD_DEPENDS:= gstreamer1 gst1-plugins-base liboil
25
+
26
+PKG_FIXUP:=autoreconf
27
+PKG_INSTALL:=1
28
+
29
+include $(INCLUDE_DIR)/package.mk
30
+include $(INCLUDE_DIR)/nls.mk
31
+
32
+define Package/gstreamer1/Default
33
+  CATEGORY:=Multimedia
34
+  SECTION:=multimedia
35
+  TITLE:=GStreamer
36
+  URL:=http://gstreamer.freedesktop.org/
37
+  DEPENDS:= $(ICONV_DEPENDS)
38
+endef
39
+
40
+define Package/gstreamer1/description/Default
41
+ GStreamer open source multimedia framework
42
+endef
43
+
44
+
45
+define Package/gst1-plugins-bad
46
+$(call Package/gstreamer1/Default)
47
+  TITLE+= plugins collection (bad)
48
+  DEPENDS+= $(GST_DEPENDS)
49
+endef
50
+
51
+define Package/gts1-plugins-bad/description
52
+$(call Package/gstreamer1/description/Default)
53
+ .
54
+ This meta package contains only dependencies to the other plugins from
55
+ the bad plugins collection.
56
+endef
57
+
58
+
59
+GST_VERSION:=1.0
60
+
61
+CONFIGURE_ARGS += \
62
+	--disable-debug \
63
+	--disable-examples \
64
+	--disable-nls	\
65
+	\
66
+	--disable-directsound \
67
+	--disable-directdraw \
68
+	--disable-osx_video \
69
+	--disable-quicktime \
70
+	--disable-vcd \
71
+	--disable-alsa \
72
+	--disable-assrender \
73
+	--disable-amrwb \
74
+	--disable-apexsink \
75
+	--disable-bz2 \
76
+	--disable-cdaudio \
77
+	--disable-celt \
78
+	--disable-cog \
79
+	--disable-dc1394 \
80
+	--disable-directfb \
81
+	--disable-dirac \
82
+	--disable-dts \
83
+	--disable-divx \
84
+	--disable-resindvd \
85
+	--disable-metadata \
86
+	--disable-faac \
87
+	--disable-faad \
88
+	--disable-fbdev \
89
+	--disable-flite \
90
+	--disable-gsm \
91
+	--disable-jack \
92
+	--disable-jp2k \
93
+	--disable-kate \
94
+	--disable-ladspa \
95
+	--disable-lv2 \
96
+	--disable-modplug \
97
+	--disable-mimic \
98
+	--disable-libmms \
99
+	--disable-mpeg2enc \
100
+	--disable-mplex \
101
+	--disable-musepack \
102
+	--disable-musicbrainz \
103
+	--disable-mythtv \
104
+	--disable-nas \
105
+	--disable-neon \
106
+	--disable-ofa \
107
+	--disable-rsvg \
108
+	--disable-timidity \
109
+	--disable-wildmidi \
110
+	--disable-sdl \
111
+	--disable-sdltest \
112
+	--disable-sndfile \
113
+	--disable-soundtouch \
114
+	--disable-spc \
115
+	--disable-gme \
116
+	--disable-swfdec \
117
+	--disable-theoradec \
118
+	--disable-xvid \
119
+	--disable-dvb \
120
+	--disable-wininet \
121
+	--disable-acm \
122
+	--disable-vdpau \
123
+	--disable-schro \
124
+	--disable-zbar \
125
+	--disable-vp8 \
126
+	\
127
+	--without-libiconv-prefix \
128
+	--without-libintl-prefix \
129
+	--without-x \
130
+
131
+TARGET_CFLAGS+= -std=gnu99
132
+
133
+EXTRA_LDFLAGS+= \
134
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
135
+	$(if $(ICONV_FULL),-liconv) \
136
+
137
+
138
+define Package/gst1-plugins-ugly/install
139
+	/bin/true
140
+endef
141
+
142
+# 1: short name
143
+# 2: description
144
+# 3: dependencies on other gstreamer libraries (short name)
145
+# 4: dependencies on other packages
146
+define GstBuildLibrary
147
+
148
+  GST_DEPENDS += +libgst1$(1)
149
+
150
+  define Package/libgst1$(1)
151
+    $(call Package/gstreamer1/Default)
152
+    TITLE+= $(2) library (base)
153
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $(4)
154
+  endef
155
+
156
+  define Package/libgst1$(1)/description
157
+   $(call Package/gstreamer1/description/Default)
158
+   .
159
+   This package contains the GStreamer $(2) library.
160
+  endef
161
+
162
+  define Package/libgst1$(1)/install
163
+	$(INSTALL_DIR) $$(1)/usr/lib
164
+	( cd $(PKG_INSTALL_DIR); $(CP) \
165
+		./usr/lib/libgst$(1)-$(GST_VERSION).so.* \
166
+		$$(1)/usr/lib/ \
167
+	)
168
+  endef
169
+
170
+  $$(eval $$(call BuildPackage,libgst1$(1)))
171
+endef
172
+
173
+$(eval $(call GstBuildLibrary,photography,photography,,))
174
+$(eval $(call GstBuildLibrary,basecamerabinsrc,basecamerabinsrc,app,))
175
+
176
+# 1: short name
177
+# 2: description
178
+# 3: dependencies on other gstreamer libraries (short name)
179
+# 4: dependencies on other gstreamer plugins (short name)
180
+# 5: dependencies on other packages
181
+define GstBuildPlugin
182
+
183
+  GST_DEPENDS += +gst1-mod-$(1)
184
+
185
+  define Package/gst1-mod-$(1)
186
+    $(call Package/gstreamer1/Default)
187
+    TITLE+= $(2) plugin (bad)
188
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
189
+  endef
190
+
191
+  define Package/gst1-mod-$(1)/description
192
+   $(call Package/gstreamer1/description/Default)
193
+   .
194
+   This package contains the GStreamer $(2) plugin.
195
+  endef
196
+
197
+  define Package/gst1-mod-$(1)/install
198
+	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
199
+	( cd $(PKG_INSTALL_DIR); $(CP) \
200
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
201
+		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
202
+	)
203
+  endef
204
+
205
+  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
206
+endef
207
+
208
+$(eval $(call GstBuildPlugin,adpcmdec,adpcm decoding support,audio,,))
209
+$(eval $(call GstBuildPlugin,adpcmenc,adpcm encoding support,audio,,))
210
+$(eval $(call GstBuildPlugin,aiff,aiff support,audio tag,,))
211
+$(eval $(call GstBuildPlugin,asfmux,asf muxing support,rtp,,))
212
+$(eval $(call GstBuildPlugin,autoconvert,autoconvert support,,,))
213
+$(eval $(call GstBuildPlugin,bayer,bayer support,video,,))
214
+$(eval $(call GstBuildPlugin,camerabin2,camerabin support,basecamerabinsrc photography tag pbutils app,,))
215
+$(eval $(call GstBuildPlugin,dataurisrc,dataurisrc support,,,))
216
+$(eval $(call GstBuildPlugin,debugutilsbad,debugutils support,video,,))
217
+$(eval $(call GstBuildPlugin,dvdspu,dvdspu support,video,,))
218
+$(eval $(call GstBuildPlugin,festival,festival support,audio,,))
219
+$(eval $(call GstBuildPlugin,frei0r,frei0r support,controller video,,))
220
+$(eval $(call GstBuildPlugin,id3tag,id3tag support,tag,,))
221
+$(eval $(call GstBuildPlugin,jpegformat,jpegformat support,tag,,))
222
+$(eval $(call GstBuildPlugin,liveadder,liveadder support,audio,,))
223
+$(eval $(call GstBuildPlugin,mpegpsdemux,mpegpsdemux support,pbutils tag,,))
224
+$(eval $(call GstBuildPlugin,mpegpsmux,mpegpsmux support,,,))
225
+#$(eval $(call GstBuildPlugin,mpegtsdemux,mpegtsdemux support,mpegts pbutils tag,,))
226
+#$(eval $(call GstBuildPlugin,mpegtsmux,mpegtsmux support,video,,))
227
+$(eval $(call GstBuildPlugin,mxf,mxf support,audio video,,))
228
+$(eval $(call GstBuildPlugin,pcapparse,pcapparse support,,,))
229
+$(eval $(call GstBuildPlugin,pnm,pnm support,video,,))
230
+$(eval $(call GstBuildPlugin,rawparse,rawparse support,audio video,,))
231
+$(eval $(call GstBuildPlugin,rfbsrc,librfb support,video,,))
232
+$(eval $(call GstBuildPlugin,sdpelem,sdp support,rtp sdp,,))
233
+$(eval $(call GstBuildPlugin,segmentclip,segmentclip support,audio,,))
234
+$(eval $(call GstBuildPlugin,siren,siren support,audio rtp,,))
235
+$(eval $(call GstBuildPlugin,speed,speed support,audio,,))
236
+$(eval $(call GstBuildPlugin,subenc,subenc support,controller,,))
237
+
238
+$(eval $(call BuildPackage,gst1-plugins-bad))

+ 45
- 0
multimedia/gst1-plugins-bad/patches/000-gettext.patch View File

@@ -0,0 +1,45 @@
1
+diff -u --recursive gst-plugins-bad-1.0.7-vanilla/configure.ac gst-plugins-bad-1.0.7/configure.ac
2
+--- gst-plugins-bad-1.0.7-vanilla/configure.ac	2013-06-01 19:44:32.199308073 -0500
3
++++ gst-plugins-bad-1.0.7/configure.ac	2013-06-01 19:45:27.754119344 -0500
4
+@@ -2373,7 +2373,6 @@
5
+ ext/timidity/Makefile
6
+ ext/xvid/Makefile
7
+ ext/zbar/Makefile
8
+-po/Makefile.in
9
+ docs/Makefile
10
+ docs/plugins/Makefile
11
+ docs/libs/Makefile
12
+diff -u --recursive gst-plugins-bad-1.0.7-vanilla/Makefile.am gst-plugins-bad-1.0.7/Makefile.am
13
+--- gst-plugins-bad-1.0.7-vanilla/Makefile.am	2013-06-01 19:44:32.165309412 -0500
14
++++ gst-plugins-bad-1.0.7/Makefile.am	2013-06-01 19:45:39.016675625 -0500
15
+@@ -2,11 +2,11 @@
16
+ 
17
+ SUBDIRS = \
18
+ 	gst-libs gst sys ext pkgconfig \
19
+-	m4 common docs tests po tools
20
++	m4 common docs tests tools
21
+ 
22
+ DIST_SUBDIRS = \
23
+ 	gst gst-libs sys ext pkgconfig \
24
+-	m4 common docs tests po tools
25
++	m4 common docs tests tools
26
+ 
27
+ # include before EXTRA_DIST for win32 assignment
28
+ include $(top_srcdir)/common/win32.mak
29
+diff -u --recursive gst-plugins-bad-1.0.7-vanilla/Makefile.in gst-plugins-bad-1.0.7/Makefile.in
30
+--- gst-plugins-bad-1.0.7-vanilla/Makefile.in	2013-06-01 19:44:32.217307364 -0500
31
++++ gst-plugins-bad-1.0.7/Makefile.in	2013-06-01 19:45:44.624454691 -0500
32
+@@ -636,11 +636,11 @@
33
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
34
+ SUBDIRS = \
35
+ 	gst-libs gst sys ext pkgconfig \
36
+-	m4 common docs tests po tools
37
++	m4 common docs tests tools
38
+ 
39
+ DIST_SUBDIRS = \
40
+ 	gst gst-libs sys ext pkgconfig \
41
+-	m4 common docs tests po tools
42
++	m4 common docs tests tools
43
+ 
44
+ 
45
+ # the MANIFEST contains all win32 related files that should be disted

+ 242
- 0
multimedia/gst1-plugins-base/Makefile View File

@@ -0,0 +1,242 @@
1
+#
2
+# Copyright (C) 2008-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=gst1-plugins-base
11
+PKG_VERSION:=1.2.3
12
+PKG_RELEASE:=1
13
+
14
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
15
+
16
+PKG_LICENSE:=LGPLv2 GPLv2
17
+PKG_LICENSE_FILE:=COPYING.LIB COPYING
18
+
19
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
20
+PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
21
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/
22
+PKG_MD5SUM:=17aeabfbcd232526f50c9bee375f1b97
23
+
24
+PKG_BUILD_DEPENDS:= gstreamer1 liboil
25
+PKG_CONFIG_DEPENDS:= \
26
+	CONFIG_PACKAGE_gst1-mod-alsa \
27
+	CONFIG_PACKAGE_gst1-mod-app \
28
+	CONFIG_PACKAGE_gst1-mod-audioconvert \
29
+	CONFIG_PACKAGE_gst1-mod-audiorate \
30
+	CONFIG_PACKAGE_gst1-mod-audioresample \
31
+	CONFIG_PACKAGE_gst1-mod-audiotestsrc \
32
+	CONFIG_PACKAGE_gst1-mod-gio \
33
+	CONFIG_PACKAGE_gst1-mod-ogg \
34
+	CONFIG_PACKAGE_gst1-mod-tcp \
35
+	CONFIG_PACKAGE_gst1-mod-theora \
36
+	CONFIG_PACKAGE_gst1-mod-videotestsrc \
37
+	CONFIG_PACKAGE_gst1-mod-volume \
38
+	CONFIG_PACKAGE_gst1-mod-vorbis \
39
+
40
+PKG_FIXUP:=autoreconf
41
+PKG_INSTALL:=1
42
+
43
+include $(INCLUDE_DIR)/package.mk
44
+include $(INCLUDE_DIR)/nls.mk
45
+
46
+define Package/gstreamer1/Default
47
+  CATEGORY:=Multimedia
48
+  SECTION:=multimedia
49
+  TITLE:=GStreamer
50
+  URL:=http://gstreamer.freedesktop.org/
51
+  DEPENDS:= $(ICONV_DEPENDS)
52
+endef
53
+
54
+define Package/gstreamer1/description/Default
55
+ GStreamer open source multimedia framework
56
+endef
57
+
58
+
59
+define Package/gst1-plugins-base
60
+$(call Package/gstreamer1/Default)
61
+  TITLE+= plugins collection (base)
62
+  DEPENDS+= $(GST_DEPENDS)
63
+endef
64
+
65
+define Package/gts1-plugins-base/description
66
+$(call Package/gstreamer1/description/Default)
67
+ .
68
+ This meta package contains only dependencies to the other libraries and
69
+ plugins from the base plugins collection.
70
+endef
71
+
72
+
73
+GST_COND_SELECT = $(patsubst %,$(if $(CONFIG_PACKAGE_gst1-mod-$(1)),--enable,--disable)-%,$(1))
74
+
75
+GST_VERSION:=1.0
76
+
77
+CONFIGURE_ARGS += \
78
+	--disable-debug \
79
+	--disable-examples \
80
+	\
81
+	$(call GST_COND_SELECT,alsa) \
82
+	--disable-alsa-test \
83
+	$(call GST_COND_SELECT,app) \
84
+	$(call GST_COND_SELECT,audioconvert) \
85
+	$(call GST_COND_SELECT,audiorate) \
86
+	$(call GST_COND_SELECT,audioresample) \
87
+	$(call GST_COND_SELECT,audiotestsrc) \
88
+	--disable-cdparanoia \
89
+	--disable-ffmpegcolorspace \
90
+	--disable-freetypetest \
91
+	$(call GST_COND_SELECT,gio) \
92
+	--disable-gnome_vfs \
93
+	--disable-gst_v4l \
94
+	--disable-libvisual \
95
+	$(call GST_COND_SELECT,ogg) \
96
+	--disable-oggtest \
97
+	--disable-pango \
98
+	--disable-subparse \
99
+	$(call GST_COND_SELECT,tcp) \
100
+	$(call GST_COND_SELECT,theora) \
101
+	--disable-videorate \
102
+	--disable-videoscale \
103
+	$(call GST_COND_SELECT,videotestsrc) \
104
+	$(call GST_COND_SELECT,volume) \
105
+	$(call GST_COND_SELECT,vorbis) \
106
+	--disable-vorbistest \
107
+	--disable-x \
108
+	--disable-xshm \
109
+	--disable-xvideo \
110
+	\
111
+	--without-libiconv-prefix \
112
+	--without-libintl-prefix \
113
+	--without-x \
114
+	\
115
+	--with-audioresample-format=int \
116
+
117
+EXTRA_LDFLAGS+= \
118
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
119
+	$(if $(ICONV_FULL),-liconv) \
120
+
121
+
122
+define Build/InstallDev
123
+	$(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION)
124
+	( cd $(PKG_INSTALL_DIR); $(CP) \
125
+		./usr/include/gstreamer-$(GST_VERSION)/* \
126
+		$(1)/usr/include/gstreamer-$(GST_VERSION)/ \
127
+	)
128
+	$(INSTALL_DIR) $(1)/usr/lib
129
+	( cd $(PKG_INSTALL_DIR); $(CP) \
130
+		./usr/lib/libgst*-$(GST_VERSION).{la,so*} \
131
+		$(1)/usr/lib/ \
132
+	)
133
+	$(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
134
+	( cd $(PKG_INSTALL_DIR); $(CP) \
135
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst*.{la,so} \
136
+		$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
137
+	)
138
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
139
+	( cd $(PKG_INSTALL_DIR); $(CP) \
140
+		./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \
141
+		$(1)/usr/lib/pkgconfig/ \
142
+	)
143
+endef
144
+
145
+
146
+define Package/gst1-plugins-base/install
147
+	/bin/true
148
+endef
149
+
150
+
151
+# 1: short name
152
+# 2: description
153
+# 3: dependencies on other gstreamer libraries (short name)
154
+# 4: dependencies on other packages
155
+define GstBuildLibrary
156
+
157
+  GST_DEPENDS += +libgst1$(1)
158
+
159
+  define Package/libgst1$(1)
160
+    $(call Package/gstreamer1/Default)
161
+    TITLE+= $(2) library (base)
162
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $(4)
163
+  endef
164
+
165
+  define Package/libgst1$(1)/description
166
+   $(call Package/gstreamer1/description/Default)
167
+   .
168
+   This package contains the GStreamer $(2) library.
169
+  endef
170
+
171
+  define Package/libgst1$(1)/install
172
+	$(INSTALL_DIR) $$(1)/usr/lib
173
+	( cd $(PKG_INSTALL_DIR); $(CP) \
174
+		./usr/lib/libgst$(1)-$(GST_VERSION).so.* \
175
+		$$(1)/usr/lib/ \
176
+	)
177
+  endef
178
+
179
+  $$(eval $$(call BuildPackage,libgst1$(1)))
180
+endef
181
+
182
+$(eval $(call GstBuildLibrary,app,app,,))
183
+$(eval $(call GstBuildLibrary,audio,audio,tag,))
184
+$(eval $(call GstBuildLibrary,fft,FFT,,))
185
+$(eval $(call GstBuildLibrary,pbutils,utils,audio tag video,))
186
+$(eval $(call GstBuildLibrary,riff,RIFF media,audio tag,,))
187
+$(eval $(call GstBuildLibrary,rtp,RTP,,))
188
+$(eval $(call GstBuildLibrary,rtsp,RTSP,,))
189
+$(eval $(call GstBuildLibrary,sdp,SDP,,))
190
+$(eval $(call GstBuildLibrary,tag,tag support,,))
191
+$(eval $(call GstBuildLibrary,video,video,,))
192
+
193
+
194
+# 1: short name
195
+# 2: description
196
+# 3: dependencies on other gstreamer libraries (short name)
197
+# 4: dependencies on other gstreamer plugins (short name)
198
+# 5: dependencies on other packages
199
+define GstBuildPlugin
200
+
201
+  GST_DEPENDS += +gst1-mod-$(1)
202
+
203
+  define Package/gst1-mod-$(1)
204
+    $(call Package/gstreamer1/Default)
205
+    TITLE+= $(2) plugin (base)
206
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
207
+  endef
208
+
209
+  define Package/gst1-mod-$(1)/description
210
+   $(call Package/gstreamer1/description/Default)
211
+   .
212
+   This package contains the GStreamer $(2) plugin.
213
+  endef
214
+
215
+  define Package/gst1-mod-$(1)/install
216
+	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
217
+	( cd $(PKG_INSTALL_DIR); $(CP) \
218
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
219
+		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
220
+	)
221
+  endef
222
+
223
+  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
224
+endef
225
+
226
+$(eval $(call GstBuildPlugin,alsa,ALSA,audio tag,,+alsa-lib))
227
+$(eval $(call GstBuildPlugin,app,app,app,,))
228
+$(eval $(call GstBuildPlugin,audioconvert,audio format conversion,audio,,))
229
+$(eval $(call GstBuildPlugin,audiorate,audio rate adjusting,audio tag,,))
230
+$(eval $(call GstBuildPlugin,audioresample,audio resampling,audio tag,,))
231
+$(eval $(call GstBuildPlugin,audiotestsrc,audio test,audio tag controller,,))
232
+$(eval $(call GstBuildPlugin,playback,media decoder (v2),pbutils,,))
233
+$(eval $(call GstBuildPlugin,gio,GIO,,,))
234
+$(eval $(call GstBuildPlugin,ogg,Ogg,riff tag pbutils video,,+libogg))
235
+$(eval $(call GstBuildPlugin,tcp,TCP,,,))
236
+$(eval $(call GstBuildPlugin,theora,Theora,tag video,,+libogg +libtheora))
237
+$(eval $(call GstBuildPlugin,typefindfunctions,'typefind' functions,audio pbutils tag video,,))
238
+$(eval $(call GstBuildPlugin,videotestsrc,video test,video,,+liboil))
239
+$(eval $(call GstBuildPlugin,volume,volume,audio controller,,+liboil))
240
+$(eval $(call GstBuildPlugin,vorbis,Vorbis,audio tag,ogg,+libvorbis))
241
+
242
+$(eval $(call BuildPackage,gst1-plugins-base))

+ 36
- 0
multimedia/gst1-plugins-base/patches/001-no_docs.patch View File

@@ -0,0 +1,36 @@
1
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/Makefile.am gst-plugins-base-1.0.7/Makefile.am
2
+--- gst-plugins-base-1.0.7-vanilla/Makefile.am	2013-06-01 22:38:30.495678685 -0500
3
++++ gst-plugins-base-1.0.7/Makefile.am	2013-06-01 22:39:04.374335121 -0500
4
+@@ -12,14 +12,12 @@
5
+ 	gst sys $(SUBDIRS_EXT) 	\
6
+ 	tools 			\
7
+ 	tests 			\
8
+-	docs			\
9
+ 	po 			\
10
+ 	common 			\
11
+ 	m4
12
+ 
13
+ DIST_SUBDIRS = 			\
14
+ 	pkgconfig		\
15
+-	docs			\
16
+ 	gst-libs		\
17
+ 	gst sys ext		\
18
+ 	tools 			\
19
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/Makefile.in gst-plugins-base-1.0.7/Makefile.in
20
+--- gst-plugins-base-1.0.7-vanilla/Makefile.in	2013-06-01 22:38:30.527677416 -0500
21
++++ gst-plugins-base-1.0.7/Makefile.in	2013-06-01 22:38:59.110543873 -0500
22
+@@ -493,14 +493,12 @@
23
+ 	gst sys $(SUBDIRS_EXT) 	\
24
+ 	tools 			\
25
+ 	tests 			\
26
+-	docs			\
27
+ 	po 			\
28
+ 	common 			\
29
+ 	m4
30
+ 
31
+ DIST_SUBDIRS = \
32
+ 	pkgconfig		\
33
+-	docs			\
34
+ 	gst-libs		\
35
+ 	gst sys ext		\
36
+ 	tools 			\

+ 38
- 0
multimedia/gst1-plugins-base/patches/002-no_tests.patch View File

@@ -0,0 +1,38 @@
1
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/Makefile.am gst-plugins-base-1.0.7/Makefile.am
2
+--- gst-plugins-base-1.0.7-vanilla/Makefile.am	2013-06-01 19:49:37.986260708 -0500
3
++++ gst-plugins-base-1.0.7/Makefile.am	2013-06-01 19:49:54.998590479 -0500
4
+@@ -11,7 +11,6 @@
5
+ 	gst-libs 		\
6
+ 	gst sys $(SUBDIRS_EXT) 	\
7
+ 	tools 			\
8
+-	tests 			\
9
+ 	po 			\
10
+ 	common 			\
11
+ 	m4
12
+@@ -21,7 +20,6 @@
13
+ 	gst-libs		\
14
+ 	gst sys ext		\
15
+ 	tools 			\
16
+-	tests 			\
17
+ 	po 			\
18
+ 	common 			\
19
+ 	m4
20
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/Makefile.in gst-plugins-base-1.0.7/Makefile.in
21
+--- gst-plugins-base-1.0.7-vanilla/Makefile.in	2013-06-01 19:49:37.987260668 -0500
22
++++ gst-plugins-base-1.0.7/Makefile.in	2013-06-01 19:49:58.374457466 -0500
23
+@@ -492,7 +492,6 @@
24
+ 	gst-libs 		\
25
+ 	gst sys $(SUBDIRS_EXT) 	\
26
+ 	tools 			\
27
+-	tests 			\
28
+ 	po 			\
29
+ 	common 			\
30
+ 	m4
31
+@@ -502,7 +501,6 @@
32
+ 	gst-libs		\
33
+ 	gst sys ext		\
34
+ 	tools 			\
35
+-	tests 			\
36
+ 	po 			\
37
+ 	common 			\
38
+ 	m4

+ 49
- 0
multimedia/gst1-plugins-base/patches/003-no_translations.patch View File

@@ -0,0 +1,49 @@
1
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/configure.ac gst-plugins-base-1.0.7/configure.ac
2
+--- gst-plugins-base-1.0.7-vanilla/configure.ac	2013-06-01 19:48:21.931257133 -0500
3
++++ gst-plugins-base-1.0.7/configure.ac	2013-06-01 19:51:30.371829534 -0500
4
+@@ -923,7 +923,6 @@
5
+ docs/libs/Makefile
6
+ docs/plugins/Makefile
7
+ docs/version.entities
8
+-po/Makefile.in
9
+ common/Makefile
10
+ common/m4/Makefile
11
+ m4/Makefile
12
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/Makefile.am gst-plugins-base-1.0.7/Makefile.am
13
+--- gst-plugins-base-1.0.7-vanilla/Makefile.am	2013-06-01 19:50:30.232202309 -0500
14
++++ gst-plugins-base-1.0.7/Makefile.am	2013-06-01 19:50:58.973069965 -0500
15
+@@ -11,7 +11,6 @@
16
+ 	gst-libs 		\
17
+ 	gst sys $(SUBDIRS_EXT) 	\
18
+ 	tools 			\
19
+-	po 			\
20
+ 	common 			\
21
+ 	m4
22
+ 
23
+@@ -20,7 +19,6 @@
24
+ 	gst-libs		\
25
+ 	gst sys ext		\
26
+ 	tools 			\
27
+-	po 			\
28
+ 	common 			\
29
+ 	m4
30
+ 
31
+diff -u --recursive gst-plugins-base-1.0.7-vanilla/Makefile.in gst-plugins-base-1.0.7/Makefile.in
32
+--- gst-plugins-base-1.0.7-vanilla/Makefile.in	2013-06-01 19:50:30.233202273 -0500
33
++++ gst-plugins-base-1.0.7/Makefile.in	2013-06-01 19:51:22.796130711 -0500
34
+@@ -492,7 +492,6 @@
35
+ 	gst-libs 		\
36
+ 	gst sys $(SUBDIRS_EXT) 	\
37
+ 	tools 			\
38
+-	po 			\
39
+ 	common 			\
40
+ 	m4
41
+ 
42
+@@ -501,7 +500,6 @@
43
+ 	gst-libs		\
44
+ 	gst sys ext		\
45
+ 	tools 			\
46
+-	po 			\
47
+ 	common 			\
48
+ 	m4
49
+ 

+ 202
- 0
multimedia/gst1-plugins-good/Makefile View File

@@ -0,0 +1,202 @@
1
+## Copyright (C) 2009-2014 OpenWrt.org
2
+#
3
+# This is free software, licensed under the GNU General Public License v2.
4
+# See /LICENSE for more information.
5
+#
6
+
7
+include $(TOPDIR)/rules.mk
8
+
9
+PKG_NAME:=gst1-plugins-good
10
+PKG_VERSION:=1.2.3
11
+PKG_RELEASE:=1
12
+
13
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
14
+
15
+PKG_LICENSE:=LGPLv2
16
+PKG_LICENSE_FILE:=COPYING
17
+
18
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
19
+PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
20
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
21
+PKG_MD5SUM:=1a1f96bc27ad446e559474299160a9a8
22
+
23
+PKG_BUILD_DEPENDS:= gstreamer1 gst1-plugins-base liboil
24
+
25
+PKG_FIXUP:=autoreconf
26
+PKG_INSTALL:=1
27
+
28
+include $(INCLUDE_DIR)/package.mk
29
+include $(INCLUDE_DIR)/nls.mk
30
+
31
+define Package/gstreamer1/Default
32
+  CATEGORY:=Multimedia
33
+  SECTION:=multimedia
34
+  TITLE:=GStreamer
35
+  URL:=http://gstreamer.freedesktop.org/
36
+  DEPENDS:= $(ICONV_DEPENDS)
37
+endef
38
+
39
+define Package/gstreamer1/description/Default
40
+ GStreamer open source multimedia framework
41
+endef
42
+
43
+
44
+define Package/gst1-plugins-good
45
+$(call Package/gstreamer1/Default)
46
+  TITLE+= plugins collection (good)
47
+  DEPENDS+= $(GST_DEPENDS)
48
+endef
49
+
50
+define Package/gts-plugins-good/description
51
+$(call Package/gstreamer1/description/Default)
52
+ .
53
+ This meta package contains only dependencies to the other plugins from
54
+ the good plugins collection.
55
+endef
56
+
57
+
58
+GST_VERSION:=1.0
59
+
60
+CONFIGURE_ARGS += \
61
+	--disable-debug \
62
+	--disable-examples \
63
+	\
64
+	--disable-aalib \
65
+	--disable-annodex \
66
+	--disable-bz2 \
67
+	--disable-cairo \
68
+	--disable-directsound \
69
+	--disable-dv1394 \
70
+	--disable-esd \
71
+	--disable-gconf \
72
+	--disable-gconftool \
73
+	--disable-gdk_pixbuf \
74
+	--disable-gst_v4l2 \
75
+	--disable-hal \
76
+	--disable-libcaca \
77
+	--disable-libdv \
78
+	--disable-osx_audio \
79
+	--disable-osx_video \
80
+	--disable-pulse \
81
+	--disable-qtdemux \
82
+	--disable-rtspmanager \
83
+	--disable-shout2 \
84
+	--disable-sunaudio \
85
+	--disable-wavpack \
86
+	--disable-x \
87
+	--disable-xshm \
88
+	--disable-xvideo \
89
+	--disable-y4m \
90
+	--disable-zlib \
91
+	\
92
+	--without-libiconv-prefix \
93
+	--without-libintl-prefix \
94
+	--without-x \
95
+
96
+EXTRA_LDFLAGS+= \
97
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
98
+	$(if $(ICONV_FULL),-liconv) \
99
+
100
+
101
+define Package/gst1-plugins-good/install
102
+	/bin/true
103
+endef
104
+
105
+
106
+# 1: short name
107
+# 2: description
108
+# 3: dependencies on other gstreamer libraries (short name)
109
+# 4: dependencies on other gstreamer plugins (short name)
110
+# 5: dependencies on other packages
111
+define GstBuildPlugin
112
+
113
+  GST_DEPENDS += +gst1-mod-$(1)
114
+
115
+  define Package/gst1-mod-$(1)
116
+    $(call Package/gstreamer1/Default)
117
+    TITLE+= $(2) plugin (good)
118
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
119
+  endef
120
+
121
+  define Package/gst1-mod-$(1)/description
122
+   $(call Package/gstreamer1/description/Default)
123
+   .
124
+   This package contains the GStreamer $(2) plugin.
125
+  endef
126
+
127
+  define Package/gst1-mod-$(1)/install
128
+	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
129
+	( cd $(PKG_INSTALL_DIR); $(CP) \
130
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
131
+		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
132
+	)
133
+  endef
134
+
135
+  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
136
+endef
137
+
138
+#$(eval $(call GstBuildPlugin,1394,IEEE 1394 support,,,))
139
+$(eval $(call GstBuildPlugin,alaw,alaw codec,audio,,))
140
+$(eval $(call GstBuildPlugin,alpha,alpha support,video,,))
141
+$(eval $(call GstBuildPlugin,alphacolor,alphacolor support,video,,))
142
+$(eval $(call GstBuildPlugin,apetag,apetag support,audio pbutils tag video,,))
143
+$(eval $(call GstBuildPlugin,audiofx,audio effects,audio fft controller,,))
144
+$(eval $(call GstBuildPlugin,audioparsers,audioparsers,audio tag pbutils,,))
145
+$(eval $(call GstBuildPlugin,auparse,auparse,audio tag pbutils,,))
146
+$(eval $(call GstBuildPlugin,autodetect,format auto-detection,,,))
147
+$(eval $(call GstBuildPlugin,avi,avi support,audio riff tag video,,))
148
+$(eval $(call GstBuildPlugin,cutter,audio cutter,audio,,))
149
+$(eval $(call GstBuildPlugin,debug,debugging,,,))
150
+$(eval $(call GstBuildPlugin,deinterlace,deinterlace support,video,,))
151
+$(eval $(call GstBuildPlugin,dtmf,dtmf support,rtp,,))
152
+#$(eval $(call GstBuildPlugin,dv,dv support,audio tag video,,))
153
+$(eval $(call GstBuildPlugin,effectv,effectvsupport,video,,))
154
+$(eval $(call GstBuildPlugin,equalizer,audio equalizer,audio controller,,))
155
+$(eval $(call GstBuildPlugin,flac,FLAC codec,audio pbutils tag,,+libflac))
156
+$(eval $(call GstBuildPlugin,flv,flv codec,audio pbutils tag video,,))
157
+$(eval $(call GstBuildPlugin,flxdec,flx codec,,,))
158
+#$(eval $(call GstBuildPlugin,gdkpixbuf,gdkpixbuf support,video,,))
159
+$(eval $(call GstBuildPlugin,goom2k1,goom support,,,))
160
+$(eval $(call GstBuildPlugin,goom,goom support,,,))
161
+$(eval $(call GstBuildPlugin,icydemux,icy demuxer,audio tag,,))
162
+$(eval $(call GstBuildPlugin,id3demux,ID3v1/v2 demuxer,pbutils tag,,))
163
+$(eval $(call GstBuildPlugin,imagefreeze,imagefreeze support,,,))
164
+$(eval $(call GstBuildPlugin,interleave,audio interleave,audio,,))
165
+$(eval $(call GstBuildPlugin,isomp4,isomp4 support,audio pbutils riff rtp tag video,,))
166
+#$(eval $(call GstBuildPlugin,jack,jack support,audio,,))
167
+$(eval $(call GstBuildPlugin,jpeg,jpeg support,video,,+libjpeg))
168
+$(eval $(call GstBuildPlugin,level,audio level,audio,,))
169
+$(eval $(call GstBuildPlugin,matroska,matroska support,audio pbutils riff tag video,,))
170
+$(eval $(call GstBuildPlugin,mulaw,mulaw support,audio,,))
171
+$(eval $(call GstBuildPlugin,multifile,multiple files access,video,,))
172
+$(eval $(call GstBuildPlugin,multipart,multipart stream handling,,,))
173
+$(eval $(call GstBuildPlugin,navigationtest,navigationtest support,video,,))
174
+$(eval $(call GstBuildPlugin,oss4audio,OSS 4 audio support,audio tag,,))
175
+$(eval $(call GstBuildPlugin,ossaudio,OSS audio support,audio,,))
176
+$(eval $(call GstBuildPlugin,png,png support,video,,+libpng))
177
+#$(eval $(call GstBuildPlugin,pulse,pulse support,audio pbutils tag video,,))
178
+$(eval $(call GstBuildPlugin,replaygain,volume normalization,pbutils,,))
179
+$(eval $(call GstBuildPlugin,rtpmanager,RTP manager,audio net rtp tag pbutils video,,))
180
+$(eval $(call GstBuildPlugin,rtp,RTP,audio rtp tag pbutils video,,))
181
+$(eval $(call GstBuildPlugin,rtsp,RTSP,net rtp rtsp sdp,,))
182
+$(eval $(call GstBuildPlugin,shapewipe,shapewipe support,video,,))
183
+#$(eval $(call GstBuildPlugin,shout2,shout2 support,,,))
184
+$(eval $(call GstBuildPlugin,smpte,smpte support,video,,))
185
+$(eval $(call GstBuildPlugin,souphttpsrc,soup input,audio tag,,+libsoup))
186
+$(eval $(call GstBuildPlugin,spectrum,spectrum data output,audio fft,,))
187
+#$(eval $(call GstBuildPlugin,speex,speex support,audio tag,,))
188
+#$(eval $(call GstBuildPlugin,sty4menc,sty4menc support,video,,))
189
+#$(eval $(call GstBuildPlugin,taglib,taglib support,tag,,))
190
+$(eval $(call GstBuildPlugin,udp,UDP,net,,))
191
+#$(eval $(call GstBuildPlugin,video4linux2,video4linux2 support,video,,))
192
+$(eval $(call GstBuildPlugin,videobox,videobox support,video,,))
193
+$(eval $(call GstBuildPlugin,videocrop,videocrop support,video,,))
194
+$(eval $(call GstBuildPlugin,videofilter,videofilter support,video,,))
195
+$(eval $(call GstBuildPlugin,videomixer,videomixer support,video,,))
196
+#$(eval $(call GstBuildPlugin,vpx,vpx support,tag video,,))
197
+$(eval $(call GstBuildPlugin,wavenc,Wav encoder,riff,,))
198
+#$(eval $(call GstBuildPlugin,wavpack,Wav packer,audio riff tag,,))
199
+$(eval $(call GstBuildPlugin,wavparse,Wav parser,audio riff tag,,))
200
+#$(eval $(call GstBuildPlugin,ximagesrc,ximagesrc support,video,,))
201
+
202
+$(eval $(call BuildPackage,gst1-plugins-good))

+ 22
- 0
multimedia/gst1-plugins-good/patches/001-no_docs.patch View File

@@ -0,0 +1,22 @@
1
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/Makefile.am gst-plugins-good-1.0.7/Makefile.am
2
+--- gst-plugins-good-1.0.7-vanilla/Makefile.am	2013-06-01 19:54:57.652601127 -0500
3
++++ gst-plugins-good-1.0.7/Makefile.am	2013-06-01 19:55:15.281902215 -0500
4
+@@ -3,7 +3,6 @@
5
+ ALWAYS_SUBDIRS =		\
6
+ 	gst sys ext 		\
7
+ 	tests			\
8
+-	docs			\
9
+ 	po			\
10
+ 	common			\
11
+ 	m4			\
12
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/Makefile.in gst-plugins-good-1.0.7/Makefile.in
13
+--- gst-plugins-good-1.0.7-vanilla/Makefile.in	2013-06-01 19:54:57.692599541 -0500
14
++++ gst-plugins-good-1.0.7/Makefile.in	2013-06-01 19:55:23.025595255 -0500
15
+@@ -523,7 +523,6 @@
16
+ ALWAYS_SUBDIRS = \
17
+ 	gst sys ext 		\
18
+ 	tests			\
19
+-	docs			\
20
+ 	po			\
21
+ 	common			\
22
+ 	m4			\

+ 22
- 0
multimedia/gst1-plugins-good/patches/002-no_tests.patch View File

@@ -0,0 +1,22 @@
1
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/Makefile.am gst-plugins-good-1.0.7/Makefile.am
2
+--- gst-plugins-good-1.0.7-vanilla/Makefile.am	2013-06-01 19:56:00.995090476 -0500
3
++++ gst-plugins-good-1.0.7/Makefile.am	2013-06-01 19:56:12.911618318 -0500
4
+@@ -2,7 +2,6 @@
5
+ 
6
+ ALWAYS_SUBDIRS =		\
7
+ 	gst sys ext 		\
8
+-	tests			\
9
+ 	po			\
10
+ 	common			\
11
+ 	m4			\
12
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/Makefile.in gst-plugins-good-1.0.7/Makefile.in
13
+--- gst-plugins-good-1.0.7-vanilla/Makefile.in	2013-06-01 19:56:00.995090476 -0500
14
++++ gst-plugins-good-1.0.7/Makefile.in	2013-06-01 19:56:16.655469989 -0500
15
+@@ -522,7 +522,6 @@
16
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
17
+ ALWAYS_SUBDIRS = \
18
+ 	gst sys ext 		\
19
+-	tests			\
20
+ 	po			\
21
+ 	common			\
22
+ 	m4			\

+ 33
- 0
multimedia/gst1-plugins-good/patches/003-no_translations.patch View File

@@ -0,0 +1,33 @@
1
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/configure.ac gst-plugins-good-1.0.7/configure.ac
2
+--- gst-plugins-good-1.0.7-vanilla/configure.ac	2013-06-01 19:56:23.004218467 -0500
3
++++ gst-plugins-good-1.0.7/configure.ac	2013-06-01 19:56:52.919033496 -0500
4
+@@ -1157,7 +1157,6 @@
5
+ sys/v4l2/Makefile
6
+ sys/waveform/Makefile
7
+ sys/ximage/Makefile
8
+-po/Makefile.in
9
+ tests/Makefile
10
+ tests/check/Makefile
11
+ tests/examples/Makefile
12
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/Makefile.am gst-plugins-good-1.0.7/Makefile.am
13
+--- gst-plugins-good-1.0.7-vanilla/Makefile.am	2013-06-01 19:56:23.043216922 -0500
14
++++ gst-plugins-good-1.0.7/Makefile.am	2013-06-01 19:56:43.671399777 -0500
15
+@@ -2,7 +2,6 @@
16
+ 
17
+ ALWAYS_SUBDIRS =		\
18
+ 	gst sys ext 		\
19
+-	po			\
20
+ 	common			\
21
+ 	m4			\
22
+ 	pkgconfig
23
+diff -u --recursive gst-plugins-good-1.0.7-vanilla/Makefile.in gst-plugins-good-1.0.7/Makefile.in
24
+--- gst-plugins-good-1.0.7-vanilla/Makefile.in	2013-06-01 19:56:23.043216922 -0500
25
++++ gst-plugins-good-1.0.7/Makefile.in	2013-06-01 19:56:47.703240080 -0500
26
+@@ -522,7 +522,6 @@
27
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
28
+ ALWAYS_SUBDIRS = \
29
+ 	gst sys ext 		\
30
+-	po			\
31
+ 	common			\
32
+ 	m4			\
33
+ 	pkgconfig

+ 142
- 0
multimedia/gst1-plugins-ugly/Makefile View File

@@ -0,0 +1,142 @@
1
+#
2
+# Copyright (C) 2009-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=gst1-plugins-ugly
11
+PKG_VERSION:=1.2.3
12
+PKG_RELEASE:=1
13
+
14
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
15
+
16
+PKG_LICENSE:=LGPLv2
17
+PKG_LICENSE_FILE:=COPYING
18
+
19
+PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
20
+PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
21
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/
22
+PKG_MD5SUM:=7ae60e2f759f58f32af5fcdc3c9193c4
23
+
24
+PKG_BUILD_DEPENDS:= gstreamer1 gst1-plugins-base liboil
25
+PKG_CONFIG_DEPENDS:= \
26
+	CONFIG_PACKAGE_gst1-mod-asf \
27
+	CONFIG_PACKAGE_gst1-mod-lame \
28
+	CONFIG_PACKAGE_gst1-mod-mad \
29
+	CONFIG_PACKAGE_gst1-mod-mpeg2dec \
30
+
31
+PKG_FIXUP:=autoreconf
32
+PKG_INSTALL:=1
33
+
34
+include $(INCLUDE_DIR)/package.mk
35
+include $(INCLUDE_DIR)/nls.mk
36
+
37
+define Package/gstreamer1/Default
38
+  CATEGORY:=Multimedia
39
+  SECTION:=multimedia
40
+  TITLE:=GStreamer
41
+  URL:=http://gstreamer.freedesktop.org/
42
+  DEPENDS:= $(ICONV_DEPENDS)
43
+endef
44
+
45
+define Package/gstreamer1/description/Default
46
+ GStreamer open source multimedia framework
47
+endef
48
+
49
+
50
+define Package/gst1-plugins-ugly
51
+$(call Package/gstreamer1/Default)
52
+  TITLE+= plugins collection (ugly)
53
+  DEPENDS+= $(GST_DEPENDS)
54
+endef
55
+
56
+define Package/gts-plugins-ugly/description
57
+$(call Package/gstreamer1/description/Default)
58
+ .
59
+ This meta package contains only dependencies to the other plugins from
60
+ the ugly plugins collection.
61
+endef
62
+
63
+
64
+GST_COND_SELECT = $(patsubst %,$(if $(CONFIG_PACKAGE_gst1-mod-$(1)),--enable,--disable)-%,$(1))
65
+
66
+GST_VERSION:=1.0
67
+
68
+CONFIGURE_ARGS += \
69
+	--disable-debug \
70
+	--disable-examples \
71
+	\
72
+	--disable-a52dec \
73
+	--disable-amrnb \
74
+	--disable-amrwb \
75
+	$(call GST_COND_SELECT,asf) \
76
+	--disable-cdio \
77
+	--disable-dvdlpcmdec \
78
+	--disable-dvdread \
79
+	--disable-dvdsub \
80
+	--disable-iec958 \
81
+	$(call GST_COND_SELECT,lame) \
82
+	$(call GST_COND_SELECT,mad) \
83
+	$(call GST_COND_SELECT,mpeg2dec) \
84
+	--disable-mpegaudioparse \
85
+	--disable-mpegstream \
86
+	--disable-realmedia \
87
+	--disable-sidplay \
88
+	--disable-synaesthesia \
89
+	--disable-twolame \
90
+	--disable-x264 \
91
+	\
92
+	--without-libiconv-prefix \
93
+	--without-libintl-prefix \
94
+
95
+EXTRA_LDFLAGS+= \
96
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
97
+	$(if $(ICONV_FULL),-liconv) \
98
+
99
+
100
+define Package/gst1-plugins-ugly/install
101
+	/bin/true
102
+endef
103
+
104
+
105
+# 1: short name
106
+# 2: description
107
+# 3: dependencies on other gstreamer libraries (short name)
108
+# 4: dependencies on other gstreamer plugins (short name)
109
+# 5: dependencies on other packages
110
+define GstBuildPlugin
111
+
112
+  GST_DEPENDS += +gst1-mod-$(1)
113
+
114
+  define Package/gst1-mod-$(1)
115
+    $(call Package/gstreamer1/Default)
116
+    TITLE+= $(2) plugin (ugly)
117
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $$(foreach p,$(4),+gst1-mod-$$(p)) $(5)
118
+  endef
119
+
120
+  define Package/gst1-mod-$(1)/description
121
+   $(call Package/gstreamer1/description/Default)
122
+   .
123
+   This package contains the GStreamer $(2) plugin.
124
+  endef
125
+
126
+  define Package/gst1-mod-$(1)/install
127
+	$(INSTALL_DIR) $$(1)/usr/lib/gstreamer-$(GST_VERSION)
128
+	( cd $(PKG_INSTALL_DIR); $(CP) \
129
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst$(1).so* \
130
+		$$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
131
+	)
132
+  endef
133
+
134
+  $$(eval $$(call BuildPackage,gst1-mod-$(1)))
135
+endef
136
+
137
+$(eval $(call GstBuildPlugin,asf,ASF demuxer,audio riff rtp rtsp sdp tag,,))
138
+$(eval $(call GstBuildPlugin,lame,MP3 encoder (using LAME),audio,,+lame-lib))
139
+$(eval $(call GstBuildPlugin,mad,MP3 decoder (using MAD),audio tag,,+libid3tag +libmad))
140
+$(eval $(call GstBuildPlugin,mpeg2dec,MPEG decoder,video,,+libmpeg2))
141
+
142
+$(eval $(call BuildPackage,gst1-plugins-ugly))

+ 24
- 0
multimedia/gst1-plugins-ugly/patches/001-no_docs.patch View File

@@ -0,0 +1,24 @@
1
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/Makefile.am gst-plugins-ugly-1.0.7/Makefile.am
2
+--- gst-plugins-ugly-1.0.7-vanilla/Makefile.am	2013-06-01 19:58:12.400886469 -0500
3
++++ gst-plugins-ugly-1.0.7/Makefile.am	2013-06-01 19:58:33.306059047 -0500
4
+@@ -1,7 +1,7 @@
5
+ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
6
+ 
7
+ SUBDIRS = \
8
+-	gst-libs gst ext docs m4 tests common pkgconfig po
9
++	gst-libs gst ext m4 tests common pkgconfig po
10
+ 
11
+ # include before EXTRA_DIST for win32 assignment
12
+ include $(top_srcdir)/common/win32.mak
13
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/Makefile.in gst-plugins-ugly-1.0.7/Makefile.in
14
+--- gst-plugins-ugly-1.0.7-vanilla/Makefile.in	2013-06-01 19:58:12.412885994 -0500
15
++++ gst-plugins-ugly-1.0.7/Makefile.in	2013-06-01 19:58:39.810801615 -0500
16
+@@ -453,7 +453,7 @@
17
+ top_srcdir = @top_srcdir@
18
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
19
+ SUBDIRS = \
20
+-	gst-libs gst ext docs m4 tests common pkgconfig po
21
++	gst-libs gst ext m4 tests common pkgconfig po
22
+ 
23
+ 
24
+ # the MANIFEST contains all win32 related files that should be disted

+ 24
- 0
multimedia/gst1-plugins-ugly/patches/002-no_tests.patch View File

@@ -0,0 +1,24 @@
1
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/Makefile.am gst-plugins-ugly-1.0.7/Makefile.am
2
+--- gst-plugins-ugly-1.0.7-vanilla/Makefile.am	2013-06-01 19:59:16.988330482 -0500
3
++++ gst-plugins-ugly-1.0.7/Makefile.am	2013-06-01 19:59:28.455876771 -0500
4
+@@ -1,7 +1,7 @@
5
+ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
6
+ 
7
+ SUBDIRS = \
8
+-	gst-libs gst ext m4 tests common pkgconfig po
9
++	gst-libs gst ext m4 common pkgconfig po
10
+ 
11
+ # include before EXTRA_DIST for win32 assignment
12
+ include $(top_srcdir)/common/win32.mak
13
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/Makefile.in gst-plugins-ugly-1.0.7/Makefile.in
14
+--- gst-plugins-ugly-1.0.7-vanilla/Makefile.in	2013-06-01 19:59:16.988330482 -0500
15
++++ gst-plugins-ugly-1.0.7/Makefile.in	2013-06-01 19:59:39.840426385 -0500
16
+@@ -453,7 +453,7 @@
17
+ top_srcdir = @top_srcdir@
18
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
19
+ SUBDIRS = \
20
+-	gst-libs gst ext m4 tests common pkgconfig po
21
++	gst-libs gst ext m4 common pkgconfig po
22
+ 
23
+ 
24
+ # the MANIFEST contains all win32 related files that should be disted

+ 35
- 0
multimedia/gst1-plugins-ugly/patches/003-no_translations.patch View File

@@ -0,0 +1,35 @@
1
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/configure.ac gst-plugins-ugly-1.0.7/configure.ac
2
+--- gst-plugins-ugly-1.0.7-vanilla/configure.ac	2013-06-01 19:59:46.199174835 -0500
3
++++ gst-plugins-ugly-1.0.7/configure.ac	2013-06-01 20:00:29.709453831 -0500
4
+@@ -479,7 +479,6 @@
5
+ tests/Makefile
6
+ tests/check/Makefile
7
+ m4/Makefile
8
+-po/Makefile.in
9
+ pkgconfig/Makefile
10
+ pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
11
+ gst-plugins-ugly.spec
12
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/Makefile.am gst-plugins-ugly-1.0.7/Makefile.am
13
+--- gst-plugins-ugly-1.0.7-vanilla/Makefile.am	2013-06-01 19:59:46.210174399 -0500
14
++++ gst-plugins-ugly-1.0.7/Makefile.am	2013-06-01 20:00:11.351179921 -0500
15
+@@ -1,7 +1,7 @@
16
+ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
17
+ 
18
+ SUBDIRS = \
19
+-	gst-libs gst ext m4 common pkgconfig po
20
++	gst-libs gst ext m4 common pkgconfig
21
+ 
22
+ # include before EXTRA_DIST for win32 assignment
23
+ include $(top_srcdir)/common/win32.mak
24
+diff -u --recursive gst-plugins-ugly-1.0.7-vanilla/Makefile.in gst-plugins-ugly-1.0.7/Makefile.in
25
+--- gst-plugins-ugly-1.0.7-vanilla/Makefile.in	2013-06-01 19:59:46.210174399 -0500
26
++++ gst-plugins-ugly-1.0.7/Makefile.in	2013-06-01 20:00:20.222829049 -0500
27
+@@ -453,7 +453,7 @@
28
+ top_srcdir = @top_srcdir@
29
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
30
+ SUBDIRS = \
31
+-	gst-libs gst ext m4 common pkgconfig po
32
++	gst-libs gst ext m4 common pkgconfig
33
+ 
34
+ 
35
+ # the MANIFEST contains all win32 related files that should be disted

+ 195
- 0
multimedia/gstreamer1/Makefile View File

@@ -0,0 +1,195 @@
1
+#
2
+# Copyright (C) 2008-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=gstreamer1
11
+PKG_VERSION:=1.2.3
12
+PKG_RELEASE:=1
13
+
14
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
15
+
16
+PKG_LICENSE:=LGPLv2
17
+PKG_LICENSE_FILE:=COPYING
18
+
19
+PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
20
+PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
21
+PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
22
+PKG_MD5SUM:=8155b9c7574ccaa361cc504e8e0e72dc
23
+
24
+PKG_FIXUP:=autoreconf
25
+PKG_REMOVE_FILES:=autogen.sh aclocal.m4
26
+
27
+PKG_INSTALL:=1
28
+
29
+include $(INCLUDE_DIR)/package.mk
30
+include $(INCLUDE_DIR)/nls.mk
31
+
32
+define Package/gstreamer1/Default
33
+  CATEGORY:=Multimedia
34
+  SECTION:=multimedia
35
+  TITLE:=GStreamer
36
+  URL:=http://gstreamer.freedesktop.org/
37
+  DEPENDS:= $(ICONV_DEPENDS) $(INTL_DEPENDS)
38
+endef
39
+
40
+define Package/gstreamer1/description/Default
41
+ GStreamer open source multimedia framework
42
+endef
43
+
44
+
45
+define Package/gstreamer1
46
+$(call Package/gstreamer1/Default)
47
+  TITLE+= framework
48
+  DEPENDS+= +libgstreamer1 \
49
+	+libgst1check \
50
+	+libgst1controller \
51
+	+libgst1net
52
+endef
53
+
54
+define Package/gstreamer1/description
55
+$(call Package/gstreamer1/description/Default)
56
+ .
57
+ This meta package contains only dependencies on the other GStreamer
58
+ componenents.
59
+endef
60
+
61
+
62
+define Package/gstreamer1-utils
63
+$(call Package/gstreamer1/Default)
64
+  TITLE+= utilities
65
+  DEPENDS+= +libgstreamer1
66
+endef
67
+
68
+define Package/gstreamer1-utils/description
69
+$(call Package/gstreamer1/description/Default)
70
+ .
71
+ This package contains the GStreamer utilities.
72
+endef
73
+
74
+
75
+define Package/libgstreamer1
76
+$(call Package/gstreamer1/Default)
77
+  TITLE+= library (core)
78
+  DEPENDS+= +glib2 +libpthread +libxml2
79
+endef
80
+
81
+define Package/libgstreamer1/description
82
+$(call Package/gstreamer1/description/Default)
83
+ .
84
+ This package contains the GStreamer core library.
85
+endef
86
+  
87
+
88
+GST_VERSION:=1.0
89
+
90
+CONFIGURE_ARGS += \
91
+	--enable-static \
92
+	--disable-examples \
93
+	--disable-tests \
94
+	--disable-valgrind \
95
+	--without-libiconv-prefix \
96
+	--without-libintl-prefix \
97
+	--without-x \
98
+
99
+EXTRA_LDFLAGS+= \
100
+	-Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
101
+	$(if $(ICONV_FULL),-liconv)
102
+
103
+define Build/InstallDev
104
+	$(INSTALL_DIR) $(1)/usr/include/gstreamer-$(GST_VERSION)
105
+	( cd $(PKG_INSTALL_DIR); $(CP) \
106
+		./usr/include/gstreamer-$(GST_VERSION)/* \
107
+		$(1)/usr/include/gstreamer-$(GST_VERSION)/ \
108
+	)
109
+	$(INSTALL_DIR) $(1)/usr/lib
110
+	( cd $(PKG_INSTALL_DIR); $(CP) \
111
+		./usr/lib/libgst*-$(GST_VERSION).{a,la,so*} \
112
+		$(1)/usr/lib/ \
113
+	)
114
+	$(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
115
+	( cd $(PKG_INSTALL_DIR); $(CP) \
116
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst*.{la,so} \
117
+		$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
118
+	)
119
+	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
120
+	( cd $(PKG_INSTALL_DIR); $(CP) \
121
+		./usr/lib/pkgconfig/gstreamer*-$(GST_VERSION).pc \
122
+		$(1)/usr/lib/pkgconfig/ \
123
+	)
124
+	$(INSTALL_DIR) $(2)/share/aclocal
125
+	( cd $(PKG_INSTALL_DIR); $(CP) \
126
+		./usr/share/aclocal/* \
127
+		$(2)/share/aclocal/ \
128
+	)
129
+endef
130
+
131
+define Package/gstreamer1/install
132
+	/bin/true
133
+endef
134
+
135
+define Package/gstreamer1-utils/install
136
+	$(INSTALL_DIR) $(1)/usr/bin
137
+	( cd $(PKG_INSTALL_DIR); $(CP) \
138
+		./usr/bin/gst-launch* \
139
+		./usr/bin/gst-inspect* \
140
+		./usr/bin/gst-typefind* \
141
+		$(1)/usr/bin/ \
142
+	)
143
+endef
144
+
145
+define Package/libgstreamer1/install
146
+	$(INSTALL_DIR) $(1)/usr/lib
147
+	( cd $(PKG_INSTALL_DIR); $(CP) \
148
+		./usr/lib/libgstbase-$(GST_VERSION).so.* \
149
+		./usr/lib/libgstreamer-$(GST_VERSION).so.* \
150
+		$(1)/usr/lib/ \
151
+	)
152
+	$(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
153
+	( cd $(PKG_INSTALL_DIR); $(CP) \
154
+		./usr/lib/gstreamer-$(GST_VERSION)/libgst*.so \
155
+		$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
156
+	)
157
+endef
158
+
159
+
160
+# 1: short name
161
+# 2: description
162
+# 3: dependencies on other gstreamer libraries (short name)
163
+# 4: dependencies on other packages
164
+define GstBuildLibrary
165
+
166
+  define Package/libgst1$(1)
167
+    $(call Package/gstreamer1/Default)
168
+    TITLE+= $(2) library (core)
169
+    DEPENDS+= +libgstreamer1 $$(foreach p,$(3),+libgst1$$(p)) $(4)
170
+  endef
171
+
172
+  define Package/libgst1$(1)/description
173
+   $(call Package/gstreamer1/description/Default)
174
+   .
175
+   This package contains the GStreamer $(2) library.
176
+  endef
177
+
178
+  define Package/libgst1$(1)/install
179
+	$(INSTALL_DIR) $$(1)/usr/lib
180
+	( cd $(PKG_INSTALL_DIR); $(CP) \
181
+		./usr/lib/libgst$(1)-$(GST_VERSION).so.* \
182
+		$$(1)/usr/lib/ \
183
+	)
184
+  endef
185
+
186
+  $$(eval $$(call BuildPackage,libgst1$(1)))
187
+endef
188
+
189
+$(eval $(call GstBuildLibrary,check,check unit testing))
190
+$(eval $(call GstBuildLibrary,controller,dynamic parameter control))
191
+$(eval $(call GstBuildLibrary,net,network classes))
192
+
193
+$(eval $(call BuildPackage,libgstreamer1))
194
+$(eval $(call BuildPackage,gstreamer1))
195
+$(eval $(call BuildPackage,gstreamer1-utils))

+ 37
- 0
multimedia/gstreamer1/patches/001-no_docs.patch View File

@@ -0,0 +1,37 @@
1
+diff -u --recursive gstreamer-1.0.7-vanilla/Makefile.am gstreamer-1.0.7/Makefile.am
2
+--- gstreamer-1.0.7-vanilla/Makefile.am	2013-06-01 18:47:44.498057069 -0500
3
++++ gstreamer-1.0.7/Makefile.am	2013-06-01 19:01:41.634143861 -0500
4
+@@ -8,7 +8,6 @@
5
+ 
6
+ SUBDIRS = pkgconfig \
7
+ 	gst libs plugins tests \
8
+-	docs \
9
+ 	po \
10
+ 	m4 \
11
+ 	common
12
+@@ -20,7 +19,6 @@
13
+ # These are all the possible subdirs
14
+ DIST_SUBDIRS = pkgconfig \
15
+ 	gst libs plugins tools tests \
16
+-	docs \
17
+ 	po \
18
+ 	m4 \
19
+ 	common
20
+diff -u --recursive gstreamer-1.0.7-vanilla/Makefile.in gstreamer-1.0.7/Makefile.in
21
+--- gstreamer-1.0.7-vanilla/Makefile.in	2013-06-01 18:47:44.533056863 -0500
22
++++ gstreamer-1.0.7/Makefile.in	2013-06-01 19:02:04.529246907 -0500
23
+@@ -508,13 +508,12 @@
24
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-docbook
25
+ aclocaldir = $(datadir)/aclocal
26
+ aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
27
+-SUBDIRS = pkgconfig gst libs plugins tests docs po m4 common \
28
++SUBDIRS = pkgconfig gst libs plugins tests po m4 common \
29
+ 	$(am__append_1)
30
+ 
31
+ # These are all the possible subdirs
32
+ DIST_SUBDIRS = pkgconfig \
33
+ 	gst libs plugins tools tests \
34
+-	docs \
35
+ 	po \
36
+ 	m4 \
37
+ 	common

+ 39
- 0
multimedia/gstreamer1/patches/002-no_tests.patch View File

@@ -0,0 +1,39 @@
1
+diff -u --recursive gstreamer-1.0.7-vanilla/Makefile.am gstreamer-1.0.7/Makefile.am
2
+--- gstreamer-1.0.7-vanilla/Makefile.am	2013-06-01 19:22:31.546496381 -0500
3
++++ gstreamer-1.0.7/Makefile.am	2013-06-01 19:20:38.141070908 -0500
4
+@@ -7,7 +7,7 @@
5
+ aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
6
+ 
7
+ SUBDIRS = pkgconfig \
8
+-	gst libs plugins tests \
9
++	gst libs plugins \
10
+ 	po \
11
+ 	m4 \
12
+ 	common
13
+@@ -18,7 +18,7 @@
14
+ 
15
+ # These are all the possible subdirs
16
+ DIST_SUBDIRS = pkgconfig \
17
+-	gst libs plugins tools tests \
18
++	gst libs plugins tools \
19
+ 	po \
20
+ 	m4 \
21
+ 	common
22
+diff -u --recursive gstreamer-1.0.7-vanilla/Makefile.in gstreamer-1.0.7/Makefile.in
23
+--- gstreamer-1.0.7-vanilla/Makefile.in	2013-06-01 19:22:31.547496342 -0500
24
++++ gstreamer-1.0.7/Makefile.in	2013-06-01 19:20:48.948632307 -0500
25
+@@ -508,12 +508,12 @@
26
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-docbook
27
+ aclocaldir = $(datadir)/aclocal
28
+ aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
29
+-SUBDIRS = pkgconfig gst libs plugins tests po m4 common \
30
++SUBDIRS = pkgconfig gst libs plugins po m4 common \
31
+ 	$(am__append_1)
32
+ 
33
+ # These are all the possible subdirs
34
+ DIST_SUBDIRS = pkgconfig \
35
+-	gst libs plugins tools tests \
36
++	gst libs plugins tools \
37
+ 	po \
38
+ 	m4 \
39
+ 	common

+ 48
- 0
multimedia/gstreamer1/patches/003-no_translations.patch View File

@@ -0,0 +1,48 @@
1
+diff -u --recursive gstreamer-1.0.7-vanilla/configure.ac gstreamer-1.0.7/configure.ac
2
+--- gstreamer-1.0.7-vanilla/configure.ac	2013-06-01 18:47:44.506057110 -0500
3
++++ gstreamer-1.0.7/configure.ac	2013-06-01 19:24:05.035756124 -0500
4
+@@ -769,7 +769,6 @@
5
+ libs/gst/net/Makefile
6
+ plugins/Makefile
7
+ plugins/elements/Makefile
8
+-po/Makefile.in
9
+ tests/Makefile
10
+ tests/benchmarks/Makefile
11
+ tests/check/Makefile
12
+diff -u --recursive gstreamer-1.0.7-vanilla/Makefile.am gstreamer-1.0.7/Makefile.am
13
+--- gstreamer-1.0.7-vanilla/Makefile.am	2013-06-01 19:23:08.361020919 -0500
14
++++ gstreamer-1.0.7/Makefile.am	2013-06-01 19:24:15.036357308 -0500
15
+@@ -8,7 +8,6 @@
16
+ 
17
+ SUBDIRS = pkgconfig \
18
+ 	gst libs plugins \
19
+-	po \
20
+ 	m4 \
21
+ 	common
22
+ 
23
+@@ -19,7 +18,6 @@
24
+ # These are all the possible subdirs
25
+ DIST_SUBDIRS = pkgconfig \
26
+ 	gst libs plugins tools \
27
+-	po \
28
+ 	m4 \
29
+ 	common
30
+ 
31
+diff -u --recursive gstreamer-1.0.7-vanilla/Makefile.in gstreamer-1.0.7/Makefile.in
32
+--- gstreamer-1.0.7-vanilla/Makefile.in	2013-06-01 19:23:08.362020867 -0500
33
++++ gstreamer-1.0.7/Makefile.in	2013-06-01 19:24:27.907844191 -0500
34
+@@ -508,13 +508,12 @@
35
+ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-docbook
36
+ aclocaldir = $(datadir)/aclocal
37
+ aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
38
+-SUBDIRS = pkgconfig gst libs plugins po m4 common \
39
++SUBDIRS = pkgconfig gst libs plugins m4 common \
40
+ 	$(am__append_1)
41
+ 
42
+ # These are all the possible subdirs
43
+ DIST_SUBDIRS = pkgconfig \
44
+ 	gst libs plugins tools \
45
+-	po \
46
+ 	m4 \
47
+ 	common
48
+ 

+ 2
- 0
multimedia/minidlna/Makefile View File

@@ -16,7 +16,9 @@ PKG_SOURCE_URL:=@SF/minidlna
16 16
 PKG_MD5SUM:=879027192c89e5376cdd2ae2d1aa33b4
17 17
 PKG_LICENSE:=GPL-2.0 BSD-3-Clause
18 18
 PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
19
+
19 20
 PKG_MAINTAINER:=Knyazkov Dmitry <medavedik@gmail.com>
21
+
20 22
 PKG_BUILD_PARALLEL:=0
21 23
 PKG_BUILD_DEPENDS:=util-linux
22 24
 

+ 12
- 0
multimedia/minidlna/patches/030-upnphttp-fixPhilips.patch View File

@@ -0,0 +1,12 @@
1
+--- a/upnphttp.c
2
++++ b/upnphttp.c
3
+@@ -1259,7 +1259,7 @@
4
+ 	int try_sendfile = 1;
5
+ #endif
6
+ 
7
+-	while( offset < end_offset )
8
++	while( offset <= end_offset )
9
+ 	{
10
+ #if HAVE_SENDFILE
11
+ 		if( try_sendfile )
12
+

+ 1
- 1
multimedia/mjpg-streamer/Makefile View File

@@ -13,7 +13,7 @@ PKG_VERSION:=r$(PKG_REV)
13 13
 PKG_RELEASE:=1
14 14
 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
15 15
 
16
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).1.tar.bz2
17 17
 PKG_SOURCE_URL:=https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer-experimental
18 18
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
19 19
 PKG_SOURCE_VERSION:=$(PKG_REV)

+ 63
- 0
net/dhcpcd/Makefile View File

@@ -0,0 +1,63 @@
1
+#
2
+# Copyright (C) 2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=dhcpcd
11
+PKG_VERSION:=6.4.3
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE_URL:=ftp://roy.marples.name/pub/dhcpcd \
15
+    http://roy.marples.name/downloads/dhcpcd
16
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17
+PKG_MD5SUM:=b22005c131e7108ecf598b6a4ac091eb
18
+
19
+PKG_LICENSE:=BSD-2c
20
+PKG_LICENSE_FILES:=
21
+
22
+PKG_MAINTAINER:=Roy Marples <roy@marples.name>
23
+
24
+PKG_BUILD_PARALLEL:=1
25
+PKG_INSTALL:=1
26
+
27
+include $(INCLUDE_DIR)/package.mk
28
+
29
+define Package/dhcpcd
30
+  SECTION:=net
31
+  CATEGORY:=Network
32
+  TITLE:=DHCPv4/IPv4LL/IPv6RS/DHCPv6 quad stack client
33
+  URL:=http://roy.marples.name/projects/dhcpcd
34
+endef
35
+
36
+define Package/dhcpcd/description
37
+  DHCPv4, IPv6RS and DHCPv6 client with IPv4LL support
38
+  dhcpcd is a one stop network management daemon which includes
39
+    * RFC compliant DHCPv4 and DHCPv6 clients
40
+    * DHCPv6 Prefix Delegation support
41
+    * IPv4LL (aka ZeroConf) support
42
+    * ARP address conflict resolution
43
+    * Link carrier detection
44
+    * Wireless SSID profiles
45
+    * ARP ping profiles
46
+endef
47
+
48
+CONFIGURE_ARGS+=	--prefix=/ --sbindir=/sbin \
49
+			--libexecdir=/lib/dhcpcd --dbdir=/var/dhcpcd
50
+
51
+define Package/dhcpcd/install
52
+	$(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/dhcpcd/dhcpcd-hooks
53
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/sbin/dhcpcd $(1)/sbin/
54
+	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/dhcpcd/dhcpcd-run-hooks \
55
+	    $(1)/lib/dhcpcd/
56
+	$(INSTALL_DATA) $(PKG_INSTALL_DIR)/lib/dhcpcd/dhcpcd-hooks/* \
57
+	    $(1)/lib/dhcpcd/dhcpcd-hooks/
58
+	$(INSTALL_DIR) $(1)/etc/init.d
59
+	$(INSTALL_BIN) ./files/dhcpcd.init $(1)/etc/init.d/dhcpcd
60
+	$(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/dhcpcd.conf $(1)/etc/dhcpcd.conf
61
+endef
62
+
63
+$(eval $(call BuildPackage,dhcpcd))

+ 24
- 0
net/dhcpcd/files/dhcpcd.init View File

@@ -0,0 +1,24 @@
1
+#!/bin/sh /etc/rc.common
2
+#
3
+# Copyright (C) 2014 OpenWrt.org
4
+#
5
+# This is free software, licensed under the GNU General Public License v2.
6
+# See /LICENSE for more information.
7
+#
8
+
9
+START=30
10
+STOP=85
11
+USE_PROCD=1
12
+
13
+start_service()
14
+{
15
+	procd_open_instance
16
+	procd_set_param command /sbin/dhcpcd -B
17
+	procd_set_param respawn
18
+	procd_close_instance
19
+}
20
+
21
+reload_service()
22
+{
23
+	/sbin/dhcpcd -n
24
+}

+ 5
- 2
net/ethtool/Makefile View File

@@ -8,13 +8,16 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=ethtool
11
-PKG_VERSION:=3.14
11
+PKG_VERSION:=3.15
12 12
 PKG_RELEASE:=1
13 13
 
14 14
 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
15 15
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 16
 PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
17
-PKG_MD5SUM:=d46b809ddd672b51d7e23787ae9122e0
17
+PKG_MD5SUM:=e7bf0c355d2bf6ee281ebc713c5fb987
18
+
19
+PKG_LICENSE:=GPL-2.0
20
+PKG_LICENSE_FILE:=COPYING
18 21
 
19 22
 PKG_FIXUP:=autoreconf
20 23
 PKG_INSTALL:=1

+ 0
- 166
net/ethtool/patches/100-ixp4xx.patch View File

@@ -1,166 +0,0 @@
1
---- a/Makefile.am
2
-+++ b/Makefile.am
3
-@@ -13,7 +13,7 @@ ethtool_SOURCES += \
4
- 		  fec_8xx.c ibm_emac.c ixgb.c ixgbe.c natsemi.c	\
5
- 		  pcnet32.c realtek.c tg3.c marvell.c vioc.c	\
6
- 		  smsc911x.c at76c50x-usb.c sfc.c stmmac.c	\
7
--		  sfpid.c sfpdiag.c ixgbevf.c
8
-+		  sfpid.c sfpdiag.c ixgbevf.c ixp4xx.c
9
- endif
10
- 
11
- TESTS = test-cmdline test-features
12
---- a/ethtool.c
13
-+++ b/ethtool.c
14
-@@ -894,6 +894,7 @@ static const struct {
15
- 	{ "ixgb", ixgb_dump_regs },
16
- 	{ "ixgbe", ixgbe_dump_regs },
17
- 	{ "ixgbevf", ixgbevf_dump_regs },
18
-+	{ "ixp4xx", ixp4xx_dump_regs },
19
- 	{ "natsemi", natsemi_dump_regs },
20
- 	{ "e100", e100_dump_regs },
21
- 	{ "amd8111e", amd8111e_dump_regs },
22
---- a/internal.h
23
-+++ b/internal.h
24
-@@ -243,6 +243,9 @@ int st_gmac_dump_regs(struct ethtool_drv
25
- /* Et131x ethernet controller */
26
- int et131x_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
27
- 
28
-+/* Intel IXP4xx internal MAC */
29
-+int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs);
30
-+
31
- /* Rx flow classification */
32
- int rxclass_parse_ruleopts(struct cmd_context *ctx,
33
- 			   struct ethtool_rx_flow_spec *fsp);
34
---- /dev/null
35
-+++ b/ixp4xx.c
36
-@@ -0,0 +1,130 @@
37
-+/*
38
-+ * Copyright (c) 2006 Christian Hohnstaed <chohnstaedt@innominate.com>
39
-+ * This file is released under the GPLv2
40
-+ */
41
-+
42
-+#include <stdio.h>
43
-+#include "internal.h"
44
-+
45
-+#ifndef BIT
46
-+#define BIT(x) (1<<x)
47
-+#endif
48
-+
49
-+#define TX_CNTRL1_TX_EN         BIT(0)
50
-+#define TX_CNTRL1_DUPLEX        BIT(1)
51
-+#define TX_CNTRL1_RETRY         BIT(2)
52
-+#define TX_CNTRL1_PAD_EN        BIT(3)
53
-+#define TX_CNTRL1_FCS_EN        BIT(4)
54
-+#define TX_CNTRL1_2DEFER        BIT(5)
55
-+#define TX_CNTRL1_RMII          BIT(6)
56
-+
57
-+/* TX Control Register 2 */
58
-+#define TX_CNTRL2_RETRIES_MASK  0xf
59
-+
60
-+/* RX Control Register 1 */
61
-+#define RX_CNTRL1_RX_EN         BIT(0)
62
-+#define RX_CNTRL1_PADSTRIP_EN   BIT(1)
63
-+#define RX_CNTRL1_CRC_EN        BIT(2)
64
-+#define RX_CNTRL1_PAUSE_EN      BIT(3)
65
-+#define RX_CNTRL1_LOOP_EN       BIT(4)
66
-+#define RX_CNTRL1_ADDR_FLTR_EN  BIT(5)
67
-+#define RX_CNTRL1_RX_RUNT_EN    BIT(6)
68
-+#define RX_CNTRL1_BCAST_DIS     BIT(7)
69
-+
70
-+/* Core Control Register */
71
-+#define CORE_RESET              BIT(0)
72
-+#define CORE_RX_FIFO_FLUSH      BIT(1)
73
-+#define CORE_TX_FIFO_FLUSH      BIT(2)
74
-+#define CORE_SEND_JAM           BIT(3)
75
-+#define CORE_MDC_EN             BIT(4)
76
-+
77
-+#define MAC "%02x:%02x:%02x:%02x:%02x:%02x"
78
-+#define MAC_DATA(d) (d)[0], (d)[1], (d)[2], (d)[3], (d)[4], (d)[5]
79
-+
80
-+int ixp4xx_dump_regs(struct ethtool_drvinfo *info, struct ethtool_regs *regs)
81
-+{
82
-+	u8 *data = regs->data;
83
-+
84
-+	fprintf(stdout,
85
-+		"TXctrl:          0x%02x:0x%02x\n"
86
-+		"    Enable:      %s\n"
87
-+		"    Duplex:      %s\n"
88
-+		"    Retry:       %s (%d)\n"
89
-+		"    Padding:     %s\n"
90
-+		"    Frame check: %s\n"
91
-+		"    TX deferral: %s\n"
92
-+		"    Connection:  %s\n"
93
-+		"\n",
94
-+		data[0], data[1],
95
-+		data[0] & TX_CNTRL1_TX_EN   ? "yes"      : "no",
96
-+		data[0] & TX_CNTRL1_DUPLEX  ? "half"     : "full",
97
-+		data[0] & TX_CNTRL1_RETRY   ? "enabled"  : "disabled",
98
-+		data[1] & TX_CNTRL2_RETRIES_MASK,
99
-+		data[0] & TX_CNTRL1_PAD_EN  ? "enabled"  : "disabled",
100
-+		data[0] & TX_CNTRL1_FCS_EN  ? "enabled"  : "disabled",
101
-+		data[0] & TX_CNTRL1_2DEFER  ? "two-part" : "one-part",
102
-+		data[0] & TX_CNTRL1_RMII    ? "RMII"     : "Full MII"
103
-+	);
104
-+
105
-+	fprintf(stdout,
106
-+		"RXctrl:          0x%02x\n"
107
-+		"    Enable:      %s\n"
108
-+		"    Pad strip:   %s\n"
109
-+		"    CRC check:   %s\n"
110
-+		"    Pause:       %s\n"
111
-+		"    Loop:        %s\n"
112
-+		"    Promiscous:  %s\n"
113
-+		"    Runt frames: %s\n"
114
-+		"    Broadcast:   %s\n"
115
-+		"\n",
116
-+		data[2],
117
-+		data[2] & RX_CNTRL1_RX_EN        ? "yes"      : "no",
118
-+		data[2] & RX_CNTRL1_PADSTRIP_EN  ? "enabled"  : "disabled",
119
-+		data[2] & RX_CNTRL1_CRC_EN       ? "enabled"  : "disabled",
120
-+		data[2] & RX_CNTRL1_PAUSE_EN     ? "enabled"  : "disabled",
121
-+		data[2] & RX_CNTRL1_LOOP_EN      ? "enabled"  : "disabled",
122
-+		data[2] & RX_CNTRL1_ADDR_FLTR_EN ? "disabled" : "enabled",
123
-+		data[2] & RX_CNTRL1_RX_RUNT_EN   ? "forward"  : "discard",
124
-+		data[2] & RX_CNTRL1_BCAST_DIS    ? "disabled" : "enabled"
125
-+	);
126
-+	fprintf(stdout,
127
-+		"Core control:    0x%02x\n"
128
-+		"    Core state:  %s\n"
129
-+		"    RX fifo:     %s\n"
130
-+		"    TX fifo:     %s\n"
131
-+		"    Send jam:    %s\n"
132
-+		"    MDC clock    %s\n"
133
-+		"\n",
134
-+		data[32],
135
-+		data[32] & CORE_RESET          ? "reset"  : "normal operation",
136
-+		data[32] & CORE_RX_FIFO_FLUSH  ? "flush"  : "ok",
137
-+		data[32] & CORE_TX_FIFO_FLUSH  ? "flush"  : "ok",
138
-+		data[32] & CORE_SEND_JAM       ? "yes"    : "no",
139
-+		data[32] & CORE_MDC_EN         ? "output" : "input"
140
-+	);
141
-+	fprintf(stdout,
142
-+		"MAC addresses: \n"
143
-+		"  Multicast mask:     " MAC "\n"
144
-+		"  Multicast address:  " MAC "\n"
145
-+		"  Unicast address:    " MAC "\n"
146
-+		"\n",
147
-+		MAC_DATA(data+13), MAC_DATA(data+19), MAC_DATA(data+26)
148
-+	);
149
-+	fprintf(stdout,
150
-+		"Random seed:      0x%02x\n"
151
-+		"Threshold empty:   %3d\n"
152
-+		"Threshold full:    %3d\n"
153
-+		"TX buffer size:    %3d\n"
154
-+		"TX deferral:       %3d\n"
155
-+		"RX deferral:       %3d\n"
156
-+		"TX two deferral 1: %3d\n"
157
-+		"TX two deferral 2: %3d\n"
158
-+		"Slot time:         %3d\n"
159
-+		"Internal clock:    %3d\n"
160
-+		"\n",
161
-+		data[4], data[5], data[6], data[7], data[8], data[9],
162
-+		data[10], data[11], data[12], data[25]
163
-+	);
164
-+
165
-+	return 0;
166
-+}

+ 3
- 0
net/fastd/Makefile View File

@@ -16,6 +16,9 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
16 16
 PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/75
17 17
 PKG_MD5SUM:=34f6bdebd0410a1fba7c8fd06fff7a05
18 18
 
19
+PKG_LICENSE:=BSD-2-Clause
20
+PKG_LICENSE_FILE:=COPYRIGHT
21
+
19 22
 PKG_CONFIG_DEPENDS:=\
20 23
 	CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
21 24
 	CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC \

+ 9
- 8
net/freeradius2/Makefile View File

@@ -18,6 +18,7 @@ PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
18 18
 
19 19
 PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
20 20
 PKG_FIXUP:=autoreconf
21
+PKG_CHECK_FORMAT_SECURITY:=0
21 22
 
22 23
 PKG_CONFIG_DEPENDS := \
23 24
   FREERADIUS_OPENSSL \
@@ -415,14 +416,14 @@ PKG_DICTIONARIES:= \
415 416
 	microsoft \
416 417
 	wispr \
417 418
 
418
-#ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
419
-#  CONFIGURE_ARGS+= \
420
-#		--with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
421
-#		--with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
422
-#  CONFIGURE_LIBS+= -lcrypto -lssl
423
-#else
419
+ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-ldap),)
420
+  CONFIGURE_ARGS+= \
421
+		--with-rlm_ldap-include-dir="$(STAGING_DIR)/usr/include" \
422
+		--with-rlm_ldap-lib-dir="$(STAGING_DIR)/usr/lib"
423
+  CONFIGURE_LIBS+= -lcrypto -lssl
424
+else
424 425
   CONFIGURE_ARGS+= --without-rlm_ldap
425
-#endif
426
+endif
426 427
 
427 428
 #ifneq ($(SDK)$(CONFIG_PACKAGE_freeradius2-mod-sql-mysql),)
428 429
 #  CONFIGURE_ARGS+= \
@@ -612,7 +613,7 @@ $(eval $(call BuildPlugin,freeradius2-mod-exec,rlm_exec,modules/exec modules/ech
612 613
 $(eval $(call BuildPlugin,freeradius2-mod-attr-rewrite,rlm_attr_rewrite,modules/attr_rewrite,modules,))
613 614
 $(eval $(call BuildPlugin,freeradius2-mod-files,rlm_files,acct_users preproxy_users users modules/files,modules,))
614 615
 $(eval $(call BuildPlugin,freeradius2-mod-passwd,rlm_passwd,modules/passwd,modules,))
615
-#$(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap modules/ldap,modules,))
616
+$(eval $(call BuildPlugin,freeradius2-mod-ldap,rlm_ldap,ldap.attrmap modules/ldap,modules,))
616 617
 $(eval $(call BuildPlugin,freeradius2-mod-mschap,rlm_mschap,modules/mschap,modules,))
617 618
 $(eval $(call BuildPlugin,freeradius2-mod-pap,rlm_pap,modules/pap,modules,))
618 619
 $(eval $(call BuildPlugin,freeradius2-mod-preprocess,rlm_preprocess,hints huntgroups modules/preprocess,modules,))

+ 45
- 0
net/horst/Makefile View File

@@ -0,0 +1,45 @@
1
+#
2
+# Copyright (C) 2006 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=horst
11
+PKG_VERSION:=4.0
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-git.tar.gz
15
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
16
+PKG_SOURCE_URL:=git://br1.einfach.org/horst
17
+PKG_SOURCE_PROTO:=git
18
+PKG_SOURCE_VERSION:=version-4.0
19
+
20
+PKG_BUILD_PARALLEL:=1
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+define Package/horst
25
+	SECTION:=net
26
+	CATEGORY:=Network
27
+	SUBMENU:=wireless
28
+	DEPENDS:=+libncurses
29
+	MAINTAINER:=Bruno Randolf <br1@einfach.org>
30
+	TITLE:=Highly Optimized 802.11 Radio Scanning Tool
31
+	URL:=http://br1.einfach.org/tech/horst/
32
+endef
33
+
34
+define Package/horst/description
35
+	[horst] is a scanning and analysis tool for 802.11 wireless networks
36
+	and especially IBSS (ad-hoc) mode and mesh networks (OLSR).
37
+endef
38
+
39
+define Package/horst/install
40
+	$(INSTALL_DIR) $(1)/usr/sbin
41
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/horst $(1)/usr/sbin/
42
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/horst.sh $(1)/usr/sbin/
43
+endef
44
+
45
+$(eval $(call BuildPackage,horst))

+ 40
- 0
net/mwan3-luci/Makefile View File

@@ -0,0 +1,40 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=luci-app-mwan3
11
+PKG_VERSION:=1.3
12
+PKG_RELEASE:=1
13
+PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
14
+PKG_LICENSE:=GPLv2
15
+
16
+include $(INCLUDE_DIR)/package.mk
17
+
18
+define Package/luci-app-mwan3
19
+  SECTION:=LuCI
20
+  CATEGORY:=LuCI
21
+  SUBMENU:=3. Applications
22
+  TITLE:=LuCI support for the MWAN3 multiwan hotplug script
23
+  DEPENDS:=+mwan3
24
+  PKGARCH:=all
25
+  MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
26
+endef
27
+
28
+define Package/luci-app-mwan3/description
29
+Hotplug script which makes configuration of multiple WAN interfaces simple and manageable
30
+With loadbalancing/failover support for up to 250 WAN interfaces, connection tracking and an easy to manage traffic ruleset
31
+endef
32
+
33
+define Build/Compile
34
+endef
35
+
36
+define Package/luci-app-mwan3/install
37
+	$(CP) ./files/* $(1)
38
+endef
39
+
40
+$(eval $(call BuildPackage,luci-app-mwan3))

+ 38
- 0
net/mwan3-luci/files/etc/hotplug.d/iface/16-mwan3custombak View File

@@ -0,0 +1,38 @@
1
+#!/bin/sh
2
+
3
+# to enable this script uncomment the case loop at the bottom
4
+# to report MWAN3 status on interface up/down events modify the lines in the send_reportdata function
5
+
6
+send_alert()
7
+{
8
+	# $1 stores the mwan3 status information
9
+	# insert your code here to send the contents of $1
10
+	echo "$1"
11
+}
12
+
13
+gather_event_info()
14
+{
15
+	# create event information message
16
+	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)""
17
+
18
+	# get current interface, policy and rule status
19
+	local CURRENT_STATUS="$(mwan3 status)"
20
+
21
+	# get last 50 mwan3 systemlog messages
22
+	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')")"
23
+
24
+	# pass event info to send_alert function
25
+	send_alert "$(echo -e "$EVENT_INFO\n\n$CURRENT_STATUS\n\n$MWAN3_LOG")"
26
+}
27
+
28
+#case "$ACTION" in
29
+#	ifup)
30
+#		gather_event_info
31
+#	;;
32
+#
33
+#	ifdown)
34
+#		gather_event_info
35
+#	;;
36
+#esac
37
+
38
+exit 0

+ 14
- 0
net/mwan3-luci/files/etc/uci-defaults/mwan3 View File

@@ -0,0 +1,14 @@
1
+#!/bin/sh
2
+
3
+# delete existing mwan3 ucitrack entry and add new entry
4
+uci -q batch <<-EOF >/dev/null
5
+	del ucitrack.@mwan3[-1]
6
+	add ucitrack mwan3
7
+	set ucitrack.@mwan3[-1].exec="/etc/init.d/mwan3 restart"
8
+	commit ucitrack
9
+EOF
10
+
11
+# make controller file addition take effect without system restart
12
+rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
13
+
14
+exit 0

+ 355
- 0
net/mwan3-luci/files/usr/lib/lua/luci/controller/mwan3.lua View File

@@ -0,0 +1,355 @@
1
+module("luci.controller.mwan3", package.seeall)
2
+
3
+sys = require "luci.sys"
4
+ut = require "luci.util"
5
+
6
+function index()
7
+	if not nixio.fs.access("/etc/config/mwan3") then
8
+		return
9
+	end
10
+
11
+	entry({"admin", "network", "mwan3"},
12
+		alias("admin", "network", "mwan3", "overview"),
13
+		_("Load Balancing"), 600)
14
+
15
+	entry({"admin", "network", "mwan3", "overview"},
16
+		alias("admin", "network", "mwan3", "overview", "over_iface"),
17
+		_("Overview"), 10)
18
+	entry({"admin", "network", "mwan3", "overview", "over_iface"},
19
+		template("mwan3/mwan3_over_interface"))
20
+	entry({"admin", "network", "mwan3", "overview", "iface_status"},
21
+		call("mwan3_iface_status"))
22
+	entry({"admin", "network", "mwan3", "overview", "over_detail"},
23
+		template("mwan3/mwan3_over_detail"))
24
+	entry({"admin", "network", "mwan3", "overview", "detail_status"},
25
+		call("mwan3_detail_status"))
26
+
27
+	entry({"admin", "network", "mwan3", "configuration"},
28
+		alias("admin", "network", "mwan3", "configuration", "interface"),
29
+		_("Configuration"), 20)
30
+	entry({"admin", "network", "mwan3", "configuration", "interface"},
31
+		arcombine(cbi("mwan3/mwan3_interface"), cbi("mwan3/mwan3_interfaceconfig")),
32
+		_("Interfaces"), 10).leaf = true
33
+	entry({"admin", "network", "mwan3", "configuration", "member"},
34
+		arcombine(cbi("mwan3/mwan3_member"), cbi("mwan3/mwan3_memberconfig")),
35
+		_("Members"), 20).leaf = true
36
+	entry({"admin", "network", "mwan3", "configuration", "policy"},
37
+		arcombine(cbi("mwan3/mwan3_policy"), cbi("mwan3/mwan3_policyconfig")),
38
+		_("Policies"), 30).leaf = true
39
+	entry({"admin", "network", "mwan3", "configuration", "rule"},
40
+		arcombine(cbi("mwan3/mwan3_rule"), cbi("mwan3/mwan3_ruleconfig")),
41
+		_("Rules"), 40).leaf = true
42
+
43
+	entry({"admin", "network", "mwan3", "advanced"},
44
+		alias("admin", "network", "mwan3", "advanced", "hotplug"),
45
+		_("Advanced"), 100)
46
+	entry({"admin", "network", "mwan3", "advanced", "hotplug"},
47
+		form("mwan3/mwan3_adv_hotplug"))
48
+	entry({"admin", "network", "mwan3", "advanced", "mwan3"},
49
+		form("mwan3/mwan3_adv_mwan3"))
50
+	entry({"admin", "network", "mwan3", "advanced", "network"},
51
+		form("mwan3/mwan3_adv_network"))
52
+	entry({"admin", "network", "mwan3", "advanced", "diag"},
53
+		template("mwan3/mwan3_adv_diagnostics"))
54
+	entry({"admin", "network", "mwan3", "advanced", "diag_display"},
55
+		call("mwan3_diag_data"), nil).leaf = true
56
+	entry({"admin", "network", "mwan3", "advanced", "tshoot"},
57
+		template("mwan3/mwan3_adv_troubleshoot"))
58
+	entry({"admin", "network", "mwan3", "advanced", "tshoot_display"},
59
+		call("mwan3_tshoot_data"))
60
+end
61
+
62
+function mwan3_get_iface_status(rulenum, ifname)
63
+	if ut.trim(sys.exec("uci get -p /var/state mwan3." .. ifname .. ".enabled")) == "1" then
64
+		if ut.trim(sys.exec("ip route list table " .. rulenum)) ~= "" then
65
+			if ut.trim(sys.exec("uci get -p /var/state mwan3." .. ifname .. ".track_ip")) ~= "" then
66
+				return "on"
67
+			else
68
+				return "nm"
69
+			end
70
+		else
71
+			return "off"
72
+		end
73
+	else
74
+		return "ne"
75
+	end
76
+end
77
+
78
+function mwan3_get_iface()
79
+	local rulenum, str = 0, ""
80
+	uci.cursor():foreach("mwan3", "interface",
81
+		function (section)
82
+			rulenum = rulenum+1
83
+			str = str .. section[".name"] .. "[" .. mwan3_get_iface_status(rulenum, section[".name"]) .. "]"
84
+		end
85
+	)
86
+	return str
87
+end
88
+
89
+function mwan3_iface_status()
90
+	local ntm = require "luci.model.network".init()
91
+
92
+	local rv = {	}
93
+
94
+	-- overview status
95
+	local statstr = mwan3_get_iface()
96
+	if statstr ~= "" then
97
+		rv.wans = { }
98
+		wansid = {}
99
+
100
+		for wanname, ifstat in string.gfind(statstr, "([^%[]+)%[([^%]]+)%]") do
101
+			local wanifname = ut.trim(sys.exec("uci get -p /var/state network." .. wanname .. ".ifname"))
102
+				if wanifname == "" then
103
+					wanifname = "X"
104
+				end
105
+			local wanlink = ntm:get_interface(wanifname)
106
+				wanlink = wanlink and wanlink:get_network()
107
+				wanlink = wanlink and wanlink:adminlink() or "#"
108
+			wansid[wanname] = #rv.wans + 1
109
+			rv.wans[wansid[wanname]] = { name = wanname, link = wanlink, ifname = wanifname, status = ifstat }
110
+		end
111
+	end
112
+
113
+	-- overview status log
114
+	local mwlg = ut.trim(sys.exec("logread | grep mwan3 | tail -n 50 | sed 'x;1!H;$!d;x'"))
115
+	if mwlg ~= "" then
116
+		rv.mwan3log = { }
117
+		mwlog = {}
118
+		mwlog[mwlg] = #rv.mwan3log + 1
119
+		rv.mwan3log[mwlog[mwlg]] = { mwanlog = mwlg }
120
+	end
121
+
122
+	luci.http.prepare_content("application/json")
123
+	luci.http.write_json(rv)
124
+end
125
+
126
+function mwan3_detail_status()
127
+	local rv = {	}
128
+
129
+	-- detailed mwan3 status
130
+	local dst = ut.trim(sys.exec("mwan3 status"))
131
+	if dst ~= "" then
132
+		rv.mwan3dst = { }
133
+		dstat = {}
134
+		dstat[dst] = #rv.mwan3dst + 1
135
+		rv.mwan3dst[dstat[dst]] = { detailstat = dst }
136
+	end
137
+
138
+	luci.http.prepare_content("application/json")
139
+	luci.http.write_json(rv)
140
+end
141
+
142
+function mwan3_diag_data(iface, tool, alt)
143
+	function get_ifnum()
144
+		local num = 0
145
+		uci.cursor():foreach("mwan3", "interface",
146
+			function (section)
147
+				num = num+1
148
+				if section[".name"] == iface then
149
+					ifnum = num
150
+				end
151
+			end
152
+		)
153
+	end
154
+
155
+	local rv = {	}
156
+
157
+	local res = ""
158
+	if tool == "service" then
159
+		os.execute("mwan3 " .. alt)
160
+		if alt == "restart" then
161
+			res = "MWAN3 restarted"
162
+		elseif alt == "stop" then
163
+			res = "MWAN3 stopped"
164
+		else
165
+			res = "MWAN3 started"
166
+		end
167
+	else
168
+		local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. iface .. ".ifname"))
169
+		if ifdev ~= "" then
170
+			if tool == "ping" then
171
+				local gateway = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $2 }'"))
172
+				if gateway ~= "" then
173
+					if alt == "gateway" then
174
+						local cmd = "ping -c 3 -W 2 -I " .. ifdev .. " " .. gateway
175
+						res = cmd .. "\n\n" .. sys.exec(cmd)
176
+					else
177
+						local str = ut.trim(sys.exec("uci get -p /var/state mwan3." .. iface .. ".track_ip"))
178
+						if str ~= "" then
179
+							for z in str:gmatch("[^ ]+") do
180
+								local cmd = "ping -c 3 -W 2 -I " .. ifdev .. " " .. z
181
+								res = res .. cmd .. "\n\n" .. sys.exec(cmd) .. "\n\n"
182
+							end
183
+						else
184
+							res = "No tracking IP addresses configured on " .. iface
185
+						end
186
+					end
187
+				else
188
+					res = "No default gateway for " .. iface .. " found. Default route does not exist or is configured incorrectly"
189
+				end
190
+			elseif tool == "rulechk" then
191
+				get_ifnum()
192
+				local rule1 = sys.exec("ip rule | grep $(echo $((" .. ifnum .. " + 1000)))")
193
+				local rule2 = sys.exec("ip rule | grep $(echo $((" .. ifnum .. " + 2000)))")
194
+				if rule1 ~= "" and rule2 ~= "" then
195
+					res = "All required interface IP rules found:\n\n" .. rule1 .. rule2
196
+				elseif rule1 ~= "" or rule2 ~= "" then
197
+					res = "Missing 1 of the 2 required interface IP rules\n\n\nRules found:\n\n" .. rule1 .. rule2
198
+				else
199
+					res = "Missing both of the required interface IP rules"
200
+				end
201
+			elseif tool == "routechk" then
202
+				get_ifnum()
203
+				local table = sys.exec("ip route list table " .. ifnum)
204
+				if table ~= "" then
205
+					res = "Interface routing table " .. ifnum .. " was found:\n\n" .. table
206
+				else
207
+					res = "Missing required interface routing table " .. ifnum
208
+				end
209
+			elseif tool == "hotplug" then
210
+				if alt == "ifup" then
211
+					os.execute("mwan3 ifup " .. iface)
212
+					res = "Hotplug ifup sent to interface " .. iface .. "..."
213
+				else
214
+					os.execute("mwan3 ifdown " .. iface)
215
+					res = "Hotplug ifdown sent to interface " .. iface .. "..."
216
+				end
217
+			end
218
+		else
219
+			res = "Unable to perform diagnostic tests on " .. iface .. ". There is no physical or virtual device associated with this interface"
220
+		end
221
+	end
222
+	if res ~= "" then
223
+		res = ut.trim(res)
224
+		rv.diagres = { }
225
+		dres = {}
226
+		dres[res] = #rv.diagres + 1
227
+		rv.diagres[dres[res]] = { diagresult = res }
228
+	end
229
+
230
+	luci.http.prepare_content("application/json")
231
+	luci.http.write_json(rv)
232
+end
233
+
234
+function mwan3_tshoot_data()
235
+	local rv = {	}
236
+
237
+	-- software versions
238
+	local wrtrelease = ut.trim(luci.version.distversion)
239
+		if wrtrelease ~= "" then
240
+			wrtrelease = "OpenWrt - " .. wrtrelease
241
+		else
242
+			wrtrelease = "OpenWrt - unknown"
243
+		end
244
+	local lucirelease = ut.trim(luci.version.luciversion)
245
+		if lucirelease ~= "" then
246
+			lucirelease = "\nLuCI - " .. lucirelease
247
+		else
248
+			lucirelease = "\nLuCI - unknown"
249
+		end
250
+	local mwan3version = ut.trim(sys.exec("opkg info mwan3 | grep Version | awk -F' ' '{ print $2 }'"))
251
+		if mwan3version ~= "" then
252
+			mwan3version = "\n\nmwan3 - " .. mwan3version
253
+		else
254
+			mwan3version = "\nmwan3 - unknown"
255
+		end
256
+	local mwan3lversion = ut.trim(sys.exec("opkg info luci-app-mwan3 | grep Version | awk -F' ' '{ print $2 }'"))
257
+		if mwan3lversion ~= "" then
258
+			mwan3lversion = "\nluci-app-mwan3 - " .. mwan3lversion
259
+		else
260
+			mwan3lversion = "\nluci-app-mwan3 - unknown"
261
+		end
262
+	local softrev = wrtrelease .. lucirelease .. mwan3version .. mwan3lversion
263
+	rv.mw3ver = { }
264
+	mwv = {}
265
+	mwv[softrev] = #rv.mw3ver + 1
266
+	rv.mw3ver[mwv[softrev]] = { mwan3v = softrev }
267
+
268
+	-- mwan3 config
269
+	local mwcg = ut.trim(sys.exec("cat /etc/config/mwan3"))
270
+		if mwcg == "" then
271
+			mwcg = "No data found"
272
+		end
273
+	rv.mwan3config = { }
274
+	mwan3cfg = {}
275
+	mwan3cfg[mwcg] = #rv.mwan3config + 1
276
+	rv.mwan3config[mwan3cfg[mwcg]] = { mwn3cfg = mwcg }
277
+
278
+	-- network config
279
+	local netcg = ut.trim(sys.exec("cat /etc/config/network | sed -e 's/.*username.*/	USERNAME HIDDEN/' -e 's/.*password.*/	PASSWORD HIDDEN/'"))
280
+		if netcg == "" then
281
+			netcg = "No data found"
282
+		end
283
+	rv.netconfig = { }
284
+	ncfg = {}
285
+	ncfg[netcg] = #rv.netconfig + 1
286
+	rv.netconfig[ncfg[netcg]] = { netcfg = netcg }
287
+
288
+	-- ifconfig
289
+	local ifcg = ut.trim(sys.exec("ifconfig"))
290
+		if ifcg == "" then
291
+			ifcg = "No data found"
292
+		end
293
+	rv.ifconfig = { }
294
+	icfg = {}
295
+	icfg[ifcg] = #rv.ifconfig + 1
296
+	rv.ifconfig[icfg[ifcg]] = { ifcfg = ifcg }
297
+
298
+	-- route -n
299
+	local routeshow = ut.trim(sys.exec("route -n"))
300
+		if routeshow == "" then
301
+			routeshow = "No data found"
302
+		end
303
+	rv.rtshow = { }
304
+	rshw = {}
305
+	rshw[routeshow] = #rv.rtshow + 1
306
+	rv.rtshow[rshw[routeshow]] = { iprtshow = routeshow }
307
+
308
+	-- ip rule show
309
+	local ipr = ut.trim(sys.exec("ip rule show"))
310
+		if ipr == "" then
311
+			ipr = "No data found"
312
+		end
313
+	rv.iprule = { }
314
+	ipruleid = {}
315
+	ipruleid[ipr] = #rv.iprule + 1
316
+	rv.iprule[ipruleid[ipr]] = { rule = ipr }
317
+
318
+	-- ip route list table 1-250
319
+	local routelisting, rlstr = ut.trim(sys.exec("ip rule | sed 's/://g' | awk -F' ' '$1>=2001 && $1<=2250' | awk -F' ' '{ print $NF }'")), ""
320
+		if routelisting ~= "" then
321
+			for line in routelisting:gmatch("[^\r\n]+") do
322
+				rlstr = rlstr .. line .. "\n" .. sys.exec("ip route list table " .. line)
323
+			end
324
+			rlstr = ut.trim(rlstr)
325
+		else
326
+			rlstr = "No data found"
327
+		end
328
+	rv.routelist = { }
329
+	rtlist = {}
330
+	rtlist[rlstr] = #rv.routelist + 1
331
+	rv.routelist[rtlist[rlstr]] = { iprtlist = rlstr }
332
+
333
+	-- default firewall output policy
334
+	local defout = ut.trim(sys.exec("uci get -p /var/state firewall.@defaults[0].output"))
335
+		if defout == "" then
336
+			defout = "No data found"
337
+		end
338
+	rv.fidef = { }
339
+	fwdf = {}
340
+	fwdf[defout] = #rv.fidef + 1
341
+	rv.fidef[fwdf[defout]] = { firedef = defout }
342
+
343
+	-- iptables
344
+	local iptbl = ut.trim(sys.exec("iptables -L -t mangle -v -n"))
345
+		if iptbl == "" then
346
+			iptbl = "No data found"
347
+		end
348
+	rv.iptables = { }
349
+	tables = {}
350
+	tables[iptbl] = #rv.iptables + 1
351
+	rv.iptables[tables[iptbl]] = { iptbls = iptbl }
352
+
353
+	luci.http.prepare_content("application/json")
354
+	luci.http.write_json(rv)
355
+end

+ 55
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_hotplug.lua View File

@@ -0,0 +1,55 @@
1
+-- ------ hotplug script configuration ------ --
2
+
3
+fs = require "nixio.fs"
4
+sys = require "luci.sys"
5
+ut = require "luci.util"
6
+
7
+script = "/etc/hotplug.d/iface/16-mwan3custom"
8
+scriptbak = "/etc/hotplug.d/iface/16-mwan3custombak"
9
+
10
+if luci.http.formvalue("cbid.luci.1._restorebak") then -- restore button has been clicked
11
+	luci.http.redirect(luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug") .. "?restore=yes")
12
+elseif luci.http.formvalue("restore") == "yes" then -- restore script from backup
13
+	os.execute("cp -f " .. scriptbak .. " " .. script)
14
+end
15
+
16
+
17
+m5 = SimpleForm("luci", nil)
18
+	m5:append(Template("mwan3/mwan3_adv_hotplug")) -- highlight current tab
19
+
20
+f = m5:section(SimpleSection, nil,
21
+	translate("This section allows you to modify the contents of /etc/hotplug.d/iface/16-mwan3custom<br />" ..
22
+	"This is useful for running system commands and/or scripts based on interface ifup or ifdown hotplug events<br /><br />" ..
23
+	"Notes:<br />" ..
24
+	"The first line of the script must be &#34;#!/bin/sh&#34; without quotes<br />" ..
25
+	"Lines beginning with # are comments and are not executed<br /><br />" ..
26
+	"Available variables:<br />" ..
27
+	"$ACTION is the hotplug event (ifup, ifdown)<br />" ..
28
+	"$INTERFACE is the interface name (wan1, wan2, etc.)<br />" ..
29
+	"$DEVICE is the device name attached to the interface (eth0.1, eth1, etc.)"))
30
+
31
+
32
+restore = f:option(Button, "_restorebak", translate("Restore default hotplug script"))
33
+	restore.inputtitle = translate("Restore...")
34
+	restore.inputstyle = "apply"
35
+
36
+t = f:option(TextValue, "lines")
37
+	t.rmempty = true
38
+	t.rows = 20
39
+
40
+	function t.cfgvalue()
41
+		local hps = fs.readfile(script)
42
+		if not hps or hps == "" then -- if script does not exist or is blank restore from backup
43
+			sys.call("cp -f " .. scriptbak .. " " .. script)
44
+			return fs.readfile(script)
45
+		else
46
+			return hps
47
+		end
48
+	end
49
+
50
+	function t.write(self, section, data) -- format and write new data to script
51
+		return fs.writefile(script, ut.trim(data:gsub("\r\n", "\n")) .. "\n")
52
+	end
53
+
54
+
55
+return m5

+ 32
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_mwan3.lua View File

@@ -0,0 +1,32 @@
1
+-- ------ mwan3 configuration ------ --
2
+
3
+ut = require "luci.util"
4
+
5
+mwan3file = "/etc/config/mwan3"
6
+
7
+
8
+m5 = SimpleForm("luci", nil)
9
+	m5:append(Template("mwan3/mwan3_adv_mwan3")) -- highlight current tab
10
+
11
+
12
+f = m5:section(SimpleSection, nil,
13
+	translate("This section allows you to modify the contents of /etc/config/mwan3"))
14
+
15
+t = f:option(TextValue, "lines")
16
+	t.rmempty = true
17
+	t.rows = 20
18
+
19
+	function t.cfgvalue()
20
+		return nixio.fs.readfile(mwan3file) or ""
21
+	end
22
+
23
+	function t.write(self, section, data) -- format and write new data to script
24
+		return nixio.fs.writefile(mwan3file, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
25
+	end
26
+
27
+	function f.handle(self, state, data)
28
+		return true
29
+	end
30
+
31
+
32
+return m5

+ 32
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_adv_network.lua View File

@@ -0,0 +1,32 @@
1
+-- ------ network configuration ------ --
2
+
3
+ut = require "luci.util"
4
+
5
+netfile = "/etc/config/network"
6
+
7
+
8
+m5 = SimpleForm("networkconf", nil)
9
+	m5:append(Template("mwan3/mwan3_adv_network")) -- highlight current tab
10
+
11
+
12
+f = m5:section(SimpleSection, nil,
13
+	translate("This section allows you to modify the contents of /etc/config/network"))
14
+
15
+t = f:option(TextValue, "lines")
16
+	t.rmempty = true
17
+	t.rows = 20
18
+
19
+	function t.cfgvalue()
20
+		return nixio.fs.readfile(netfile) or ""
21
+	end
22
+
23
+	function t.write(self, section, data) -- format and write new data to script
24
+		return nixio.fs.writefile(netfile, "\n" .. ut.trim(data:gsub("\r\n", "\n")) .. "\n")
25
+	end
26
+
27
+	function f.handle(self, state, data)
28
+		return true
29
+	end
30
+
31
+
32
+return m5

+ 266
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interface.lua View File

@@ -0,0 +1,266 @@
1
+-- ------ extra functions ------ --
2
+
3
+function iface_check() -- find issues with too many interfaces, reliability and metric
4
+	uci.cursor():foreach("mwan3", "interface",
5
+		function (section)
6
+			local ifname = section[".name"]
7
+			ifnum = ifnum+1 -- count number of mwan3 interfaces configured
8
+			-- create list of metrics for none and duplicate checking
9
+			local metlkp = ut.trim(sys.exec("uci get -p /var/state network." .. ifname .. ".metric"))
10
+			if metlkp == "" then
11
+				err_found = 1
12
+				err_nomet_list = err_nomet_list .. ifname .. " "
13
+			else
14
+				metric_list = metric_list .. ifname .. " " .. metlkp .. "\n"
15
+			end
16
+			-- check if any interfaces have a higher reliability requirement than tracking IPs configured
17
+			local tipnum = tonumber(ut.trim(sys.exec("echo $(uci get -p /var/state mwan3." .. ifname .. ".track_ip) | wc -w")))
18
+			if tipnum > 0 then
19
+				local relnum = tonumber(ut.trim(sys.exec("uci get -p /var/state mwan3." .. ifname .. ".reliability")))
20
+				if relnum and relnum > tipnum then
21
+					err_found = 1
22
+					err_rel_list = err_rel_list .. ifname .. " "
23
+				end
24
+			end
25
+			-- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table
26
+			if ut.trim(sys.exec("uci get -p /var/state network." .. ifname)) == "interface" then
27
+				local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. ifname .. ".ifname"))
28
+				if ifdev == "uci: Entry not found" or ifdev == "" then
29
+					err_found = 1
30
+					err_netcfg_list = err_netcfg_list .. ifname .. " "
31
+					err_route_list = err_route_list .. ifname .. " "
32
+				else
33
+					local rtcheck = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $1 }'"))
34
+					if rtcheck == "" then
35
+						err_found = 1
36
+						err_route_list = err_route_list .. ifname .. " "
37
+					end
38
+				end
39
+			else
40
+				err_found = 1
41
+				err_netcfg_list = err_netcfg_list .. ifname .. " "
42
+				err_route_list = err_route_list .. ifname .. " "
43
+			end
44
+		end
45
+	)
46
+	-- check if any interfaces have duplicate metrics
47
+	local metric_dupnums = sys.exec("echo '" .. metric_list .. "' | awk -F' ' '{ print $2 }' | uniq -d")
48
+	if metric_dupnums ~= "" then
49
+		err_found = 1
50
+		local metric_dupes = ""
51
+		for line in metric_dupnums:gmatch("[^\r\n]+") do
52
+			metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk -F' ' '{ print $1 }'")
53
+			err_dupmet_list = err_dupmet_list .. metric_dupes
54
+		end
55
+		err_dupmet_list = sys.exec("echo '" .. err_dupmet_list .. "' | tr '\n' ' '")
56
+	end
57
+end
58
+
59
+function iface_warn() -- display status and warning messages at the top of the page
60
+	local warns = ""
61
+	if ifnum <= 250 then
62
+		warns = "<strong>There are currently " .. ifnum .. " of 250 supported interfaces configured</strong>"
63
+	else
64
+		warns = "<font color=\"ff0000\"><strong>WARNING: " .. ifnum .. " interfaces are configured exceeding the maximum of 250!</strong></font>"
65
+	end
66
+	if err_rel_list ~= " " then
67
+		warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have a higher reliability requirement than there are tracking IP addresses!</strong></font>"
68
+	end
69
+	if err_route_list ~= " " then
70
+		warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have no default route in the main routing table!</strong></font>"
71
+	end
72
+	if err_netcfg_list ~= " " then
73
+		warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces are configured incorrectly or not at all in /etc/config/network!</strong></font>"
74
+	end
75
+	if err_nomet_list ~= " " then
76
+		warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have no metric configured in /etc/config/network!</strong></font>"
77
+	end
78
+	if err_dupmet_list ~= " " then
79
+		warns = warns .. "<br /><br /><font color=\"ff0000\"><strong>WARNING: some interfaces have duplicate metrics configured in /etc/config/network!</strong></font>"
80
+	end
81
+	return warns
82
+end
83
+
84
+-- ------ interface configuration ------ --
85
+
86
+dsp = require "luci.dispatcher"
87
+sys = require "luci.sys"
88
+ut = require "luci.util"
89
+
90
+ifnum = 0
91
+metric_list = ""
92
+err_found = 0
93
+err_dupmet_list = " "
94
+err_netcfg_list = " "
95
+err_nomet_list = " "
96
+err_rel_list = " "
97
+err_route_list = " "
98
+iface_check()
99
+
100
+
101
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Interface Configuration"),
102
+	translate(iface_warn()))
103
+	m5:append(Template("mwan3/mwan3_config_css"))
104
+
105
+
106
+mwan_interface = m5:section(TypedSection, "interface", translate("Interfaces"),
107
+	translate("MWAN3 supports up to 250 physical and/or logical interfaces<br />" ..
108
+	"MWAN3 requires that all interfaces have a unique metric configured in /etc/config/network<br />" ..
109
+	"Names must match the interface name found in /etc/config/network (see advanced tab)<br />" ..
110
+	"Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
111
+	"Interfaces may not share the same name as configured members, policies or rules"))
112
+	mwan_interface.addremove = true
113
+	mwan_interface.dynamic = false
114
+	mwan_interface.sectionhead = "Interface"
115
+	mwan_interface.sortable = true
116
+	mwan_interface.template = "cbi/tblsection"
117
+	mwan_interface.extedit = dsp.build_url("admin", "network", "mwan3", "configuration", "interface", "%s")
118
+	function mwan_interface.create(self, section)
119
+		TypedSection.create(self, section)
120
+		m5.uci:save("mwan3")
121
+		luci.http.redirect(dsp.build_url("admin", "network", "mwan3", "configuration", "interface", section))
122
+	end
123
+
124
+
125
+enabled = mwan_interface:option(DummyValue, "enabled", translate("Enabled"))
126
+	enabled.rawhtml = true
127
+	function enabled.cfgvalue(self, s)
128
+		if self.map:get(s, "enabled") == "1" then
129
+			return "Yes"
130
+		else
131
+			return "No"
132
+		end
133
+	end
134
+
135
+track_ip = mwan_interface:option(DummyValue, "track_ip", translate("Tracking IP"))
136
+	track_ip.rawhtml = true
137
+	function track_ip.cfgvalue(self, s)
138
+		local str = ""
139
+		tracked = self.map:get(s, "track_ip")
140
+		if tracked then
141
+			for k,v in pairs(tracked) do
142
+				str = str .. v .. "<br />"
143
+			end
144
+			return str
145
+		else
146
+			return "&#8212;"
147
+		end
148
+	end
149
+
150
+reliability = mwan_interface:option(DummyValue, "reliability", translate("Tracking reliability"))
151
+	reliability.rawhtml = true
152
+	function reliability.cfgvalue(self, s)
153
+		if tracked then
154
+			return self.map:get(s, "reliability") or "&#8212;"
155
+		else
156
+			return "&#8212;"
157
+		end
158
+	end
159
+
160
+count = mwan_interface:option(DummyValue, "count", translate("Ping count"))
161
+	count.rawhtml = true
162
+	function count.cfgvalue(self, s)
163
+		if tracked then
164
+			return self.map:get(s, "count") or "&#8212;"
165
+		else
166
+			return "&#8212;"
167
+		end
168
+	end
169
+
170
+timeout = mwan_interface:option(DummyValue, "timeout", translate("Ping timeout"))
171
+	timeout.rawhtml = true
172
+	function timeout.cfgvalue(self, s)
173
+		if tracked then
174
+			local tcheck = self.map:get(s, "timeout")
175
+			if tcheck then
176
+				return tcheck .. "s"
177
+			else
178
+				return "&#8212;"
179
+			end
180
+		else
181
+			return "&#8212;"
182
+		end
183
+	end
184
+
185
+interval = mwan_interface:option(DummyValue, "interval", translate("Ping interval"))
186
+	interval.rawhtml = true
187
+	function interval.cfgvalue(self, s)
188
+		if tracked then
189
+			local icheck = self.map:get(s, "interval")
190
+			if icheck then
191
+				return icheck .. "s"
192
+			else
193
+				return "&#8212;"
194
+			end
195
+		else
196
+			return "&#8212;"
197
+		end
198
+	end
199
+
200
+down = mwan_interface:option(DummyValue, "down", translate("Interface down"))
201
+	down.rawhtml = true
202
+	function down.cfgvalue(self, s)
203
+		if tracked then
204
+			return self.map:get(s, "down") or "&#8212;"
205
+		else
206
+			return "&#8212;"
207
+		end
208
+	end
209
+
210
+up = mwan_interface:option(DummyValue, "up", translate("Interface up"))
211
+	up.rawhtml = true
212
+	function up.cfgvalue(self, s)
213
+		if tracked then
214
+			return self.map:get(s, "up") or "&#8212;"
215
+		else
216
+			return "&#8212;"
217
+		end
218
+	end
219
+
220
+metric = mwan_interface:option(DummyValue, "metric", translate("Metric"))
221
+	metric.rawhtml = true
222
+	function metric.cfgvalue(self, s)
223
+		local metcheck = sys.exec("uci get -p /var/state network." .. s .. ".metric")
224
+		if metcheck ~= "" then
225
+			return metcheck
226
+		else
227
+			return "&#8212;"
228
+		end
229
+	end
230
+
231
+errors = mwan_interface:option(DummyValue, "errors", translate("Errors"))
232
+	errors.rawhtml = true
233
+	function errors.cfgvalue(self, s)
234
+		if err_found == 1 then
235
+			local mouseover, linebrk = "", ""
236
+			if string.find(err_rel_list, " " .. s .. " ") then
237
+				mouseover = "Higher reliability requirement than there are tracking IP addresses"
238
+				linebrk = "&#10;&#10;"
239
+			end
240
+			if string.find(err_route_list, " " .. s .. " ") then
241
+				mouseover = mouseover .. linebrk .. "No default route in the main routing table"
242
+				linebrk = "&#10;&#10;"
243
+			end
244
+			if string.find(err_netcfg_list, " " .. s .. " ") then
245
+				mouseover = mouseover .. linebrk .. "Configured incorrectly or not at all in /etc/config/network"
246
+				linebrk = "&#10;&#10;"
247
+			end
248
+			if string.find(err_nomet_list, " " .. s .. " ") then
249
+				mouseover = mouseover .. linebrk .. "No metric configured in /etc/config/network"
250
+				linebrk = "&#10;&#10;"
251
+			end
252
+			if string.find(err_dupmet_list, " " .. s .. " ") then
253
+				mouseover = mouseover .. linebrk .. "Duplicate metric configured in /etc/config/network"
254
+			end
255
+			if mouseover == "" then
256
+				return ""
257
+			else
258
+				return "<span title=\"" .. mouseover .. "\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
259
+			end
260
+		else
261
+			return ""
262
+		end
263
+	end
264
+
265
+
266
+return m5

+ 191
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_interfaceconfig.lua View File

@@ -0,0 +1,191 @@
1
+-- ------ extra functions ------ --
2
+
3
+function iface_check()
4
+	metcheck = ut.trim(sys.exec("uci get -p /var/state network." .. arg[1] .. ".metric"))
5
+	if metcheck == "" then -- no metric
6
+		err_nomet = 1
7
+	else -- if metric exists create list of interface metrics to compare against for duplicates
8
+		uci.cursor():foreach("mwan3", "interface",
9
+			function (section)
10
+				local metlkp = ut.trim(sys.exec("uci get -p /var/state network." .. section[".name"] .. ".metric"))
11
+				metric_list = metric_list .. section[".name"] .. " " .. metlkp .. "\n"
12
+			end
13
+		)
14
+		-- compare metric against list
15
+		local metric_dupnums, metric_dupes = sys.exec("echo '" .. metric_list .. "' | awk -F' ' '{ print $2 }' | uniq -d"), ""
16
+		for line in metric_dupnums:gmatch("[^\r\n]+") do
17
+			metric_dupes = sys.exec("echo '" .. metric_list .. "' | grep '" .. line .. "' | awk -F' ' '{ print $1 }'")
18
+			err_dupmet_list = err_dupmet_list .. metric_dupes
19
+		end
20
+		if sys.exec("echo '" .. err_dupmet_list .. "' | grep -w " .. arg[1]) ~= "" then
21
+			err_dupmet = 1
22
+		end
23
+	end
24
+	-- check if this interface has a higher reliability requirement than track IPs configured
25
+	local tipnum = tonumber(ut.trim(sys.exec("echo $(uci get -p /var/state mwan3." .. arg[1] .. ".track_ip) | wc -w")))
26
+	if tipnum > 0 then
27
+		local relnum = tonumber(ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".reliability")))
28
+		if relnum and relnum > tipnum then
29
+			err_reliability = 1
30
+		end
31
+	end
32
+	-- check if any interfaces are not properly configured in /etc/config/network or have no default route in main routing table
33
+	if ut.trim(sys.exec("uci get -p /var/state network." .. arg[1])) == "interface" then
34
+		local ifdev = ut.trim(sys.exec("uci get -p /var/state network." .. arg[1] .. ".ifname"))
35
+		if ifdev == "uci: Entry not found" or ifdev == "" then
36
+			err_netcfg = 1
37
+			err_route = 1
38
+		else
39
+			local rtcheck = ut.trim(sys.exec("route -n | awk -F' ' '{ if ($8 == \"" .. ifdev .. "\" && $1 == \"0.0.0.0\") print $1 }'"))
40
+			if rtcheck == "" then
41
+				err_route = 1
42
+			end
43
+		end
44
+	else
45
+		err_netcfg = 1
46
+		err_route = 1
47
+	end
48
+end
49
+
50
+function iface_warn() -- display warning messages at the top of the page
51
+	local warns, linebrk = "", ""
52
+	if err_reliability == 1 then
53
+		warns = "<font color=\"ff0000\"><strong>WARNING: this interface has a higher reliability requirement than there are tracking IP addresses!</strong></font>"
54
+		linebrk = "<br /><br />"
55
+	end
56
+	if err_route == 1 then
57
+		warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this interface has no default route in the main routing table!</strong></font>"
58
+		linebrk = "<br /><br />"
59
+	end
60
+	if err_netcfg == 1 then
61
+		warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this interface is configured incorrectly or not at all in /etc/config/network!</strong></font>"
62
+		linebrk = "<br /><br />"
63
+	end
64
+	if err_nomet == 1 then
65
+		warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this interface has no metric configured in /etc/config/network!</strong></font>"
66
+	elseif err_dupmet == 1 then
67
+		warns = warns .. linebrk .. "<font color=\"ff0000\"><strong>WARNING: this and other interfaces have duplicate metrics configured in /etc/config/network!</strong></font>"
68
+	end
69
+	return warns
70
+end
71
+
72
+-- ------ interface configuration ------ --
73
+
74
+dsp = require "luci.dispatcher"
75
+sys = require "luci.sys"
76
+ut = require "luci.util"
77
+arg[1] = arg[1] or ""
78
+
79
+metcheck = ""
80
+metric_list = ""
81
+err_dupmet_list = ""
82
+err_rel_list = ""
83
+err_nomet = 0
84
+err_dupmet = 0
85
+err_route = 0
86
+err_netcfg = 0
87
+err_reliability = 0
88
+iface_check()
89
+
90
+
91
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Interface Configuration - " .. arg[1]),
92
+	translate(iface_warn()))
93
+	m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "interface")
94
+
95
+
96
+mwan_interface = m5:section(NamedSection, arg[1], "interface", "")
97
+	mwan_interface.addremove = false
98
+	mwan_interface.dynamic = false
99
+
100
+
101
+enabled = mwan_interface:option(ListValue, "enabled", translate("Enabled"))
102
+	enabled.default = "1"
103
+	enabled:value("1", translate("Yes"))
104
+	enabled:value("0", translate("No"))
105
+
106
+track_ip = mwan_interface:option(DynamicList, "track_ip", translate("Tracking IP"),
107
+	translate("This IP address will be pinged to dermine if the link is up or down. Leave blank to assume interface is always online"))
108
+	track_ip.datatype = "ipaddr"
109
+
110
+reliability = mwan_interface:option(Value, "reliability", translate("Tracking reliability"),
111
+	translate("Acceptable values: 1-100. This many Tracking IP addresses must respond for the link to be deemed up"))
112
+	reliability.datatype = "range(1, 100)"
113
+	reliability.default = "1"
114
+
115
+count = mwan_interface:option(ListValue, "count", translate("Ping count"))
116
+	count.default = "1"
117
+	count:value("1")
118
+	count:value("2")
119
+	count:value("3")
120
+	count:value("4")
121
+	count:value("5")
122
+
123
+timeout = mwan_interface:option(ListValue, "timeout", translate("Ping timeout"))
124
+	timeout.default = "2"
125
+	timeout:value("1", translate("1 second"))
126
+	timeout:value("2", translate("2 seconds"))
127
+	timeout:value("3", translate("3 seconds"))
128
+	timeout:value("4", translate("4 seconds"))
129
+	timeout:value("5", translate("5 seconds"))
130
+	timeout:value("6", translate("6 seconds"))
131
+	timeout:value("7", translate("7 seconds"))
132
+	timeout:value("8", translate("8 seconds"))
133
+	timeout:value("9", translate("9 seconds"))
134
+	timeout:value("10", translate("10 seconds"))
135
+
136
+interval = mwan_interface:option(ListValue, "interval", translate("Ping interval"))
137
+	interval.default = "5"
138
+	interval:value("1", translate("1 second"))
139
+	interval:value("3", translate("3 seconds"))
140
+	interval:value("5", translate("5 seconds"))
141
+	interval:value("10", translate("10 seconds"))
142
+	interval:value("20", translate("20 seconds"))
143
+	interval:value("30", translate("30 seconds"))
144
+	interval:value("60", translate("1 minute"))
145
+	interval:value("300", translate("5 minutes"))
146
+	interval:value("600", translate("10 minutes"))
147
+	interval:value("900", translate("15 minutes"))
148
+	interval:value("1800", translate("30 minutes"))
149
+	interval:value("3600", translate("1 hour"))
150
+
151
+down = mwan_interface:option(ListValue, "down", translate("Interface down"),
152
+	translate("Interface will be deemed down after this many failed ping tests"))
153
+	down.default = "3"
154
+	down:value("1")
155
+	down:value("2")
156
+	down:value("3")
157
+	down:value("4")
158
+	down:value("5")
159
+	down:value("6")
160
+	down:value("7")
161
+	down:value("8")
162
+	down:value("9")
163
+	down:value("10")
164
+
165
+up = mwan_interface:option(ListValue, "up", translate("Interface up"),
166
+	translate("Downed interface will be deemed up after this many successful ping tests"))
167
+	up.default = "3"
168
+	up:value("1")
169
+	up:value("2")
170
+	up:value("3")
171
+	up:value("4")
172
+	up:value("5")
173
+	up:value("6")
174
+	up:value("7")
175
+	up:value("8")
176
+	up:value("9")
177
+	up:value("10")
178
+
179
+metric = mwan_interface:option(DummyValue, "metric", translate("Metric"),
180
+	translate("This displays the metric assigned to this interface in /etc/config/network"))
181
+	metric.rawhtml = true
182
+	function metric.cfgvalue(self, s)
183
+		if err_nomet == 0 then
184
+			return metcheck
185
+		else
186
+			return "&#8212;"
187
+		end
188
+	end
189
+
190
+
191
+return m5

+ 46
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_member.lua View File

@@ -0,0 +1,46 @@
1
+-- ------ member configuration ------ --
2
+
3
+ds = require "luci.dispatcher"
4
+
5
+
6
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Member Configuration"))
7
+	m5:append(Template("mwan3/mwan3_config_css"))
8
+
9
+
10
+mwan_member = m5:section(TypedSection, "member", translate("Members"),
11
+	translate("Members are profiles attaching a metric and weight to an MWAN3 interface<br />" ..
12
+	"Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
13
+	"Members may not share the same name as configured interfaces, policies or rules"))
14
+	mwan_member.addremove = true
15
+	mwan_member.dynamic = false
16
+	mwan_member.sectionhead = "Member"
17
+	mwan_member.sortable = true
18
+	mwan_member.template = "cbi/tblsection"
19
+	mwan_member.extedit = ds.build_url("admin", "network", "mwan3", "configuration", "member", "%s")
20
+	function mwan_member.create(self, section)
21
+		TypedSection.create(self, section)
22
+		m5.uci:save("mwan3")
23
+		luci.http.redirect(ds.build_url("admin", "network", "mwan3", "configuration", "member", section))
24
+	end
25
+
26
+
27
+interface = mwan_member:option(DummyValue, "interface", translate("Interface"))
28
+	interface.rawhtml = true
29
+	function interface.cfgvalue(self, s)
30
+		return self.map:get(s, "interface") or "&#8212;"
31
+	end
32
+
33
+metric = mwan_member:option(DummyValue, "metric", translate("Metric"))
34
+	metric.rawhtml = true
35
+	function metric.cfgvalue(self, s)
36
+		return self.map:get(s, "metric") or "1"
37
+	end
38
+
39
+weight = mwan_member:option(DummyValue, "weight", translate("Weight"))
40
+	weight.rawhtml = true
41
+	function weight.cfgvalue(self, s)
42
+		return self.map:get(s, "weight") or "1"
43
+	end
44
+
45
+
46
+return m5

+ 47
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_memberconfig.lua View File

@@ -0,0 +1,47 @@
1
+-- ------ extra functions ------ --
2
+
3
+function cbi_add_interface(field)
4
+	uci.cursor():foreach("mwan3", "interface",
5
+		function (section)
6
+			field:value(section[".name"])
7
+		end
8
+	)
9
+end
10
+
11
+-- ------ member configuration ------ --
12
+
13
+dsp = require "luci.dispatcher"
14
+arg[1] = arg[1] or ""
15
+
16
+
17
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Member Configuration - ") .. arg[1])
18
+	m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "member")
19
+
20
+
21
+mwan_member = m5:section(NamedSection, arg[1], "member", "")
22
+	mwan_member.addremove = false
23
+	mwan_member.dynamic = false
24
+
25
+
26
+interface = mwan_member:option(Value, "interface", translate("Interface"))
27
+	cbi_add_interface(interface)
28
+
29
+metric = mwan_member:option(Value, "metric", translate("Metric"),
30
+	translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
31
+	metric.datatype = "range(1, 1000)"
32
+
33
+weight = mwan_member:option(Value, "weight", translate("Weight"),
34
+	translate("Acceptable values: 1-1000. Defaults to 1 if not set"))
35
+	weight.datatype = "range(1, 1000)"
36
+
37
+
38
+-- ------ currently configured interfaces ------ --
39
+
40
+mwan_interface = m5:section(TypedSection, "interface", translate("Currently Configured Interfaces"))
41
+	mwan_interface.addremove = false
42
+	mwan_interface.dynamic = false
43
+	mwan_interface.sortable = false
44
+	mwan_interface.template = "cbi/tblsection"
45
+
46
+
47
+return m5

+ 82
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policy.lua View File

@@ -0,0 +1,82 @@
1
+-- ------ extra functions ------ --
2
+
3
+function policy_check() -- check to see if any policy names exceed the maximum of 15 characters
4
+	uci.cursor():foreach("mwan3", "policy",
5
+		function (section)
6
+			if string.len(section[".name"]) > 15 then
7
+				toolong = 1
8
+				err_name_list = err_name_list .. section[".name"] .. " "
9
+			end
10
+		end
11
+	)
12
+end
13
+
14
+function policy_warn() -- display status and warning messages at the top of the page
15
+	if toolong == 1 then
16
+		return "<font color=\"ff0000\"><strong>WARNING: Some policies have names exceeding the maximum of 15 characters!</strong></font>"
17
+	else
18
+		return ""
19
+	end
20
+end
21
+
22
+-- ------ policy configuration ------ --
23
+
24
+ds = require "luci.dispatcher"
25
+sys = require "luci.sys"
26
+
27
+toolong = 0
28
+err_name_list = " "
29
+policy_check()
30
+
31
+
32
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Policy Configuration"),
33
+	translate(policy_warn()))
34
+	m5:append(Template("mwan3/mwan3_config_css"))
35
+
36
+
37
+mwan_policy = m5:section(TypedSection, "policy", translate("Policies"),
38
+	translate("Policies are profiles grouping one or more members controlling how MWAN3 distributes traffic<br />" ..
39
+	"Member interfaces with lower metrics are used first. Interfaces with the same metric load-balance<br />" ..
40
+	"Load-balanced member interfaces distribute more traffic out those with higher weights<br />" ..
41
+	"Names may contain characters A-Z, a-z, 0-9, _ and no spaces. Names must be 15 characters or less<br />" ..
42
+	"Policies may not share the same name as configured interfaces, members or rules"))
43
+	mwan_policy.addremove = true
44
+	mwan_policy.dynamic = false
45
+	mwan_policy.sectionhead = "Policy"
46
+	mwan_policy.sortable = true
47
+	mwan_policy.template = "cbi/tblsection"
48
+	mwan_policy.extedit = ds.build_url("admin", "network", "mwan3", "configuration", "policy", "%s")
49
+	function mwan_policy.create(self, section)
50
+		TypedSection.create(self, section)
51
+		m5.uci:save("mwan3")
52
+		luci.http.redirect(ds.build_url("admin", "network", "mwan3", "configuration", "policy", section))
53
+	end
54
+
55
+
56
+use_member = mwan_policy:option(DummyValue, "use_member", translate("Members assigned"))
57
+	use_member.rawhtml = true
58
+	function use_member.cfgvalue(self, s)
59
+		local tab, str = self.map:get(s, "use_member"), ""
60
+		if tab then
61
+			for k,v in pairs(tab) do
62
+				str = str .. v .. "<br />"
63
+			end
64
+			return str
65
+		else
66
+			return "&#8212;"
67
+		end
68
+		
69
+	end
70
+
71
+errors = mwan_policy:option(DummyValue, "errors", translate("Errors"))
72
+	errors.rawhtml = true
73
+	function errors.cfgvalue(self, s)
74
+		if not string.find(err_name_list, " " .. s .. " ") then
75
+			return ""
76
+		else
77
+			return "<span title=\"Name exceeds 15 characters\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
78
+		end
79
+	end
80
+
81
+
82
+return m5

+ 58
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_policyconfig.lua View File

@@ -0,0 +1,58 @@
1
+-- ------ extra functions ------ --
2
+
3
+function policy_check() -- check to see if this policy's name exceed the maximum of 15 characters
4
+	polchar = string.len(arg[1])
5
+	if polchar > 15 then
6
+		toolong = 1
7
+	end
8
+end
9
+
10
+function policy_warn() -- display status and warning messages at the top of the page
11
+	if toolong == 1 then
12
+		return "<font color=\"ff0000\"><strong>WARNING: this policy's name is " .. polchar .. " characters exceeding the maximum of 15!</strong></font>"
13
+	else
14
+		return ""
15
+	end
16
+end
17
+
18
+function cbi_add_member(field)
19
+	uci.cursor():foreach("mwan3", "member",
20
+		function (section)
21
+			field:value(section[".name"])
22
+		end
23
+	)
24
+end
25
+
26
+-- ------ policy configuration ------ --
27
+
28
+dsp = require "luci.dispatcher"
29
+arg[1] = arg[1] or ""
30
+
31
+toolong = 0
32
+policy_check()
33
+
34
+
35
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Policy Configuration - " .. arg[1]),
36
+	translate(policy_warn()))
37
+	m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "policy")
38
+
39
+
40
+mwan_policy = m5:section(NamedSection, arg[1], "policy", "")
41
+	mwan_policy.addremove = false
42
+	mwan_policy.dynamic = false
43
+
44
+
45
+use_member = mwan_policy:option(DynamicList, "use_member", translate("Member used"))
46
+	cbi_add_member(use_member)
47
+
48
+
49
+-- ------ currently configured members ------ --
50
+
51
+mwan_member = m5:section(TypedSection, "member", translate("Currently Configured Members"))
52
+	mwan_member.addremove = false
53
+	mwan_member.dynamic = false
54
+	mwan_member.sortable = false
55
+	mwan_member.template = "cbi/tblsection"
56
+
57
+
58
+return m5

+ 109
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_rule.lua View File

@@ -0,0 +1,109 @@
1
+-- ------ extra functions ------ --
2
+
3
+function rule_check() -- determine if rules needs a proper protocol configured
4
+	uci.cursor():foreach("mwan3", "rule",
5
+		function (section)
6
+			local sport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. section[".name"] .. ".src_port"))
7
+			local dport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. section[".name"] .. ".dest_port"))
8
+			if sport ~= "" or dport ~= "" then -- ports configured
9
+				local proto = ut.trim(sys.exec("uci get -p /var/state mwan3." .. section[".name"] .. ".proto"))
10
+				if proto == "" or proto == "all" then -- no or improper protocol
11
+					err_proto_list = err_proto_list .. section[".name"] .. " "
12
+				end
13
+			end
14
+		end
15
+	)
16
+end
17
+
18
+function rule_warn() -- display warning messages at the top of the page
19
+	if err_proto_list ~= " " then
20
+		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>"
21
+	else
22
+		return ""
23
+	end
24
+end
25
+
26
+-- ------ rule configuration ------ --
27
+
28
+dsp = require "luci.dispatcher"
29
+sys = require "luci.sys"
30
+ut = require "luci.util"
31
+
32
+err_proto = 0
33
+err_proto_list = " "
34
+rule_check()
35
+
36
+
37
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Traffic Rule Configuration"),
38
+	translate(rule_warn()))
39
+	m5:append(Template("mwan3/mwan3_config_css"))
40
+
41
+
42
+mwan_rule = m5:section(TypedSection, "rule", translate("Traffic Rules"),
43
+	translate("Rules specify which traffic will use a particular MWAN3 policy based on IP address, port or protocol<br />" ..
44
+	"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 />" ..
45
+	"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 />" ..
46
+	"Names may contain characters A-Z, a-z, 0-9, _ and no spaces<br />" ..
47
+	"Rules may not share the same name as configured interfaces, members or policies"))
48
+	mwan_rule.addremove = true
49
+	mwan_rule.anonymous = false
50
+	mwan_rule.dynamic = false
51
+	mwan_rule.sectionhead = "Rule"
52
+	mwan_rule.sortable = true
53
+	mwan_rule.template = "cbi/tblsection"
54
+	mwan_rule.extedit = dsp.build_url("admin", "network", "mwan3", "configuration", "rule", "%s")
55
+	function mwan_rule.create(self, section)
56
+		TypedSection.create(self, section)
57
+		m5.uci:save("mwan3")
58
+		luci.http.redirect(dsp.build_url("admin", "network", "mwan3", "configuration", "rule", section))
59
+	end
60
+
61
+
62
+src_ip = mwan_rule:option(DummyValue, "src_ip", translate("Source address"))
63
+	src_ip.rawhtml = true
64
+	function src_ip.cfgvalue(self, s)
65
+		return self.map:get(s, "src_ip") or "&#8212;"
66
+	end
67
+
68
+src_port = mwan_rule:option(DummyValue, "src_port", translate("Source port"))
69
+	src_port.rawhtml = true
70
+	function src_port.cfgvalue(self, s)
71
+		return self.map:get(s, "src_port") or "&#8212;"
72
+	end
73
+
74
+dest_ip = mwan_rule:option(DummyValue, "dest_ip", translate("Destination address"))
75
+	dest_ip.rawhtml = true
76
+	function dest_ip.cfgvalue(self, s)
77
+		return self.map:get(s, "dest_ip") or "&#8212;"
78
+	end
79
+
80
+dest_port = mwan_rule:option(DummyValue, "dest_port", translate("Destination port"))
81
+	dest_port.rawhtml = true
82
+	function dest_port.cfgvalue(self, s)
83
+		return self.map:get(s, "dest_port") or "&#8212;"
84
+	end
85
+
86
+proto = mwan_rule:option(DummyValue, "proto", translate("Protocol"))
87
+	proto.rawhtml = true
88
+	function proto.cfgvalue(self, s)
89
+		return self.map:get(s, "proto") or "all"
90
+	end
91
+
92
+use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned"))
93
+	use_policy.rawhtml = true
94
+	function use_policy.cfgvalue(self, s)
95
+		return self.map:get(s, "use_policy") or "&#8212;"
96
+	end
97
+
98
+errors = mwan_rule:option(DummyValue, "errors", translate("Errors"))
99
+	errors.rawhtml = true
100
+	function errors.cfgvalue(self, s)
101
+		if not string.find(err_proto_list, " " .. s .. " ") then
102
+			return ""
103
+		else
104
+			return "<span title=\"No protocol specified\"><img src=\"/luci-static/resources/cbi/reset.gif\" alt=\"error\"></img></span>"
105
+		end
106
+	end
107
+
108
+
109
+return m5

+ 99
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan3/mwan3_ruleconfig.lua View File

@@ -0,0 +1,99 @@
1
+-- ------ extra functions ------ --
2
+
3
+function rule_check() -- determine if rule needs a protocol specified
4
+	local sport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".src_port"))
5
+	local dport = ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".dest_port"))
6
+	if sport ~= "" or dport ~= "" then -- ports configured
7
+		local proto = ut.trim(sys.exec("uci get -p /var/state mwan3." .. arg[1] .. ".proto"))
8
+		if proto == "" or proto == "all" then -- no or improper protocol
9
+			err_proto = 1
10
+		end
11
+	end
12
+end
13
+
14
+function rule_warn() -- display warning message at the top of the page
15
+	if err_proto == 1 then
16
+		return "<font color=\"ff0000\"><strong>WARNING: this rule is incorrectly configured with no or improper protocol specified! Please configure a specific protocol!</strong></font>"
17
+	else
18
+		return ""
19
+	end
20
+end
21
+
22
+function cbi_add_policy(field)
23
+	uci.cursor():foreach("mwan3", "policy",
24
+		function (section)
25
+			field:value(section[".name"])
26
+		end
27
+	)
28
+end
29
+
30
+function cbi_add_protocol(field)
31
+	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' ' '"))
32
+	for p in string.gmatch(protos, "%S+") do
33
+		field:value(p)
34
+	end
35
+end
36
+
37
+-- ------ rule configuration ------ --
38
+
39
+dsp = require "luci.dispatcher"
40
+sys = require "luci.sys"
41
+ut = require "luci.util"
42
+arg[1] = arg[1] or ""
43
+
44
+err_proto = 0
45
+rule_check()
46
+
47
+
48
+m5 = Map("mwan3", translate("MWAN3 Multi-WAN Rule Configuration - ") .. arg[1],
49
+	translate(rule_warn()))
50
+	m5.redirect = dsp.build_url("admin", "network", "mwan3", "configuration", "rule")
51
+
52
+
53
+mwan_rule = m5:section(NamedSection, arg[1], "rule", "")
54
+	mwan_rule.addremove = false
55
+	mwan_rule.dynamic = false
56
+
57
+
58
+src_ip = mwan_rule:option(Value, "src_ip", translate("Source address"),
59
+	translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"))
60
+	src_ip.datatype = ipaddr
61
+
62
+src_port = mwan_rule:option(Value, "src_port", translate("Source port"),
63
+	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"))
64
+
65
+dest_ip = mwan_rule:option(Value, "dest_ip", translate("Destination address"),
66
+	translate("Supports CIDR notation (eg \"192.168.100.0/24\") without quotes"))
67
+	dest_ip.datatype = ipaddr
68
+
69
+dest_port = mwan_rule:option(Value, "dest_port", translate("Destination port"),
70
+	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"))
71
+
72
+proto = mwan_rule:option(Value, "proto", translate("Protocol"),
73
+	translate("View the contents of /etc/protocols for protocol descriptions"))
74
+	proto.default = "all"
75
+	proto.rmempty = false
76
+	proto:value("all")
77
+	proto:value("ip")
78
+	proto:value("tcp")
79
+	proto:value("udp")
80
+	proto:value("icmp")
81
+	proto:value("esp")
82
+	cbi_add_protocol(proto)
83
+
84
+use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned"))
85
+	cbi_add_policy(use_policy)
86
+	use_policy:value("unreachable")
87
+	use_policy:value("default")
88
+
89
+
90
+-- ------ currently configured policies ------ --
91
+
92
+mwan_policy = m5:section(TypedSection, "policy", translate("Currently Configured Policies"))
93
+	mwan_policy.addremove = false
94
+	mwan_policy.dynamic = false
95
+	mwan_policy.sortable = false
96
+	mwan_policy.template = "cbi/tblsection"
97
+
98
+
99
+return m5

+ 1
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/admin_status/index/mwan3.htm View File

@@ -0,0 +1 @@
1
+<%+mwan3/mwan3_status%>

+ 134
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_diagnostics.htm View File

@@ -0,0 +1,134 @@
1
+<%+header%>
2
+
3
+<ul class="cbi-tabmenu">
4
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
5
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
6
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
7
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
8
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
9
+</ul>
10
+
11
+<%
12
+	local uci = require "luci.model.uci"
13
+
14
+	str = ""
15
+	uci.cursor():foreach("mwan3", "interface",
16
+		function (section)
17
+			str = str .. section[".name"] .. " "
18
+		end
19
+	)
20
+%>
21
+
22
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
23
+<script type="text/javascript">//<![CDATA[
24
+	var stxhr = new XHR();
25
+
26
+	function update_status(tool, alt)
27
+	{
28
+		var iface = document.getElementById('mwan3iface').value;
29
+		var output = document.getElementById('diag_output');
30
+
31
+		if (tool == "service")
32
+			{
33
+				output.innerHTML =
34
+					'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
35
+					"Waiting for MWAN3 to " + alt + "..."
36
+				;
37
+			}
38
+			else
39
+			{
40
+				output.innerHTML =
41
+					'<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="padding: 20px; vertical-align: middle;" /> ' +
42
+					"Waiting for diagnostic results..."
43
+				;
44
+			}
45
+
46
+		output.parentNode.style.display = 'block';
47
+		output.style.display = 'inline';
48
+
49
+		stxhr.get('<%=luci.dispatcher.build_url("admin", "network", "mwan3", "advanced")%>/diag_display' + '/' + iface + '/' + tool + '/' + alt, null,
50
+			function(x, st)
51
+			{
52
+				if (st.diagres)
53
+				{
54
+					output.innerHTML = String.format('<pre id="diag_output_css">%h</pre>', st.diagres[0].diagresult);
55
+				}
56
+				else
57
+				{
58
+					var temp = '';
59
+					var ncint = 'No diagnostic results returned';
60
+					temp = String.format(
61
+						'<pre id="diag_output_css"><strong>%s</strong></pre>',
62
+							ncint
63
+					);
64
+					output.innerHTML = temp;
65
+				}
66
+			}
67
+		);
68
+	}
69
+//]]></script>
70
+
71
+<div id="mwan3_diagnostics" class="cbi-map">
72
+	<fieldset id="diag_select" class="cbi-section">
73
+		<legend><%:MWAN3 Interface Diagnostics%></legend>
74
+		<select id="mwan3iface">
75
+			<% for z in str:gmatch("[^ ]+") do -%><option value="<%=z%>"><%=z%></option><%- end %>
76
+		</select>
77
+		<div id="buttoncss">
78
+			<input type="button" value="<%:Ping default gateway%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'gateway')" />
79
+			<input type="button" value="<%:Ping tracking IP%>" class="cbi-button cbi-button-apply" onclick="update_status('ping', 'track_ip')" />
80
+			<input type="button" value="<%:Check IP rules%>" class="cbi-button cbi-button-apply" onclick="update_status('rulechk', null)" />
81
+			<input type="button" value="<%:Check routing table%>" class="cbi-button cbi-button-apply" onclick="update_status('routechk', null)" />
82
+			<input type="button" value="<%:Hotplug ifup%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifup')" />
83
+			<input type="button" value="<%:Hotplug ifdown%>" class="cbi-button cbi-button-apply" onclick="update_status('hotplug', 'ifdown')" />
84
+		</div>
85
+	</fieldset>
86
+	<fieldset id="diag_select" class="cbi-section">
87
+		<legend><%:MWAN3 Service Control%></legend>
88
+		<div id="buttoncss">
89
+			<input type="button" value="<%:Restart MWAN3%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'restart')" />
90
+			<input type="button" value="<%:Stop MWAN3%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'stop')" />
91
+			<input type="button" value="<%:Start MWAN3%>" class="cbi-button cbi-button-apply" onclick="update_status('service', 'start')" />
92
+		</div>
93
+	</fieldset>
94
+	<fieldset class="cbi-section" style="display:none">
95
+		<legend><%:Diagnostic Results%></legend>
96
+		<div id="diag_output"></div>
97
+	</fieldset>
98
+</div>
99
+
100
+<style type="text/css">
101
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
102
+	max-width: none;
103
+	margin-left: 30px;
104
+	padding-right: 30px;
105
+	width: auto;
106
+  }
107
+  #mwan3_diagnostics {
108
+	background-color: #FFFFFF;
109
+	border: 1px dotted #555555;
110
+	padding: 20px;
111
+  }
112
+  #diag_select {
113
+	padding: 12px 20px 20px 20px;
114
+  }
115
+  #mwan3iface {
116
+	float: left;
117
+	margin: 8px 20px 0px 0px;
118
+  }
119
+  #buttoncss {
120
+	display: table;
121
+	float: left;
122
+	text-align: left;
123
+  }
124
+  .cbi-button {
125
+	margin: 8px 20px 0px 0px;
126
+	min-width: 153px;
127
+  }
128
+  #diag_output_css {
129
+	padding: 20px;
130
+	text-align: left;
131
+  }
132
+</style>
133
+
134
+<%+footer%>

+ 23
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_hotplug.htm View File

@@ -0,0 +1,23 @@
1
+<ul class="cbi-tabmenu">
2
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
3
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
4
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
5
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
6
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
7
+</ul>
8
+
9
+<style type="text/css">
10
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
11
+	max-width: none;
12
+	margin: 0px 0px 0px 30px;
13
+	padding-right: 30px;
14
+	width: auto;
15
+  }
16
+  .cbi-section-node {
17
+	margin-top: 20px;
18
+  }
19
+  .cbi-section {
20
+	border: 1px dotted #555555;
21
+	padding: 20px;
22
+  }
23
+</style>

+ 23
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_mwan3.htm View File

@@ -0,0 +1,23 @@
1
+<ul class="cbi-tabmenu">
2
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
3
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
4
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
5
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
6
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
7
+</ul>
8
+
9
+<style type="text/css">
10
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
11
+	max-width: none;
12
+	margin: 0px 0px 0px 30px;
13
+	padding-right: 30px;
14
+	width: auto;
15
+  }
16
+  .cbi-section-node {
17
+	margin-top: 20px;
18
+  }
19
+  .cbi-section {
20
+	border: 1px dotted #555555;
21
+	padding: 20px;
22
+  }
23
+</style>

+ 23
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_network.htm View File

@@ -0,0 +1,23 @@
1
+<ul class="cbi-tabmenu">
2
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
3
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
4
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
5
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
6
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
7
+</ul>
8
+
9
+<style type="text/css">
10
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
11
+	max-width: none;
12
+	margin: 0px 0px 0px 30px;
13
+	padding-right: 30px;
14
+	width: auto;
15
+  }
16
+  .cbi-section-node {
17
+	margin-top: 20px;
18
+  }
19
+  .cbi-section {
20
+	border: 1px dotted #555555;
21
+	padding: 20px;
22
+  }
23
+</style>

+ 77
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_adv_troubleshoot.htm View File

@@ -0,0 +1,77 @@
1
+<%+header%>
2
+
3
+<ul class="cbi-tabmenu">
4
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/hotplug")%>"><%:Hotplug Script%></a></li>
5
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/mwan3")%>"><%:MWAN3 Config%></a></li>
6
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/network")%>"><%:Network Config%></a></li>
7
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/diag")%>"><%:Diagnostics%></a></li>
8
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/advanced/tshoot")%>"><%:Troubleshooting%></a></li>
9
+</ul>
10
+
11
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
12
+<script type="text/javascript">//<![CDATA[
13
+	XHR.poll(15, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "advanced", "tshoot_display")%>', null,
14
+		function(x, st)
15
+		{
16
+			var tx = document.getElementById('mwan3_tshoot_text');
17
+			if (st.mw3ver)
18
+			{
19
+				var temp = '';
20
+				var mwanvers = 'Software versions : <br /><br />';
21
+				var mwan3cnfg = '<br /><br />Output of &#34;cat /etc/config/mwan3&#34; : <br /><br />';
22
+				var netcnfg = '<br /><br />Output of &#34;cat /etc/config/network&#34; : <br /><br />';
23
+				var ifcnfg = '<br /><br />Output of &#34;ifconfig&#34; : <br /><br />';
24
+				var iproute = '<br /><br />Output of &#34;route -n&#34; : <br /><br />';
25
+				var iprulesh = '<br /><br />Output of &#34;ip rule show&#34; : <br /><br />';
26
+				var routelisttbl = '<br /><br />Output of &#34;ip route list table 1-250&#34; : <br /><br />';
27
+				var firewalldef = '<br /><br />Firewall default output policy (must be ACCEPT) : <br /><br />';
28
+				var iptable = '<br /><br />Output of &#34;iptables -L -t mangle -v -n&#34; : <br /><br />';
29
+
30
+				temp = String.format(
31
+					'<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>',
32
+						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
33
+				);
34
+				tx.innerHTML = temp;
35
+			}
36
+			else
37
+			{
38
+				var temp = '';
39
+				var terror = 'Error collecting troubleshooting information';
40
+				temp = String.format(
41
+					'<strong>%s</strong>',
42
+						terror
43
+				);
44
+				tx.innerHTML = temp;
45
+			}
46
+		}
47
+	);
48
+//]]></script>
49
+
50
+<div id="tshoot_div">
51
+	<fieldset class="cbi-section">
52
+		<legend><%:Troubleshooting Data%></legend>
53
+		<div id="mwan3_tshoot_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
54
+	</fieldset>
55
+</div>
56
+<style type="text/css">
57
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
58
+	max-width: none;
59
+	margin-left: 30px;
60
+	padding-right: 30px;
61
+	width: auto;
62
+  }
63
+  #tshoot_div {
64
+	background-color: #FFFFFF;
65
+	border: 1px dotted #555555;
66
+	padding: 20px;
67
+  }
68
+  #mwan3_tshoot_text {
69
+	padding: 20px;
70
+	text-align: left;
71
+  }
72
+  .tsht {
73
+	background-color: rgb(78, 186, 241);
74
+  }
75
+</style>
76
+
77
+<%+footer%>

+ 34
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_config_css.htm View File

@@ -0,0 +1,34 @@
1
+<style type="text/css">
2
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
3
+	max-width: none;
4
+	margin-left: 30px;
5
+	padding-right: 30px;
6
+	width: auto;
7
+  }
8
+  table td {  /*cells showing the configuration values*/
9
+	padding: 0px;
10
+	text-align: center;
11
+	vertical-align: middle;
12
+  }
13
+  table th {  /*column for configuration section name*/
14
+	padding: 0px;
15
+	text-align: center;
16
+	vertical-align: middle;
17
+  }
18
+  table tbody th {  /*column for configuration section name*/
19
+	padding: 0px;
20
+	vertical-align: middle;
21
+  }
22
+  .cbi-section-node table div {  /*rows*/
23
+	padding-top: 5px;
24
+  }
25
+  table.cbi-section-table td.cbi-section-table-cell {  /*sort buttons column*/
26
+	text-align: center;
27
+  }
28
+  .cbi-section h3 {
29
+	color: rgb(85, 85, 85);
30
+	font-family: Trebuchet MS,Verdana,sans-serif;
31
+	font-style: italic;
32
+	font-weight: normal;
33
+  }
34
+</style>

+ 62
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_detail.htm View File

@@ -0,0 +1,62 @@
1
+<%+header%>
2
+
3
+<ul class="cbi-tabmenu">
4
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview")%>"><%:Interface Status%></a></li>
5
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview/over_detail")%>"><%:Detailed Status%></a></li>
6
+</ul>
7
+
8
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
9
+<script type="text/javascript">//<![CDATA[
10
+	XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "overview", "detail_status")%>', null,
11
+		function(x, st)
12
+		{
13
+			var tx = document.getElementById('mwan3_detail_text');
14
+			if (st.mwan3dst)
15
+			{
16
+				var temp = '';
17
+				temp = String.format(
18
+					'<pre>%s</pre>',
19
+						st.mwan3dst[0].detailstat
20
+				);
21
+				tx.innerHTML = temp;
22
+			}
23
+			else
24
+			{
25
+				var temp = '';
26
+				var nslg = 'No detailed status information available';
27
+				temp = String.format(
28
+					'<strong>%s</strong>',
29
+						nslg
30
+				);
31
+				tx.innerHTML = temp;
32
+			}
33
+		}
34
+	);
35
+//]]></script>
36
+
37
+<div id="mwan3_detail_status">
38
+	<fieldset class="cbi-section">
39
+		<legend><%:MWAN3 Multi-WAN Detailed Status%></legend>
40
+		<div id="mwan3_detail_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
41
+	</fieldset>
42
+</div>
43
+
44
+<style type="text/css">
45
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
46
+	max-width: none;
47
+	margin-left: 30px;
48
+	padding-right: 30px;
49
+	width: auto;
50
+  }
51
+  #mwan3_detail_status {
52
+	border: 1px dotted #555555;
53
+	background-color: #FFFFFF;
54
+	padding: 20px;
55
+  }
56
+  #mwan3_detail_text {
57
+	padding: 20px;
58
+	text-align: left;
59
+  }
60
+</style>
61
+
62
+<%+footer%>

+ 146
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_over_interface.htm View File

@@ -0,0 +1,146 @@
1
+<%+header%>
2
+
3
+<ul class="cbi-tabmenu">
4
+	<li class="cbi-tab"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview")%>"><%:Interface Status%></a></li>
5
+	<li class="cbi-tab-disabled"><a href="<%=luci.dispatcher.build_url("admin/network/mwan3/overview/over_detail")%>"><%:Detailed Status%></a></li>
6
+</ul>
7
+
8
+<script type="text/javascript" src="<%=resource%>/cbi.js"></script>
9
+<script type="text/javascript">//<![CDATA[
10
+	XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "overview", "iface_status")%>', null,
11
+		function(x, st)
12
+		{
13
+			var tx = document.getElementById('mwan3_status_text');
14
+			if (st.wans)
15
+			{
16
+				var temp = '';
17
+
18
+				for( var i = 0; i < st.wans.length; i++ )
19
+				{
20
+					var stat = '';
21
+					var cssc = '';
22
+
23
+					switch (st.wans[i].status)
24
+					{
25
+						case 'on':
26
+							stat = 'Online (tracking active)';
27
+							cssc = 'wanon';
28
+							break;
29
+
30
+						case 'nm':
31
+							stat = 'Online (tracking off)';
32
+							cssc = 'wanon';
33
+							break;
34
+
35
+						case 'off':
36
+							stat = 'Offline';
37
+							cssc = 'wanoff';
38
+							break;
39
+
40
+						case 'ne':
41
+							stat = 'Disabled';
42
+							cssc = 'wanoff';
43
+							break;
44
+					}
45
+
46
+					temp += String.format(
47
+						'<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
48
+							cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
49
+					);
50
+				}
51
+				tx.innerHTML = temp;
52
+			}
53
+			else
54
+			{
55
+				var temp = '';
56
+				var ncint = 'No MWAN3 interfaces found';
57
+				temp = String.format(
58
+					'<strong>%s</strong>',
59
+						ncint
60
+				);
61
+				tx.innerHTML = temp;
62
+			}
63
+
64
+			var tx = document.getElementById('mwan3_statuslog_text');
65
+			if (st.mwan3log)
66
+			{
67
+				var temp = '';
68
+				var mwan3lg = 'Last 50 MWAN3 systemlog entries. Newest entries sorted at the top :';
69
+
70
+				temp = String.format(
71
+					'<pre>%s<br /><br />%s</pre>',
72
+						mwan3lg, st.mwan3log[0].mwanlog
73
+				);
74
+				tx.innerHTML = temp;
75
+			}
76
+			else
77
+			{
78
+				var temp = '';
79
+				var nslg = 'No MWAN3 systemlog history found';
80
+				temp = String.format(
81
+					'<strong>%s</strong>',
82
+						nslg
83
+				);
84
+				tx.innerHTML = temp;
85
+			}
86
+		}
87
+	);
88
+//]]></script>
89
+
90
+<div id="mwan3_interface_status">
91
+	<fieldset id="interface_field" class="cbi-section">
92
+		<legend><%:MWAN3 Multi-WAN Interface Live Status%></legend>
93
+		<div id="mwan3_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
94
+	</fieldset>
95
+	<fieldset class="cbi-section">
96
+		<legend><%:MWAN3 Multi-WAN Interface Systemlog%></legend>
97
+		<div id="mwan3_statuslog_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
98
+	</fieldset>
99
+</div>
100
+
101
+<style type="text/css">
102
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
103
+	max-width: none;
104
+	margin-left: 30px;
105
+	padding-right: 30px;
106
+	width: auto;
107
+  }
108
+  #mwan3_interface_status {
109
+	background-color: #FFFFFF;
110
+	border: 1px dotted #555555;
111
+	padding: 20px;
112
+  }
113
+  #interface_field {
114
+	padding: 12px 20px 20px 20px;
115
+  }
116
+  #mwan3_status_text {
117
+	display: table;
118
+	font-size: 14px;
119
+	margin: auto;
120
+	max-width: 1044px;
121
+	min-width: 246px;
122
+	width: 100%;
123
+  }
124
+  .wanon {
125
+	background-color: rgb(144, 240, 144);
126
+  }
127
+  .wanoff {
128
+	background-color: rgb(240, 144, 144);
129
+  }
130
+  .wanon, .wanoff {
131
+	border-radius: 60px;
132
+	box-shadow: 0px 2px 5px -3px;
133
+	float: left;
134
+	margin: 8px 3px 0px 3px;
135
+	min-height: 30px;
136
+	min-width: 235px;
137
+	padding: 5px 10px 8px 10px;
138
+	text-align: center;
139
+  }
140
+  #mwan3_statuslog_text {
141
+	padding: 20px;
142
+	text-align: left;
143
+  }
144
+</style>
145
+
146
+<%+footer%>

+ 95
- 0
net/mwan3-luci/files/usr/lib/lua/luci/view/mwan3/mwan3_status.htm View File

@@ -0,0 +1,95 @@
1
+<script type="text/javascript">//<![CDATA[
2
+	XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "mwan3", "overview", "iface_status")%>', null,
3
+		function(x, st)
4
+		{
5
+			var tx = document.getElementById('mwan3_status_text');
6
+			if (st.wans)
7
+			{
8
+				var temp = '';
9
+
10
+				for( var i = 0; i < st.wans.length; i++ )
11
+				{
12
+					var stat = '';
13
+					var cssc = '';
14
+
15
+					switch (st.wans[i].status)
16
+					{
17
+						case 'on':
18
+							stat = 'Online (tracking active)';
19
+							cssc = 'wanon';
20
+							break;
21
+
22
+						case 'nm':
23
+							stat = 'Online (tracking off)';
24
+							cssc = 'wanon';
25
+							break;
26
+
27
+						case 'off':
28
+							stat = 'Offline';
29
+							cssc = 'wanoff';
30
+							break;
31
+
32
+						case 'ne':
33
+							stat = 'Disabled';
34
+							cssc = 'wanoff';
35
+							break;
36
+					}
37
+
38
+					temp += String.format(
39
+						'<span class="%s"><strong>%s (<a href="%q">%s</a>)</strong><br />%s</span>',
40
+							cssc, st.wans[i].name, st.wans[i].link, st.wans[i].ifname, stat
41
+					);
42
+				}
43
+				tx.innerHTML = temp;
44
+			}
45
+			else
46
+			{
47
+				var temp = '';
48
+				var ncint = 'No MWAN3 interfaces found';
49
+				temp += String.format(
50
+					'<strong>%s</strong>',
51
+						ncint
52
+				);
53
+				tx.innerHTML = temp;
54
+			}
55
+		}
56
+	);
57
+//]]></script>
58
+
59
+<fieldset id="interface_field" class="cbi-section">
60
+	<legend><%:MWAN3 Multi-WAN Interface Live Status%></legend>
61
+	<div id="mwan3_status_text"><img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" /> Collecting data...</div>
62
+</fieldset>
63
+
64
+<style type="text/css">
65
+  .container {  /*container for entire page. fixes bootstrap theme's ridiculously small page width*/
66
+	max-width: 1044px;
67
+  }
68
+  #interface_field {
69
+	padding: 12px 20px 20px 20px;
70
+  }
71
+  #mwan3_status_text {
72
+	display: table;
73
+	font-size: 14px;
74
+	margin: auto;
75
+	max-width: 1044px;
76
+	min-width: 246px;
77
+	width: 100%;
78
+  }
79
+  .wanon {
80
+	background-color: rgb(144, 240, 144);
81
+  }
82
+  .wanoff {
83
+	background-color: rgb(240, 144, 144);
84
+  }
85
+  .wanon, .wanoff {
86
+	border-radius: 60px;
87
+	box-shadow: 0px 2px 5px -3px;
88
+	float: left;
89
+	margin: 8px 3px 0px 3px;
90
+	min-height: 30px;
91
+	min-width: 235px;
92
+	padding: 5px 10px 8px 10px;
93
+	text-align: center;
94
+  }
95
+</style>

+ 48
- 0
net/mwan3/Makefile View File

@@ -0,0 +1,48 @@
1
+#
2
+# Copyright (C) 2006-2014 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=mwan3
11
+PKG_VERSION:=1.4
12
+PKG_RELEASE:=22
13
+PKG_MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
14
+PKG_LICENSE:=GPLv2
15
+
16
+include $(INCLUDE_DIR)/package.mk
17
+
18
+define Package/mwan3
19
+   SECTION:=net
20
+   CATEGORY:=Network
21
+   SUBMENU:=Routing and Redirection
22
+   DEPENDS:=+ip +iptables +iptables-mod-conntrack-extra +iptables-mod-ipopt
23
+   TITLE:=Multiwan hotplug script with connection tracking support
24
+   MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
25
+   PKGARCH:=all
26
+endef
27
+
28
+define Package/mwan3/description
29
+   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.
30
+endef
31
+
32
+define Package/mwan3/conffiles
33
+   /etc/config/mwan3
34
+endef
35
+
36
+define Build/Compile
37
+endef
38
+
39
+define Package/mwan3/install
40
+   $(CP) ./files/* $(1)
41
+endef
42
+
43
+define Package/mwan3/postinst
44
+   [ -n "$${IPKG_INSTROOT}" ] || /etc/init.d/mwan3 enable
45
+   exit 0
46
+endef
47
+
48
+$(eval $(call BuildPackage,mwan3))

+ 79
- 0
net/mwan3/files/etc/config/mwan3 View File

@@ -0,0 +1,79 @@
1
+
2
+config interface 'wan'
3
+	option enabled '1'
4
+	list track_ip '8.8.4.4'
5
+	list track_ip '8.8.8.8'
6
+	list track_ip '208.67.222.222'
7
+	list track_ip '208.67.220.220'
8
+	option reliability '2'
9
+	option count '1'
10
+	option timeout '2'
11
+	option interval '5'
12
+	option down '3'
13
+	option up '8'
14
+
15
+config interface 'wan2'
16
+	option enabled '0'
17
+	list track_ip '8.8.8.8'
18
+	list track_ip '208.67.220.220'
19
+	option reliability '1'
20
+	option count '1'
21
+	option timeout '2'
22
+	option interval '5'
23
+	option down '3'
24
+	option up '8'
25
+
26
+config member 'wan_m1_w3'
27
+	option interface 'wan'
28
+	option metric '1'
29
+	option weight '3'
30
+
31
+config member 'wan_m2_w3'
32
+	option interface 'wan'
33
+	option metric '2'
34
+	option weight '3'
35
+
36
+config member 'wan2_m1_w2'
37
+	option interface 'wan2'
38
+	option metric '1'
39
+	option weight '2'
40
+
41
+config member 'wan2_m2_w2'
42
+	option interface 'wan2'
43
+	option metric '2'
44
+	option weight '2'
45
+
46
+config policy 'wan_only'
47
+	list use_member 'wan_m1_w3'
48
+
49
+config policy 'wan2_only'
50
+	list use_member 'wan2_m1_w2'
51
+
52
+config policy 'balanced'
53
+	list use_member 'wan_m1_w3'
54
+	list use_member 'wan2_m1_w2'
55
+
56
+config policy 'wan_wan2'
57
+	list use_member 'wan_m1_w3'
58
+	list use_member 'wan2_m2_w2'
59
+
60
+config policy 'wan2_wan'
61
+	list use_member 'wan_m2_w3'
62
+	list use_member 'wan2_m1_w2'
63
+
64
+config rule 'sticky_even'
65
+	option src_ip '0.0.0.0/0.0.0.1'
66
+	option dest_port '443'
67
+	option proto 'tcp'
68
+	option use_policy 'wan_wan2'
69
+
70
+config rule 'sticky_odd'
71
+	option src_ip '0.0.0.1/0.0.0.1'
72
+	option dest_port '443'
73
+	option proto 'tcp'
74
+	option use_policy 'wan2_wan'
75
+
76
+config rule 'default_rule'
77
+	option dest_ip '0.0.0.0/0'
78
+	option use_policy 'balanced'
79
+

+ 328
- 0
net/mwan3/files/etc/hotplug.d/iface/15-mwan3 View File

@@ -0,0 +1,328 @@
1
+#!/bin/sh
2
+
3
+mwan3_get_iface_id()
4
+{
5
+	let iface_count++
6
+	[ "$1" == "$INTERFACE" ] && iface_id=$iface_count
7
+}
8
+
9
+mwan3_get_route_args()
10
+{
11
+	route_args=$(ip -4 route list dev $DEVICE default | head -1 | sed '/.*via \([^ ]*\) .*$/!d;s//\1/;q' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}')
12
+	[ -n "$route_args" ] && route_args="via $route_args"
13
+	route_args="nexthop $route_args dev $DEVICE"
14
+}
15
+
16
+mwan3_set_general_iptables()
17
+{
18
+	if ! iptables -S mwan3_ifaces -t mangle &> /dev/null; then
19
+		iptables -N mwan3_ifaces -t mangle
20
+	fi
21
+
22
+	if ! iptables -S mwan3_rules -t mangle &> /dev/null; then
23
+		iptables -N mwan3_rules -t mangle
24
+	fi
25
+
26
+	if ! iptables -S mwan3_connected -t mangle &> /dev/null; then
27
+		iptables -N mwan3_connected -t mangle
28
+	fi
29
+
30
+	if ! iptables -S mwan3_hook -t mangle &> /dev/null; then
31
+		iptables -N mwan3_hook -t mangle
32
+		iptables -A mwan3_hook -t mangle -j CONNMARK --restore-mark --nfmask 0xff00 --ctmask 0xff00
33
+		iptables -A mwan3_hook -t mangle -m mark --mark 0x0/0xff00 -j mwan3_ifaces
34
+		iptables -A mwan3_hook -t mangle -m mark --mark 0x0/0xff00 -j mwan3_connected
35
+		iptables -A mwan3_hook -t mangle -m mark --mark 0x0/0xff00 -j mwan3_rules
36
+		iptables -A mwan3_hook -t mangle -j CONNMARK --save-mark --nfmask 0xff00 --ctmask 0xff00
37
+	fi
38
+
39
+	if ! iptables -S mwan3_track_hook -t mangle &> /dev/null; then
40
+		iptables -N mwan3_track_hook -t mangle
41
+	fi
42
+
43
+	if ! iptables -S PREROUTING -t mangle | grep mwan3_hook &> /dev/null; then
44
+		iptables -A PREROUTING -t mangle -j mwan3_hook
45
+	fi
46
+
47
+	if ! iptables -S OUTPUT -t mangle | grep mwan3_hook &> /dev/null; then
48
+		iptables -A OUTPUT -t mangle -j mwan3_hook
49
+	fi
50
+
51
+	if ! iptables -S OUTPUT -t mangle | grep mwan3_track_hook &> /dev/null; then
52
+		iptables -A OUTPUT -t mangle -j mwan3_track_hook
53
+	fi
54
+
55
+	iptables -F mwan3_rules -t mangle
56
+}
57
+
58
+mwan3_set_connected_iptables()
59
+{
60
+	local connected_networks
61
+
62
+	if iptables -S mwan3_connected -t mangle &> /dev/null; then
63
+		iptables -F mwan3_connected -t mangle
64
+
65
+		for connected_networks in $(ip -4 route | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}'); do
66
+			iptables -A mwan3_connected -t mangle -d $connected_networks -m mark --mark 0x0/0xff00 -j MARK --set-xmark 0xff00/0xff00
67
+		done
68
+
69
+		iptables -I mwan3_connected -t mangle -d 224.0.0.0/3 -m mark --mark 0x0/0xff00 -j MARK --set-xmark 0xff00/0xff00
70
+		iptables -I mwan3_connected -t mangle -d 127.0.0.0/8 -m mark --mark 0x0/0xff00 -j MARK --set-xmark 0xff00/0xff00
71
+	fi
72
+}
73
+
74
+mwan3_set_iface_iptables()
75
+{
76
+	local local_net local_nets
77
+
78
+	local_net=$(ip -4 route list dev $DEVICE scope link | awk '{print $1}' | egrep '[0-9]{1,3}(\.[0-9]{1,3}){3}')
79
+
80
+	if ! iptables -S mwan3_iface_$INTERFACE -t mangle &> /dev/null; then
81
+		iptables -N mwan3_iface_$INTERFACE -t mangle
82
+	fi
83
+
84
+	iptables -F mwan3_iface_$INTERFACE -t mangle
85
+	iptables -D mwan3_ifaces -t mangle -i $DEVICE -m mark --mark 0x0/0xff00 -j mwan3_iface_$INTERFACE &> /dev/null
86
+
87
+	if [ $ACTION == "ifup" ]; then
88
+		if [ -n "$local_net" ]; then
89
+			for local_nets in $local_net ; do
90
+				if [ $ACTION == "ifup" ]; then
91
+					iptables -I mwan3_iface_$INTERFACE -t mangle -s $local_net -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE" -j MARK --set-xmark 0xff00/0xff00
92
+				fi
93
+			done
94
+		fi
95
+
96
+		iptables -A mwan3_iface_$INTERFACE -t mangle -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE" -j MARK --set-xmark $(($iface_id*256))/0xff00
97
+		iptables -A mwan3_ifaces -t mangle -i $DEVICE -m mark --mark 0x0/0xff00 -j mwan3_iface_$INTERFACE
98
+	fi
99
+
100
+	if [ $ACTION == "ifdown" ]; then
101
+		iptables -X mwan3_iface_$INTERFACE -t mangle
102
+	fi
103
+}
104
+
105
+mwan3_set_iface_route()
106
+{
107
+	ip -4 route flush table $iface_id
108
+	[ $ACTION == "ifup" ] && ip -4 route add table $iface_id default $route_args
109
+}
110
+
111
+mwan3_set_iface_rules()
112
+{
113
+	while [ -n "$(ip -4 rule list | awk '$1 == "'$(($iface_id+1000)):'"')" ]; do
114
+		ip -4 rule del pref $(($iface_id+1000))
115
+	done
116
+
117
+	while [ -n "$(ip -4 rule list | awk '$1 == "'$(($iface_id+2000)):'"')" ]; do
118
+		ip -4 rule del pref $(($iface_id+2000))
119
+	done
120
+
121
+	while [ -n "$(ip -4 rule list | awk '$1 == "2254:"')" ]; do
122
+		ip -4 rule del pref 2254
123
+	done
124
+
125
+	[ $ACTION == "ifup" ] && ip -4 rule add pref $(($iface_id+1000)) iif $DEVICE lookup main
126
+	[ $ACTION == "ifup" ] && ip -4 rule add pref $(($iface_id+2000)) fwmark $(($iface_id*256))/0xff00 lookup $iface_id
127
+        ip rule add pref 2254 fwmark 0xfe00/0xff00 unreachable                                   
128
+}
129
+
130
+mwan3_track()
131
+{
132
+	local track_ip track_ips reliability count timeout interval down up
133
+
134
+	mwan3_list_track_ips()
135
+	{
136
+		track_ips="$1 $track_ips"
137
+	}
138
+	config_list_foreach $INTERFACE track_ip mwan3_list_track_ips
139
+
140
+	if [ -n "$track_ips" ]; then
141
+		config_get reliability $INTERFACE reliability 1
142
+		config_get count $INTERFACE count 1
143
+		config_get timeout $INTERFACE timeout 4
144
+		config_get interval $INTERFACE interval 10
145
+		config_get down $INTERFACE down 5
146
+		config_get up $INTERFACE up 5
147
+
148
+		if ! iptables -S mwan3_track_$INTERFACE -t mangle &> /dev/null; then
149
+			iptables -N mwan3_track_$INTERFACE -t mangle
150
+			iptables -A mwan3_track_hook -t mangle -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_$INTERFACE
151
+		fi
152
+
153
+		iptables -F mwan3_track_$INTERFACE -t mangle
154
+
155
+		for track_ip in $track_ips; do
156
+			iptables -A mwan3_track_$INTERFACE -t mangle -d $track_ip -j MARK --set-xmark 0xff00/0xff00
157
+		done
158
+
159
+		[ -x /usr/sbin/mwan3track ] && /usr/sbin/mwan3track $INTERFACE $DEVICE $reliability $count $timeout $interval $down $up $track_ips &
160
+	else
161
+		iptables -D mwan3_track_hook -t mangle -p icmp -m icmp --icmp-type 8 -m length --length 32 -j mwan3_track_$INTERFACE &> /dev/null
162
+		iptables -F mwan3_track_$INTERFACE -t mangle &> /dev/null
163
+		iptables -X mwan3_track_$INTERFACE -t mangle &> /dev/null
164
+	fi
165
+}
166
+
167
+mwan3_set_policy()
168
+{
169
+	local iface_count iface_id metric probability weight
170
+
171
+	config_get INTERFACE $1 interface
172
+	config_get metric $1 metric 1
173
+	config_get weight $1 weight 1
174
+
175
+	[ -n "$INTERFACE" ] || return 0
176
+	
177
+	config_foreach mwan3_get_iface_id interface
178
+
179
+	[ -n "$iface_id" ] || return 0
180
+
181
+	if iptables -S mwan3_iface_$INTERFACE -t mangle &> /dev/null; then
182
+		if [ "$metric" -lt "$lowest_metric" ]; then
183
+
184
+			total_weight=$weight
185
+			iptables -F mwan3_policy_$policy -t mangle
186
+			iptables -A mwan3_policy_$policy -t mangle -m mark --mark 0x0/0xff00 -m comment --comment "$INTERFACE $weight $weight" -j MARK --set-xmark $(($iface_id*256))/0xff00
187
+
188
+			lowest_metric=$metric
189
+
190
+		elif [ "$metric" -eq "$lowest_metric" ]; then
191
+
192
+			total_weight=$(($total_weight+$weight))
193
+			probability=$(($weight*1000/$total_weight))
194
+			
195
+			if [ "$probability" -lt 10 ]; then
196
+				probability="0.00$probability"
197
+				elif [ $probability -lt 100 ]; then
198
+				probability="0.0$probability"
199
+				elif [ $probability -lt 1000 ]; then
200
+				probability="0.$probability"
201
+			else
202
+				probability="1"
203
+			fi
204
+
205
+			probability="-m statistic --mode random --probability $probability"
206
+			
207
+			iptables -I mwan3_policy_$policy -t mangle -m mark --mark 0x0/0xff00 $probability -m comment --comment "$INTERFACE $weight $total_weight" -j MARK --set-xmark $(($iface_id*256))/0xff00
208
+		fi
209
+	fi
210
+}
211
+
212
+mwan3_set_policies_iptables()
213
+{
214
+	local lowest_metric policy total_weight
215
+
216
+	policy=$1
217
+
218
+	if [ "$policy" != $(echo "$policy" | cut -c1-15) ]; then
219
+		logger -t mwan3 -p warn "Policy $policy exceeds max of 15 chars. Not setting policy" && return 0
220
+	fi
221
+
222
+	if ! iptables -S mwan3_policy_$policy -t mangle &> /dev/null; then
223
+		iptables -N mwan3_policy_$policy -t mangle
224
+	fi
225
+
226
+	iptables -F mwan3_policy_$policy -t mangle
227
+	iptables -A mwan3_policy_$policy -t mangle -m mark --mark 0x0/0xff00 -m comment --comment "unreachable" -j MARK --set-xmark 0xfe00/0xff00
228
+
229
+	lowest_metric=256
230
+	total_weight=0
231
+
232
+	config_list_foreach $policy use_member mwan3_set_policy
233
+
234
+	iptables -X $policy -t mangle &> /dev/null
235
+}
236
+
237
+mwan3_set_user_rules_iptables()
238
+{
239
+	local proto src_ip src_port dest_ip dest_port use_policy
240
+
241
+	config_get proto $1 proto all
242
+	config_get src_ip $1 src_ip 0.0.0.0/0
243
+	config_get src_port $1 src_port 0:65535
244
+	config_get dest_ip $1 dest_ip 0.0.0.0/0
245
+	config_get dest_port $1 dest_port 0:65535
246
+	config_get use_policy $1 use_policy
247
+
248
+	if [ -n "$use_policy" ]; then
249
+		if [ "$use_policy" == "default" ]; then
250
+			use_policy="MARK --set-xmark 0xff00/0xff00"
251
+		elif [ "$use_policy" == "unreachable" ]; then
252
+			use_policy="MARK --set-xmark 0xfe00/0xff00"
253
+		else
254
+			use_policy="mwan3_policy_$use_policy"
255
+		fi
256
+
257
+		case $proto in
258
+			tcp|udp)
259
+			iptables -A mwan3_rules -t mangle -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
260
+			;;
261
+			*)
262
+			iptables -A mwan3_rules -t mangle -p $proto -s $src_ip -d $dest_ip -m mark --mark 0/0xff00 -m comment --comment "$1" -j $use_policy &> /dev/null
263
+			;;
264
+		esac
265
+	fi
266
+}
267
+
268
+mwan3_ifupdown()
269
+{
270
+	local counter enabled iface_count iface_id route_args wan_metric
271
+
272
+	[ -n "$DEVICE" ] || exit 0
273
+	[ -n "$INTERFACE" ] || exit 0
274
+	[ "$(uci get -P /var/state mwan3.$INTERFACE 2> /dev/null)" == "interface" ] || return 0
275
+
276
+	config_load mwan3
277
+	config_get enabled $INTERFACE enabled 0
278
+
279
+	counter=0
280
+
281
+	if [ $ACTION == "ifup" ]; then
282
+		[ "$enabled" -eq 1 ] || exit 0
283
+
284
+		while [ -z "$(ip -4 route list dev $DEVICE default | head -1)" -a "$counter" -lt 10 ]; do
285
+			sleep 1
286
+			let counter++
287
+			if [ "$counter" -ge 10 ]; then
288
+				logger -t mwan3 -p warn "Could not find gateway for interface $INTERFACE ($DEVICE)" && exit 0
289
+			fi
290
+		done
291
+
292
+		mwan3_get_route_args
293
+	fi
294
+
295
+	while [ "$(pgrep -f -o hotplug-call)" -ne $$ -a "$counter" -lt 60 ]; do
296
+		sleep 1
297
+		let counter++
298
+		if [ "$counter" -ge 60 ]; then
299
+			logger -t mwan3 -p warn "Timeout waiting for older hotplug processes to finish. $ACTION interface $INTERFACE ($DEVICE) aborted" && exit 0
300
+		fi
301
+	done
302
+
303
+	config_foreach mwan3_get_iface_id interface
304
+
305
+	[ -n "$iface_id" ] || exit 0
306
+	[ "$iface_count" -le 250 ] || exit 0
307
+	unset iface_count
308
+	unset counter
309
+
310
+	logger -t mwan3 -p notice "$ACTION interface $INTERFACE ($DEVICE)"
311
+
312
+	mwan3_set_general_iptables
313
+	mwan3_set_iface_iptables
314
+	mwan3_set_iface_route
315
+	mwan3_set_iface_rules
316
+
317
+	[ $ACTION == "ifup" ] && mwan3_track
318
+
319
+	config_foreach mwan3_set_policies_iptables policy
320
+	config_foreach mwan3_set_user_rules_iptables rule
321
+}
322
+
323
+case "$ACTION" in
324
+	ifup|ifdown)
325
+		mwan3_ifupdown
326
+		mwan3_set_connected_iptables
327
+	;;
328
+esac

+ 20
- 0
net/mwan3/files/etc/init.d/mwan3 View File

@@ -0,0 +1,20 @@
1
+#!/bin/sh /etc/rc.common
2
+START=99
3
+
4
+start() {
5
+	/usr/sbin/mwan3 start
6
+}
7
+
8
+stop() {
9
+	/usr/sbin/mwan3 stop
10
+}
11
+
12
+restart() {
13
+	stop
14
+	start
15
+}
16
+
17
+boot() {
18
+	# Don't start on boot, mwan3 is started by hotplug event.
19
+	return 0
20
+}

+ 208
- 0
net/mwan3/files/usr/sbin/mwan3 View File

@@ -0,0 +1,208 @@
1
+#!/bin/sh /etc/rc.common
2
+
3
+. /lib/network/config.sh
4
+
5
+extra_help() {
6
+	cat <<EOF
7
+
8
+	ifup <iface>	Start service on interface
9
+	ifdown <iface>	Stop service on interface
10
+	interfaces	Show interfaces status
11
+	policies	Show policies status
12
+	rules		Show rules status
13
+	status		Show all status
14
+EOF
15
+}
16
+
17
+EXTRA_COMMANDS="ifdown ifup interfaces policies rules status"
18
+EXTRA_HELP="$(extra_help)"
19
+
20
+
21
+ifdown()
22
+{
23
+	if [ -z "$1" ]; then
24
+		echo "Error: Expecting interface. Usage: mwan3 ifdown <interface>" && exit 0
25
+	fi
26
+
27
+	if [ -n "$2" ]; then
28
+		echo "Error: Too many arguments. Usage: mwan3 ifdown <interface>" && exit 0
29
+	fi
30
+
31
+	local device
32
+	
33
+	device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
34
+	
35
+	if [ -e /var/run/mwan3track-$1.pid ] ; then
36
+		kill $(cat /var/run/mwan3track-$1.pid)
37
+		rm /var/run/mwan3track-$1.pid
38
+	fi
39
+
40
+	if [ -n "$device" ] ; then
41
+		ACTION=ifdown INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
42
+	fi
43
+}
44
+
45
+ifup()
46
+{
47
+	config_load mwan3
48
+
49
+	if [ -z "$1" ]; then
50
+		echo "Expecting interface. Usage: mwan3 ifup <interface>" && exit 0
51
+	fi
52
+
53
+	if [ -n "$2" ]; then
54
+		echo "Too many arguments. Usage: mwan3 ifup <interface>" && exit 0
55
+	fi
56
+
57
+	local device enabled
58
+	
59
+	config_get enabled "$1" enabled 0
60
+
61
+	device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
62
+	
63
+	if [ -n "$device" ] ; then
64
+		[ "$enabled" -eq 1 ] && ACTION=ifup INTERFACE=$1 DEVICE=$device /sbin/hotplug-call iface
65
+	fi
66
+}
67
+
68
+interfaces()
69
+{
70
+	config_load mwan3
71
+
72
+	local device enabled iface_id tracking
73
+
74
+	echo "Interface status:"
75
+	
76
+	check_iface_status()
77
+	{
78
+		device=$(uci get -p /var/state network.$1.ifname) &> /dev/null
79
+
80
+		if [ -z "$device" ]; then
81
+			echo "Interface $1 is unknown"
82
+			return 0
83
+		fi
84
+
85
+		config_get enabled "$1" enabled 0
86
+		let iface_id++
87
+
88
+		if [ -n "$(ps -w | grep mwan3track | grep -v grep | sed '/.*\/usr\/sbin\/mwan3track \([^ ]*\) .*$/!d;s//\1/' | awk '$1 == ("'$1'")')" ]; then
89
+			tracking="active"
90
+		else
91
+			tracking="down"
92
+		fi
93
+
94
+		if [ -n "$(ip rule | awk '$5 == ("'$device'")')" -a -n "$(iptables -S mwan3_iface_$1 -t mangle 2> /dev/null)" -a -n "$(ip -4 route list table $iface_id default dev $device 2> /dev/null)" ]; then
95
+			if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
96
+				echo "Interface $1 is online (tracking $tracking)"
97
+			else
98
+				echo "Interface $1 is online"
99
+			fi
100
+		elif [ -n "$(ip rule | awk '$5 == ("'$device'")')" -o -n "$(iptables -S mwan3_iface_$1 -t mangle 2> /dev/null)" -o -n "$(ip -4 route list table $iface_id default dev $device 2> /dev/null)" ]; then
101
+			echo "Interface $1 error"
102
+		else
103
+			if [ "$enabled" -eq 1 ]; then
104
+				if [ -n "$(uci get -p /var/state mwan3.$1.track_ip 2> /dev/null)" ]; then
105
+					echo "Interface $1 is offline (tracking $tracking)"
106
+				else
107
+					echo "Interface $1 is offline"
108
+				fi
109
+			else
110
+				echo "Interface $1 is disabled"
111
+			fi
112
+		fi
113
+	}
114
+	config_foreach check_iface_status interface
115
+	echo -e
116
+}
117
+
118
+policies()
119
+{
120
+	local percent policy share total_weight weight iface
121
+
122
+	for policy in $(iptables -S -t mangle | awk '{print $2}' | grep mwan3_policy_ | sort -u); do
123
+		echo "Policy $policy:" | sed 's/mwan3_policy_//g'
124
+
125
+		for iface in $(iptables -S $policy -t mangle | cut -s -d'"' -f2 | awk '{print $1}'); do
126
+			[ -n "$total_weight" ] || total_weight=$(iptables -S $policy -t mangle | grep "$iface " | cut -s -d'"' -f2 | awk '{print $3}')
127
+		done
128
+
129
+		if [ ! -z "${total_weight##*[!0-9]*}" ]; then
130
+			for iface in $(iptables -S $policy -t mangle | cut -s -d'"' -f2 | awk '{print $1}'); do
131
+				weight=$(iptables -S $policy -t mangle | grep "$iface " | cut -s -d'"' -f2 | awk '{print $2}')
132
+				percent=$(($weight*100/$total_weight))
133
+				echo " $iface ($percent%)"
134
+			done
135
+		else
136
+			echo " $(iptables -S $policy -t mangle | sed '/.*--comment \([^ ]*\) .*$/!d;s//\1/;q')"
137
+		fi
138
+
139
+		echo -e
140
+
141
+		unset iface
142
+		unset total_weight
143
+	done
144
+}
145
+rules()
146
+{
147
+	if [ -n "$(iptables -S mwan3_connected -t mangle 2> /dev/null)" ]; then
148
+		echo "Known networks:"
149
+		echo "destination policy hits" | awk '{ printf "%-19s%-19s%-9s%s\n",$1,$2,$3}'
150
+		echo "------------------------------------------------"
151
+		iptables -L mwan3_connected -t mangle -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}'
152
+		echo -e
153
+	fi
154
+
155
+	if [ -n "$(iptables -S mwan3_rules -t mangle 2> /dev/null)" ]; then
156
+		echo "Active rules:"
157
+		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}'
158
+		echo "---------------------------------------------------------------------------------------------------"
159
+		iptables -L mwan3_rules -t mangle -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}'
160
+		echo -e
161
+	fi
162
+}
163
+
164
+status()
165
+{
166
+	interfaces
167
+	policies
168
+	rules
169
+}
170
+
171
+start()
172
+{
173
+	config_load mwan3
174
+	config_foreach ifup interface
175
+}
176
+
177
+stop()
178
+{
179
+	local route rule table
180
+
181
+	killall mwan3track &> /dev/null
182
+	rm /var/run/mwan3track-* &> /dev/null
183
+
184
+	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
185
+		ip -4 route flush table $route &> /dev/null
186
+	done
187
+
188
+	for rule in $(ip -4 rule list | egrep '^[1-2][0-9]{3}\:' | cut -d ':' -f 1); do
189
+		ip -4 rule del pref $rule &> /dev/null
190
+	done
191
+
192
+	iptables -D PREROUTING -t mangle -j mwan3_hook &> /dev/null
193
+	iptables -D OUTPUT -t mangle -j mwan3_hook &> /dev/null
194
+	iptables -D OUTPUT -t mangle -j mwan3_track_hook &> /dev/null
195
+
196
+	for table in $(iptables -S -t mangle | awk '{print $2}' | grep mwan3 | sort -u); do
197
+		iptables -F $table -t mangle &> /dev/null
198
+	done
199
+
200
+	for table in $(iptables -S -t mangle | awk '{print $2}' | grep mwan3 | sort -u); do
201
+		iptables -X $table -t mangle &> /dev/null
202
+	done
203
+}
204
+
205
+restart() {
206
+	stop
207
+	start
208
+}

+ 65
- 0
net/mwan3/files/usr/sbin/mwan3track View File

@@ -0,0 +1,65 @@
1
+#!/bin/sh
2
+
3
+[ -z "$9" ] && echo "Error: should not be started manually" && exit 0
4
+
5
+if [ -e /var/run/mwan3track-$1.pid ] ; then
6
+	kill $(cat /var/run/mwan3track-$1.pid) &> /dev/null
7
+	rm /var/run/mwan3track-$1.pid &> /dev/null
8
+fi
9
+
10
+echo "$$" > /var/run/mwan3track-$1.pid
11
+
12
+score=$(($7+$8))
13
+track_ips=$(echo $* | cut -d ' ' -f 9-99)
14
+host_up_count=0
15
+lost=0
16
+
17
+while true; do
18
+
19
+	for track_ip in $track_ips; do
20
+		ping -I $2 -c $4 -W $5 -s 4 -q $track_ip &> /dev/null
21
+		if [ $? -eq 0 ]; then
22
+			let host_up_count++
23
+		else
24
+			let lost++
25
+		fi
26
+	done
27
+		
28
+	if [ $host_up_count -lt $3 ]; then
29
+		let score--
30
+
31
+		if [ $score -lt $8 ]; then score=0 ; fi
32
+		if [ $score -eq $8 ]; then
33
+
34
+			logger -t mwan3track -p notice "Interface $1 ($2) is offline"
35
+			env -i ACTION=ifdown INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
36
+			score=0
37
+
38
+		fi
39
+
40
+	else
41
+
42
+		if [ $score -lt $(($7+$8)) ] && [ $lost -gt 0 ]; then
43
+
44
+			logger -t mwan3track -p info "Lost $(($lost*$4)) ping(s) on interface $1 ($2)"
45
+
46
+		fi
47
+
48
+		let score++
49
+		lost=0
50
+
51
+		if [ $score -gt $8 ]; then score=$(($7+$8)); fi
52
+		if [ $score -eq $8 ]; then
53
+
54
+			logger -t mwan3track -p notice "Interface $1 ($2) is online"
55
+			env -i ACTION=ifup INTERFACE=$1 DEVICE=$2 /sbin/hotplug-call iface
56
+			rm /var/run/mwan3track-$1.pid
57
+			exit 0
58
+		fi
59
+	fi
60
+
61
+	host_up_count=0
62
+	sleep $6
63
+done
64
+
65
+exit 1

+ 86
- 0
net/netatalk/Makefile View File

@@ -0,0 +1,86 @@
1
+#
2
+# Copyright (C) 2009-2013 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=netatalk
11
+PKG_VERSION:=2.2.4
12
+PKG_RELEASE:=1
13
+
14
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15
+PKG_SOURCE_URL:=@SF/netatalk
16
+PKG_MD5SUM:=40753a32340c24e4ec395aeb55ef056e
17
+
18
+PKG_BUILD_PARALLEL:=1
19
+PKG_INSTALL:=1
20
+PKG_FIXUP:=autoreconf
21
+
22
+include $(INCLUDE_DIR)/package.mk
23
+
24
+define Package/netatalk
25
+  SECTION:=net
26
+  CATEGORY:=Network
27
+  SUBMENU:=Filesystem
28
+  DEPENDS:=+attr +libdb47 +libgcrypt +libopenssl $(LIBRPC_DEPENDS)
29
+  TITLE:=netatalk
30
+  URL:=http://netatalk.sourceforge.net
31
+  MAINTAINER:=W. Michael Petullo <mike@flyn.org>
32
+endef
33
+
34
+define Package/netatalk/decription
35
+  Netatalk is a freely-available Open Source AFP fileserver.
36
+  It also provides a kernel level implementation of the AppleTalk
37
+  Protocol Suite.
38
+endef
39
+
40
+define Package/netatalk/conffiles
41
+/etc/netatalk/afpd.conf
42
+endef
43
+
44
+TARGET_CFLAGS += -std=gnu99
45
+TARGET_LDFLAGS += $(LIBRPC)
46
+
47
+CONFIGURE_ARGS += \
48
+	--disable-afs \
49
+	--enable-hfs \
50
+	--disable-debugging \
51
+	--disable-shell-check \
52
+	--disable-timelord \
53
+	--disable-a2boot \
54
+	--disable-cups \
55
+	--disable-tcp-wrappers \
56
+	--with-cnid-default-backend=dbd \
57
+	--with-bdb="$(STAGING_DIR)/usr/" \
58
+	--with-libgcrypt-dir="$(STAGING_DIR)/usr" \
59
+	--with-ssl-dir="$(STAGING_DIR)/usr" \
60
+	--with-uams-path="/usr/lib/uams" \
61
+	--without-acls \
62
+	--without-pam \
63
+	--disable-admin-group \
64
+	--disable-srvloc \
65
+	--disable-zeroconf \
66
+	$(if $(CONFIG_SHADOW_PASSWORDS),--with-shadow,--without-shadow) \
67
+	--without-ldap
68
+
69
+define Package/netatalk/install
70
+	$(INSTALL_DIR) $(1)/usr/bin
71
+	$(INSTALL_DIR) $(1)/usr/sbin
72
+	$(INSTALL_DIR) $(1)/usr/lib/uams
73
+	$(INSTALL_DIR) $(1)/etc/netatalk
74
+	$(INSTALL_DIR) $(1)/etc/init.d
75
+	$(CP) $(PKG_INSTALL_DIR)/usr/bin/afppasswd $(1)/usr/bin/
76
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/afpd $(1)/usr/sbin/
77
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/
78
+	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/
79
+	$(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/
80
+	$(CP) ./files/AppleVolumes.default $(1)/etc/netatalk/
81
+	$(CP) $(PKG_INSTALL_DIR)/etc/netatalk/AppleVolumes.system $(1)/etc/netatalk/
82
+	$(INSTALL_CONF) ./files/afpd.conf $(1)/etc/netatalk/
83
+	$(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd
84
+endef
85
+
86
+$(eval $(call BuildPackage,netatalk))

+ 2
- 0
net/netatalk/files/AppleVolumes.default View File

@@ -0,0 +1,2 @@
1
+-
2
+/tmp Temp allow:root,nobody cnidscheme:dbd

+ 0
- 0
net/netatalk/files/afpd.conf View File


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