From: nynex Date: Wed, 22 Apr 2015 02:38:10 +0000 (+0000) Subject: Added packages from feed X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0ad41377eb547ac6ef49b6572b0e297b75c48c69;p=librecmc%2Flibrecmc-fossil.git Added packages from feed --- diff --git a/trunk/feeds.conf.default b/trunk/feeds.conf.default index e69de29b..cb336f8b 100644 --- a/trunk/feeds.conf.default +++ b/trunk/feeds.conf.default @@ -0,0 +1 @@ +src-link packages ../../packages diff --git a/trunk/package/admin/debootstrap/Makefile b/trunk/package/admin/debootstrap/Makefile new file mode 100644 index 00000000..a55ba353 --- /dev/null +++ b/trunk/package/admin/debootstrap/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2010 Gianluigi Tiesi +# Copyright (C) 2011-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=debootstrap +PKG_VERSION:=1.0.67 +PKG_RELEASE:=1 +PKG_MAINTAINER=Daniel Golle + +PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb +PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap +PKG_MD5SUM:=e7854d4b10ab860f08921525406debdd +PKG_LICENSE:=Unique +PKG_LICENSE_FILES:=debian/copyright + +UNPACK_CMD=ar -p "$(DL_DIR)/$(PKG_SOURCE)" data.tar.xz | xzcat | tar -C $(1) -xf - + +include $(INCLUDE_DIR)/package.mk + +define Package/debootstrap + SECTION:=admin + CATEGORY:=Administration + TITLE:=Bootstrap a basic Debian system + URL:=http://wiki.debian.org/Debootstrap + DEPENDS:= +coreutils +coreutils-chroot +coreutils-sha1sum +ar +endef + +define Package/debootstrap/description + debootstrap is used to create a Debian base system from scratch, without + requiring the availability of dpkg or apt. It does this by downloading .deb + files from a mirror site, and carefully unpacking them into a directory which + can eventually be chrooted into. +endef + +define Build/Compile +# file pkgdetails.c was imported from debian package base-installer version 1.130 + $(TARGET_CC) $(TARGET_CFLAGS) $(TARGET_LDFLAGS) ./files/pkgdetails.c -o $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails +endef + +define Package/debootstrap/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/sbin/$(PKG_NAME) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/share/debootstrap + $(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/share/debootstrap/pkgdetails $(1)/usr/share/debootstrap + $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/functions $(1)/usr/share/debootstrap + $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/devices.tar.gz $(1)/usr/share/debootstrap + $(INSTALL_DIR) $(1)/usr/share/debootstrap/scripts + $(INSTALL_DATA) $(PKG_BUILD_DIR)/usr/share/debootstrap/scripts/* $(1)/usr/share/debootstrap/scripts +endef + +$(eval $(call BuildPackage,debootstrap)) diff --git a/trunk/package/admin/debootstrap/files/pkgdetails.c b/trunk/package/admin/debootstrap/files/pkgdetails.c new file mode 100644 index 00000000..99ee1900 --- /dev/null +++ b/trunk/package/admin/debootstrap/files/pkgdetails.c @@ -0,0 +1,347 @@ +#include +#include +#include +#include +#include +#include + +#define MAX_LINE 1000 +#define MAX_PKGS 100 + +char *checksum_field=NULL; + +static void oom_die(void) +{ + fputs("Out of memory!\n", stderr); + exit(1); +} + +static char *xvasprintf(const char *fmt, va_list ap) { + char *ret; + + if (vasprintf (&ret, fmt, ap) < 0) { + if (errno == ENOMEM) + oom_die(); + return NULL; + } + return ret; +} + +static char *xasprintf(const char *fmt, ...) { + va_list ap; + char *ret; + + va_start(ap, fmt); + ret = xvasprintf(fmt, ap); + va_end(ap); + return ret; +} + +static char *fieldcpy(char *dst, char *fld) { + while (*fld && *fld != ':') + fld++; + if (!*(fld++)) + return NULL; + while (isspace(*fld)) fld++; + return strcpy(dst, fld); +} + +static void outputdeps(char *deps) { + char *pch = deps; + + while (1) { + while (isspace(*pch)) pch++; + if (!*pch) break; + + while (*pch && *pch != '(' && *pch != '|' && *pch != ',' + && !isspace(*pch)) + { + fputc(*pch++, stdout); + } + fputc('\n', stdout); + while (*pch && *pch++ != ',') (void)NULL; + } +} + +static void dogetdeps(char *pkgsfile, char **in_pkgs, int pkgc) { + char buf[MAX_LINE]; + char cur_pkg[MAX_LINE]; + char cur_deps[MAX_LINE]; + char cur_predeps[MAX_LINE]; + char prev_pkg[MAX_LINE]; + char *pkgs[MAX_PKGS]; + int i; + int skip; + FILE *f; + int output_pkg = -1; + + cur_pkg[0] = cur_deps[0] = cur_predeps[0] = prev_pkg[0] = '\0'; + + for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; + + f = fopen(pkgsfile, "r"); + if (f == NULL) { + perror(pkgsfile); + exit(1); + } + + skip = 1; + while (fgets(buf, sizeof(buf), f)) { + if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + if (strncasecmp(buf, "Package:", 8) == 0) { + int any = 0; + skip = 1; + fieldcpy(cur_pkg, buf); + if (strcmp(cur_pkg, prev_pkg) != 0) { + if (output_pkg != -1) + pkgs[output_pkg] = NULL; + if (cur_deps[0]) + outputdeps(cur_deps); + if (cur_predeps[0]) + outputdeps(cur_predeps); + strcpy(prev_pkg, cur_pkg); + } + cur_deps[0] = cur_predeps[0] = '\0'; + output_pkg = -1; + for (i = 0; i < pkgc; i++) { + if (!pkgs[i]) continue; + any = 1; + if (strcmp(cur_pkg, pkgs[i]) == 0) { + skip = 0; + output_pkg = i; + break; + } + } + if (!any) break; + } else if (!skip && strncasecmp(buf, "Depends:", 8) == 0) + fieldcpy(cur_deps, buf); + else if (!skip && strncasecmp(buf, "Pre-Depends:", 12) == 0) + fieldcpy(cur_predeps, buf); + } + if (cur_deps[0]) + outputdeps(cur_deps); + if (cur_predeps[0]) + outputdeps(cur_predeps); + fclose(f); +} + +static void dopkgmirrorpkgs(int uniq, char *mirror, char *pkgsfile, + char *fieldname, char **in_pkgs, int pkgc) +{ + char buf[MAX_LINE]; + char cur_field[MAX_LINE]; + char cur_pkg[MAX_LINE]; + char cur_ver[MAX_LINE]; + char cur_arch[MAX_LINE]; + char cur_size[MAX_LINE]; + char cur_checksum[MAX_LINE]; + char cur_filename[MAX_LINE]; + char prev_pkg[MAX_LINE]; + char *pkgs[MAX_PKGS]; + int i; + FILE *f; + char *output = NULL; + int output_pkg = -1; + + cur_field[0] = cur_pkg[0] = cur_ver[0] = cur_arch[0] = cur_filename[0] = prev_pkg[0] = '\0'; + + for (i = 0; i < pkgc; i++) pkgs[i] = in_pkgs[i]; + + f = fopen(pkgsfile, "r"); + if (f == NULL) { + perror(pkgsfile); + exit(1); + } + while (fgets(buf, sizeof(buf), f)) { + if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + if (strncasecmp(buf, fieldname, strlen(fieldname)) == 0) { + fieldcpy(cur_field, buf); + } + if (strncasecmp(buf, "Package:", 8) == 0) { + fieldcpy(cur_pkg, buf); + if (strcmp(cur_pkg, prev_pkg) != 0) { + if (output) + fputs(output, stdout); + if (uniq && output_pkg != -1) + pkgs[output_pkg] = NULL; + strcpy(prev_pkg, cur_pkg); + } + free(output); + output = NULL; + output_pkg = -1; + } else if (strncasecmp(buf, "Version:", 8) == 0) { + fieldcpy(cur_ver, buf); + } else if (strncasecmp(buf, "Architecture:", 13) == 0) { + fieldcpy(cur_arch, buf); + } else if (strncasecmp(buf, "Size:", 5) == 0) { + fieldcpy(cur_size, buf); + } else if (strncasecmp(buf, checksum_field, strlen(checksum_field)) == 0 + && buf[strlen(checksum_field)] == ':') { + fieldcpy(cur_checksum, buf); + } else if (strncasecmp(buf, "Filename:", 9) == 0) { + fieldcpy(cur_filename, buf); + } else if (!*buf) { + int any = 0; + for (i = 0; i < pkgc; i++) { + if (!pkgs[i]) continue; + any = 1; + if (strcmp(cur_field, pkgs[i]) == 0) { + free(output); + output = xasprintf("%s %s %s %s %s %s %s\n", cur_pkg, cur_ver, cur_arch, mirror, cur_filename, cur_checksum, cur_size); + output_pkg = i; + break; + } + } + if (!any) break; + cur_field[0] = '\0'; + } + } + if (output) + fputs(output, stdout); + if (uniq && output_pkg != -1) + pkgs[output_pkg] = NULL; + fclose(f); + + /* any that weren't found are returned as "pkg -" */ + if (uniq) { + for (i = 0; i < pkgc; i++) { + if (pkgs[i]) { + printf("%s -\n", pkgs[i]); + } + } + } +} + +static void dopkgstanzas(char *pkgsfile, char **pkgs, int pkgc) +{ + char buf[MAX_LINE]; + char *accum; + size_t accum_size = 0, accum_alloc = MAX_LINE * 2; + char cur_pkg[MAX_LINE]; + FILE *f; + + accum = malloc(accum_alloc); + if (!accum) + oom_die(); + + f = fopen(pkgsfile, "r"); + if (f == NULL) { + perror(pkgsfile); + free(accum); + exit(1); + } + while (fgets(buf, sizeof(buf), f)) { + if (*buf) { + size_t len = strlen(buf); + if (accum_size + len + 1 > accum_alloc) { + accum_alloc = (accum_size + len + 1) * 2; + accum = realloc(accum, accum_alloc); + if (!accum) + oom_die(); + } + strcpy(accum + accum_size, buf); + accum_size += len; + } + if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; + if (strncasecmp(buf, "Package:", 8) == 0) { + fieldcpy(cur_pkg, buf); + } else if (!*buf) { + int i; + for (i = 0; i < pkgc; i++) { + if (!pkgs[i]) continue; + if (strcmp(cur_pkg, pkgs[i]) == 0) { + fputs(accum, stdout); + if (accum[accum_size - 1] != '\n') + fputs("\n\n", stdout); + else if (accum[accum_size - 2] != '\n') + fputc('\n', stdout); + break; + } + } + *accum = '\0'; + accum_size = 0; + } + } + fclose(f); + + free(accum); +} + +static int dotranslatewgetpercent(int low, int high, int end, char *str) { + int ch; + int val, lastval; + + /* print out anything that looks like a % on its own line, appropriately + * scaled */ + + lastval = val = 0; + while ( (ch = getchar()) != EOF ) { + if (isdigit(ch)) { + val *= 10; val += ch - '0'; + } else if (ch == '%') { + float f = (float) val / 100.0 * (high - low) + low; + if (str) { + printf("P: %d %d %s\n", (int) f, end, str); + } else { + printf("P: %d %d\n", (int) f, end); + } + lastval = val; + } else { + val = 0; + } + } + return lastval == 100; +} + +int main(int argc, char *argv[]) { + checksum_field=getenv("DEBOOTSTRAP_CHECKSUM_FIELD"); + if (checksum_field == NULL) { + checksum_field="MD5sum"; + } + + if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) { + if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]), + atoi(argv[4]), argc == 6 ? argv[5] : NULL)) + { + exit(0); + } else { + exit(1); + } + } else if (argc >= 4 && strcmp(argv[1], "GETDEPS") == 0) { + int i; + for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) { + dogetdeps(argv[2], argv+i, MAX_PKGS); + } + dogetdeps(argv[2], argv+i, argc-i); + exit(0); + } else if (argc >= 5 && strcmp(argv[1], "PKGS") == 0) { + int i; + for (i = 4; argc - i > MAX_PKGS; i += MAX_PKGS) { + dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, MAX_PKGS); + } + dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv+i, argc-i); + exit(0); + } else if (argc >= 6 && strcmp(argv[1], "FIELD") == 0) { + int i; + for (i = 5; argc - i > MAX_PKGS; i += MAX_PKGS) { + dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, MAX_PKGS); + } + dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv+i, argc-i); + exit(0); + } else if (argc >= 4 && strcmp(argv[1], "STANZAS") == 0) { + int i; + for (i = 3; argc - i > MAX_PKGS; i += MAX_PKGS) { + dopkgstanzas(argv[2], argv+i, MAX_PKGS); + } + dopkgstanzas(argv[2], argv+i, argc-i); + exit(0); + } else { + fprintf(stderr, "usage: %s PKGS mirror packagesfile pkgs..\n", argv[0]); + fprintf(stderr, " or: %s FIELD field mirror packagesfile pkgs..\n", + argv[0]); + fprintf(stderr, " or: %s GETDEPS packagesfile pkgs..\n", argv[0]); + fprintf(stderr, " or: %s STANZAS packagesfile pkgs..\n", argv[0]); + fprintf(stderr, " or: %s WGET%% low high end reason\n", argv[0]); + exit(1); + } +} diff --git a/trunk/package/admin/debootstrap/patches/100-busybox_fix.patch b/trunk/package/admin/debootstrap/patches/100-busybox_fix.patch new file mode 100644 index 00000000..5e8db057 --- /dev/null +++ b/trunk/package/admin/debootstrap/patches/100-busybox_fix.patch @@ -0,0 +1,11 @@ +--- a/usr/share/debootstrap/functions ++++ b/usr/share/debootstrap/functions +@@ -859,8 +859,6 @@ choose_extractor () { + + if [ -n "$EXTRACTOR_OVERRIDE" ]; then + extractor="$EXTRACTOR_OVERRIDE" +- elif type dpkg-deb >/dev/null 2>&1; then +- extractor="dpkg-deb" + else + extractor="ar" + fi diff --git a/trunk/package/admin/htop/Makefile b/trunk/package/admin/htop/Makefile new file mode 100644 index 00000000..7cb47067 --- /dev/null +++ b/trunk/package/admin/htop/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=htop +PKG_VERSION:=1.0.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://hisham.hm/htop/releases/$(PKG_VERSION)/ +PKG_MD5SUM:=e768b9b55c033d9c1dffda72db3a6ac7 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/htop + SECTION:=admin + CATEGORY:=Administration + TITLE:=Interactive processes viewer + DEPENDS:=+libncurses + URL:=http://htop.sourceforge.net/ + MAINTAINER:=Etienne CHAMPETIER +endef + +define Package/htop/description + Htop is an ncursed-based process viewer similar to top, but + it allows to scroll the list vertically and horizontally to + see all processes and their full command lines. +endef + +CONFIGURE_ARGS += \ + --disable-native-affinity \ + --disable-unicode \ + --enable-hwloc + +CONFIGURE_VARS += \ + ac_cv_file__proc_stat=yes \ + ac_cv_file__proc_meminfo=yes \ + ac_cv_func_malloc_0_nonnull=yes \ + ac_cv_func_realloc_0_nonnull=yes + +define Package/htop/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,htop)) diff --git a/trunk/package/admin/monit/Makefile b/trunk/package/admin/monit/Makefile new file mode 100644 index 00000000..b14b2225 --- /dev/null +++ b/trunk/package/admin/monit/Makefile @@ -0,0 +1,95 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=monit +PKG_VERSION:=5.12.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://mmonit.com/monit/dist +PKG_MD5SUM:=5f5cf4c18b42e8091b49b4e07cf972ce + +PKG_LICENSE:=AGPL-3.0 +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/monit/Default + SECTION:=admin + CATEGORY:=Administration + DEPENDS:= +libpthread + TITLE:=System services monitoring utility + URL:=http://mmonit.com/monit/ + MAINTAINER:=Etienne CHAMPETIER +endef + +define Package/monit/Default/description + An utility for monitoring services on a Unix system +endef + +define Package/monit +$(call Package/monit/Default) + DEPENDS+= +libopenssl + TITLE+= (with SSL support) + VARIANT:=ssl +endef + +define Package/monit/description +$(call Package/monit/Default/description) + This package is built with SSL support. +endef + +define Package/monit-nossl +$(call Package/monit/Default) + TITLE+= (without SSL support) + VARIANT:=nossl +endef + +define Package/monit-nossl/description +$(call Package/monit/Default/description) + This package is built without SSL support. +endef + +CONFIGURE_ARGS += \ + --without-pam \ + libmonit_cv_setjmp_available=yes \ + libmonit_cv_vsnprintf_c99_conformant=yes + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl \ + --with-ssl-dir="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --without-ssl +endif + +define Package/monit/conffiles +/etc/monitrc +endef + +define Package/monit/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/monitrc $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/monit.init $(1)/etc/init.d/monit + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/monit $(1)/usr/bin/ +endef + +Package/monit-nossl/conffiles = $(Package/monit/conffiles) +Package/monit-nossl/install = $(Package/monit/install) + +$(eval $(call BuildPackage,monit)) +$(eval $(call BuildPackage,monit-nossl)) diff --git a/trunk/package/admin/monit/files/monit.init b/trunk/package/admin/monit/files/monit.init new file mode 100644 index 00000000..2bb36092 --- /dev/null +++ b/trunk/package/admin/monit/files/monit.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=60 +USE_PROCD=1 +PROG=/usr/bin/monit + +start_service() { + [ -f /etc/monitrc ] || { echo "monit: /etc/monitrc is missing"; return 1; } + chmod 0600 /etc/monitrc + procd_open_instance + # -I runs in foreground, as procd requires + procd_set_param command "$PROG" -I + procd_close_instance +} diff --git a/trunk/package/admin/monit/patches/001-fix-default-piddir.patch b/trunk/package/admin/monit/patches/001-fix-default-piddir.patch new file mode 100644 index 00000000..13d6029c --- /dev/null +++ b/trunk/package/admin/monit/patches/001-fix-default-piddir.patch @@ -0,0 +1,18 @@ +--- a/configure ++++ b/configure +@@ -13821,14 +13821,7 @@ fi + # Find the right directory to put the root-mode PID file in + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pid file location" >&5 + $as_echo_n "checking pid file location... " >&6; } +-if test -d "/run" +-then +- piddir="/run" +-elif test -d "/var/run"; then +- piddir="/var/run" +-elif test -d "/etc"; then +- piddir="/etc" +-fi ++piddir="/var/run" + + + cat >>confdefs.h <<_ACEOF diff --git a/trunk/package/admin/muninlite/Makefile b/trunk/package/admin/muninlite/Makefile new file mode 100644 index 00000000..1c1793ed --- /dev/null +++ b/trunk/package/admin/muninlite/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=muninlite +PKG_VERSION:=1.0.4 +PKG_RELEASE:=5 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_MD5SUM:=a8cc86f0cc536a6c22dc298f4ed55339 +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/muninlite + SECTION:=admin + CATEGORY:=Administration + DEPENDS:=+xinetd + TITLE:=Munin node implemented in shell + URL:=http://sourceforge.net/projects/muninlite/ + PKG_MAINTAINER:=Jonathan McCrohan +endef + +define Package/muninlite/Default/description + Munin node implemented in shell. + Munin is a monitoring system for Unix networks. +endef + +define Package/muninlite/install + $(INSTALL_DIR) $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/munin-node $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/xinetd.d + $(INSTALL_DATA) ./files/etc/xinetd.d/munin $(1)/etc/xinetd.d/ +endef + +define Package/muninlite/conffiles +/etc/xinetd.d/munin +endef + +define Build/Configure +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) +endef + +$(eval $(call BuildPackage,muninlite)) diff --git a/trunk/package/admin/muninlite/files/etc/xinetd.d/munin b/trunk/package/admin/muninlite/files/etc/xinetd.d/munin new file mode 100644 index 00000000..012d71b9 --- /dev/null +++ b/trunk/package/admin/muninlite/files/etc/xinetd.d/munin @@ -0,0 +1,10 @@ +service munin +{ + socket_type = stream + protocol = tcp + wait = no + user = root + group = root + server = /usr/sbin/munin-node + disable = no +} diff --git a/trunk/package/admin/muninlite/patches/001-no_disks.patch b/trunk/package/admin/muninlite/patches/001-no_disks.patch new file mode 100644 index 00000000..bf9b2b1c --- /dev/null +++ b/trunk/package/admin/muninlite/patches/001-no_disks.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,7 @@ + + +-PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_ +-#PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats ++#PLUGINS=df cpu if_ if_err_ load memory processes swap netstat uptime interrupts irqstats ntpdate plugindir_ ++PLUGINS=cpu if_ if_err_ load memory processes netstat uptime interrupts irqstats + + munin-node: plugins/* munin-node.conf + @VERSION=$$(cat VERSION); \ diff --git a/trunk/package/admin/muninlite/patches/002-hostname.patch b/trunk/package/admin/muninlite/patches/002-hostname.patch new file mode 100644 index 00000000..5d871683 --- /dev/null +++ b/trunk/package/admin/muninlite/patches/002-hostname.patch @@ -0,0 +1,11 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -113,7 +113,7 @@ PLUGINS=$RES + + # ===== MAIN LOOP ===== + FUNCTIONS="list nodes config fetch version quit" +-HOSTNAME=$(hostname -f 2>/dev/null || hostname) ++HOSTNAME=$(/sbin/uci get "system.@system[0].hostname" 2>/dev/null || cat /proc/sys/kernel/hostname) + echo "# munin node at $HOSTNAME" + while read arg0 arg1 + do diff --git a/trunk/package/admin/muninlite/patches/100-fix-no-ethtool.patch b/trunk/package/admin/muninlite/patches/100-fix-no-ethtool.patch new file mode 100644 index 00000000..88f7e305 --- /dev/null +++ b/trunk/package/admin/muninlite/patches/100-fix-no-ethtool.patch @@ -0,0 +1,21 @@ +--- a/plugins/if_ ++++ b/plugins/if_ +@@ -15,10 +15,14 @@ config_if() { + echo "up.min 0" + echo "up.negative down" + echo "up.cdef up,8,*" +- if ethtool $1 | grep -q Speed; then +- MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) +- echo "up.max $MAX" +- echo "down.max $MAX" ++ if [ -n "$(which ethtool)" ]; then ++ if [ -x "$(which ethtool)" ]; then ++ if ethtool $1 | grep -q Speed; then ++ MAX=$(($(ethtool $1 | grep Speed | sed -e 's/[[:space:]]\{1,\}/ /g' -e 's/^ //' -e 's/M.*//' | cut -d\ -f2) * 1000000)) ++ echo "up.max $MAX" ++ echo "down.max $MAX" ++ fi ++ fi + fi + } + fetch_if() { diff --git a/trunk/package/admin/muninlite/patches/110-fix-uptime-days.patch b/trunk/package/admin/muninlite/patches/110-fix-uptime-days.patch new file mode 100644 index 00000000..d9aa43f4 --- /dev/null +++ b/trunk/package/admin/muninlite/patches/110-fix-uptime-days.patch @@ -0,0 +1,12 @@ +--- a/plugins/uptime ++++ b/plugins/uptime +@@ -4,8 +4,7 @@ config_uptime() { + echo "graph_vlabel uptime in days" + echo "uptime.label uptime" + echo "uptime.draw AREA" +- echo "uptime.cdef uptime,86400,/" + } + fetch_uptime() { +- echo "uptime.value" $(cut -d\ -f1 /proc/uptime) ++ awk '{printf "uptime.value %.2f",$1/86400; print ""}' /proc/uptime + } diff --git a/trunk/package/admin/muninlite/patches/200-add-tap-dev.patch b/trunk/package/admin/muninlite/patches/200-add-tap-dev.patch new file mode 100644 index 00000000..fa46ce6b --- /dev/null +++ b/trunk/package/admin/muninlite/patches/200-add-tap-dev.patch @@ -0,0 +1,20 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,7 +72,7 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_$INTERRES" +@@ -80,7 +80,7 @@ do + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do + INTERRES=$(echo $INTER | sed 's/\./VLAN/') + RES="$RES if_err_$INTERRES" diff --git a/trunk/package/admin/muninlite/patches/210-add-bridge-devs.patch b/trunk/package/admin/muninlite/patches/210-add-bridge-devs.patch new file mode 100644 index 00000000..1a76e971 --- /dev/null +++ b/trunk/package/admin/muninlite/patches/210-add-bridge-devs.patch @@ -0,0 +1,24 @@ +--- a/munin-node.in ++++ b/munin-node.in +@@ -72,17 +72,17 @@ RES="" + for PLUG in $PLUGINS + do + if [ "$PLUG" = "if_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do +- INTERRES=$(echo $INTER | sed 's/\./VLAN/') ++ INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/') + RES="$RES if_$INTERRES" + eval "fetch_if_${INTERRES}() { fetch_if $INTER $@; };" + eval "config_if_${INTERRES}() { config_if $INTER $@; };" + done + elif [ "$PLUG" = "if_err_" ]; then +- for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); ++ for INTER in $(grep '^ *\(ppp\|eth\|wlan\|ath\|ra\|ipsec\|tap\|br-\)\([^:]\)\{1,\}:' /proc/net/dev | cut -f1 -d: | sed 's/ //g'); + do +- INTERRES=$(echo $INTER | sed 's/\./VLAN/') ++ INTERRES=$(echo $INTER | sed -e 's/\./VLAN/' -e 's/\-/_/') + RES="$RES if_err_$INTERRES" + eval "fetch_if_err_${INTERRES}() { fetch_if_err $INTER $@; };" + eval "config_if_err_${INTERRES}() { config_if_err $INTER $@; };" diff --git a/trunk/package/admin/sudo/Makefile b/trunk/package/admin/sudo/Makefile new file mode 100644 index 00000000..69ace606 --- /dev/null +++ b/trunk/package/admin/sudo/Makefile @@ -0,0 +1,97 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=sudo +PKG_VERSION:=1.8.13 +PKG_RELEASE:=1 +PKG_LICENSE:=ISC +PKG_LICENSE_FILES:=doc/LICENSE + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sudo.ws/sudo/dist +PKG_MD5SUM:=f61577ec330ad1bd504c0e2eec6ea2d8 + +PKG_INSTALL:=1 + +PKG_BUILD_DEPENDS:=sudo/host + +include $(INCLUDE_DIR)/package.mk + +define Package/sudo + SECTION:=admin + CATEGORY:=Administration + TITLE:=Delegate authority to run commands + URL:=http://www.sudo.ws/ + MAINTAINER:=Gergely Kiss +endef + +define Package/sudo/description + Sudo (su "do") allows a system administrator to delegate authority to + give certain users (or groups of users) the ability to run some (or + all) commands as root or another user while providing an audit trail of + the commands and their arguments. +endef + +define Package/sudo/conffiles +/etc/sudoers +endef + +CONFIGURE_ARGS+= \ + --without-pam \ + --disable-pam-session \ + --with-editor=/bin/vi \ + --without-lecture \ + --disable-zlib \ + --with-rundir=/var/lib/sudo \ + --with-vardir=/var/lib/sudo + +CONFIGURE_VARS+= \ + sudo_cv_uid_t_len=10 \ + sudo_cv_func_unsetenv_void=no + +include $(INCLUDE_DIR)/host-build.mk + +define Host/Compile + cd $(HOST_BUILD_DIR)/lib/util; \ + $(MAKE) mksiglist; $(MAKE) mksigname +endef + +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin + $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR_HOST)/bin/ +endef + +$(eval $(call HostBuild)) + +define Package/sudo/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/sudo $(1)/usr/bin/ + chmod 4755 $(1)/usr/bin/sudo + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/visudo $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/sudoers $(1)/etc/ + chmod 0440 $(1)/etc/sudoers + $(INSTALL_DIR) $(1)/etc/sudoers.d + $(INSTALL_DIR) $(1)/usr/lib/sudo + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sudo/*.so* $(1)/usr/lib/sudo/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sudo.init $(1)/etc/init.d/sudo +endef + +define Package/sudo/postinst +#!/bin/sh + +[ -n "$$IPKG_INSTROOT" ] || { + /etc/init.d/sudo enable + /etc/init.d/sudo start +} +endef + +$(eval $(call BuildPackage,sudo)) diff --git a/trunk/package/admin/sudo/files/sudo.init b/trunk/package/admin/sudo/files/sudo.init new file mode 100755 index 00000000..705fe841 --- /dev/null +++ b/trunk/package/admin/sudo/files/sudo.init @@ -0,0 +1,11 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=99 + +start() { + [ -d /var/lib/sudo ] || { + mkdir -m 0755 -p /var/lib/sudo + chmod 0700 /var/lib/sudo + } +} diff --git a/trunk/package/admin/sudo/patches/010-cross-compile-fixes.patch b/trunk/package/admin/sudo/patches/010-cross-compile-fixes.patch new file mode 100644 index 00000000..4e80d4d4 --- /dev/null +++ b/trunk/package/admin/sudo/patches/010-cross-compile-fixes.patch @@ -0,0 +1,25 @@ +diff -rupN sudo-1.8.11p2.orig/lib/util/Makefile.in sudo-1.8.11p2/lib/util/Makefile.in +--- sudo-1.8.11p2.orig/lib/util/Makefile.in 2014-10-07 22:26:20.000000000 +0200 ++++ sudo-1.8.11p2/lib/util/Makefile.in 2014-12-09 21:44:35.610041162 +0100 +@@ -17,6 +17,8 @@ + # @configure_input@ + # + ++include $(TOPDIR)/rules.mk ++ + #### Start of system configuration section. #### + + srcdir = @srcdir@ +@@ -142,10 +144,10 @@ libsudo_util.la: $(LTOBJS) @LT_LDDEP@ + esac + + siglist.c: mksiglist +- ./mksiglist > $@ ++ $(STAGING_DIR_HOST)/bin/mksiglist > $@ + + signame.c: mksigname +- ./mksigname > $@ ++ $(STAGING_DIR_HOST)/bin/mksigname > $@ + + mksiglist: $(srcdir)/mksiglist.c $(srcdir)/mksiglist.h $(incdir)/sudo_compat.h $(top_builddir)/config.h + $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFS) $(srcdir)/mksiglist.c -o $@ diff --git a/trunk/package/admin/sudo/patches/020-no-owner-change.patch b/trunk/package/admin/sudo/patches/020-no-owner-change.patch new file mode 100644 index 00000000..417e95de --- /dev/null +++ b/trunk/package/admin/sudo/patches/020-no-owner-change.patch @@ -0,0 +1,12 @@ +diff -rupN sudo-1.8.11p2.orig/Makefile.in sudo-1.8.11p2/Makefile.in +--- sudo-1.8.11p2.orig/Makefile.in 2014-10-07 22:26:20.000000000 +0200 ++++ sudo-1.8.11p2/Makefile.in 2014-12-09 22:00:27.256934143 +0100 +@@ -62,7 +62,7 @@ SHELL = @SHELL@ + SED = @SED@ + + INSTALL = $(SHELL) $(top_srcdir)/install-sh -c +-INSTALL_OWNER = -o $(install_uid) -g $(install_gid) ++INSTALL_OWNER = + + ECHO_N = @ECHO_N@ + ECHO_C = @ECHO_C@ diff --git a/trunk/package/admin/zabbix/Makefile b/trunk/package/admin/zabbix/Makefile new file mode 100644 index 00000000..8e084a77 --- /dev/null +++ b/trunk/package/admin/zabbix/Makefile @@ -0,0 +1,247 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=zabbix +PKG_VERSION:=2.4.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/zabbix +PKG_MD5SUM:=400a3e2ebec80e2f1fe86d1b32bfd2e1 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_INSTALL:=1 + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/zabbix/Default + SECTION:=admin + CATEGORY:=Administration + TITLE:=Zabbix + URL:=http://www.zabbix.com/ + SUBMENU:=zabbix + MAINTAINER:=Etienne CHAMPETIER + USERID:=zabbix=53:zabbix=53 +endef + +define Package/zabbix-agent + $(call Package/zabbix/Default) + TITLE+= agent +endef + +define Package/zabbix-agentd + $(call Package/zabbix/Default) + TITLE+= agentd +endef + +define Package/zabbix-extra-mac80211 + $(call Package/zabbix/Default) + TITLE+= discovery/userparameters for mac80211 + DEPENDS += +zabbix-agentd @PACKAGE_MAC80211_DEBUGFS @KERNEL_DEBUG_FS +endef + +define Package/zabbix-extra-network + $(call Package/zabbix/Default) + TITLE+= discovery/userparameters for network + DEPENDS += +zabbix-agentd +libuci-lua +lua +endef + +define Package/zabbix-extra-wifi + $(call Package/zabbix/Default) + TITLE+= discovery/userparameters for wifi + DEPENDS += +zabbix-agentd +libiwinfo-lua +libuci-lua +lua +endef + +define Package/zabbix-sender + $(call Package/zabbix/Default) + TITLE+= sender +endef + +define Package/zabbix-get + $(call Package/zabbix/Default) + TITLE+= get +endef + +define Package/zabbix-server + $(call Package/zabbix/Default) + TITLE+= server + DEPENDS += +libsqlite3 +endef + +define Package/zabbix-proxy + $(call Package/zabbix/Default) + TITLE+= proxy + DEPENDS += +libsqlite3 +endef + +define Package/zabbix-extra-mac80211/description +An extra package for zabbix-agentd that adds a discovery rule for mac80211 wifi phy and many userparameters. +It contains an suid helper to allow zabbix-agentd to still run as zabbix user and not as root. +See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates. +endef + +define Package/zabbix-extra-network/description +An extra package for zabbix-agentd that adds a discovery rule for openwrt network interfaces. +The idea here is to discover only interfaces listed in /etc/config/network (discover br-lan and not eth0.1 and wlan0) +See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates. +endef + +define Package/zabbix-extra-wifi/description +An extra package for zabbix-agentd that adds a discovery rule for wifi interfaces and many userparameters. +As it uses libiwinfo, it works with all wifi devices supported by openwrt. +See http://wiki.openwrt.org/doc/howto/zabbix for ready to use zabbix templates. +endef + +CONFIGURE_ARGS+= \ + --enable-agent \ + --enable-server \ + --enable-proxy \ + --disable-java \ + --with-sqlite3="$(STAGING_DIR)/usr" + +MAKE_FLAGS += ARCH="linux" + +define Package/zabbix/install/sbin + $(INSTALL_DIR) \ + $(1)/usr/sbin + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/zabbix_$(2) \ + $(1)/usr/sbin/ +endef + +define Package/zabbix/install/bin + $(INSTALL_DIR) \ + $(1)/usr/bin + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/zabbix_$(2) \ + $(1)/usr/bin/ +endef + +define Package/zabbix/install/etc + $(INSTALL_DIR) \ + $(1)/etc + + $(INSTALL_CONF) \ + $(PKG_INSTALL_DIR)/etc/zabbix_$(2).conf \ + $(1)/etc/ +endef + +define Package/zabbix/install/init.d + $(INSTALL_DIR) \ + $(1)/etc/init.d + + $(INSTALL_BIN) \ + ./files/zabbix_$(2).init \ + $(1)/etc/init.d/zabbix_$(2) +endef + +define Package/zabbix/install/zabbix.conf.d + $(INSTALL_DIR) \ + $(1)/etc/zabbix_agentd.conf.d + + $(INSTALL_BIN) \ + ./files/$(2) \ + $(1)/etc/zabbix_agentd.conf.d/$(2) +endef + +define Package/zabbix-agent/conffiles +/etc/zabbix_agent.conf +endef +define Package/zabbix-agentd/conffiles +/etc/zabbix_agentd.conf +endef +define Package/zabbix-server/conffiles +/etc/zabbix_server.conf +endef +define Package/zabbix-proxy/conffiles +/etc/zabbix_proxy.conf +endef + +ifdef CONFIG_PACKAGE_zabbix-extra-mac80211 +define Build/Prepare/zabbix-extra-mac80211 + mkdir -p $(PKG_BUILD_DIR)/zabbix-extra-mac80211 + $(CP) ./files/zabbix_helper_mac80211.c $(PKG_BUILD_DIR)/zabbix-extra-mac80211/ +endef + +define Build/Compile/zabbix-extra-mac80211 + $(TARGET_CC) $(TARGET_CFLAGS) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211.c -o $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 +endef +endif + +define Build/Prepare + $(call Build/Prepare/Default) + $(call Build/Prepare/zabbix-extra-mac80211) +endef + +define Build/Compile + $(call Build/Compile/Default) + $(call Build/Compile/zabbix-extra-mac80211) +endef + +define Package/zabbix-agent/install + $(call Package/zabbix/install/sbin,$(1),agent) + $(call Package/zabbix/install/etc,$(1),agent) +endef + +define Package/zabbix-agentd/install + $(INSTALL_DIR) $(1)/etc/zabbix_agentd.conf.d + $(call Package/zabbix/install/sbin,$(1),agentd) + $(call Package/zabbix/install/etc,$(1),agentd) + $(call Package/zabbix/install/init.d,$(1),agentd) +endef + +define Package/zabbix-extra-mac80211/install + $(call Package/zabbix/install/zabbix.conf.d,$(1),mac80211) + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/zabbix-extra-mac80211/zabbix_helper_mac80211 $(1)/usr/bin/ + chmod 4755 $(1)/usr/bin/zabbix_helper_mac80211 +endef + +define Package/zabbix-extra-network/install + $(call Package/zabbix/install/zabbix.conf.d,$(1),network) +endef + +define Package/zabbix-extra-wifi/install + $(call Package/zabbix/install/zabbix.conf.d,$(1),wifi) +endef + +define Package/zabbix-sender/install + $(call Package/zabbix/install/bin,$(1),sender) +endef + +define Package/zabbix-get/install + $(call Package/zabbix/install/bin,$(1),get) +endef + +define Package/zabbix-server/install + $(call Package/zabbix/install/sbin,$(1),server) + $(call Package/zabbix/install/etc,$(1),server) +endef + +define Package/zabbix-proxy/install + $(call Package/zabbix/install/sbin,$(1),proxy) + $(call Package/zabbix/install/etc,$(1),proxy) +endef + +$(eval $(call BuildPackage,zabbix-agent)) +$(eval $(call BuildPackage,zabbix-agentd)) +$(eval $(call BuildPackage,zabbix-extra-mac80211)) +$(eval $(call BuildPackage,zabbix-extra-network)) +$(eval $(call BuildPackage,zabbix-extra-wifi)) +$(eval $(call BuildPackage,zabbix-sender)) +$(eval $(call BuildPackage,zabbix-server)) +$(eval $(call BuildPackage,zabbix-proxy)) +$(eval $(call BuildPackage,zabbix-get)) diff --git a/trunk/package/admin/zabbix/files/mac80211 b/trunk/package/admin/zabbix/files/mac80211 new file mode 100644 index 00000000..93d83518 --- /dev/null +++ b/trunk/package/admin/zabbix/files/mac80211 @@ -0,0 +1,27 @@ +#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates + +# If you want to know the exact meaning of an UserParameter, you can search in the ieee80211 standard: +# http://standards.ieee.org/getieee802/download/802.11-2012.pdf +# exemple: for mac80211.ACKFailureCount search for dot11ACKFailureCount (page 2145) + +# mac80211 phy discovery (like 'phy0') +# exemple: {"data":[{"{#PHY}":"phy0"}]} +# +UserParameter=mac80211.phydiscovery,zabbix_helper_mac80211 discovery + +#phy statistics (you need {#PHY} as parameter) +# +UserParameter=mac80211.ACKFailureCount[*],zabbix_helper_mac80211 $1 dot11ACKFailureCount +UserParameter=mac80211.FCSErrorCount[*],zabbix_helper_mac80211 $1 dot11FCSErrorCount +UserParameter=mac80211.RTSFailureCount[*],zabbix_helper_mac80211 $1 dot11RTSFailureCount +UserParameter=mac80211.RTSSuccessCount[*],zabbix_helper_mac80211 $1 dot11RTSSuccessCount +UserParameter=mac80211.FailedCount[*],zabbix_helper_mac80211 $1 failed_count +UserParameter=mac80211.FrameDuplicateCount[*],zabbix_helper_mac80211 $1 frame_duplicate_count +UserParameter=mac80211.MulticastReceivedFrameCount[*],zabbix_helper_mac80211 $1 multicast_received_frame_count +UserParameter=mac80211.MulticastTransmittedFrameCount[*],zabbix_helper_mac80211 $1 multicast_transmitted_frame_count +UserParameter=mac80211.MultipleRetryCount[*],zabbix_helper_mac80211 $1 multiple_retry_count +UserParameter=mac80211.ReceivedFragmentCount[*],zabbix_helper_mac80211 $1 received_fragment_count +UserParameter=mac80211.RetryCount[*],zabbix_helper_mac80211 $1 retry_count +UserParameter=mac80211.TransmittedFragmentCount[*],zabbix_helper_mac80211 $1 transmitted_fragment_count +UserParameter=mac80211.TransmittedFrameCount[*],zabbix_helper_mac80211 $1 transmitted_frame_count + diff --git a/trunk/package/admin/zabbix/files/network b/trunk/package/admin/zabbix/files/network new file mode 100644 index 00000000..51cb1cbc --- /dev/null +++ b/trunk/package/admin/zabbix/files/network @@ -0,0 +1,9 @@ +#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates + +# network interface discovery +# exemple: {"data":[{"{#IF}":"lo", "{#NET}":"loopback"},{"{#IF}":"br-lan", "{#NET}":"lan"},{"{#IF}":"eth0.1", "{#NET}":"wan"}]} +# +UserParameter=netowrt.discovery,lua -l uci -e 'x = uci.cursor(nil, "/var/state");list = "{\"data\":[";x:foreach("network", "interface", function(s) list=list.."{\"{#IF}\":\""..s.ifname.."\", \"{#NET}\":\""..s[".name"].."\"}," end); list=string.gsub(list,",$",""); print(list.."]}")' + + + diff --git a/trunk/package/admin/zabbix/files/wifi b/trunk/package/admin/zabbix/files/wifi new file mode 100644 index 00000000..250d2f91 --- /dev/null +++ b/trunk/package/admin/zabbix/files/wifi @@ -0,0 +1,25 @@ +#see http://wiki.openwrt.org/doc/howto/zabbix for ready to use templates + +# wifi interface discovery +# exemple: {"data":[{"{#IF}":"wlan0", "{#MODE}":"ap", "{#SSID}":"Openwrt", "{#NET}":"lan", "{#DEV}":"radio0", "{#ENC}":"psk2+ccmp", "{#TYPE}":"mac80211", "{#HWMODE}":"11ng", "{#CHANNEL}":"11", "{#BSSID}":"xx:xx:xx:xx:xx:xx"}]} +# ubus call only work as root so you need to run zabbix as root to use wifi.ifdiscovery +UserParameter=wifi.ifdiscovery, lua -l uci -l ubus -l iwinfo -e 'u = ubus.connect();x = uci.cursor();list="{\"data\":[";stat=u:call("network.wireless", "status", {});for dev, dev_table in pairs(stat) do for i, iface in pairs(dev_table["interfaces"]) do s=iface["section"];list=list.."{\"{#IF}\":\""..iface["ifname"].."\", \"{#MODE}\":\""..x:get("wireless", s, "mode").."\", \"{#SSID}\":\""..x:get("wireless", s, "ssid").."\", \"{#NET}\":\""..x:get("wireless", s, "network").."\", \"{#DEV}\":\""..dev.."\", \"{#ENC}\":\""..(x:get("wireless", s, "encryption") or "?").."\", \"{#TYPE}\":\""..x:get("wireless", dev, "type").."\", \"{#HWMODE}\":\""..x:get("wireless", dev, "hwmode").."\", \"{#CHANNEL}\":\""..x:get("wireless", dev, "channel").."\", \"{#BSSID}\":\""..iwinfo[iwinfo.type(iface["ifname"])].bssid(iface["ifname"]).."\"},";end;end;list=string.gsub(list,",$","");print(list.."]}")' + + +#iwinfo info (you need {#IF} as parameter, like 'wlan0') +UserParameter=wifi.iwinfo.channel[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].channel('$1'))" +UserParameter=wifi.iwinfo.frequency[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].frequency('$1'))" +UserParameter=wifi.iwinfo.txpower[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].txpower('$1'))" +UserParameter=wifi.iwinfo.bitrate[*],lua -l iwinfo -e "b = iwinfo[iwinfo.type('$1')].bitrate('$1'); print(b or '0')" +UserParameter=wifi.iwinfo.signal[*],lua -l iwinfo -e "s = iwinfo[iwinfo.type('$1')].signal('$1'); print(s or '-255')" +UserParameter=wifi.iwinfo.noise[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].noise('$1'))" +UserParameter=wifi.iwinfo.quality[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].quality('$1'))" +UserParameter=wifi.iwinfo.quality_max[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].quality_max('$1'))" +UserParameter=wifi.iwinfo.mode[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].mode('$1'))" +UserParameter=wifi.iwinfo.ssid[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].ssid('$1'))" +UserParameter=wifi.iwinfo.bssid[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].bssid('$1'))" +UserParameter=wifi.iwinfo.country[*],lua -l iwinfo -e "print(iwinfo[iwinfo.type('$1')].country('$1'))" +UserParameter=wifi.iwinfo.nbusers[*],lua -l iwinfo -e "n = 0; for _,_ in pairs(iwinfo[iwinfo.type('$1')].assoclist('$1')) do n = n + 1 end; print(n)" +UserParameter=wifi.iwinfo.encryption[*],lua -l iwinfo -e "e = iwinfo[iwinfo.type('$1')].encryption('$1'); print(e and e.description or 'None')" +UserParameter=wifi.iwinfo.hwmode[*],lua -l iwinfo -e "x=iwinfo[iwinfo.type('$1')].hwmodelist('$1'); print((x.a and 'a' or '')..(x.b and 'b' or '')..(x.g and 'g' or '')..(x.n and 'n' or ''))" + diff --git a/trunk/package/admin/zabbix/files/zabbix_agentd.init b/trunk/package/admin/zabbix/files/zabbix_agentd.init new file mode 100644 index 00000000..c806a9f0 --- /dev/null +++ b/trunk/package/admin/zabbix/files/zabbix_agentd.init @@ -0,0 +1,31 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2008-2011 OpenWrt.org + +START=60 + +PROG=/usr/sbin/zabbix_agentd +CONFIG=/etc/zabbix_agentd.conf +SERVICE_PID_FILE=/var/run/zabbix_agentd.pid + +start() { + # Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf + [ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG} + + [ -f ${CONFIG} ] || return 1 + + grep -q "^PidFile=${SERVICE_PID_FILE}" ${CONFIG} || { + logger -s -t ${CONFIG} -p daemon.error "Only \"PidFile=${SERVICE_PID_FILE}\" supported" + return 1 + } + + grep -q "^AllowRoot=1" ${CONFIG} || { + touch ${SERVICE_PID_FILE} + chown zabbix:zabbix ${SERVICE_PID_FILE} + } + + service_start ${PROG} -c ${CONFIG} +} + +stop() { + service_stop ${PROG} +} diff --git a/trunk/package/admin/zabbix/files/zabbix_helper_mac80211.c b/trunk/package/admin/zabbix/files/zabbix_helper_mac80211.c new file mode 100644 index 00000000..1442d274 --- /dev/null +++ b/trunk/package/admin/zabbix/files/zabbix_helper_mac80211.c @@ -0,0 +1,77 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include + +int discovery() +{ + DIR *dir; + struct dirent *ent; + bool comma = false; + if ((dir = opendir ("/sys/kernel/debug/ieee80211/")) != NULL) { + printf("{\"data\":["); + while ((ent = readdir (dir)) != NULL) { + if (strcmp(".", ent->d_name) && strcmp("..", ent->d_name)) { + if (comma) + printf(","); + printf("{\"{#PHY}\":\"%s\"}", ent->d_name); + comma = true; + } + } + printf("]}\n"); + closedir(dir); + } else { + perror(""); + return EXIT_FAILURE; + } + return EXIT_SUCCESS; +} + +int get_param(char *phy, char *stat) +{ + char *filename = NULL; + FILE *f = NULL; + phy = basename(phy); + stat = basename(stat); + if (asprintf(&filename, "/sys/kernel/debug/ieee80211/%s/statistics/%s", phy, stat) > 0) + f = fopen(filename, "r"); + + if (f != NULL) { + char temp[256]; + while (fgets(temp, 256, f) != NULL) + printf("%s",temp); + + fclose(f); + } else { + perror(""); + return EXIT_FAILURE; + } + free(filename); + return EXIT_SUCCESS; +} + +int usage(char *name) +{ + fprintf(stderr, "Usage:\n"); + fprintf(stderr, " %s discovery\n", name); + fprintf(stderr, " => print mac80211.phydiscovery discovery rule\n"); + fprintf(stderr, " %s PHY STAT\n", name); + fprintf(stderr, " => cat /sys/kernel/debug/ieee80211/PHY/statistics/STAT as root\n"); + return EXIT_FAILURE; +} + +int main(int argc, char *argv[]) +{ + + switch (argc) { + case 2: + return discovery(); + case 3: + return get_param(argv[1], argv[2]); + default: + return usage(argv[0]); + } +} diff --git a/trunk/package/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch b/trunk/package/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch new file mode 100644 index 00000000..cedad900 --- /dev/null +++ b/trunk/package/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch @@ -0,0 +1,35 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -152,6 +152,10 @@ if test "x$found_resolv" != "xyes"; then + AC_MSG_ERROR([Unable to do DNS lookups (libresolv check failed)]) + fi + LIBS="${LIBS} ${RESOLV_LIBS}" ++AC_SEARCH_LIBS([res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])]) ++AC_SEARCH_LIBS([__res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])]) ++AC_SEARCH_LIBS([res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])]) ++AC_SEARCH_LIBS([__res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])]) + + dnl ***************************************************************** + dnl * * +--- a/src/libs/zbxsysinfo/common/net.c ++++ b/src/libs/zbxsysinfo/common/net.c +@@ -450,6 +450,7 @@ static int dns_query(AGENT_REQUEST *requ + return SYSINFO_RET_FAIL; + } + ++#if defined(HAVE_RES_MKQUERY) && defined(HAVE_RES_SEND) + if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf)))) + { + SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot create DNS query: %s", zbx_strerror(errno))); +@@ -480,6 +481,11 @@ static int dns_query(AGENT_REQUEST *requ + _res.retry = retry; + + res = res_send(buf, res, answer.buffer, sizeof(answer.buffer)); ++#else /* defined(HAVE_RES_QUERY) && defined(HAVE_RES_SEND) */ ++ /* retrand and retry are ignored */ ++ if (-1 == (res = res_query(zone, C_IN, type, answer.buffer, sizeof(answer.buffer)))) ++ return SYSINFO_RET_FAIL; ++#endif + + _res.retrans = saved_retrans; + _res.retry = saved_retry; diff --git a/trunk/package/admin/zabbix/patches/002-uclibc_loadavg.patch b/trunk/package/admin/zabbix/patches/002-uclibc_loadavg.patch new file mode 100644 index 00000000..191f1a13 --- /dev/null +++ b/trunk/package/admin/zabbix/patches/002-uclibc_loadavg.patch @@ -0,0 +1,48 @@ +--- a/src/libs/zbxsysinfo/linux/cpu.c ++++ b/src/libs/zbxsysinfo/linux/cpu.c +@@ -62,6 +62,45 @@ int SYSTEM_CPU_DISCOVERY(AGENT_REQUEST * + return SYSINFO_RET_OK; + } + ++ ++/* uclibc and dietlibc do not have this junk -ReneR */ ++#if defined (__UCLIBC__) || defined (__dietlibc__) ++static int getloadavg (double loadavg[], int nelem) ++{ ++ int fd; ++ ++ fd = open ("/proc/loadavg", O_RDONLY); ++ if (fd < 0) ++ return -1; ++ else ++ { ++ char buf[65], *p; ++ ssize_t nread; ++ int i; ++ ++ nread = read (fd, buf, sizeof buf - 1); ++ close (fd); ++ if (nread <= 0) ++ return -1; ++ buf[nread - 1] = '\0'; ++ ++ if (nelem > 3) ++ nelem = 3; ++ p = buf; ++ for (i = 0; i < nelem; ++i) ++ { ++ char *endp; ++ loadavg[i] = strtod (p, &endp); ++ if (endp == p) ++ return -1; ++ p = endp; ++ } ++ ++ return i; ++ } ++} ++#endif ++ + int SYSTEM_CPU_NUM(AGENT_REQUEST *request, AGENT_RESULT *result) + { + char *type; diff --git a/trunk/package/admin/zabbix/patches/010-change-agentd-config.patch b/trunk/package/admin/zabbix/patches/010-change-agentd-config.patch new file mode 100644 index 00000000..ccc36d1b --- /dev/null +++ b/trunk/package/admin/zabbix/patches/010-change-agentd-config.patch @@ -0,0 +1,62 @@ +--- a/conf/zabbix_agentd.conf ++++ b/conf/zabbix_agentd.conf +@@ -3,12 +3,8 @@ + + ############ GENERAL PARAMETERS ################# + +-### Option: PidFile +-# Name of PID file. +-# +-# Mandatory: no +-# Default: +-# PidFile=/tmp/zabbix_agentd.pid ++# Only /var/run/zabbix_agentd.pid supported ++PidFile=/var/run/zabbix_agentd.pid + + ### Option: LogFile + # Name of log file. +@@ -18,8 +14,6 @@ + # Default: + # LogFile= + +-LogFile=/tmp/zabbix_agentd.log +- + ### Option: LogFileSize + # Maximum size of log file in MB. + # 0 - disable automatic log rotation. +@@ -104,6 +98,7 @@ Server=127.0.0.1 + # Range: 0-100 + # Default: + # StartAgents=3 ++StartAgents=1 + + ##### Active checks related + +@@ -119,8 +114,6 @@ Server=127.0.0.1 + # Default: + # ServerActive= + +-ServerActive=127.0.0.1 +- + ### Option: Hostname + # Unique, case sensitive hostname. + # Required for active checks and must match hostname as configured on the server. +@@ -130,8 +123,6 @@ ServerActive=127.0.0.1 + # Default: + # Hostname= + +-Hostname=Zabbix server +- + ### Option: HostnameItem + # Item used for generating Hostname if it is undefined. Ignored if Hostname is defined. + # Does not support UserParameters or aliases. +@@ -249,8 +240,8 @@ Hostname=Zabbix server + # Include= + + # Include=/usr/local/etc/zabbix_agentd.userparams.conf +-# Include=/usr/local/etc/zabbix_agentd.conf.d/ + # Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf ++Include=/etc/zabbix_agentd.conf.d/ + + ####### USER-DEFINED MONITORED PARAMETERS ####### + diff --git a/trunk/package/devel/diffutils/Makefile b/trunk/package/devel/diffutils/Makefile new file mode 100644 index 00000000..b313dafa --- /dev/null +++ b/trunk/package/devel/diffutils/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2008-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=diffutils +PKG_VERSION:=3.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/diffutils +PKG_MD5SUM:=99180208ec2a82ce71f55b0d7389f1b3 +PKG_MAINTAINER:=Roger D +PKG_LICENSE:=GPL-3.0 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/diffutils + SECTION:=devel + CATEGORY:=Development + DEPENDS:=+USE_GLIBC:librt + TITLE:=diffutils + URL:=http://www.gnu.org/software/diffutils/ +endef + +define Package/diffutils/description + The Diffutils package contains programs that show the differences between + files or directories. +endef + +CONFIGURE_VARS += \ + ac_cv_func_mempcpy=n +TARGET_CFLAGS += --std=c99 + +define Package/diffutils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{sdiff,diff3,diff,cmp} $(1)/usr/bin/ +endef + +define Package/diffutils/preinst +#!/bin/sh +for x in sdiff diff3 diff cmp; do + [ -L "$${IPKG_INSTROOT}/usr/bin/$$x" ] && rm -f "$${IPKG_INSTROOT}/usr/bin/$$x" +done +exit 0 +endef + +define Package/diffutils/postrm +#!/bin/sh +for x in sdiff diff3 diff cmp; do + /bin/busybox $$x -h 2>&1 | grep -q BusyBox && ln -sf ../../bin/busybox /usr/bin/$$x +done +exit 0 +endef + +$(eval $(call BuildPackage,diffutils)) diff --git a/trunk/package/devel/gcc/Makefile b/trunk/package/devel/gcc/Makefile new file mode 100644 index 00000000..9cdde88d --- /dev/null +++ b/trunk/package/devel/gcc/Makefile @@ -0,0 +1,116 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gcc +PKG_VERSION:=4.8.3 +PKG_RELEASE:=1 +PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \ + http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \ + ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION) + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_MD5SUM:=7c60f24fab389f77af203d2516ee110f +PKG_INSTALL:=1 +PKG_FIXUP:=libtool +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +TARGET_LANGUAGES:="c,c++" +BUGURL=https://dev.openwrt.org/ +PKGVERSION=OpenWrt GCC $(PKG_VERSION) + +# not using sstrip here as this fucks up the .so's somehow +STRIP:=$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)strip +RSTRIP:= \ + NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \ + STRIP="$(STRIP)" \ + STRIP_KMOD="$(STRIP) --strip-debug" \ + $(SCRIPT_DIR)/rstrip.sh + + +define Package/gcc + SECTION:=devel + CATEGORY:=Development + TITLE:=gcc + MAINTAINER:=Christian Beier + DEPENDS:= +binutils +libstdcpp +endef + +define Package/gcc/description + build a native toolchain for compiling on target +endef + + +define Build/Prepare + $(PKG_UNPACK) +# we have to download additional stuff before patching + (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites) + $(Build/Patch) +endef + + +define Build/Configure + (cd $(PKG_BUILD_DIR); rm -f config.cache; \ + SHELL="$(BASH)" \ + $(TARGET_CONFIGURE_OPTS) \ + $(PKG_BUILD_DIR)/configure \ + $(CONFIGURE_ARGS) \ + --build=$(GNU_HOST_NAME) \ + --host=$(REAL_GNU_TARGET_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --enable-languages=$(TARGET_LANGUAGES) \ + --with-bugurl=$(BUGURL) \ + --with-pkgversion="$(PKGVERSION)" \ + --enable-shared \ + --disable-__cxa_atexit \ + --enable-target-optspace \ + --with-gnu-ld \ + --disable-nls \ + --disable-libmudflap \ + --disable-multilib \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-libssp \ + --disable-decimal-float \ + --disable-libstdcxx-pch \ + --with-host-libstdcxx=-lstdc++ \ + --prefix=/usr \ + --libexecdir=/usr/lib \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ + $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ + --with-abi=$(subst ",,$(CONFIG_MIPS64_ABI))) \ + ); +endef + +define Build/Compile + export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install +endef + +define Package/gcc/install + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -ar $(PKG_INSTALL_DIR)/usr/include $(1)/usr + cp -a $(PKG_INSTALL_DIR)/usr/bin/{$(REAL_GNU_TARGET_NAME)-{g++,gcc},cpp,gcov} $(1)/usr/bin + ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/c++ + ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/g++ + ln -s $(REAL_GNU_TARGET_NAME)-g++ $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-c++ + ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc + ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION) + cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib + $(RM) $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a + cp -ar $(TOOLCHAIN_DIR)/include $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) + grep "GROUP.*-lgcc" $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libgcc_s.so && cp -a $(PKG_INSTALL_DIR)/usr/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libgcc.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/ ; true +endef + +$(eval $(call BuildPackage,gcc)) diff --git a/trunk/package/devel/gcc/README b/trunk/package/devel/gcc/README new file mode 100644 index 00000000..58db4740 --- /dev/null +++ b/trunk/package/devel/gcc/README @@ -0,0 +1,10 @@ +Native GCC that runs on target. + +To save disk space, this GCC only supports dynamic linking on the target box, +there are no static libraries shipped except libgcc.a on those architectures +that need it. + +For now, this was only tested on arm (EABI) and mips targets. Others to be +done... + + Christian Beier diff --git a/trunk/package/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch b/trunk/package/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch new file mode 100644 index 00000000..84729605 --- /dev/null +++ b/trunk/package/devel/gcc/patches/002-dont-choke-when-building-32bit-on-64bit.patch @@ -0,0 +1,15 @@ +diff --git a/gcc/real.h b/gcc/real.h +index 2ff84f6..fbb4b0e 100644 +--- a/gcc/real.h ++++ b/gcc/real.h +@@ -72,8 +72,10 @@ struct GTY(()) real_value { + + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */ + + /* Verify the guess. */ ++#ifndef __LP64__ + extern char test_real_width + [sizeof(REAL_VALUE_TYPE) <= REAL_WIDTH*sizeof(HOST_WIDE_INT) ? 1 : -1]; ++#endif + + /* Calculate the format for CONST_DOUBLE. We need as many slots as + are necessary to overlay a REAL_VALUE_TYPE on them. This could be diff --git a/trunk/package/devel/gcc/patches/003-mpfr-longlong-mips.patch b/trunk/package/devel/gcc/patches/003-mpfr-longlong-mips.patch new file mode 100644 index 00000000..0ab9fe50 --- /dev/null +++ b/trunk/package/devel/gcc/patches/003-mpfr-longlong-mips.patch @@ -0,0 +1,38 @@ +diff -Naurd mpfr-2.4.2-a/mpfr-longlong.h mpfr-2.4.2-b/mpfr-longlong.h +--- -a/mpfr-2.4.2/mpfr-longlong.h 2009-11-30 02:43:08.000000000 +0000 ++++ -b/mpfr-2.4.2/mpfr-longlong.h 2009-12-18 12:04:29.000000000 +0000 +@@ -1011,7 +1011,15 @@ + #endif /* __m88000__ */ + + #if defined (__mips) && W_TYPE_SIZE == 32 +-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 ++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) ++#define umul_ppmm(w1, w0, u, v) \ ++ do { \ ++ UDItype _r; \ ++ _r = (UDItype) u * v; \ ++ (w1) = _r >> 32; \ ++ (w0) = (USItype) _r; \ ++ } while (0) ++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7 + #define umul_ppmm(w1, w0, u, v) \ + __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v)) + #else +@@ -1024,7 +1032,16 @@ + #endif /* __mips */ + + #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64 +-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7 ++#if (__GNUC__ >= 5) || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) ++typedef unsigned int UTItype __attribute__ ((mode (TI))); ++#define umul_ppmm(w1, w0, u, v) \ ++ do { \ ++ UTItype _r; \ ++ _r = (UTItype) u * v; \ ++ (w1) = _r >> 64; \ ++ (w0) = (UDItype) _r; \ ++ } while (0) ++#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7 + #define umul_ppmm(w1, w0, u, v) \ + __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v)) + #else diff --git a/trunk/package/devel/gcc/patches/010-documentation.patch b/trunk/package/devel/gcc/patches/010-documentation.patch new file mode 100644 index 00000000..3f604ee4 --- /dev/null +++ b/trunk/package/devel/gcc/patches/010-documentation.patch @@ -0,0 +1,23 @@ +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -4326,18 +4326,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/trunk/package/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch b/trunk/package/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch new file mode 100644 index 00000000..afc5cfdc --- /dev/null +++ b/trunk/package/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch @@ -0,0 +1,45 @@ +diff --git a/gcc/configure b/gcc/configure +index 3793681..bcda752 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -26876,19 +26876,6 @@ $as_echo "#define TARGET_LIBC_PROVIDES_SSP 1" >>confdefs.h + + fi + +-# Test for on the target. +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 +-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; } +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- +-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 +-$as_echo "$have_sys_sdt_h" >&6; } + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 3ee1d67..e321218 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -4796,16 +4796,6 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then + [Define if your target C library provides stack protector support]) + fi + +-# Test for on the target. +-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) +-AC_MSG_CHECKING(sys/sdt.h in the target C library) +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- AC_DEFINE(HAVE_SYS_SDT_H, 1, +- [Define if your target C library provides sys/sdt.h]) +-fi +-AC_MSG_RESULT($have_sys_sdt_h) + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 diff --git a/trunk/package/devel/gcc/patches/100-uclibc-conf.patch b/trunk/package/devel/gcc/patches/100-uclibc-conf.patch new file mode 100644 index 00000000..ff9ad94f --- /dev/null +++ b/trunk/package/devel/gcc/patches/100-uclibc-conf.patch @@ -0,0 +1,33 @@ +--- a/contrib/regression/objs-gcc.sh ++++ b/contrib/regression/objs-gcc.sh +@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H + then + make all-gdb all-dejagnu all-ld || exit 1 + make install-gdb install-dejagnu install-ld || exit 1 ++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ] ++ then ++ make all-gdb all-dejagnu all-ld || exit 1 ++ make install-gdb install-dejagnu install-ld || exit 1 + elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then + make bootstrap || exit 1 + make install || exit 1 +--- a/libjava/classpath/ltconfig ++++ b/libjava/classpath/ltconfig +@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- + + # Transform linux* to *-*-linux-gnu*, to support old configure scripts. + case $host_os in +-linux-gnu*) ;; ++linux-gnu*|linux-uclibc*) ;; + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` + esac + +@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux + ;; + + # This must be Linux ELF. +-linux-gnu*) ++linux*) + version_type=linux + need_lib_prefix=no + need_version=no diff --git a/trunk/package/devel/gcc/patches/200-musl.patch b/trunk/package/devel/gcc/patches/200-musl.patch new file mode 100644 index 00000000..2e6df47e --- /dev/null +++ b/trunk/package/devel/gcc/patches/200-musl.patch @@ -0,0 +1,321 @@ +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -549,7 +549,7 @@ case ${target} in + esac + + # Common C libraries. +-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" ++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" + + # Common parts for widely ported systems. + case ${target} in +@@ -652,6 +652,9 @@ case ${target} in + *-*-*uclibc*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" + ;; ++ *-*-*musl*) ++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" ++ ;; + *) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" + ;; +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -77,6 +77,10 @@ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" + ++/* musl has no "classic" (i.e. broken) mode */ ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +--- a/gcc/config/i386/linux.h ++++ b/gcc/config/i386/linux.h +@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3. + + #define GNU_USER_LINK_EMULATION "elf_i386" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" +--- a/gcc/config/i386/linux64.h ++++ b/gcc/config/i386/linux64.h +@@ -30,3 +30,7 @@ see the files COPYING3 and COPYING.RUNTI + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++ ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" ++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ +@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTI + uClibc or Bionic is the default C library and whether + -muclibc or -mglibc or -mbionic has been passed to change the default. */ + +-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ +- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" ++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ ++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" + + #if DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) + #elif DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) + #elif DEFAULT_LIBC == LIBC_BIONIC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) + #else + #error "Unsupported DEFAULT_LIBC" + #endif /* DEFAULT_LIBC */ +@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTI + + #define GNU_USER_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ +- BIONIC_DYNAMIC_LINKER) ++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + #define GNU_USER_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ +- BIONIC_DYNAMIC_LINKER32) ++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ +- BIONIC_DYNAMIC_LINKER64) ++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + #define GNU_USER_DYNAMIC_LINKERX32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ +- BIONIC_DYNAMIC_LINKERX32) ++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) + + /* Determine whether the entire c99 runtime + is present in the runtime library. */ +--- a/gcc/config/linux.opt ++++ b/gcc/config/linux.opt +@@ -30,3 +30,7 @@ Use GNU C library + muclibc + Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) + Use uClibc C library ++ ++mmusl ++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc) ++Use musl C library +--- a/gcc/config/mips/linux.h ++++ b/gcc/config/mips/linux.h +@@ -18,3 +18,5 @@ along with GCC; see the file COPYING3. + . */ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" ++ ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1" +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -364,17 +364,21 @@ extern int dot_symbols; + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1" + #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" + #elif DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER32 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + + + #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \ +--- a/gcc/config/rs6000/sysv4.h ++++ b/gcc/config/rs6000/sysv4.h +@@ -789,15 +789,18 @@ extern int fixuplabelno; + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +--- a/gcc/ginclude/stddef.h ++++ b/gcc/ginclude/stddef.h +@@ -181,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + #ifndef _GCC_SIZE_T + #ifndef _SIZET_ + #ifndef __size_t ++#ifndef __DEFINED_size_t /* musl */ + #define __size_t__ /* BeOS */ + #define __SIZE_T__ /* Cray Unicos/Mk */ + #define _SIZE_T +@@ -197,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t; + #define ___int_size_t_h + #define _GCC_SIZE_T + #define _SIZET_ ++#define __DEFINED_size_t /* musl */ + #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \ + || defined(__FreeBSD_kernel__) + /* __size_t is a typedef on FreeBSD 5, must not trash it. */ +@@ -214,6 +216,7 @@ typedef __SIZE_TYPE__ size_t; + typedef long ssize_t; + #endif /* __BEOS__ */ + #endif /* !(defined (__GNUG__) && defined (size_t)) */ ++#endif /* __DEFINED_size_t */ + #endif /* __size_t */ + #endif /* _SIZET_ */ + #endif /* _GCC_SIZE_T */ +--- a/libgomp/config/posix/time.c ++++ b/libgomp/config/posix/time.c +@@ -28,6 +28,8 @@ + The following implementation uses the most simple POSIX routines. + If present, POSIX 4 clocks should be used instead. */ + ++#define _POSIX_C_SOURCE 199309L /* for clocks */ ++ + #include "libgomp.h" + #include + #if TIME_WITH_SYS_TIME +--- a/libitm/config/arm/hwcap.cc ++++ b/libitm/config/arm/hwcap.cc +@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0 + + #ifdef __linux__ + #include ++#ifdef __GLIBC__ + #include ++#else ++#include ++#endif + #include + + static void __attribute__((constructor)) +--- a/libitm/config/linux/x86/tls.h ++++ b/libitm/config/linux/x86/tls.h +@@ -25,16 +25,19 @@ + #ifndef LIBITM_X86_TLS_H + #define LIBITM_X86_TLS_H 1 + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + /* Use slots in the TCB head rather than __thread lookups. + GLIBC has reserved words 10 through 13 for TM. */ + #define HAVE_ARCH_GTM_THREAD 1 + #define HAVE_ARCH_GTM_THREAD_DISP 1 + #endif ++#endif + + #include "config/generic/tls.h" + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + namespace GTM HIDDEN { + + #ifdef __x86_64__ +@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a + + } // namespace GTM + #endif /* >= GLIBC 2.10 */ ++#endif + + #endif // LIBITM_X86_TLS_H +--- a/libstdc++-v3/configure.host ++++ b/libstdc++-v3/configure.host +@@ -264,6 +264,13 @@ case "${host_os}" in + os_include_dir="os/bsd/freebsd" + ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) ++ # check for musl by target ++ case "${host_os}" in ++ *-musl*) ++ os_include_dir="os/generic" ++ ;; ++ *) ++ + if [ "$uclibc" = "yes" ]; then + os_include_dir="os/uclibc" + elif [ "$bionic" = "yes" ]; then +@@ -272,6 +279,9 @@ case "${host_os}" in + os_include_dir="os/gnu-linux" + fi + ;; ++ ++ esac ++ ;; + hpux*) + os_include_dir="os/hpux" + ;; +--- a/gcc/config/mips/linux64.h ++++ b/gcc/config/mips/linux64.h +@@ -27,6 +27,9 @@ along with GCC; see the file COPYING3. + #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1" + #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0" + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" ++#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1" + #define GNU_USER_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ +- BIONIC_DYNAMIC_LINKERN32) ++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) +--- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100 ++++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100 +@@ -104,6 +104,9 @@ + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2" + ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-sparc.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-sparc.so.1" ++ + #ifdef SPARC_BI_ARCH + + #undef SUBTARGET_EXTRA_SPECS + diff --git a/trunk/package/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch b/trunk/package/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 00000000..ae4f6516 --- /dev/null +++ b/trunk/package/devel/gcc/patches/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -271,7 +271,7 @@ extern void (*arm_lang_output_object_att + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) + +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + /* The following two macros concern the ability to execute coprocessor diff --git a/trunk/package/devel/gcc/patches/810-arm-softfloat-libgcc.patch b/trunk/package/devel/gcc/patches/810-arm-softfloat-libgcc.patch new file mode 100644 index 00000000..33cf8add --- /dev/null +++ b/trunk/package/devel/gcc/patches/810-arm-softfloat-libgcc.patch @@ -0,0 +1,25 @@ +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -55,8 +55,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/trunk/package/devel/gcc/patches/820-libgcc_pic.patch b/trunk/package/devel/gcc/patches/820-libgcc_pic.patch new file mode 100644 index 00000000..7a0ac735 --- /dev/null +++ b/trunk/package/devel/gcc/patches/820-libgcc_pic.patch @@ -0,0 +1,36 @@ +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + endif +@@ -1058,6 +1059,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/trunk/package/devel/gcc/patches/830-arm_unbreak_armv4t.patch b/trunk/package/devel/gcc/patches/830-arm_unbreak_armv4t.patch new file mode 100644 index 00000000..37f8f2a5 --- /dev/null +++ b/trunk/package/devel/gcc/patches/830-arm_unbreak_armv4t.patch @@ -0,0 +1,13 @@ +http://sourceware.org/ml/crossgcc/2008-05/msg00009.html + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -45,7 +45,7 @@ + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ + #undef SUBTARGET_CPU_DEFAULT +-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ diff --git a/trunk/package/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch b/trunk/package/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 00000000..e938905a --- /dev/null +++ b/trunk/package/devel/gcc/patches/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,19 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -81,10 +81,15 @@ + #undef MUSL_DYNAMIC_LINKER + #define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC BE8_LINK_SPEC \ ++#define LINK_SPEC BE8_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/trunk/package/devel/gcc/patches/850-use_shared_libgcc.patch b/trunk/package/devel/gcc/patches/850-use_shared_libgcc.patch new file mode 100644 index 00000000..2c7369fc --- /dev/null +++ b/trunk/package/devel/gcc/patches/850-use_shared_libgcc.patch @@ -0,0 +1,47 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -114,10 +114,6 @@ + #define ENDFILE_SPEC \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_assert ("system=posix"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic is the default C library and whether + -muclibc or -mglibc or -mbionic has been passed to change the default. */ +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -132,5 +132,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -61,6 +61,9 @@ + #undef CPLUSPLUS_CPP_SPEC + #define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" + diff --git a/trunk/package/devel/gcc/patches/860-uclibc_use_eh_frame.patch b/trunk/package/devel/gcc/patches/860-uclibc_use_eh_frame.patch new file mode 100644 index 00000000..0464bd7d --- /dev/null +++ b/trunk/package/devel/gcc/patches/860-uclibc_use_eh_frame.patch @@ -0,0 +1,29 @@ +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -100,15 +100,20 @@ call_ ## FUNC (void) \ + #if defined(OBJECT_FORMAT_ELF) \ + && !defined(OBJECT_FORMAT_FLAT) \ + && defined(HAVE_LD_EH_FRAME_HDR) \ +- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \ +- && defined(__GLIBC__) && __GLIBC__ >= 2 ++ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) + #include + /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h. + But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */ +-# if !defined(__UCLIBC__) \ +- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ +- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) +-# define USE_PT_GNU_EH_FRAME ++# if defined(__UCLIBC__) ++# if (__UCLIBC_MAJOR__ > 0 || __UCLIBC_MINOR__ > 9 || \ ++ (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 33)) ++# define USE_PT_GNU_EH_FRAME ++# endif ++# elif defined(__GLIBC__) ++# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \ ++ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG))) ++# define USE_PT_GNU_EH_FRAME ++# endif + # endif + #endif + diff --git a/trunk/package/devel/gcc/patches/870-ppc_no_crtsavres.patch b/trunk/package/devel/gcc/patches/870-ppc_no_crtsavres.patch new file mode 100644 index 00000000..d8c460a9 --- /dev/null +++ b/trunk/package/devel/gcc/patches/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -17653,7 +17653,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/trunk/package/devel/gcc/patches/880-no_java_section.patch b/trunk/package/devel/gcc/patches/880-no_java_section.patch new file mode 100644 index 00000000..def6c9f4 --- /dev/null +++ b/trunk/package/devel/gcc/patches/880-no_java_section.patch @@ -0,0 +1,11 @@ +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI + /* If we have named section and we support weak symbols, then use the + .jcr section for recording java classes which need to be registered + at program start-up time. */ +-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK ++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK + #ifndef JCR_SECTION_NAME + #define JCR_SECTION_NAME ".jcr" + #endif diff --git a/trunk/package/devel/gcc/patches/900-bad-mips16-crt.patch b/trunk/package/devel/gcc/patches/900-bad-mips16-crt.patch new file mode 100644 index 00000000..dd6e9dc8 --- /dev/null +++ b/trunk/package/devel/gcc/patches/900-bad-mips16-crt.patch @@ -0,0 +1,9 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/trunk/package/devel/gcc/patches/910-mbsd_multi.patch b/trunk/package/devel/gcc/patches/910-mbsd_multi.patch new file mode 100644 index 00000000..d04dc7d9 --- /dev/null +++ b/trunk/package/devel/gcc/patches/910-mbsd_multi.patch @@ -0,0 +1,253 @@ + + This patch brings over a few features from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + * -Werror-maybe-reset + Has the effect of -Wno-error if GCC_NO_WERROR is + set and not '0', a no-operation otherwise. This is + to be able to use -Werror in "make" but prevent + GNU autoconf generated configure scripts from + freaking out. + * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks + the default for -O2/-Os, because they trigger gcc bugs + and can delete code with security implications. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -104,6 +104,9 @@ static size_t include_cursor; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -383,6 +386,9 @@ c_common_handle_option (size_t scode, co + cpp_opts->warn_endif_labels = value; + break; + ++ case OPT_Werror_maybe_reset: ++ break; ++ + case OPT_Winvalid_pch: + cpp_opts->warn_invalid_pch = value; + break; +@@ -491,6 +497,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1027,6 +1039,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -379,6 +379,10 @@ Werror-implicit-function-declaration + C ObjC RejectNegative Warning Alias(Werror=, implicit-function-declaration) + This switch is deprecated; use -Werror=implicit-function-declaration instead + ++Werror-maybe-reset ++C ObjC C++ ObjC++ ++; Documented in common.opt ++ + Wfloat-equal + C ObjC C++ ObjC++ Var(warn_float_equal) Warning + Warn if testing floating point numbers for equality +@@ -949,6 +953,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -541,6 +541,10 @@ Werror= + Common Joined + Treat specified warning as error + ++Werror-maybe-reset ++Common ++If environment variable GCC_NO_WERROR is set, act as -Wno-error ++ + Wextra + Common Var(extra_warnings) Warning + Print extra (possibly unwanted) warnings +@@ -1242,6 +1246,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -468,8 +468,6 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_fschedule_insns2, NULL, 1 }, + #endif + { OPT_LEVELS_2_PLUS, OPT_fregmove, NULL, 1 }, +- { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 }, +- { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 }, +@@ -488,6 +486,8 @@ static const struct default_options defa + { OPT_LEVELS_2_PLUS, OPT_fhoist_adjacent_loads, NULL, 1 }, + + /* -O3 optimizations. */ ++ { OPT_LEVELS_3_PLUS, OPT_fstrict_aliasing, NULL, 1 }, ++ { OPT_LEVELS_3_PLUS, OPT_fstrict_overflow, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_ftree_loop_distribute_patterns, NULL, 1 }, + { OPT_LEVELS_3_PLUS, OPT_fpredictive_commoning, NULL, 1 }, + /* Inlining of functions reducing size is a good idea with -Os +@@ -1423,6 +1423,17 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_Werror_maybe_reset: ++ { ++ char *ev = getenv ("GCC_NO_WERROR"); ++ if ((ev != NULL) && (*ev != '0')) ++ warnings_are_errors = 0; ++ } ++ break; ++ ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -163,6 +163,11 @@ in older programs. This warning is on b + Make all warnings into hard errors. Source code which triggers warnings + will be rejected. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ + @item -Wsystem-headers + @opindex Wsystem-headers + Issue warnings for code in system headers. These are normally unhelpful +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -240,7 +240,7 @@ Objective-C and Objective-C++ Dialects}. + -Wconversion -Wcoverage-mismatch -Wno-cpp -Wno-deprecated @gol + -Wno-deprecated-declarations -Wdisabled-optimization @gol + -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol +--Wno-endif-labels -Werror -Werror=* @gol ++-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol + -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol + -Wformat-security -Wformat-y2k @gol +@@ -4808,6 +4808,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ ++ at item -fhonour-copts ++ at opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +@@ -6919,7 +6935,7 @@ so, the first branch is redirected to ei + second branch or a point immediately following it, depending on whether + the condition is known to be true or false. + +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. ++Enabled at levels @option{-O3}. + + @item -fsplit-wide-types + @opindex fsplit-wide-types +--- a/gcc/java/jvspec.c ++++ b/gcc/java/jvspec.c +@@ -626,6 +626,7 @@ lang_specific_pre_link (void) + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); ++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ + err = do_spec (jvgenmain_spec); + if (err == 0) + { diff --git a/trunk/package/devel/gcc/patches/920-specs_nonfatal_getenv.patch b/trunk/package/devel/gcc/patches/920-specs_nonfatal_getenv.patch new file mode 100644 index 00000000..4baa9669 --- /dev/null +++ b/trunk/package/devel/gcc/patches/920-specs_nonfatal_getenv.patch @@ -0,0 +1,14 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -8003,7 +8003,10 @@ getenv_spec_function (int argc, const ch + + value = getenv (argv[0]); + if (!value) +- fatal_error ("environment variable %qs not defined", argv[0]); ++ { ++ warning (0, "environment variable %qs not defined", argv[0]); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/trunk/package/devel/lttng-modules/Makefile b/trunk/package/devel/lttng-modules/Makefile new file mode 100644 index 00000000..355f3250 --- /dev/null +++ b/trunk/package/devel/lttng-modules/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2013-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lttng-modules +PKG_VERSION:=2.6.0 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/ +PKG_MD5SUM:=a058ab037daaca293a54934d7b9f9c98 + +PKG_LICENSE:=LGPL-2.1 GPL-2.0 MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Nicolas Thill + +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/lttng + SUBMENU:=Other modules + TITLE:=Linux Trace Toolkit: next generation (kernel modules) + URL:=https://lttng.org/ + DEPENDS:= @!TARGET_uml @KERNEL_FTRACE + FILES:= \ + $(PKG_BUILD_DIR)/lttng-*.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/lib/lttng-*.$(LINUX_KMOD_SUFFIX) \ + $(PKG_BUILD_DIR)/probes/lttng-*.$(LINUX_KMOD_SUFFIX) +endef + +define Build/Compile + $(MAKE) -C "$(LINUX_DIR)" \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + V="$(V)" \ + modules +endef + +$(eval $(call KernelPackage,lttng)) diff --git a/trunk/package/devel/lttng-modules/patches/001-mm_page_alloc_extfrag.patch b/trunk/package/devel/lttng-modules/patches/001-mm_page_alloc_extfrag.patch new file mode 100644 index 00000000..183f7d11 --- /dev/null +++ b/trunk/package/devel/lttng-modules/patches/001-mm_page_alloc_extfrag.patch @@ -0,0 +1,98 @@ +--- a/instrumentation/events/lttng-module/kmem.h ++++ b/instrumentation/events/lttng-module/kmem.h +@@ -286,7 +286,94 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT(mm + __entry->order, __entry->migratetype) + ) + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,2) \ ++ || LTTNG_KERNEL_RANGE(3,18,10, 3,19,0) \ ++ || LTTNG_KERNEL_RANGE(3,14,36, 3,15,0)) ++ ++LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag, ++ ++ TP_PROTO(struct page *page, ++ int alloc_order, int fallback_order, ++ int alloc_migratetype, int fallback_migratetype), ++ ++ TP_ARGS(page, ++ alloc_order, fallback_order, ++ alloc_migratetype, fallback_migratetype), ++ ++ TP_STRUCT__entry( ++ __field_hex( struct page *, page ) ++ __field( int, alloc_order ) ++ __field( int, fallback_order ) ++ __field( int, alloc_migratetype ) ++ __field( int, fallback_migratetype ) ++ __field( int, change_ownership ) ++ ), ++ ++ TP_fast_assign( ++ tp_assign(page, page) ++ tp_assign(alloc_order, alloc_order) ++ tp_assign(fallback_order, fallback_order) ++ tp_assign(alloc_migratetype, alloc_migratetype) ++ tp_assign(fallback_migratetype, fallback_migratetype) ++ tp_assign(change_ownership, ++ (alloc_migratetype == get_pageblock_migratetype(page))) ++ ), ++ ++ TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", ++ __entry->page, ++ page_to_pfn(__entry->page), ++ __entry->alloc_order, ++ __entry->fallback_order, ++ pageblock_order, ++ __entry->alloc_migratetype, ++ __entry->fallback_migratetype, ++ __entry->fallback_order < pageblock_order, ++ __entry->change_ownership) ++) ++ ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,30)) ++ ++LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag, ++ ++ TP_PROTO(struct page *page, ++ int alloc_order, int fallback_order, ++ int alloc_migratetype, int fallback_migratetype, int new_migratetype), ++ ++ TP_ARGS(page, ++ alloc_order, fallback_order, ++ alloc_migratetype, fallback_migratetype, new_migratetype), ++ ++ TP_STRUCT__entry( ++ __field_hex( struct page *, page ) ++ __field( int, alloc_order ) ++ __field( int, fallback_order ) ++ __field( int, alloc_migratetype ) ++ __field( int, fallback_migratetype ) ++ __field( int, change_ownership ) ++ ), ++ ++ TP_fast_assign( ++ tp_assign(page, page) ++ tp_assign(alloc_order, alloc_order) ++ tp_assign(fallback_order, fallback_order) ++ tp_assign(alloc_migratetype, alloc_migratetype) ++ tp_assign(fallback_migratetype, fallback_migratetype) ++ tp_assign(change_ownership, (new_migratetype == alloc_migratetype)) ++ ), ++ ++ TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", ++ __entry->page, ++ page_to_pfn(__entry->page), ++ __entry->alloc_order, ++ __entry->fallback_order, ++ pageblock_order, ++ __entry->alloc_migratetype, ++ __entry->fallback_migratetype, ++ __entry->fallback_order < pageblock_order, ++ __entry->change_ownership) ++) ++ ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,0)) + + LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag, + diff --git a/trunk/package/devel/lttng-tools/Makefile b/trunk/package/devel/lttng-tools/Makefile new file mode 100644 index 00000000..6c902dfc --- /dev/null +++ b/trunk/package/devel/lttng-tools/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (C) 2013-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=lttng-tools +PKG_VERSION:=2.6.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://lttng.org/files/$(PKG_NAME)/ +PKG_MD5SUM:=0478f60395f9564b4a19f45ce7b7f3df + +PKG_LICENSE:=LGPL-2.1 GPL-2.0 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Nicolas Thill + +PKG_FIXUP:=autoreconf +PKG_USE_MIPS16:=0 +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/lttng-tools + SECTION:=devel + CATEGORY:=Development + TITLE:=Linux Trace Toolkit: next generation (tools) + URL:=https://lttng.org/ + DEPENDS:= +lttng-ust +libpopt +libxml2 +endef + +CONFIGURE_ARGS += --disable-kmod + +TARGET_LDFLAGS += -lurcu-bp + +MAKE_FLAGS += V="$(V)" + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/lttng $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblttng-ctl*.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/lttng-ctl.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/lttng-tools/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/liblttng-ctl*.so.* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lttng $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lttng* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,lttng-tools)) diff --git a/trunk/package/devel/patch/Makefile b/trunk/package/devel/patch/Makefile new file mode 100644 index 00000000..d705a30a --- /dev/null +++ b/trunk/package/devel/patch/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=patch +PKG_VERSION:=2.7.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/patch +PKG_MD5SUM:=e3da7940431633fb65a01b91d3b7a27a +PKG_LICENSE:=GPL-3.0+ +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/patch + SECTION:=devel + CATEGORY:=Development + TITLE:=patch + URL:=http://www.gnu.org/ + MAINTAINER:=Russell Senior +endef + +define Package/patch/description + The Patch package contains a program for modifying or creating files + by applying a "patch" file typically created by the diff program. +endef + +CONFIGURE_ARGS+= --disable-xattr + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Package/patch/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/patch $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,patch)) diff --git a/trunk/package/feeds/packages/acl/Makefile b/trunk/package/feeds/packages/acl/Makefile new file mode 100644 index 00000000..8f3ea7dc --- /dev/null +++ b/trunk/package/feeds/packages/acl/Makefile @@ -0,0 +1,88 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=acl +PKG_REV:=62ce6354ef5a8eb5644908748f79c8cd18474d4c +PKG_VERSION:=20140812 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://git.sv.gnu.org/acl.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_MAINTAINER:=Maxim Storchak + +PKG_LICENSE:=LGPL-2.1 GPL-2.0 +PKG_LICENSE_FILES:=doc/COPYING doc/COPYING.LGPL + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/acl/Default + TITLE:=Access control list (ACL) manipulation + URL:=http://savannah.nongnu.org/projects/acl + SUBMENU:=Filesystem +endef + +define Package/acl/Default/description + Access control list support +endef + +define Package/acl +$(call Package/acl/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+=utils + DEPENDS:=+libacl +endef + +define Package/libacl +$(call Package/acl/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+=library + DEPENDS:=+libattr +endef + +define Package/libacl/description +$(call Package/acl/Default/description) + This package provides libacl +endef + +define Package/acl/description +$(call Package/acl/Default/description) + This package provides ACL manipulation utilities + - chacl + - getfacl + - setfacl +endef + +CONFIGURE_ARGS += --enable-static --enable-shared + +define Package/acl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +define Package/libacl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include + mkdir -p $(1)/usr/lib/pkgconfig + $(CP) -r $(PKG_INSTALL_DIR)/usr/{include,lib} $(1)/usr/ +endef + +$(eval $(call BuildPackage,acl)) +$(eval $(call BuildPackage,libacl)) diff --git a/trunk/package/feeds/packages/acl/patches/100-no-gettext_configure.patch b/trunk/package/feeds/packages/acl/patches/100-no-gettext_configure.patch new file mode 100644 index 00000000..e7b419e7 --- /dev/null +++ b/trunk/package/feeds/packages/acl/patches/100-no-gettext_configure.patch @@ -0,0 +1,21 @@ +diff --git a/configure.ac b/configure.ac +index 2182e81..4836b3d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -31,9 +31,6 @@ AC_FUNC_GCC_VISIBILITY + AM_PROG_AR + LT_INIT + +-AM_GNU_GETTEXT_VERSION([0.18.2]) +-AM_GNU_GETTEXT([external]) +- + AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], [Enable extra debugging])]) + AS_IF([test "x$enable_debug" = "xyes"], +@@ -61,6 +58,5 @@ AC_CONFIG_COMMANDS([include/sys], + AC_CONFIG_FILES([ + libacl.pc + Makefile +- po/Makefile.in + ]) + AC_OUTPUT diff --git a/trunk/package/feeds/packages/acl/patches/101-no-gettext_autogen.patch b/trunk/package/feeds/packages/acl/patches/101-no-gettext_autogen.patch new file mode 100644 index 00000000..1fad67a1 --- /dev/null +++ b/trunk/package/feeds/packages/acl/patches/101-no-gettext_autogen.patch @@ -0,0 +1,9 @@ +diff --git a/autogen.sh b/autogen.sh +index a98a3c5..982aff1 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -1,4 +1,2 @@ + #!/bin/sh -ex +-po/update-potfiles +-autopoint --force + exec autoreconf -f -i diff --git a/trunk/package/feeds/packages/acl/patches/102-no-gettext_Makefile.patch b/trunk/package/feeds/packages/acl/patches/102-no-gettext_Makefile.patch new file mode 100644 index 00000000..d7e7377a --- /dev/null +++ b/trunk/package/feeds/packages/acl/patches/102-no-gettext_Makefile.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.am b/Makefile.am +index 47d2a4e..d02ee91 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,8 +3,6 @@ ACLOCAL_AMFLAGS = -I m4 + EXTRA_DIST = \ + exports + +-SUBDIRS = po +- + AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ diff --git a/trunk/package/feeds/packages/aiccu/Makefile b/trunk/package/feeds/packages/aiccu/Makefile new file mode 100644 index 00000000..50839f35 --- /dev/null +++ b/trunk/package/feeds/packages/aiccu/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=aiccu +PKG_VERSION:=20070115 +PKG_RELEASE:=12 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.sixxs.net/archive/sixxs/aiccu/unix +PKG_MD5SUM:=c9bcc83644ed788e22a7c3f3d4021350 +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=doc/LICENSE + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/aiccu + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +ip +kmod-sit +kmod-tun + TITLE:=SixXS Automatic IPv6 Connectivity Client Utility + URL:=http://www.sixxs.net/tools/aiccu/ + MAINTAINER:=Ondrej Caletka +endef + +define Build/Configure + $(SED) "s,strip,/bin/true," $(PKG_BUILD_DIR)/unix-console/Makefile +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" OS_NAME="Linux" OS_VERSION="$(LINUX_VERSION)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS) -pthread" \ + DEBUG=0 +endef + +define Package/aiccu/conffiles +/etc/config/aiccu +endef + +define Package/aiccu/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/lib/netifd/proto $(1)/etc/hotplug.d/ntp + $(INSTALL_BIN) $(PKG_BUILD_DIR)/unix-console/$(PKG_NAME) $(1)/usr/sbin/ + $(INSTALL_BIN) ./files/aiccu.sh $(1)/lib/netifd/proto/aiccu.sh + $(INSTALL_DATA) ./files/aiccu.hotplug $(1)/etc/hotplug.d/ntp/10-aiccu +endef + +$(eval $(call BuildPackage,aiccu)) diff --git a/trunk/package/feeds/packages/aiccu/files/aiccu.hotplug b/trunk/package/feeds/packages/aiccu/files/aiccu.hotplug new file mode 100644 index 00000000..b5213717 --- /dev/null +++ b/trunk/package/feeds/packages/aiccu/files/aiccu.hotplug @@ -0,0 +1,3 @@ +#!/bin/sh +NTPSTRATUMFILE="/var/run/aiccu_ntp_stratum" +echo $stratum > "$NTPSTRATUMFILE" diff --git a/trunk/package/feeds/packages/aiccu/files/aiccu.sh b/trunk/package/feeds/packages/aiccu/files/aiccu.sh new file mode 100755 index 00000000..584574b7 --- /dev/null +++ b/trunk/package/feeds/packages/aiccu/files/aiccu.sh @@ -0,0 +1,121 @@ +#!/bin/sh +# aiccu.sh - AICCU proto +# Copyright (c) 2014 OpenWrt.org + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . /lib/functions/network.sh + . ../netifd-proto.sh + init_proto "$@" +} + +proto_aiccu_setup() { + local cfg="$1" + local iface="$2" + local link="aiccu-$cfg" + + local username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr ntpsynctimeout + json_get_vars username password protocol server ip6prefix tunnelid requiretls defaultroute nat heartbeat verbose sourcerouting ip6addr ntpsynctimeout + + [ -z "$username" -o -z "$password" ] && { + proto_notify_error "$cfg" "MISSING_USERNAME_OR_PASSWORD" + proto_block_restart "$cfg" + return + } + + ( proto_add_host_dependency "$cfg" 0.0.0.0 ) + + CFGFILE="/var/etc/${link}.conf" + PIDFILE="/var/run/${link}.pid" + NTPSTRATUMFILE="/var/run/aiccu_ntp_stratum" + mkdir -p /var/run /var/etc + + echo "username $username" > "$CFGFILE" + echo "password $password" >> "$CFGFILE" + echo "ipv6_interface $link" >> "$CFGFILE" + [ -n "$server" ] && echo "server $server" >> "$CFGFILE" + [ -n "$protocol" ] && echo "protocol $protocol" >> "$CFGFILE" + [ -n "$tunnelid" ] && echo "tunnel_id $tunnelid" >> "$CFGFILE" + [ "$requiretls" == 1 ] && echo "requiretls true" >> "$CFGFILE" + [ "$nat" == 1 ] && echo "behindnat true" >> "$CFGFILE" + [ "$heartbeat" == 1 ] && echo "makebeats true" >> "$CFGFILE" + [ "$verbose" == 1 ] && echo "verbose true" >> "$CFGFILE" + echo "defaultroute false" >> "$CFGFILE" + echo "daemonize true" >> "$CFGFILE" + echo "pidfile $PIDFILE" >> "$CFGFILE" + + # By default, wait at most 90 seconds for NTP sync + [ -z "$ntpsynctimeout" ] && ntpsynctimeout=90 + for i in $(seq 1 $ntpsynctimeout); do + [ -f "$NTPSTRATUMFILE" ] && \ + [ "$(cat $NTPSTRATUMFILE)" -lt 16 ] && \ + echo "NTP synced, stratum $(cat $NTPSTRATUMFILE)" && break + [ "$(( $i % 10 ))" -eq 0 ] && echo "Waiting ${i} secs for NTP sync..." + sleep 1 + done + + aiccu start "$CFGFILE" + + [ "$?" -ne 0 ] && { + proto_notify_error "$cfg" "AICCU_FAILED_SEE_LOG" + proto_block_restart "$cfg" + return + } + + proto_init_update "$link" 1 + + local source="" + [ "$sourcerouting" != "0" ] && source="::/128" + [ "$defaultroute" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$source" + + [ -n "$ip6addr" ] && { + local local6="${ip6addr%%/*}" + local mask6="${ip6addr##*/}" + [[ "$local6" = "$mask6" ]] && mask6= + proto_add_ipv6_address "$local6" "$mask6" + [ "$defaultroute" != "0" -a "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$local6/$mask6" + } + + [ -n "$ip6prefix" ] && { + proto_add_ipv6_prefix "$ip6prefix" + [ "$defaultroute" != "0" -a "$sourcerouting" != "0" ] && proto_add_ipv6_route "::" 0 "" "" "" "$ip6prefix" + } + + proto_send_update "$cfg" + +} + +proto_aiccu_teardown() { + local cfg="$1" + local link="aiccu-$cfg" + CFGFILE="/var/etc/${link}.conf" + PIDFILE="/var/run/${link}.pid" + [ -f "$CFGFILE" -a -f "$PIDFILE" ] && { + local pid="$(cat "$PIDFILE")" + [ -d /proc/$pid -a $(cat /proc/$pid/comm) = "aiccu" ] && \ + aiccu stop "$CFGFILE" + } +} + +proto_aiccu_init_config() { + no_device=1 + available=1 + proto_config_add_string "username" + proto_config_add_string "password" + proto_config_add_string "protocol" + proto_config_add_string "server" + proto_config_add_string "ip6addr:ip6addr" + proto_config_add_string "ip6prefix:ip6addr" + proto_config_add_string "tunnelid" + proto_config_add_boolean "requiretls" + proto_config_add_boolean "defaultroute" + proto_config_add_boolean "sourcerouting" + proto_config_add_boolean "nat" + proto_config_add_boolean "heartbeat" + proto_config_add_boolean "verbose" + proto_config_add_int "ntpsynctimeout" +} + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol aiccu +} diff --git a/trunk/package/feeds/packages/aiccu/patches/100-cross_compile.patch b/trunk/package/feeds/packages/aiccu/patches/100-cross_compile.patch new file mode 100644 index 00000000..dbdc50aa --- /dev/null +++ b/trunk/package/feeds/packages/aiccu/patches/100-cross_compile.patch @@ -0,0 +1,101 @@ +--- aiccu/unix-console/Makefile.orig 2007-09-02 23:19:39.000000000 +0200 ++++ aiccu/unix-console/Makefile 2007-09-02 23:20:11.000000000 +0200 +@@ -25,7 +25,8 @@ + # CWARNS += -Wpacked + + #CFLAGS += $(CWARNS) -D_GNU_SOURCE -D_DEBUG -g3 -O0 +-CFLAGS += $(CWARNS) -D_GNU_SOURCE ++CFLAGS += $(CWARNS) $(EXTRA_CFLAGS) -D_GNU_SOURCE ++LDFLAGS += $(EXTRA_LDFLAGS) + CC = @gcc + RM = rm + +@@ -40,25 +41,25 @@ + # GnuTLS Support ? + # Used by TIC to secure that communication + # Currently defaultly builds only on Linux, but other platforms might easily also support it +-ifeq ($(shell uname | grep -c "Linux"),1) ++ifneq ($(HAVE_GNUTLS),) + CFLAGS += -D AICCU_GNUTLS + LDFLAGS += -lgnutls + endif + + # Linux +-ifeq ($(shell uname | grep -c "Linux"),1) ++ifeq ($(OS_NAME),Linux) + CFLAGS += -D_LINUX -D HAS_IFHEAD -D AICCU_TYPE="\"linux\"" + SRCS += ../common/aiccu_linux.c + OBJS += ../common/aiccu_linux.o +-LDFLAGS += -lpthread -lresolv ++LDFLAGS += -pthread -lresolv + endif + + # FreeBSD +-ifeq ($(shell uname | grep -c "FreeBSD"),1) ++ifeq ($(OS_NAME),FreeBSD) + CFLAGS += -D_FREEBSD + + # FreeBSD 4.x +-ifeq ($(shell uname -r | cut -c 1),4) ++ifeq ($(shell echo $(OS_VERSION) | cut -c 1),4) + CFLAGS += -D AICCU_TYPE="\"freebsd4\"" + SRCS += ../common/aiccu_freebsd4.c + OBJS += ../common/aiccu_freebsd4.o +@@ -71,7 +72,7 @@ + endif + + # DragonFlyBSD +-ifeq ($(shell uname | grep -c "DragonFly"),1) ++ifeq ($(OS_NAME),DragonFly) + CFLAGS += -D_DFBSD -D NEED_IFHEAD -D AICCU_TYPE="\"dragonfly\"" + SRCS += ../common/aiccu_freebsd4.c + OBJS += ../common/aiccu_freebsd4.o +@@ -79,7 +80,7 @@ + endif + + # NetBSD +-ifeq ($(shell uname | grep -c "NetBSD"),1) ++ifeq ($(OS_NAME),NetBSD) + CFLAGS += -D_NETBSD -D AICCU_TYPE="\"kame\"" + + # Check if net/if_tun.h has TUNSIFHEAD and enable support for it +@@ -97,10 +98,10 @@ + endif + + # OpenBSD +-ifeq ($(shell uname | grep -c "OpenBSD"),1) ++ifeq ($(OS_NAME),OpenBSD) + CFLAGS += -D_OPENBSD -D HAS_IFHEAD + # 2.7-2.9 +-ifeq ($(shell uname -r | cut -c 1),2) ++ifeq ($(shell echo $(OS_VERSION) | cut -c 1),2) + CFLAGS += -D AICCU_TYPE="\"openbsd2\"" + SRCS += ../common/aiccu_openbsd2.c + OBJS += ../common/aiccu_openbsd2.o +@@ -114,7 +115,7 @@ + endif + + # Darwin +-ifeq ($(shell uname | grep -c "Darwin"),1) ++ifeq ($(OS_NAME),Darwin) + CFLAGS += -D_DARWIN -D NEED_IFHEAD -D AICCU_TYPE="\"darwin\"" + SRCS += ../common/aiccu_darwin.c + OBJS += ../common/aiccu_darwin.o +@@ -122,7 +123,7 @@ + endif + + # SunOS / Solaris +-ifeq ($(shell uname | grep -c "SunOS"),1) ++ifeq ($(OS_NAME),SunOS) + CFLAGS += -D_SUNOS -D AICCU_TYPE="\"sunos\"" + SRCS += ../common/aiccu_sunos.c + OBJS += ../common/aiccu_sunos.o +@@ -130,7 +131,7 @@ + endif + + # AIX +-ifeq ($(shell uname | grep -c "AIX"),1) ++ifeq ($(OS_NAME),AIX) + CC = @/usr/vac/bin/xlc_r + CFLAGS = -qthreaded -q64 -qlanglvl=stdc99 -bmaxdata:0xD0000000 -D_64BIT -g -qdbxextra -qfullpath -qheapdebug -qformat=all -qcheck=all + CFLAGS += -D AICCU_CONSOLE diff --git a/trunk/package/feeds/packages/aiccu/patches/200-add_dn_skipname.patch b/trunk/package/feeds/packages/aiccu/patches/200-add_dn_skipname.patch new file mode 100644 index 00000000..ca6afcea --- /dev/null +++ b/trunk/package/feeds/packages/aiccu/patches/200-add_dn_skipname.patch @@ -0,0 +1,70 @@ +diff -Nru aiccu.old/common/dn_skipname.c aiccu/common/dn_skipname.c +--- aiccu.old/common/dn_skipname.c 1970-01-01 02:00:00.000000000 +0200 ++++ aiccu/common/dn_skipname.c 2006-11-04 00:50:23.000000000 +0200 +@@ -0,0 +1,51 @@ ++#include ++#include ++ ++/* Ripped from glibc 2.4 sources. */ ++ ++/* ++ * ns_name_skip(ptrptr, eom) ++ * Advance *ptrptr to skip over the compressed name it points at. ++ * return: ++ * 0 on success, -1 (with errno set) on failure. ++ */ ++int ns_name_skip(const u_char **ptrptr, const u_char *eom) ++{ ++ const u_char *cp; ++ u_int n; ++ ++ cp = *ptrptr; ++ while (cp < eom && (n = *cp++) != 0) ++ { ++ /* Check for indirection. */ ++ switch (n & NS_CMPRSFLGS) { ++ case 0: /* normal case, n == len */ ++ cp += n; ++ continue; ++ case NS_CMPRSFLGS: /* indirection */ ++ cp++; ++ break; ++ default: /* illegal type */ ++ errno = EMSGSIZE; ++ return (-1); ++ } ++ break; ++ } ++ if (cp > eom) ++ { ++ errno = EMSGSIZE; ++ return (-1); ++ } ++ *ptrptr = cp; ++ return (0); ++} ++ ++int dn_skipname(const u_char *ptr, const u_char *eom) ++{ ++ const u_char *saveptr = ptr; ++ ++ if(ns_name_skip(&ptr, eom) == -1) ++ return (-1); ++ return (ptr - saveptr); ++} ++ +diff -Nru aiccu.old/unix-console/Makefile aiccu/unix-console/Makefile +--- aiccu.old/unix-console/Makefile 2006-11-04 00:51:20.000000000 +0200 ++++ aiccu/unix-console/Makefile 2006-11-04 00:48:51.000000000 +0200 +@@ -10,9 +10,9 @@ + # $Date: 2006-07-25 09:20:48 $ + # **********************************************************/ + +-SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ++SRCS = main.c ../common/tun.c ../common/aiccu.c ../common/hash_md5.c ../common/hash_sha1.c ../common/common.c ../common/heartbeat.c ../common/tic.c ../common/ayiya.c ../common/aiccu_test.c ../common/resolver.c ../common/dn_skipname.c + INCS = ../common/tun.h ../common/aiccu.h ../common/hash_md5.h ../common/hash_sha1.h ../common/common.h ../common/heartbeat.h ../common/tic.h ../common/ayiya.h ../common/resolver.h +-OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ++OBJS = main.o ../common/tun.o ../common/aiccu.o ../common/hash_md5.o ../common/hash_sha1.o ../common/common.o ../common/heartbeat.o ../common/tic.o ../common/ayiya.o ../common/aiccu_test.o ../common/resolver.o ../common/dn_skipname.o + + # New features not fully implemented and thus disabled for now + #CFLAGS += -D NEWSTUFF_TSP -D NEWSTUFF_TEEPEE diff --git a/trunk/package/feeds/packages/aiccu/patches/300-resolver-uclibc.patch b/trunk/package/feeds/packages/aiccu/patches/300-resolver-uclibc.patch new file mode 100644 index 00000000..fbd6a509 --- /dev/null +++ b/trunk/package/feeds/packages/aiccu/patches/300-resolver-uclibc.patch @@ -0,0 +1,29 @@ +--- aiccu/common/resolver.c.orig 2007-09-02 23:10:58.000000000 +0200 ++++ aiccu/common/resolver.c 2007-09-02 23:11:01.000000000 +0200 +@@ -26,7 +26,7 @@ + + int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record)) + { +-#ifdef _LINUX ++#if defined(_LINUX) && !defined(__UCLIBC__) + struct __res_state res; + #endif + unsigned char answer[8192]; +@@ -38,7 +38,7 @@ + uint16_t type = 0, class = 0; + uint32_t ttl = 0; + +-#ifdef _LINUX ++#if defined(_LINUX) && !defined(__UCLIBC__) + memset(&res, 0, sizeof(res)); + res.options = RES_DEBUG; + res_ninit(&res); +@@ -47,7 +47,7 @@ + #endif + + memset(answer, 0, sizeof(answer)); +-#ifdef _LINUX ++#if defined(_LINUX) && !defined(__UCLIBC__) + ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer)); + #else + ret = res_query(label, C_IN, rrtype, answer, sizeof(answer)); diff --git a/trunk/package/feeds/packages/aircrack-ng/Makefile b/trunk/package/feeds/packages/aircrack-ng/Makefile new file mode 100644 index 00000000..960ef856 --- /dev/null +++ b/trunk/package/feeds/packages/aircrack-ng/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=aircrack-ng +PKG_VERSION:=1.2-rc1 +PKG_RELEASE:=1 +PKG_LICENSE:=GPLv2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.aircrack-ng.org/ \ + http://archive.aircrack-ng.org/aircrack-ng/$(PKG_VERSION)/ +PKG_MD5SUM:=c2f8648c92f7e46051c86c618d4fb0d5 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/aircrack-ng + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpcap +libpthread +libopenssl +libnl +wireless-tools +ethtool + TITLE:=WLAN tools for breaking 802.11 WEP/WPA keys + URL:=http://www.aircrack-ng.org/ + MAINTAINER:=Rick Farina + SUBMENU:=wireless +endef + +define Package/aircrack-ng/description + WLAN tools for breaking 802.11 WEP/WPA keys +endef + +MAKE_FLAGS += prefix=/usr \ + libnl=true \ + sqlite=false \ + unstable=false \ + OSNAME=Linux + +define Package/aircrack-ng/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,aircrack-ng)) diff --git a/trunk/package/feeds/packages/alpine/Makefile b/trunk/package/feeds/packages/alpine/Makefile new file mode 100644 index 00000000..322e954b --- /dev/null +++ b/trunk/package/feeds/packages/alpine/Makefile @@ -0,0 +1,123 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=alpine +PKG_VERSION:=2.20 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=http://patches.freeiz.com/alpine/release/src/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_MD5SUM:=043b67666af73b26f9627ad97e2aaf92 + +PKG_MAINTAINER:=Antti Seppälä +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE + +PKG_INSTALL:=1 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/alpine/Default + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libopenssl +libncurses +libpthread +libpam $(ICONV_DEPENDS) $(INTL_DEPENDS) + TITLE:=Alternatively Licensed Program for Internet News and Email + URL:=http://www.washington.edu/alpine +endef + +define Package/alpine/Default/description + Alpine (Alternatively Licenced Program for Internet News and Email) is a + free software email client developed at the University of Washington. + It is suitable for both the inexperienced email user as well as for + the most demanding power user. +endef + +define Package/alpine +$(call Package/alpine/Default) + TITLE+= (with OpenSSL support) + DEPENDS+= +libcrypto +libopenssl + VARIANT:=ssl +endef + +define Package/alpine/description +$(call Package/alpine/Default/description) + This package is built with OpenSSL support. +endef + +define Package/alpine-nossl +$(call Package/alpine/Default) + TITLE+= (without OpenSSL support) + VARIANT:=nossl +endef + +define Package/alpine-nossl/description +$(call Package/alpine/Default/description) + This package is built without OpenSSL support. +endef + +CONFIGURE_ARGS += \ + --with-libiconv-prefix=$(ICONV_PREFIX) \ + --with-libintl-prefix=$(INTL_PREFIX) \ + --without-tcl \ + --without-ldap \ + --without-krb5 \ + --with-system-pinerc=/etc/pine.conf \ + --with-system-fixed-pinerc=/etc/pine.conf.fixed \ + --with-supplied-regex \ + --with-default-sshpath=/usr/bin/ssh \ + --disable-debug \ + --disable-mouse \ + --with-c-client-target=slx \ + +CONFIGURE_VARS += \ + top_builddir=$(PKG_BUILD_DIR) + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl-include-dir=$(STAGING_DIR)/usr/include/openssl/. \ + --with-ssl-lib-dir=$(STAGING_DIR)/usr/lib +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --without-ssl +endif + +ifeq ($(CONFIG_BUILD_NLS),y) + DISABLE_NLS:= +endif + +ifeq ($(CONFIG_IPV6),y) + DISABLE_IPV6:= +else + DISABLE_IPV6:=--without-ipv6 +endif + +define Build/Compile + ( cd $(PKG_BUILD_DIR)/pith ; \ + $(HOSTCC) help_h_gen.c -c -o help_h_gen.o ; \ + $(HOSTCC) help_h_gen.o -o help_h_gen ; \ + $(HOSTCC) help_c_gen.c -c -o help_c_gen.o ; \ + $(HOSTCC) help_c_gen.o -o help_c_gen ; \ + ) + $(call Build/Compile/Default) +endef + +define Package/alpine/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME) +endef + +Package/alpine-nossl/install = $(Package/alpine/install) + +$(eval $(call BuildPackage,alpine)) +$(eval $(call BuildPackage,alpine-nossl)) diff --git a/trunk/package/feeds/packages/alpine/patches/100-no-openssl-check-cross-compile.patch b/trunk/package/feeds/packages/alpine/patches/100-no-openssl-check-cross-compile.patch new file mode 100644 index 00000000..40430986 --- /dev/null +++ b/trunk/package/feeds/packages/alpine/patches/100-no-openssl-check-cross-compile.patch @@ -0,0 +1,29 @@ +diff -Nru alpine-2.20-orig/configure alpine-2.20/configure +--- alpine-2.20-orig/configure 2015-01-18 09:00:42.100645053 +0200 ++++ alpine-2.20/configure 2015-01-25 12:01:11.831015443 +0200 +@@ -17643,10 +17643,8 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Openssl library version >= 1.0.1c" >&5 + $as_echo_n "checking Openssl library version >= 1.0.1c... " >&6; } + if test "$cross_compiling" = yes; then : +- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +-as_fn_error $? "cannot run test program while cross compiling +-See \`config.log' for more details" "$LINENO" 5; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross compiling: not checking" >&5 ++$as_echo "$as_me: WARNING: cross compiling: not checking" >&2;} + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +diff -Nru alpine-2.20-orig/configure.ac alpine-2.20/configure.ac +--- alpine-2.20-orig/configure.ac 2015-01-18 08:38:08.893495949 +0200 ++++ alpine-2.20/configure.ac 2015-01-25 12:01:02.773015236 +0200 +@@ -1370,7 +1370,8 @@ + } + ]])], + [ AC_MSG_RESULT(yes) ], +- [ alpine_SSLTYPE="none" ]) ++ [ alpine_SSLTYPE="none" ], ++ [ AC_MSG_WARN([cross compiling: not checking])]) + + if test "x$alpine_SSLTYPE" = "xnone" ; then + AC_MSG_ERROR(Install openssl version >= 1.0.1c) diff --git a/trunk/package/feeds/packages/alsa-lib/Makefile b/trunk/package/feeds/packages/alsa-lib/Makefile new file mode 100644 index 00000000..a4ccc233 --- /dev/null +++ b/trunk/package/feeds/packages/alsa-lib/Makefile @@ -0,0 +1,94 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=alsa-lib +PKG_VERSION:=1.0.28 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/lib/ \ + http://alsa.cybermirror.org/lib/ +PKG_MD5SUM:=c9e21b88a2b3e6e12ea7ba0f3b271fc3 +PKG_MAINTAINER:=Ted Hess + +PKG_LICENSE:=LGPLv2.1 GPLv2 +PKG_LICENSE_FILES:=COPYING aserver/COPYING + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 +PKG_USE_MIPS16:=0 +PKG_CHECK_FORMAT_SECURITY:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/alsa-lib + SECTION:=libs + CATEGORY:=Libraries + TITLE:=ALSA (Advanced Linux Sound Architecture) library + URL:=http://www.alsa-project.org/ + MAINTAINER:=Peter Wagner + DEPENDS:=@AUDIO_SUPPORT +kmod-sound-core +libpthread +librt +endef + +define Package/alsa-lib/description + This is the library package for alsa, needed by some userspace programs. + You must have enabled the ALSA support in the kernel. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-python \ + --disable-debug \ + --without-debug \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + --with-versioned=no \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/alsa \ + $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libasound.{la,so*} \ + $(1)/usr/lib/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/alsa.pc \ + $(1)/usr/lib/pkgconfig/ + + $(INSTALL_DIR) $(1)/usr/share/aclocal + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/aclocal/alsa.m4 \ + $(1)/usr/share/aclocal/ +endef + +define Package/alsa-lib/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libasound.so.* \ + $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/share/alsa/{cards,pcm} + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/alsa/alsa.conf \ + $(1)/usr/share/alsa/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/alsa/pcm/* \ + $(1)/usr/share/alsa/pcm/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/alsa/cards/* \ + $(1)/usr/share/alsa/cards/ +endef + +$(eval $(call BuildPackage,alsa-lib)) diff --git a/trunk/package/feeds/packages/alsa-lib/patches/001-link_fix.patch b/trunk/package/feeds/packages/alsa-lib/patches/001-link_fix.patch new file mode 100644 index 00000000..001a8bc6 --- /dev/null +++ b/trunk/package/feeds/packages/alsa-lib/patches/001-link_fix.patch @@ -0,0 +1,22 @@ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -418,7 +418,7 @@ clean-libLTLIBRARIES: + rm -f $${locs}; \ + } + libasound.la: $(libasound_la_OBJECTS) $(libasound_la_DEPENDENCIES) $(EXTRA_libasound_la_DEPENDENCIES) +- $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS) ++ $(AM_V_CCLD)$(libasound_la_LINK) -rpath $(DESTDIR)$(libdir) $(libasound_la_OBJECTS) $(libasound_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) +--- a/src/pcm/scopes/Makefile.in ++++ b/src/pcm/scopes/Makefile.in +@@ -348,7 +348,7 @@ clean-pkglibLTLIBRARIES: + rm -f $${locs}; \ + } + scope-level.la: $(scope_level_la_OBJECTS) $(scope_level_la_DEPENDENCIES) $(EXTRA_scope_level_la_DEPENDENCIES) +- $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS) ++ $(AM_V_CCLD)$(scope_level_la_LINK) -rpath $(DESTDIR)$(pkglibdir) $(scope_level_la_OBJECTS) $(scope_level_la_LIBADD) $(LIBS) + + mostlyclean-compile: + -rm -f *.$(OBJEXT) diff --git a/trunk/package/feeds/packages/alsa-lib/patches/002-remove_cross_compile_guess.patch b/trunk/package/feeds/packages/alsa-lib/patches/002-remove_cross_compile_guess.patch new file mode 100644 index 00000000..d8f9f122 --- /dev/null +++ b/trunk/package/feeds/packages/alsa-lib/patches/002-remove_cross_compile_guess.patch @@ -0,0 +1,23 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -27,20 +27,6 @@ AC_PREFIX_DEFAULT(/usr) + + dnl Checks for programs. + +-dnl try to gues cross-compiler if not set +-if test "x$host" != "x$build" -a -z "`echo $CC | grep -e '-gcc'`"; +-then +- AC_MSG_CHECKING(for cross-compiler) +- +- which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc +- which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 \ +- && CC=${host_cpu}-${host_os}-gcc +- which ${host_cpu}-${host_vendor}-${host_os}-gcc >/dev/null 2>&1 \ +- && CC=${host_cpu}-${host_vendor}-${host_os}-gcc +- +- AC_MSG_RESULT($CC) +-fi +- + CFLAGS="$CFLAGS -D_GNU_SOURCE" + + diff --git a/trunk/package/feeds/packages/alsa-utils/Makefile b/trunk/package/feeds/packages/alsa-utils/Makefile new file mode 100644 index 00000000..f7c87526 --- /dev/null +++ b/trunk/package/feeds/packages/alsa-utils/Makefile @@ -0,0 +1,93 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=alsa-utils +PKG_VERSION:=1.0.28 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \ + http://alsa.cybermirror.org/utils/ +PKG_MD5SUM:=361552d5b1cacd0a1e7ba09e69990211 +PKG_INSTALL:=1 +PKG_MAINTAINER:=Ted Hess + +include $(INCLUDE_DIR)/package.mk + +define Package/alsa-utils + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+alsa-lib +libncurses +libpthread + TITLE:=ALSA (Advanced Linux Sound Architecture) utilities + URL:=http://www.alsa-project.org/ +endef + +define Package/alsa-utils-seq + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+alsa-lib +libpthread + TITLE:=ALSA sequencer utilities + URL:=http://www.alsa-project.org/ +endef + +define Package/alsa-utils-tests + $(call Package/alsa-utils/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE:=ALSA utilities test data (adds ~1.3M to image) + DEPENDS:=+alsa-lib +libpthread +endef + +define Build/Configure + $(call Build/Configure/Default, \ + --disable-rpath \ + --disable-alsatest \ + --disable-xmlto \ + , \ + ac_cv_prog_ncurses5_config=no \ + ac_cv_prog_ncursesw5_config=no \ + ) +endef + +define Package/alsa-utils/install + $(INSTALL_DIR) $(1)/usr/{s,}bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amixer $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alsamixer $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplay $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecord $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/alsactl $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/usr/share/alsa/init + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/alsa/init/* \ + $(1)/usr/share/alsa/init/ +endef + +define Package/alsa-utils-seq/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aconnect $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amidi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplaymidi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecordmidi $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqdump $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqnet $(1)/usr/bin/ +endef + +define Package/alsa-utils-tests/install + $(INSTALL_DIR) $(1)/usr/{s,}bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speaker-test $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/sounds/alsa + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/share/sounds/alsa/* \ + $(1)/usr/share/sounds/alsa/ +endef + +$(eval $(call BuildPackage,alsa-utils)) +$(eval $(call BuildPackage,alsa-utils-seq)) +$(eval $(call BuildPackage,alsa-utils-tests)) diff --git a/trunk/package/feeds/packages/alsa-utils/patches/100-uClibc-compat.patch b/trunk/package/feeds/packages/alsa-utils/patches/100-uClibc-compat.patch new file mode 100644 index 00000000..987c9b8b --- /dev/null +++ b/trunk/package/feeds/packages/alsa-utils/patches/100-uClibc-compat.patch @@ -0,0 +1,23 @@ +--- a/alsamixer/volume_mapping.c ++++ b/alsamixer/volume_mapping.c +@@ -114,9 +114,9 @@ static double get_normalized_volume(snd_ + if (use_linear_dB_scale(min, max)) + return (value - min) / (double)(max - min); + +- normalized = exp10((value - max) / 6000.0); ++ normalized = pow(10, (value - max) / 6000.0); + if (min != SND_CTL_TLV_DB_GAIN_MUTE) { +- min_norm = exp10((min - max) / 6000.0); ++ min_norm = pow(10, (min - max) / 6000.0); + normalized = (normalized - min_norm) / (1 - min_norm); + } + +@@ -149,7 +149,7 @@ static int set_normalized_volume(snd_mix + } + + if (min != SND_CTL_TLV_DB_GAIN_MUTE) { +- min_norm = exp10((min - max) / 6000.0); ++ min_norm = pow(10, (min - max) / 6000.0); + volume = volume * (1 - min_norm) + min_norm; + } + value = lrint_dir(6000.0 * log10(volume), dir) + max; diff --git a/trunk/package/feeds/packages/announce/Makefile b/trunk/package/feeds/packages/announce/Makefile new file mode 100644 index 00000000..60d9e63f --- /dev/null +++ b/trunk/package/feeds/packages/announce/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=announce +PKG_VERSION:=1.0.1 +PKG_RELEASE:=1 +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=src/LICENSE.txt +PKG_MAINTAINER:=Simon Peter + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/probonopd/announce.git +PKG_SOURCE_VERSION:=1368525c7305ca5bb4134242f332344f5f7e94e3 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +PKG_BUILD_DEPENDS:= +libpthread + +define Package/announce + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=Announce services on the network with Zeroconf/Bonjour + URL:=https://github.com/probonopd/announce + DEPENDS:= +libpthread +endef + +define Package/announce/description + Announce services on the network with Zeroconf/Bonjour. + This announces services such as ssh, sftp, and http running on the local machine + to the network. +endef + +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) $(PKG_BUILD_DIR)/src/* $(PKG_BUILD_DIR)/ +endef + +define Package/announce/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/announce $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/announce.initscript $(1)/etc/init.d/announce +endef + +$(eval $(call BuildPackage,announce)) diff --git a/trunk/package/feeds/packages/apache/Makefile b/trunk/package/feeds/packages/apache/Makefile new file mode 100644 index 00000000..dde5bcae --- /dev/null +++ b/trunk/package/feeds/packages/apache/Makefile @@ -0,0 +1,166 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=apache +PKG_VERSION:=2.2.29 +PKG_RELEASE:=1 +PKG_SOURCE_NAME:=httpd +PKG_MAINTAINER:=Thomas Heil +PKG_LICENSE:=Apache License + +PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://mirrors.ibiblio.org/apache/httpd/ \ + http://apache.imsam.info/httpd/ +PKG_MD5SUM:=579342fdeaa7b8b68d17fee91f8fab6e + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/apache/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=The Apache Web Server + URL:=http://httpd.apache.org/ +endef + +define Package/apache/Default/description + The Apache Web Server is a powerful and flexible HTTP/1.1 compliant + web server. Originally designed as a replacement for the NCSA HTTP + Server, it has grown to be the most popular web server on the Internet. +endef + +define Package/apache +$(call Package/apache/Default) + DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +endef + +define Package/apache/description +$(call Package/apache/Default/description) + . + This package contains the Apache web server and utility programs. + . + Take care that you don't include apache at the moment into your image + please select it only as module because busybox will override + /usr/sbin/httpd. It'll be solved soon. If you need to include this + package in the image anyway, remove httpd from busybox + (Base system --> Configuration --> Networking Utilities --> httpd). + Also you should take care for the initscripts, apache's httpd isn't + compatible with the one from busybox, so if you want to use apache + for running your webif, you'll need to change the parameters in the + scripts and configure the rest in /etc/httpd.conf. +endef + +define Package/apache/conffiles +/etc/apache/httpd.conf +/etc/apache/extra/httpd-autoindex.conf +/etc/apache/extra/httpd-dav.conf +/etc/apache/extra/httpd-default.conf +/etc/apache/extra/httpd-info.conf +/etc/apache/extra/httpd-languages.conf +/etc/apache/extra/httpd-manual.conf +/etc/apache/extra/httpd-mpm.conf +/etc/apache/extra/httpd-multilang-errordoc.conf +/etc/apache/extra/httpd-ssl.conf +/etc/apache/extra/httpd-userdir.conf +/etc/apache/extra/httpd-vhosts.conf +/etc/apache/magic +/etc/apache/mime.types +endef + +define Package/apache-icons +$(call Package/apache/Default) + TITLE:=Icons from Apache + DEPENDS:=apache +endef + +define Package/apache-icons/description +$(call Package/apache/Default/description) + . + This package contains the icons from Apache. +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +define Build/Configure + $(call Build/Configure/Default, \ + --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ + --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \ + --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \ + --enable-http \ + --enable-ssl \ + --enable-proxy \ + --disable-disk-cache \ + --enable-maintainer-mode \ + --enable-mime-magic \ + --without-suexec-bin \ + --sysconfdir=/etc/apache \ + ap_cv_void_ptr_lt_long=no \ + logfiledir="/var/log" \ + runtimedir="/var/run" \ + ) +endef + +define Build/InstallDev + rm -rf $(PKG_INSTALL_DIR)/usr/man/ \ + $(PKG_INSTALL_DIR)/usr/share/manual/ + # if you need docs take a look into the build-dir :) + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/* \ + $(1)/etc + $(INSTALL_DIR) $(1)/usr/include/apache + $(CP) $(PKG_INSTALL_DIR)/usr/include/* \ + $(1)/usr/include/apache + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \ + $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \ + $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/* \ + $(1)/usr/share +endef + +define Package/apache/preinst + rm /usr/sbin/httpd + echo -e "You should take a look in the initscripts, busybox's httpd \n\ + uses some parameters which are maybe unsupported by apache." +endef + +define Package/apache/install + $(INSTALL_DIR) $(1)/usr/sbin + # we don't need apxs on the router, it's just for building apache modules. + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{ab,apachectl,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/ + $(INSTALL_DIR) $(1)/etc/apache + $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/ +endef + +define Package/apache/postrm + rm -rf /usr/sbin/httpd + ln -s /bin/busybox /usr/sbin/httpd + echo -e "You may need to change your initscripts back for the use \n\ + with busybox's httpd." +endef + +define Package/apache-icons/install + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,apache)) +$(eval $(call BuildPackage,apache-icons)) diff --git a/trunk/package/feeds/packages/apache/patches/001-Makefile_in.patch b/trunk/package/feeds/packages/apache/patches/001-Makefile_in.patch new file mode 100644 index 00000000..0bccfd3b --- /dev/null +++ b/trunk/package/feeds/packages/apache/patches/001-Makefile_in.patch @@ -0,0 +1,14 @@ +--- a/server/Makefile.in ++++ b/server/Makefile.in +@@ -26,7 +26,10 @@ gen_test_char: $(gen_test_char_OBJECTS) + $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS) + + test_char.h: gen_test_char +- ./gen_test_char > test_char.h ++ true ++# ./gen_test_char > test_char.h ++# doesn't matter if you run it on the buildhost or on an wl500gd, ++# same output on both, so i just patched in the test_char.h :). + + util.lo: test_char.h + diff --git a/trunk/package/feeds/packages/apache/patches/002-test_char_h.patch b/trunk/package/feeds/packages/apache/patches/002-test_char_h.patch new file mode 100644 index 00000000..e8ea3cd1 --- /dev/null +++ b/trunk/package/feeds/packages/apache/patches/002-test_char_h.patch @@ -0,0 +1,26 @@ +--- /dev/null ++++ b/server/test_char.h +@@ -0,0 +1,23 @@ ++/* this file is automatically generated by gen_test_char, do not edit */ ++#define T_ESCAPE_SHELL_CMD (1) ++#define T_ESCAPE_PATH_SEGMENT (2) ++#define T_OS_ESCAPE_PATH (4) ++#define T_HTTP_TOKEN_STOP (8) ++#define T_ESCAPE_LOGITEM (16) ++#define T_ESCAPE_FORENSIC (32) ++ ++static const unsigned char test_char_table[256] = { ++ 32,62,62,62,62,62,62,62,62,62,63,62,62,62,62,62,62,62,62,62, ++ 62,62,62,62,62,62,62,62,62,62,62,62,14,0,23,6,1,38,1,1, ++ 9,9,1,0,8,0,0,10,0,0,0,0,0,0,0,0,0,0,40,15, ++ 15,8,15,15,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++ 0,0,0,0,0,0,0,0,0,0,0,15,31,15,7,0,7,0,0,0, ++ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, ++ 0,0,0,15,39,15,1,62,54,54,54,54,54,54,54,54,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54, ++ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54 ++}; diff --git a/trunk/package/feeds/packages/apache/patches/003-logdir_fix.patch b/trunk/package/feeds/packages/apache/patches/003-logdir_fix.patch new file mode 100644 index 00000000..635c65ca --- /dev/null +++ b/trunk/package/feeds/packages/apache/patches/003-logdir_fix.patch @@ -0,0 +1,33 @@ +--- a/build/mkconfNW.awk ++++ b/build/mkconfNW.awk +@@ -24,7 +24,7 @@ BEGIN { + A["sysconfdir"] = "conf" + A["iconsdir"] = "icons" + A["manualdir"] = "manual" +- A["runtimedir"] = "logs" ++ A["runtimedir"] = "log" + A["errordir"] = "error" + A["proxycachedir"] = "proxy" + +--- a/config.layout ++++ b/config.layout +@@ -28,8 +28,8 @@ + cgidir: ${datadir}/cgi-bin + includedir: ${prefix}/include + localstatedir: ${prefix} +- runtimedir: ${localstatedir}/logs +- logfiledir: ${localstatedir}/logs ++ runtimedir: ${localstatedir}/log ++ logfiledir: ${localstatedir}/log + proxycachedir: ${localstatedir}/proxy + + +@@ -150,7 +150,7 @@ + includedir: ${prefix}/include + localstatedir: /var${prefix} + runtimedir: ${localstatedir}/run +- logfiledir: ${localstatedir}/logs ++ logfiledir: ${localstatedir}/log + proxycachedir: ${localstatedir}/proxy + + diff --git a/trunk/package/feeds/packages/apache/patches/004-pidfile_fix.patch b/trunk/package/feeds/packages/apache/patches/004-pidfile_fix.patch new file mode 100644 index 00000000..e9f0b6de --- /dev/null +++ b/trunk/package/feeds/packages/apache/patches/004-pidfile_fix.patch @@ -0,0 +1,11 @@ +--- a/include/scoreboard.h ++++ b/include/scoreboard.h +@@ -42,7 +42,7 @@ extern "C" { + + /* Scoreboard file, if there is one */ + #ifndef DEFAULT_SCOREBOARD +-#define DEFAULT_SCOREBOARD "logs/apache_runtime_status" ++#define DEFAULT_SCOREBOARD "log/apache_runtime_status" + #endif + + /* Scoreboard info on a process is, for now, kept very brief --- diff --git a/trunk/package/feeds/packages/apache/patches/005-httpd_conf.patch b/trunk/package/feeds/packages/apache/patches/005-httpd_conf.patch new file mode 100644 index 00000000..60f0dca9 --- /dev/null +++ b/trunk/package/feeds/packages/apache/patches/005-httpd_conf.patch @@ -0,0 +1,60 @@ +--- a/docs/conf/httpd.conf.in ++++ b/docs/conf/httpd.conf.in +@@ -51,7 +51,6 @@ Listen @@Port@@ + # Example: + # LoadModule foo_module modules/mod_foo.so + # +-@@LoadModule@@ + + + +@@ -63,8 +62,8 @@ Listen @@Port@@ + # It is usually good practice to create a dedicated user and group for + # running httpd, as with most system services. + # +-User daemon +-Group daemon ++User nobody ++Group nogroup + + + +@@ -191,7 +190,7 @@ ErrorLog "@rel_logfiledir@/error_log" + # Possible values include: debug, info, notice, warn, error, crit, + # alert, emerg. + # +-LogLevel warn ++LogLevel debug + + + # +@@ -336,7 +335,7 @@ DefaultType text/plain + # contents of the file itself to determine its type. The MIMEMagicFile + # directive tells the module where the hint definitions are located. + # +-#MIMEMagicFile @rel_sysconfdir@/magic ++MIMEMagicFile @rel_sysconfdir@/magic + + # + # Customizable error responses come in three flavors: +@@ -358,7 +357,7 @@ DefaultType text/plain + # broken on your system. + # + #EnableMMAP off +-#EnableSendfile off ++EnableSendfile off + + # Supplemental configuration + # +@@ -404,7 +403,7 @@ DefaultType text/plain + # starting without SSL on platforms with no /dev/random equivalent + # but a statically compiled-in mod_ssl. + # +- +-SSLRandomSeed startup builtin +-SSLRandomSeed connect builtin +- ++# ++#SSLRandomSeed startup builtin ++#SSLRandomSeed connect builtin ++# diff --git a/trunk/package/feeds/packages/apcupsd/Makefile b/trunk/package/feeds/packages/apcupsd/Makefile new file mode 100644 index 00000000..fd8236d8 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/Makefile @@ -0,0 +1,106 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=apcupsd +PKG_VERSION:=3.14.13 +PKG_RELEASE:=4 + +PKG_MAINTAINER:=Othmar Truniger +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/apcupsd +PKG_MD5SUM:=c291d9d3923b4d9c0e600b755ad4f489 + +PKG_BUILD_DEPENDS:=libgd + +include $(INCLUDE_DIR)/package.mk + +define Package/apcupsd + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +libusb-compat + TITLE:=UPS control software + URL:=http://www.apcupsd.org/ +endef + +define Package/apcupsd-cgi + SECTION:=net + CATEGORY:=Network + DEPENDS:=+libpthread +libgd + TITLE:=UPS control software CGI module + URL:=http://www.apcupsd.org/ +endef + +define Build/Configure + $(CP) $(SCRIPT_DIR)/config.* $(PKG_BUILD_DIR)/autoconf/ + $(call Build/Configure/Default, \ + --with-distname=unknown \ + --sysconfdir=/etc/apcupsd \ + --enable-cgi \ + --enable-usb \ + --enable-modbus-usb \ + --without-x \ + ) +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + LD="$(TARGET_CC)" \ + all install +endef + +define Package/apcupsd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcupsd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/smtp $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apctest $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apcaccess $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/apcupsd + $(INSTALL_CONF) ./files/apcupsd.conf $(1)/etc/apcupsd/ + $(INSTALL_CONF) ./files/apcupsd_mail.conf $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/changeme $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/commfailure $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/commok $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/offbattery $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/onbattery $(1)/etc/apcupsd/ + $(INSTALL_BIN) ./files/apccontrol $(1)/etc/apcupsd/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/apcupsd.init $(1)/etc/init.d/apcupsd +endef + +define Package/apcupsd-cgi/install + $(INSTALL_DIR) $(1)/www/cgi-bin/apcupsd + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/apcupsd/*.cgi $(1)/www/cgi-bin/apcupsd + $(INSTALL_DIR) $(1)/etc/apcupsd + $(INSTALL_CONF) ./files/apcupsd.css $(1)/etc/apcupsd/ + $(INSTALL_CONF) ./files/hosts.conf $(1)/etc/apcupsd/ + $(INSTALL_CONF) ./files/multimon.conf $(1)/etc/apcupsd/ +endef + +define Package/apcupsd/conffiles +/etc/apcupsd/apcupsd.conf +/etc/apcupsd/apcupsd_mail.conf +/etc/apcupsd/changeme +/etc/apcupsd/commfailure +/etc/apcupsd/commok +/etc/apcupsd/offbattery +/etc/apcupsd/onbattery +endef + +define Package/apcupsd-cgi/conffiles +/etc/apcupsd/apcupsd.css +/etc/apcupsd/hosts.conf +/etc/apcupsd/multimon.conf +endef + +$(eval $(call BuildPackage,apcupsd)) +$(eval $(call BuildPackage,apcupsd-cgi)) diff --git a/trunk/package/feeds/packages/apcupsd/files/apccontrol b/trunk/package/feeds/packages/apcupsd/files/apccontrol new file mode 100644 index 00000000..25493541 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/apccontrol @@ -0,0 +1,146 @@ +#!/bin/sh +# +# Copyright (C) 1999-2002 Riccardo Facchetti +# +# for apcupsd release 3.14.1 (04 May 2007) - unknown +# +# platforms/apccontrol. Generated from apccontrol.in by configure. +# +# Note, this is a generic file that can be used by most +# systems. If a particular system needs to have something +# special, start with this file, and put a copy in the +# platform subdirectory. +# + +# +# These variables are needed for set up the autoconf other variables. +# +prefix=/usr +exec_prefix=/usr + +APCPID=/var/run/apcupsd.pid +APCUPSD=/usr/sbin/apcupsd +SHUTDOWN=/sbin/shutdown +SCRIPTSHELL=/bin/sh +SCRIPTDIR=/etc/apcupsd +WALL=true + +# +# Concatenate all output from this script to the events file +# Note, the following kills the script in a power fail situation +# where the disks are mounted read-only. +# exec >>/var/log/apcupsd.events 2>&1 + +# +# This piece is to substitute the default behaviour with your own script, +# perl, or C program. +# You can customize every single command creating an executable file (may be a +# script or a compiled program) and calling it the same as the $1 parameter +# passed by apcupsd to this script. +# +# After executing your script, apccontrol continues with the default action. +# If you do not want apccontrol to continue, exit your script with exit +# code 99. E.g. "exit 99". +# +# WARNING: the apccontrol file will be overwritten every time you update your +# apcupsd, doing `make install'. Your own customized scripts will _not_ be +# overwritten. If you wish to make changes to this file (discouraged), you +# should change apccontrol.sh.in and then rerun the configure process. +# +if [ -f ${SCRIPTDIR}/${1} -a -x ${SCRIPTDIR}/${1} ] +then + ${SCRIPTDIR}/${1} ${2} ${3} ${4} + # exit code 99 means he does not want us to do default action + if [ $? = 99 ] ; then + exit 0 + fi +fi + +case "$1" in + killpower) + echo "Apccontrol doing: ${APCUPSD} --killpower on UPS ${2}" + sleep 10 + ${APCUPSD} --killpower + echo "Apccontrol has done: ${APCUPSD} --killpower on UPS ${2}" | ${WALL} + ;; + commfailure) + echo "Warning communications lost with UPS ${2}" | ${WALL} + ;; + commok) + echo "Communications restored with UPS ${2}" | ${WALL} + ;; +# +# powerout, onbattery, offbattery, mainsback events occur +# in that order. +# + powerout) + echo "Warning power loss detected on UPS ${2}" | ${WALL} + ;; + onbattery) + echo "Power failure on UPS ${2}. Running on batteries." | ${WALL} + ;; + offbattery) + ;; + mainsback) + echo "Power has returned on UPS ${2}..." | ${WALL} + if [ -f /etc/powerfail ] ; then + printf "Continuing with shutdown." | ${WALL} + fi + ;; + failing) + echo "Battery power exhaused on UPS ${2}. Doing shutdown." | ${WALL} + ;; + timeout) + echo "Battery time limit exceeded on UPS ${2}. Doing shutdown." | ${WALL} + ;; + loadlimit) + echo "Remaining battery charge below limit on UPS ${2}. Doing shutdown." | ${WALL} + ;; + runlimit) + echo "Remaining battery runtime below limit on UPS ${2}. Doing shutdown." | ${WALL} + ;; + doreboot) + echo "UPS ${2} initiating Reboot Sequence" | ${WALL} + ${SHUTDOWN} -r now "apcupsd UPS ${2} initiated reboot" + ;; + doshutdown) + echo "UPS ${2} initiated Shutdown Sequence" | ${WALL} + ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown" + ;; + annoyme) + echo "Power problems with UPS ${2}. Please logoff." | ${WALL} + ;; + emergency) + echo "Emergency Shutdown. Possible battery failure on UPS ${2}." | ${WALL} + ;; + changeme) + echo "Emergency! Batteries have failed on UPS ${2}. Change them NOW" | ${WALL} + ;; + remotedown) + echo "Remote Shutdown. Beginning Shutdown Sequence." | ${WALL} + ;; + restartme) + echo -n "Restarting APCUPSD Power Management: " + THEPID=`cat ${APCPID}` + kill ${THEPID} + rm -f ${APCPID} + rm -f /etc/powerfail + rm -f /etc/nologin + sleep 5 + `${APCUPSD}` + echo "apcupsd" + ;; + startselftest) + ;; + endselftest) + ;; + battdetach) + ;; + battattach) + ;; + *) echo "Usage: ${0##*/} command" + echo " warning: this script is intended to be launched by" + echo " apcupsd and should never be launched by users." + exit 1 + ;; +esac diff --git a/trunk/package/feeds/packages/apcupsd/files/apcupsd.conf b/trunk/package/feeds/packages/apcupsd/files/apcupsd.conf new file mode 100644 index 00000000..b9acd61d --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/apcupsd.conf @@ -0,0 +1,322 @@ +## apcupsd.conf v1.1 ## +# +# for apcupsd release 3.14.1 (04 May 2007) - unknown +# +# "apcupsd" POSIX config file + +# +# ========= General configuration parameters ============ +# + +# UPSNAME xxx +# Use this to give your UPS a name in log files and such. This +# is particulary useful if you have multiple UPSes. This does not +# set the EEPROM. It should be 8 characters or less. +UPSNAME ups1 + +# UPSCABLE +# Defines the type of cable connecting the UPS to your computer. +# +# Possible generic choices for are: +# simple, smart, ether, usb +# +# Or a specific cable model number may be used: +# 940-0119A, 940-0127A, 940-0128A, 940-0020B, +# 940-0020C, 940-0023A, 940-0024B, 940-0024C, +# 940-1524C, 940-0024G, 940-0095A, 940-0095B, +# 940-0095C, M-04-02-2000 +# +UPSCABLE smart + +# To get apcupsd to work, in addition to defining the cable +# above, you must also define a UPSTYPE, which corresponds to +# the type of UPS you have (see the Description for more details). +# You must also specify a DEVICE, sometimes referred to as a port. +# For USB UPSes, please leave the DEVICE directive blank. For +# other UPS types, you must specify an appropriate port or address. +# +# UPSTYPE DEVICE Description +# apcsmart /dev/tty** Newer serial character device, +# appropriate for SmartUPS models using +# a serial cable (not USB). +# +# usb Most new UPSes are USB. A blank DEVICE +# setting enables autodetection, which is +# the best choice for most installations. +# +# net hostname:port Network link to a master apcupsd +# through apcupsd's Network Information +# Server. This is used if you don't have +# a UPS directly connected to your computer. +# +# snmp hostname:port:vendor:community +# SNMP Network link to an SNMP-enabled +# UPS device. Vendor is the MIB used by +# the UPS device: can be "APC", "APC_NOTRAP" +# or "RFC" where APC is the powernet MIB, +# "APC_NOTRAP" is powernet with SNMP trap +# catching disabled, and RFC is the IETF's +# rfc1628 UPS-MIB. You usually want "APC". +# Port is usually 161. Community is usually +# "private". +# +# dumb /dev/tty** Old serial character device for use +# with simple-signaling UPSes. +# +# pcnet ipaddr:username:passphrase +# PowerChute Network Shutdown protocol +# which can be used as an alternative to SNMP +# with AP9617 family of smart slot cards. +# ipaddr is the IP address of the UPS mgmt +# card. username and passphrase are the +# credentials for which the card has been +# configured. +# +UPSTYPE apcsmart +DEVICE /dev/ttyS0 + + +# LOCKFILE +# Path for device lock file. Not used on Win32. +LOCKFILE /var/lock + +# SCRIPTDIR +# Directory in which apccontrol and event scripts are located. +SCRIPTDIR /etc/apcupsd + +# PWRFAILDIR +# Directory in which to write the powerfail flag file. This file +# is created when apcupsd initiates a system shutdown and is +# checked in the OS halt scripts to determine if a killpower +# (turning off UPS output power) is required. +PWRFAILDIR /etc + +# NOLOGINDIR +# Directory in which to write the nologin file. The existence +# of this flag file tells the OS to disallow new logins. +NOLOGINDIR /etc + + +# +# ======== Configuration parameters used during power failures ========== +# + +# The ONBATTERYDELAY is the time in seconds from when a power failure +# is detected until we react to it with an onbattery event. +# +# This means that, apccontrol will be called with the powerout argument +# immediately when a power failure is detected. However, the +# onbattery argument is passed to apccontrol only after the +# ONBATTERYDELAY time. If you don't want to be annoyed by short +# powerfailures, make sure that apccontrol powerout does nothing +# i.e. comment out the wall. +#ONBATTERYDELAY 6 + +# +# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so +# the first that occurs will cause the initation of a shutdown. +# + +# If during a power failure, the remaining battery percentage +# (as reported by the UPS) is below or equal to BATTERYLEVEL, +# apcupsd will initiate a system shutdown. +BATTERYLEVEL 5 + +# If during a power failure, the remaining runtime in minutes +# (as calculated internally by the UPS) is below or equal to MINUTES, +# apcupsd, will initiate a system shutdown. +MINUTES 3 + +# If during a power failure, the UPS has run on batteries for TIMEOUT +# many seconds or longer, apcupsd will initiate a system shutdown. +# A value of 0 disables this timer. +# +# Note, if you have a Smart UPS, you will most likely want to disable +# this timer by setting it to zero. That way, you UPS will continue +# on batteries until either the % charge remaing drops to or below BATTERYLEVEL, +# or the remaining battery runtime drops to or below MINUTES. Of course, +# if you are testing, setting this to 60 causes a quick system shutdown +# if you pull the power plug. +# If you have an older dumb UPS, you will want to set this to less than +# the time you know you can run on batteries. +TIMEOUT 0 + +# Time in seconds between annoying users to signoff prior to +# system shutdown. 0 disables. +ANNOY 300 + +# Initial delay after power failure before warning users to get +# off the system. +ANNOYDELAY 60 + +# The condition which determines when users are prevented from +# logging in during a power failure. +# NOLOGON [ disable | timeout | percent | minutes | always ] +NOLOGON disable + +# If KILLDELAY is non-zero, apcupsd will continue running after a +# shutdown has been requested, and after the specified time in +# seconds attempt to kill the power. This is for use on systems +# where apcupsd cannot regain control after a shutdown. +# KILLDELAY 0 disables +KILLDELAY 0 + +# +# ==== Configuration statements for Network Information Server ==== +# + +# NETSERVER [ on | off ] on enables, off disables the network +# information server. If netstatus is on, a network information +# server process will be started for serving the STATUS and +# EVENT data over the network (used by CGI programs). +NETSERVER on + +# NISIP +# IP address on which NIS server will listen for incoming connections. +# This is useful if your server is multi-homed (has more than one +# network interface and IP address). Default value is 0.0.0.0 which +# means any incoming request will be serviced. Alternatively, you can +# configure this setting to any specific IP address of your server and +# NIS will listen for connections only on that interface. Use the +# loopback address (127.0.0.1) to accept connections only from the +# local machine. +NISIP 0.0.0.0 + +# NISPORT default is 3551 as registered with the IANA +# port to use for sending STATUS and EVENTS data over the network. +# It is not used unless NETSERVER is on. If you change this port, +# you will need to change the corresponding value in the cgi directory +# and rebuild the cgi programs. +NISPORT 3551 + +# If you want the last few EVENTS to be available over the network +# by the network information server, you must define an EVENTSFILE. +EVENTSFILE /var/log/apcupsd.events + +# EVENTSFILEMAX +# By default, the size of the EVENTSFILE will be not be allowed to exceed +# 10 kilobytes. When the file grows beyond this limit, older EVENTS will +# be removed from the beginning of the file (first in first out). The +# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set +# to zero to allow the EVENTSFILE to grow without limit. +EVENTSFILEMAX 10 + +# +# ========== Configuration statements used if sharing ============= +# a UPS with more than one machine + +# NETTIME +# Interval (in seconds) at which the NIS client polls the server. +# Used only when this apcupsd is a network client (UPSTYPE net). +#NETTIME 60 + +# +# Remaining items are for ShareUPS (APC expansion card) ONLY +# + +# UPSCLASS [ standalone | shareslave | sharemaster ] +# Normally standalone unless you share an UPS using an APC ShareUPS +# card. +UPSCLASS standalone + +# UPSMODE [ disable | share ] +# Normally disable unless you share an UPS using an APC ShareUPS card. +UPSMODE disable + +# +# ===== Configuration statements to control apcupsd system logging ======== +# + +# Time interval in seconds between writing the STATUS file; 0 disables +STATTIME 0 + +# Location of STATUS file (written to only if STATTIME is non-zero) +STATFILE /var/log/apcupsd.status + +# LOGSTATS [ on | off ] on enables, off disables +# Note! This generates a lot of output, so if +# you turn this on, be sure that the +# file defined in syslog.conf for LOG_NOTICE is a named pipe. +# You probably do not want this on. +LOGSTATS off + +# Time interval in seconds between writing the DATA records to +# the log file. 0 disables. +DATATIME 0 + +# FACILITY defines the logging facility (class) for logging to syslog. +# If not specified, it defaults to "daemon". This is useful +# if you want to separate the data logged by apcupsd from other +# programs. +#FACILITY DAEMON + +# +# ========== Configuration statements used in updating the UPS EPROM ========= +# + +# +# These statements are used only by apctest when choosing "Set EEPROM with conf +# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD. +# + +# UPS name, max 8 characters +#UPSNAME UPS_IDEN + +# Battery date - 8 characters +#BATTDATE mm/dd/yy + +# Sensitivity to line voltage quality (H cause faster transfer to batteries) +# SENSITIVITY H M L (default = H) +#SENSITIVITY H + +# UPS delay after power return (seconds) +# WAKEUP 000 060 180 300 (default = 0) +#WAKEUP 60 + +# UPS Grace period after request to power off (seconds) +# SLEEP 020 180 300 600 (default = 20) +#SLEEP 180 + +# Low line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 106 103 100 097 +# M 177 172 168 182 +# A 092 090 088 086 +# I 208 204 200 196 (default = 0 => not valid) +#LOTRANSFER 208 + +# High line voltage causing transfer to batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 127 130 133 136 +# M 229 234 239 224 +# A 108 110 112 114 +# I 253 257 261 265 (default = 0 => not valid) +#HITRANSFER 253 + +# Battery charge needed to restore power +# RETURNCHARGE 00 15 50 90 (default = 15) +#RETURNCHARGE 15 + +# Alarm delay +# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never +# BEEPSTATE 0 T L N (default = 0) +#BEEPSTATE T + +# Low battery warning delay in minutes +# LOWBATT 02 05 07 10 (default = 02) +#LOWBATT 2 + +# UPS Output voltage when running on batteries +# The permitted values depend on your model as defined by last letter +# of FIRMWARE or APCMODEL. Some representative values are: +# D 115 +# M 208 +# A 100 +# I 230 240 220 225 (default = 0 => not valid) +#OUTPUTVOLTS 230 + +# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on +# SELFTEST 336 168 ON OFF (default = 336) +#SELFTEST 336 diff --git a/trunk/package/feeds/packages/apcupsd/files/apcupsd.css b/trunk/package/feeds/packages/apcupsd/files/apcupsd.css new file mode 100644 index 00000000..e98c75e5 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/apcupsd.css @@ -0,0 +1,64 @@ +body { + color: black; + background: white; +} + +div.Center { + text-align: center; +} + +img { + border-style: none; +} + +pre { + text-align: left; +} + +strong { + color: red; +} + +table.Outer { + color: black; + background: #60a0a0; + empty-cells: show; border: solid #60a0a0 +} + +th.Outer { + color: black; + background: #60b0b0 +} + +.Title { + font-size: 18pt; +} + +.SubTitle { + font-size: 12pt; +} + +.Empty { + color: black; + background: aqua; +} + +.Fault { + color: black; + background: red; +} + +.Label { + color: black; + background: aqua; +} + +.Normal { + color: black; + background: lime; +} + +.Warning { + color: black; + background: yellow; +} diff --git a/trunk/package/feeds/packages/apcupsd/files/apcupsd.init b/trunk/package/feeds/packages/apcupsd/files/apcupsd.init new file mode 100644 index 00000000..54543779 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/apcupsd.init @@ -0,0 +1,12 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=50 +STOP=50 + +start() { + /usr/sbin/apcupsd -f /etc/apcupsd/apcupsd.conf +} + +stop() { + kill $(cat /var/run/apcupsd.pid) +} diff --git a/trunk/package/feeds/packages/apcupsd/files/apcupsd_mail.conf b/trunk/package/feeds/packages/apcupsd/files/apcupsd_mail.conf new file mode 100644 index 00000000..3ada8e52 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/apcupsd_mail.conf @@ -0,0 +1,7 @@ +#!/bin/sh + +MAILPROG="/usr/sbin/smtp" +MAILHOST="mail:25" +FROM="OpenWrt" +TO="apcups@example.com" +HOSTNAME="OpenWrt" diff --git a/trunk/package/feeds/packages/apcupsd/files/changeme b/trunk/package/feeds/packages/apcupsd/files/changeme new file mode 100644 index 00000000..bcf448ab --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/changeme @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# detects that the battery should be replaced. +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME UPS battery needs changing NOW." +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/trunk/package/feeds/packages/apcupsd/files/commfailure b/trunk/package/feeds/packages/apcupsd/files/commfailure new file mode 100644 index 00000000..b899195f --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/commfailure @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# loses contact with the UPS (i.e. the serial connection is not responding). +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Communications with UPS lost" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/trunk/package/feeds/packages/apcupsd/files/commok b/trunk/package/feeds/packages/apcupsd/files/commok new file mode 100644 index 00000000..cd5d1c62 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/commok @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# restores contact with the UPS (i.e. the serial connection is restored). +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Communications with UPS restored" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/trunk/package/feeds/packages/apcupsd/files/hosts.conf b/trunk/package/feeds/packages/apcupsd/files/hosts.conf new file mode 100644 index 00000000..854e0081 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/hosts.conf @@ -0,0 +1,19 @@ +# Network UPS Tools - hosts.conf +# +# This file does double duty - it lists the systems that multimon will +# monitor, and also specifies the systems that upsstats is allowed to +# watch. It keeps people from feeding random addresses to upsstats, +# among other things. upsimage also uses this file to know who it +# may speak to. upsfstats too. +# +# Usage: list systems running upsd that you want to monitor +# +# MONITOR
"" +# +# Please note, MONITOR must start in column 1 (no spaces permitted) +# +# Example: +# MONITOR 10.64.1.1 "Finance department" +# MONITOR 10.78.1.1 "Sierra High School data room #1" +# +MONITOR 127.0.0.1 "Local Host" diff --git a/trunk/package/feeds/packages/apcupsd/files/multimon.conf b/trunk/package/feeds/packages/apcupsd/files/multimon.conf new file mode 100644 index 00000000..4cdf9b06 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/multimon.conf @@ -0,0 +1,63 @@ +# Sample multimon configuration file +# +# This file is not required. Without it, multimon will use the default +# field layout. +# +# Temperature selection +# +# Pick "TEMPC" for Celsius or "TEMPF" for Fahrenheit. This will override +# the --enable-celsius setting from the compile. UPSTEMP (below) will +# use this setting by default. + +TEMPC + +# Format: +# FIELD "" "" +# +# is either a word from the UPS protocol like battchg (see the +# table in src/cgi/upsfetch.c) or a special word in uppercase. +# +# Special words are: +# MODEL - Show the model name for this system in cyan +# +# STATUS - Parse the status for this system using the appropriate color +# +# UPSTEMP and AMBTEMP use the default scale. This is set to C if you use +# --enable-celsius at compile time *or* if you use "TEMPC" above. +# +# UPSTEMP - Show the UPS temperature in the default scale (suffix ignored) +# AMBTEMP - Show the ambient temperature in the default scale (suffix ignored) +# +# UPSTEMPC - Show the UPS temperature in degrees C (suffix ignored) +# UPSTEMPF - Show the UPS temperature in degrees F (suffix ignored) +# AMBTEMPC - Show the ambient temperature in degrees C (suffix ignored) +# AMBTEMPF - Show the ambient temperature in degrees F (suffix ignored) +# +# They're called "special" since they actually understand the content +# being printed and do other things based on what's in there. +# +# is what you'd like this column to be called on the page. +# Remember that this is HTML, so you can actually embed markup in here. +# This means you can even include images here. You can include quotes +# (and backslashes!) in the string by escaping them with a backslash (\). +# +# is typically something like % or VAC. It's useful if +# you want to convey the units that apply to a value. +# +# Example config + +FIELD SYSTEM "System" "" +FIELD MODEL "Model" "" +FIELD STATUS "Status" "" +FIELD battpct "Battery Chg" "%" +FIELD utility "Utility" "VAC" +FIELD loadpct "UPS Load" "%" +FIELD UPSTEMP "UPS Temp" "" +FIELD runtime "Batt. Run Time" "min." +FIELD DATA "Data" "All data" + +# These are only useful if you have a Smart-UPS model with the Measure-UPS II +# measurement card. No other models presently support these features. +# +# FIELD AMBTEMP "Ambient Temp" "" +# FIELD HUMIDITY "Ambient Humidity" "%" diff --git a/trunk/package/feeds/packages/apcupsd/files/offbattery b/trunk/package/feeds/packages/apcupsd/files/offbattery new file mode 100644 index 00000000..cd5d1c62 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/offbattery @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when apcupsd +# restores contact with the UPS (i.e. the serial connection is restored). +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Communications with UPS restored" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/trunk/package/feeds/packages/apcupsd/files/onbattery b/trunk/package/feeds/packages/apcupsd/files/onbattery new file mode 100644 index 00000000..ee5f6530 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/files/onbattery @@ -0,0 +1,17 @@ +#!/bin/sh +# +# This shell script if placed in /etc/apcupsd +# will be called by /etc/apcupsd/apccontrol when the UPS +# goes on batteries. +# We send an email message to root to notify him. +# +. /etc/apcupsd/apcupsd_mail.conf + +MSG="$HOSTNAME Power Failure !!!" +# +( + echo "$MSG" + echo " " + /usr/sbin/apcaccess status +) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO +exit 0 diff --git a/trunk/package/feeds/packages/apcupsd/patches/010-fix-usb.patch b/trunk/package/feeds/packages/apcupsd/patches/010-fix-usb.patch new file mode 100644 index 00000000..b313bb22 --- /dev/null +++ b/trunk/package/feeds/packages/apcupsd/patches/010-fix-usb.patch @@ -0,0 +1,8 @@ +--- a/include/libusb.h.in.orig 2015-02-21 18:53:51.023682068 +0100 ++++ a/include/libusb.h.in 2015-02-21 18:54:14.722788757 +0100 +@@ -6,4 +6,4 @@ + * path at configure time and various apcupsd bits include this + * when they need libusb's usb.h. + */ +-#include "@LIBUSBH@" ++#include "usb.h" diff --git a/trunk/package/feeds/packages/apinger/Makefile b/trunk/package/feeds/packages/apinger/Makefile new file mode 100644 index 00000000..5d73ae1b --- /dev/null +++ b/trunk/package/feeds/packages/apinger/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=apinger +PKG_VERSION:=0.6.1 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/Jajcus/apinger.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=c7da72f7ec26eedd7fd8d224c0e10787b204f94e +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_MAINTAINER:=Alex Samorukov +PKG_LICENSE:= GPL-2.0 + +PKG_FIXUP:=autoreconf + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/apinger + SECTION:=net + CATEGORY:=Network + TITLE:=Tool which monitors various IP devices by simple ICMP echo requests + URL:=https://github.com/Jajcus/apinger + PKG_MAINTAINER:=Alex Samorukov +endef + +define Package/apinger/description + Alarm Pinger (apinger) is a little tool which monitors various IP devices by + simple ICMP echo requests. There are various other tools, that can do this, + but most of them are shell or perl scripts, spawning many processes, thus much + CPU-expensive, especially when one wants continuous monitoring and fast + response on target failure. Alarm Pinger is a single program written in C, so + it doesn't need much CPU power even when monitoring many targets with frequent + probes. Alarm Pinger supports both IPv4 and IPv6. The code have been tested + on Linux and FreeBSD. +endef + +define Package/apinger/conffiles +/etc/apinger.conf +endef + +define Build/Configure + $(call Build/Configure/Default) +endef + +define Package/apinger/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/apinger $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/apinger.conf $(1)/etc/apinger.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/apinger.init $(1)/etc/init.d/apinger +endef + +$(eval $(call BuildPackage,apinger)) + diff --git a/trunk/package/feeds/packages/apinger/files/apinger.init b/trunk/package/feeds/packages/apinger/files/apinger.init new file mode 100644 index 00000000..8caac386 --- /dev/null +++ b/trunk/package/feeds/packages/apinger/files/apinger.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=80 + +SERVICE_USE_PID=1 + +start() { + service_start /usr/sbin/apinger +} + +stop() { + service_stop /usr/sbin/apinger +} + +reload() { + service_reload /usr/sbin/apinger +} diff --git a/trunk/package/feeds/packages/apinger/patches/001-autoreconf.patch b/trunk/package/feeds/packages/apinger/patches/001-autoreconf.patch new file mode 100644 index 00000000..cb5bd454 --- /dev/null +++ b/trunk/package/feeds/packages/apinger/patches/001-autoreconf.patch @@ -0,0 +1,13 @@ +--- apinger-0.6.1/acinclude.m4 2003-10-21 12:44:48.000000000 +0000 ++++ apinger-0.6.1/acinclude.m4 2015-04-08 15:27:37.451903960 +0000 +@@ -39,9 +39,7 @@ + [$jk_inet_includes + $jk_icmp_includes]) + +-AC_CHECK_MEMBERS([struct icmp.icmp_type, struct icmp.icmp_code,\ +-struct icmp.icmp_cksum, struct icmp.icmp_seq,\ +-struct icmp.icmp_id],[], ++AC_CHECK_MEMBERS([struct icmp.icmp_type, struct icmp.icmp_code,struct icmp.icmp_cksum, struct icmp.icmp_seq,struct icmp.icmp_id],[], + AC_MSG_ERROR(struct icmp not defined or not compatible), + [$jk_inet_includes + $jk_icmp_includes]) diff --git a/trunk/package/feeds/packages/apinger/patches/002-run_as_user.patch b/trunk/package/feeds/packages/apinger/patches/002-run_as_user.patch new file mode 100644 index 00000000..16d64acc --- /dev/null +++ b/trunk/package/feeds/packages/apinger/patches/002-run_as_user.patch @@ -0,0 +1,11 @@ +--- apinger-0.6.1/src/apinger.conf.orig 2015-04-08 16:05:24.558919722 +0000 ++++ apinger-0.6.1/src/apinger.conf 2015-04-08 16:07:47.089170236 +0000 +@@ -9,7 +9,7 @@ + + ## User and group the pinger should run as + user "nobody" +-group "nobody" ++group "nogroup" + + ## Mailer to use (default: "/usr/lib/sendmail -t") + #mailer "/var/qmail/bin/qmail-inject" diff --git a/trunk/package/feeds/packages/apinger/patches/003-no_docs.patch b/trunk/package/feeds/packages/apinger/patches/003-no_docs.patch new file mode 100644 index 00000000..c08f44de --- /dev/null +++ b/trunk/package/feeds/packages/apinger/patches/003-no_docs.patch @@ -0,0 +1,11 @@ +--- apinger-0.6.1/Makefile.am.orig 2015-04-08 16:47:40.999990050 +0000 ++++ apinger-0.6.1/Makefile.am 2015-04-08 16:48:07.565220137 +0000 +@@ -1,7 +1,7 @@ + + EXTRA_DIST = autogen.sh TODO BUGS + +-SUBDIRS = src doc ++SUBDIRS = src + + .PHONY: ChangeLog + diff --git a/trunk/package/feeds/packages/apr-util/Makefile b/trunk/package/feeds/packages/apr-util/Makefile new file mode 100644 index 00000000..d5178d56 --- /dev/null +++ b/trunk/package/feeds/packages/apr-util/Makefile @@ -0,0 +1,77 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=apr-util +PKG_VERSION:=1.5.4 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://archive.apache.org/dist/apr/ +PKG_MD5SUM:=2202b18f269ad606d70e1864857ed93c +PKG_MAINTAINER:=Thomas Heil +PKG_LICENSE:=Apache License + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/libaprutil + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libapr +libexpat +libsqlite3 +libuuid $(ICONV_DEPENDS) + TITLE:=Apache Portable Runtime Utility Library + URL:=http://apr.apache.org/ +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +CONFIGURE_ARGS += \ + --with-pgsql=no \ + --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \ + --with-expat="$(STAGING_DIR)/usr" \ + --without-sqlite2 \ + --with-sqlite3="$(STAGING_DIR)/usr" \ + --with-iconv="$(ICONV_PREFIX)" \ + +CONFIGURE_VARS += \ + ac_cv_file_dbd_apr_dbd_mysql_c=no \ + ac_cv_path_ODBC_CONFIG= \ + APR_BUILD_DIR="$(STAGING_DIR)/usr/share/build-1" \ + +MAKE_FLAGS += \ + APRUTIL_LIBS="-lsqlite3 $(TARGET_LDFLAGS) -lexpat $(if $(ICONV_FULL),-liconv) -lapr-1 -luuid -lm -lcrypt" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1/ $(1)/usr/lib $(1)/usr/lib/pkgconfig/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/apu-1-config \ + $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \ + $(1)/usr/include/apr-1/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.{la,a,so*} \ + $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-util-1.pc \ + $(1)/usr/lib/pkgconfig/ + $(SED) 's, -e \"s -I$$$$prefix/lib g\",,g' $(1)/usr/bin/apu-1-config + $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apu-1-config + $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apu-1-config + $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apu-1-config + $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apu-1-config +endef + +define Package/libaprutil/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libaprutil-1.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libaprutil)) diff --git a/trunk/package/feeds/packages/apr-util/patches/001-automake-compat.patch b/trunk/package/feeds/packages/apr-util/patches/001-automake-compat.patch new file mode 100644 index 00000000..20c4cf2b --- /dev/null +++ b/trunk/package/feeds/packages/apr-util/patches/001-automake-compat.patch @@ -0,0 +1,21 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -8,6 +8,7 @@ APRUTIL_MAJOR_VERSION=@APRUTIL_MAJOR_VER + APRUTIL_DOTTED_VERSION=@APRUTIL_DOTTED_VERSION@ + + srcdir = @srcdir@ ++top_builddir = @top_builddir@ + VPATH = @srcdir@ + + INCLUDES = @APRUTIL_PRIV_INCLUDES@ @APR_INCLUDES@ @APRUTIL_INCLUDES@ +--- a/configure.in ++++ b/configure.in +@@ -41,6 +41,8 @@ AC_SUBST(APU_CONFIG_LOCATION) + AC_CANONICAL_SYSTEM + + AC_PROG_INSTALL ++AC_PROG_LIBTOOL ++LT_INIT + + # Use -no-install or -no-fast-install to link the test + # programs on all platforms but Darwin, where it would cause diff --git a/trunk/package/feeds/packages/apr/Makefile b/trunk/package/feeds/packages/apr/Makefile new file mode 100644 index 00000000..69f5b5fd --- /dev/null +++ b/trunk/package/feeds/packages/apr/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2007-2011 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=apr +PKG_VERSION:=1.5.1 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://mirrors.ibiblio.org/apache/apr/ +PKG_MD5SUM:=5486180ec5a23efb5cae6d4292b300ab +PKG_MAINTAINER:=Thomas Heil +PKG_LICENSE:=Apache License + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 build/ltmain.sh + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libapr + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libpthread +librt +libuuid + TITLE:=Apache Portable Runtime Library + URL:=http://apr.apache.org/ +endef + +TARGET_CFLAGS += $(FPIC) +TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE + +CONFIGURE_ARGS += \ + --with-devrandom=/dev/urandom \ + --disable-dso \ + --enable-ipv6 + +# XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure +CONFIGURE_VARS += \ + ac_cv_sizeof_struct_iovec=1 \ + ac_cv_struct_rlimit=yes \ + apr_cv_process_shared_works=no \ + apr_cv_mutex_robust_shared=no \ + apr_cv_tcp_nodelay_with_cork=yes \ + apr_cv_use_lfs64=yes \ + LDFLAGS="$$$$LDFLAGS -lpthread" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 $(1)/usr/lib $(1)/usr/lib/pkgconfig $(1)/usr/share/build-1 + $(CP) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \ + $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \ + $(1)/usr/include/apr-1/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} \ + $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \ + $(1)/usr/lib/pkgconfig/ + $(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* \ + $(1)/usr/share/build-1/ + $(SED) 's,^datadir=\"/usr/share\",datadir=\"$(STAGING_DIR)/usr/share\",g' $(1)/usr/bin/apr-1-config + $(SED) 's,^installbuilddir=\"/usr/share/build-1\",installbuilddir=\"$(STAGING_DIR)/usr/share/build-1\",g' $(1)/usr/bin/apr-1-config + $(SED) 's,^libdir=\"$$$${exec_prefix}/lib,libdir=\"$(STAGING_DIR)/usr/lib,g' $(1)/usr/bin/apr-1-config + $(SED) 's,^includedir=\"$$$${prefix}/include/,includedir=\"$(STAGING_DIR)/usr/include/,g' $(1)/usr/bin/apr-1-config + $(SED) 's,-L$$$$libdir,,g' $(1)/usr/bin/apr-1-config + $(SED) 's,-R$$$$libdir,,g' $(1)/usr/bin/apr-1-config + $(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' $(1)/usr/share/build-1/apr_rules.mk +endef + +define Package/libapr/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libapr)) diff --git a/trunk/package/feeds/packages/apr/patches/001-autoconf-compat.patch b/trunk/package/feeds/packages/apr/patches/001-autoconf-compat.patch new file mode 100644 index 00000000..8170572b --- /dev/null +++ b/trunk/package/feeds/packages/apr/patches/001-autoconf-compat.patch @@ -0,0 +1,22 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -3,6 +3,7 @@ srcdir=@srcdir@ + VPATH=@srcdir@ + top_srcdir=@apr_srcdir@ + top_blddir=@apr_builddir@ ++top_builddir=@top_builddir@ + + # + # APR (Apache Portable Runtime) library Makefile. +--- a/configure.in ++++ b/configure.in +@@ -246,9 +246,6 @@ case $host in + gcc $CFLAGS $CPPFLAGS -o $LIBTOOL.exe $LIBTOOL.c + ;; + *) +- if test "x$LTFLAGS" = "x"; then +- LTFLAGS='--silent' +- fi + if test "$experimental_libtool" = "yes"; then + # Use a custom-made libtool replacement + echo "using jlibtool" diff --git a/trunk/package/feeds/packages/apr/patches/101-fix_apr_time_now.patch b/trunk/package/feeds/packages/apr/patches/101-fix_apr_time_now.patch new file mode 100644 index 00000000..6ad14a37 --- /dev/null +++ b/trunk/package/feeds/packages/apr/patches/101-fix_apr_time_now.patch @@ -0,0 +1,13 @@ +https://dev.openwrt.org/ticket/9287 + +--- a/time/unix/time.c ++++ b/time/unix/time.c +@@ -75,7 +75,7 @@ APR_DECLARE(apr_time_t) apr_time_now(voi + { + struct timeval tv; + gettimeofday(&tv, NULL); +- return tv.tv_sec * APR_USEC_PER_SEC + tv.tv_usec; ++ return tv.tv_sec * (apr_time_t)APR_USEC_PER_SEC + (apr_time_t)tv.tv_usec; + } + + static void explode_time(apr_time_exp_t *xt, apr_time_t t, diff --git a/trunk/package/feeds/packages/apr/patches/201-upgrade-and-fix-1.5.1.patch b/trunk/package/feeds/packages/apr/patches/201-upgrade-and-fix-1.5.1.patch new file mode 100644 index 00000000..42f4c0f0 --- /dev/null +++ b/trunk/package/feeds/packages/apr/patches/201-upgrade-and-fix-1.5.1.patch @@ -0,0 +1,54 @@ +Makefile.in: fix cross compiling failed + +The tools/gen_test_char was invoked at build time, +and it didn't work for the cross compiling, so we +compile it with $BUILDCC. + +Remove the 'tools' dir creation, it always existed. +And it caused gen_test_char unexpected rebuilt at +do_install time. + +Upstream-Status: inappropriate [oe specific] + +Signed-off-by: Hongxu Jia +--- + Makefile.in | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +Index: apr-1.5.1/Makefile.in +=================================================================== +--- apr-1.5.1.orig/Makefile.in ++++ apr-1.5.1/Makefile.in +@@ -20,7 +20,7 @@ INCDIR=./include + OSDIR=$(top_srcdir)/include/arch/@OSDIR@ + DEFOSDIR=$(INCDIR)/arch/@DEFAULT_OSDIR@ + INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR) -I$(top_srcdir)/include/arch/@DEFAULT_OSDIR@ -I$(top_srcdir)/include -I$(top_srcdir)/include/private -I$(top_blddir)/include/private +- ++BUILDCC=gcc + # + # Macros for target determination + # +@@ -47,7 +47,6 @@ LT_VERSION = @LT_VERSION@ + + CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \ + build/apr_rules.out tools/gen_test_char@EXEEXT@ \ +- tools/gen_test_char.o tools/gen_test_char.lo \ + include/private/apr_escape_test_char.h + DISTCLEAN_TARGETS = config.cache config.log config.status \ + include/apr.h include/arch/unix/apr_private.h \ +@@ -130,13 +129,8 @@ check: $(TARGET_LIB) + etags: + etags `find . -name '*.[ch]'` + +-make_tools_dir: +- $(APR_MKDIR) tools +- +-OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS) +-tools/gen_test_char.lo: make_tools_dir +-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char) +- $(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS) ++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c ++ $(BUILDCC) $(CFLAGS_FOR_BUILD) $< -o $@ + + include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@ + $(APR_MKDIR) include/private diff --git a/trunk/package/feeds/packages/argp-standalone/Makefile b/trunk/package/feeds/packages/argp-standalone/Makefile new file mode 100644 index 00000000..8cf23fec --- /dev/null +++ b/trunk/package/feeds/packages/argp-standalone/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=argp-standalone +PKG_VERSION:=1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/ +PKG_MD5SUM:=720704bac078d067111b32444e24ba69 +PKG_MAINTAINER:=Ted Hess + +PKG_LICENSE:=LGPL-2.1 +PKG_LICENSE:=Makefile.am + +include $(INCLUDE_DIR)/package.mk + +define Package/argp-standalone + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Hierarchial argument parsing broken out from glibc + URL:=http://www.lysator.liu.se/~nisse/misc/ +endef + +define Package/argp-standalone/description + GNU libc hierarchial argument parsing library broken out from glibc. +endef + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS) $(FPIC)" + + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/argp.h \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libargp.a \ + $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,argp-standalone)) diff --git a/trunk/package/feeds/packages/argp-standalone/patches/001-throw-in-funcdef.patch b/trunk/package/feeds/packages/argp-standalone/patches/001-throw-in-funcdef.patch new file mode 100644 index 00000000..4a90751e --- /dev/null +++ b/trunk/package/feeds/packages/argp-standalone/patches/001-throw-in-funcdef.patch @@ -0,0 +1,79 @@ +# --- T2-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone +# Copyright (C) 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This patch file is dual-licensed. It is available under the license the +# patched project is licensed under, as long as it is an OpenSource license +# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms +# of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# --- T2-COPYRIGHT-NOTE-END --- + + +No __THROW in function implementation. + --jsaw + +--- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100 ++++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100 +@@ -560,17 +560,17 @@ + # endif + + # ifndef ARGP_EI +-# define ARGP_EI extern __inline__ ++# define ARGP_EI extern inline + # endif + + ARGP_EI void +-__argp_usage (__const struct argp_state *__state) __THROW ++__argp_usage (__const struct argp_state *__state) + { + __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); + } + + ARGP_EI int +-__option_is_short (__const struct argp_option *__opt) __THROW ++__option_is_short (__const struct argp_option *__opt) + { + if (__opt->flags & OPTION_DOC) + return 0; +@@ -582,7 +582,7 @@ + } + + ARGP_EI int +-__option_is_end (__const struct argp_option *__opt) __THROW ++__option_is_end (__const struct argp_option *__opt) + { + return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; + } +--- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100 ++++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100 +@@ -1290,13 +1290,13 @@ + /* Defined here, in case a user is not inlining the definitions in + * argp.h */ + void +-__argp_usage (__const struct argp_state *__state) __THROW ++__argp_usage (__const struct argp_state *__state) + { + __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE); + } + + int +-__option_is_short (__const struct argp_option *__opt) __THROW ++__option_is_short (__const struct argp_option *__opt) + { + if (__opt->flags & OPTION_DOC) + return 0; +@@ -1310,7 +1310,7 @@ + } + + int +-__option_is_end (__const struct argp_option *__opt) __THROW ++__option_is_end (__const struct argp_option *__opt) + { + return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; + } diff --git a/trunk/package/feeds/packages/aria2/Config.in b/trunk/package/feeds/packages/aria2/Config.in new file mode 100644 index 00000000..ec21fafe --- /dev/null +++ b/trunk/package/feeds/packages/aria2/Config.in @@ -0,0 +1,28 @@ +menu "Aria2 configuration" + depends on PACKAGE_aria2 + +choice + prompt "SSL library" + default ARIA2_OPENSSL + +config ARIA2_OPENSSL + bool "OpenSSL" + +config ARIA2_GNUTLS + bool "GNUTLS" + +config ARIA2_NOSSL + bool "No SSL support" + +endchoice + +config ARIA2_BITTORRENT + bool "Enable bittorrent support" + depends on ARIA2_OPENSSL + default n + +config ARIA2_METALINK + bool "Enable metalink support" + default N + +endmenu diff --git a/trunk/package/feeds/packages/aria2/Makefile b/trunk/package/feeds/packages/aria2/Makefile new file mode 100644 index 00000000..cac017a6 --- /dev/null +++ b/trunk/package/feeds/packages/aria2/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (C) 2012-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=aria2 +PKG_VERSION:=1.18.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/aria2 +PKG_MD5SUM:=36e92af92b4370817c577ed802546842 +PKG_INSTALL:=1 + +PKG_MAINTAINER:=Imre Kaloz +PKG_LICENSE:=GPLv2 +PKG_LICENSE_FILES:=COPYING + +PKG_CONFIG_DEPENDS := \ + ARIA2_NOSSL \ + ARIA2_OPENSSL \ + ARIA2_GNUTLS \ + ARIA2_BITTORRENT \ + ARIA2_METALINK + +include $(INCLUDE_DIR)/package.mk + +define Package/aria2/config + source "$(SOURCE)/Config.in" +endef + +define Package/aria2 + SECTION:=net + CATEGORY:=Network + SUBMENU:=File Transfer + TITLE:=lightweight download utility + URL:=http://aria2.sourceforge.net/ + DEPENDS:=+zlib +ARIA2_METALINK:libxml2 +libstdcpp +ARIA2_OPENSSL:libopenssl +ARIA2_GNUTLS:libgnutls +endef + +define Package/aria2/description + aria2 is a lightweight multi-protocol & multi-source command-line download + utility +endef + +CONFIGURE_ARGS += \ + --disable-nls \ + $(if $(CONFIG_ARIA2_NOSSL),--disable,--enable)-ssl \ + $(if $(CONFIG_ARIA2_OPENSSL),--with,--without)-openssl \ + $(if $(CONFIG_ARIA2_GNUTLS),--with,--without)-gnutls \ + $(if $(CONFIG_ARIA2_BITTORRENT),--enable,--disable)-bittorrent \ + $(if $(CONFIG_ARIA2_METALINK),--enable,--disable)-metalink \ + $(if $(CONFIG_ARIA2_METALINK),--with,--without)-libxml2 \ + --without-libnettle \ + --without-libgmp \ + --without-libgcrypt \ + --without-libexpat \ + --without-libcares \ + --without-sqlite3 \ + --with-libz + +define Package/aria2/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aria2c $(1)/usr/bin +endef + +$(eval $(call BuildPackage,aria2)) diff --git a/trunk/package/feeds/packages/attr/Makefile b/trunk/package/feeds/packages/attr/Makefile new file mode 100644 index 00000000..80da9ccd --- /dev/null +++ b/trunk/package/feeds/packages/attr/Makefile @@ -0,0 +1,93 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=attr +PKG_REV:=c252ef434219891f616d891b46aad6b06efdd185 +PKG_VERSION:=20150220 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://git.sv.gnu.org/attr.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_MAINTAINER:=Maxim Storchak + +PKG_LICENSE:=LGPL-2.1 GPL-2.0 +PKG_LICENSE_FILES:=doc/COPYING doc/COPYING.LGPL + +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/attr/Default + TITLE:=Extended attributes (xattr) manipulation + URL:=http://savannah.nongnu.org/projects/attr + SUBMENU:=Filesystem +endef + +define Package/attr/Default/description + Extended attributes support +endef + +define Package/attr +$(call Package/attr/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+=utils + DEPENDS:=+libattr +endef + +define Package/libattr +$(call Package/attr/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+=library +endef + +define Package/libattr/description +$(call Package/attr/Default/description) + This package provides libattr +endef + +define Package/attr/description +$(call Package/attr/Default/description) + This package provides xattr manipulation utilities + - attr + - getfattr + - setfattr +endef + +CONFIGURE_ARGS += --enable-static --enable-shared + +define Package/attr/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +define Package/libattr/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc $(1)/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ +endef + +define Package/attr/conffiles +/etc/xattr.conf +endef + +define Build/InstallDev + mkdir -p $(1)/usr/include + mkdir -p $(1)/usr/lib/pkgconfig + $(CP) -r $(PKG_INSTALL_DIR)/usr/{include,lib} $(1)/usr/ +endef + +$(eval $(call BuildPackage,attr)) +$(eval $(call BuildPackage,libattr)) diff --git a/trunk/package/feeds/packages/attr/patches/100-no-gettext_configure.patch b/trunk/package/feeds/packages/attr/patches/100-no-gettext_configure.patch new file mode 100644 index 00000000..2e8b4f4c --- /dev/null +++ b/trunk/package/feeds/packages/attr/patches/100-no-gettext_configure.patch @@ -0,0 +1,21 @@ +diff --git a/configure.ac b/configure.ac +index 8a1ca39..ceee757 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -33,9 +33,6 @@ AC_FUNC_ALLOCA + AM_PROG_AR + LT_INIT + +-AM_GNU_GETTEXT_VERSION([0.18.2]) +-AM_GNU_GETTEXT([external]) +- + dnl Most people get these man(2) pages from the system now. + AC_ARG_ENABLE([man2], + [AS_HELP_STRING([--enable-man2], [Install man(2) pages])]) +@@ -59,6 +56,5 @@ AC_CONFIG_COMMANDS([include/attr], + AC_CONFIG_FILES([ + libattr.pc + Makefile +- po/Makefile.in + ]) + AC_OUTPUT diff --git a/trunk/package/feeds/packages/attr/patches/101-no-gettext_autogen.patch b/trunk/package/feeds/packages/attr/patches/101-no-gettext_autogen.patch new file mode 100644 index 00000000..1fad67a1 --- /dev/null +++ b/trunk/package/feeds/packages/attr/patches/101-no-gettext_autogen.patch @@ -0,0 +1,9 @@ +diff --git a/autogen.sh b/autogen.sh +index a98a3c5..982aff1 100755 +--- a/autogen.sh ++++ b/autogen.sh +@@ -1,4 +1,2 @@ + #!/bin/sh -ex +-po/update-potfiles +-autopoint --force + exec autoreconf -f -i diff --git a/trunk/package/feeds/packages/attr/patches/102-no-gettext_Makefile.patch b/trunk/package/feeds/packages/attr/patches/102-no-gettext_Makefile.patch new file mode 100644 index 00000000..76c8dcd3 --- /dev/null +++ b/trunk/package/feeds/packages/attr/patches/102-no-gettext_Makefile.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile.am b/Makefile.am +index a3e8353..381bb55 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,8 +3,6 @@ ACLOCAL_AMFLAGS = -I m4 + EXTRA_DIST = \ + exports + +-SUBDIRS = po +- + AM_CPPFLAGS = \ + -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ diff --git a/trunk/package/feeds/packages/avahi/Makefile b/trunk/package/feeds/packages/avahi/Makefile new file mode 100644 index 00000000..2d1a64b3 --- /dev/null +++ b/trunk/package/feeds/packages/avahi/Makefile @@ -0,0 +1,404 @@ +# +# Copyright (C) 2007-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=avahi +PKG_VERSION:=0.6.31 +PKG_RELEASE:=12 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://avahi.org/download/ +PKG_MD5SUM:=2f22745b8f7368ad5a0a3fddac343f2d +PKG_MAINTAINER:=Ted Hess + +PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=autogen.sh + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +ifeq ($(BUILD_VARIANT),dbus) +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/dbus/$(PKG_NAME)-$(PKG_VERSION) +else +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)/nodbus/$(PKG_NAME)-$(PKG_VERSION) +endif + +include $(INCLUDE_DIR)/package.mk + +define Package/avahi/Default + SECTION:=net + CATEGORY:=Network + TITLE:=An mDNS/DNS-SD implementation + URL:=http://www.avahi.org/ +endef + +define Package/avahi/Default/description + Avahi is an mDNS/DNS-SD (aka RendezVous/Bonjour/ZeroConf) + implementation (library). It facilitates + service discovery on a local network -- this means that + you can plug your laptop or computer into a network and + instantly be able to view other people who you can chat with, + find printers to print to or find files being shared. + This kind of technology is already found in MacOS X + (branded 'Rendezvous', 'Bonjour' and sometimes 'ZeroConf') + and is very convenient. +endef + +define Package/libavahi/Default + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + PROVIDES:=libavahi + DEPENDS:=+libpthread +endef + +define Package/libavahi/description +$(call Package/avahi/Default/description) + . + The libavahi package contains the mDNS/DNS-SD shared libraries, + used by other programs. Specifically, it provides + libavahi-core and libavahi-common libraries. +endef + +define Package/avahi-autoipd + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+libdaemon + TITLE:=IPv4LL network address configuration daemon +endef + +define Package/avahi-autoipd/description +$(call Package/avahi/Default/description) + . + This package implements IPv4LL, "Dynamic Configuration of IPv4 Link-Local + Addresses" (IETF RFC3927), a protocol for automatic IP address configuration + from the link-local 169.254.0.0/16 range without the need for a central + server. It is primarily intended to be used in ad-hoc networks which lack a + DHCP server. +endef + +define Package/avahi-dbus-daemon + $(call Package/avahi/Default) + PROVIDES:=avahi-daemon + VARIANT:=dbus + SUBMENU:=IP Addresses and Names + DEPENDS:=+libavahi-dbus-support +libexpat +librt +libdaemon + TITLE+= (daemon) +endef + +define Package/avahi-nodbus-daemon + $(call Package/avahi/Default) + PROVIDES:=avahi-daemon + VARIANT:=nodbus + SUBMENU:=IP Addresses and Names + DEPENDS:=+libavahi-nodbus-support +libexpat +librt +libdaemon + TITLE+= (daemon) + USERID:=avahi=105:avahi=105 +endef + +define Package/avahi-daemon/description +$(call Package/avahi/Default/description) + . + This package contains an mDNS/DNS-SD daemon. +endef + +Package/avahi-dbus-daemon/description=$(Package/avahi-daemon/description) +Package/avahi-nodbus-daemon/description=$(Package/avahi-daemon/description) + +define Package/avahi-daemon/conffiles +/etc/avahi/avahi-daemon.conf +endef + +Package/avahi-dbus-daemon/conffiles=$(Package/avahi-daemon/conffiles) +Package/avahi-nodbus-daemon/conffiles=$(Package/avahi-daemon/conffiles) + +define Package/avahi-daemon-service-http + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+avahi-daemon + TITLE:=Announce HTTP service +endef + +define Package/avahi-daemon-service-http/description +$(call Package/avahi/Default/description) + . + This package contains the service definition for announcing HTTP service. +endef + +define Package/avahi-daemon-service-http/conffiles +/etc/avahi/services/http.service +endef + +define Package/avahi-daemon-service-ssh + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+avahi-daemon + TITLE:=Announce SSH service +endef + +define Package/avahi-daemon-service-ssh/description +$(call Package/avahi/Default/description) + . + This package contains the service definition for announcing SSH service. +endef + +define Package/avahi-daemon-service-ssh/conffiles +/etc/avahi/services/ssh.service +endef + +define Package/avahi-dnsconfd + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + DEPENDS:=+libavahi +libdaemon +libpthread + TITLE:=A Unicast DNS server using avahi-daemon +endef + +define Package/avahi-dnsconfd/description +$(call Package/avahi/Default/description) + . + This package contains a Unicast DNS server from mDNS/DNS-SD configuration + daemon, which may be used to configure conventional DNS servers using mDNS + in a DHCP-like fashion. Especially useful on IPv6. +endef + +define Package/libavahi-dbus-support + $(call Package/libavahi/Default) + VARIANT:=dbus + DEPENDS:=+dbus + TITLE+= (D-Bus support) +endef + +define Package/libavahi-nodbus-support + $(call Package/libavahi/Default) + VARIANT:=nodbus + TITLE+= (No D-Bus) +endef + +define Package/libavahi-dbus-support/description +$(call Package/libavahi/description) + . + The libavahi-dbus-support package enables + D-Bus support in avahi, needed to support + the libavahi-client library and avahi-utils. + . + Selecting this package modifies the build configuration + so that avahi packages are built with support for D-BUS enabled; + it does not generate a separate binary of its own. + It also automatically adds the D-Bus package to the build. + libavahi-dbus-support is selected automatically if you select + libavahi-client or avahi-utils. +endef + +define Package/libavahi-nodbus-support/description +$(call Package/libavahi/description) + . + Selecting this package modifies the build configuration + so that avahi packages are built without support for D-BUS enabled; + it does not generate a separate binary of its own. +endef + +define Package/libavahi-client + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + VARIANT:=dbus + DEPENDS:=+avahi-dbus-daemon + TITLE+= (libavahi-client library) +endef + +define Package/libavahi-client/description +$(call Package/avahi/Default/description) + . + This packages adds the libavahi-client library. + It also automatically adds the required + libavahi-dbus-support and the avahi-dbus-daemon packages. + For more information please see the avahi documentation. +endef + +define Package/libavahi-compat-libdnssd + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + VARIANT:=dbus + DEPENDS:=+libavahi-client + TITLE+= (libdnssd) +endef + +define Package/libavahi-compat-libdnssd/description +$(call Package/avahi/Default/description) + . + This packages adds the libavahi-compat-libdnssd library. + It also automatically adds the required libavahi-client package. + For more information please see the avahi documentation. +endef + +define Package/avahi-utils + $(call Package/avahi/Default) + SUBMENU:=IP Addresses and Names + VARIANT:=dbus + DEPENDS:=libavahi-client +libgdbm + TITLE+= (utilities) +endef + +define Package/avahi-utils/description +$(call Package/avahi/Default/description) + . + This packages installs the following avahi utility programs: + avahi-browse, avahi-publish, avahi-resolve, avahi-set-host-name. + It also automatically adds the required libavahi-client package. + For more information please see the avahi documentation. +endef + +TARGET_CFLAGS += $(FPIC) -DGETTEXT_PACKAGE + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --disable-glib \ + --disable-gobject \ + --disable-qt3 \ + --disable-qt4 \ + --disable-gtk \ + --disable-gtk3 \ + --with-xml=expat \ + --disable-dbm \ + --enable-gdbm \ + --enable-libdaemon \ + $(and $(CONFIG_PACKAGE_libavahi-compat-libdnssd),ifeq ($(BUILD_VARIANT),dbus),\ + --enable-compat-libdns_sd) \ + --disable-python \ + --disable-pygtk \ + --disable-python-dbus \ + --disable-mono \ + --disable-monodoc \ + --disable-doxygen-doc \ + --disable-doxygen-dot \ + --disable-doxygen-man \ + --disable-doxygen-rtf \ + --disable-doxygen-xml \ + --disable-doxygen-chm \ + --disable-doxygen-chi \ + --disable-doxygen-html \ + --disable-doxygen-ps \ + --disable-doxygen-pdf \ + --disable-xmltoman \ + --with-distro=none \ + --with-avahi-user=nobody \ + --with-avahi-group=nogroup \ + --with-autoipd-user=nobody \ + --with-autoipd-group=nogroup + +ifneq ($(CONFIG_SSP_SUPPORT),y) +CONFIGURE_ARGS+= \ + --disable-stack-protector +endif + +ifeq ($(BUILD_VARIANT),dbus) +CONFIGURE_ARGS += \ + --enable-dbus +else +CONFIGURE_ARGS += \ + --disable-dbus +endif + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS -DNDEBUG -DDISABLE_SYSTEMD" \ + ac_cv_header_sys_capability_h=no \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/ +ifeq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd)-$(BUILD_VARIANT),y-dbus) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/ +endif + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ +endef + +define Package/libavahi/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-{common,core}.so.* $(1)/usr/lib/ +endef + +define Package/libavahi-dbus-support/install + $(call Package/libavahi/install,$(1)) + $(INSTALL_DIR) $(1)/etc/dbus-1/system.d + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/dbus-1/system.d/* $(1)/etc/dbus-1/system.d +endef + +Package/libavahi-nodbus-support/install=$(Package/libavahi/install) + +define Package/libavahi-client/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/ +endef + +define Package/libavahi-compat-libdnssd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/ +endef + +define Package/avahi-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +define Package/avahi-autoipd/install + $(INSTALL_DIR) $(1)/etc/avahi + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/ +endef + +define Package/avahi-daemon/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-daemon $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/avahi + $(INSTALL_DATA) ./files/avahi-daemon.conf $(1)/etc/avahi/ + # install empty service directory so that user knows where + # to place custom service files + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/avahi-daemon.init $(1)/etc/init.d/avahi-daemon +endef + +Package/avahi-dbus-daemon/install=$(Package/avahi-daemon/install) +Package/avahi-nodbus-daemon/install=$(Package/avahi-daemon/install) + +define Package/avahi-daemon-service-http/install + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DATA) ./files/service-http $(1)/etc/avahi/services/http.service +endef + +define Package/avahi-daemon-service-ssh/install + $(INSTALL_DIR) $(1)/etc/avahi/services + $(INSTALL_DATA) ./files/service-ssh $(1)/etc/avahi/services/ssh.service +endef + +define Package/avahi-dnsconfd/install + $(INSTALL_DIR) $(1)/etc/avahi + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-dnsconfd.action $(1)/etc/avahi/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-dnsconfd $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,libavahi-client)) +$(eval $(call BuildPackage,libavahi-compat-libdnssd)) +$(eval $(call BuildPackage,avahi-utils)) +$(eval $(call BuildPackage,libavahi-dbus-support)) +$(eval $(call BuildPackage,libavahi-nodbus-support)) +$(eval $(call BuildPackage,avahi-autoipd)) +$(eval $(call BuildPackage,avahi-dbus-daemon)) +$(eval $(call BuildPackage,avahi-nodbus-daemon)) +$(eval $(call BuildPackage,avahi-daemon-service-http)) +$(eval $(call BuildPackage,avahi-daemon-service-ssh)) +$(eval $(call BuildPackage,avahi-dnsconfd)) diff --git a/trunk/package/feeds/packages/avahi/files/avahi-daemon.conf b/trunk/package/feeds/packages/avahi/files/avahi-daemon.conf new file mode 100644 index 00000000..3ef0788e --- /dev/null +++ b/trunk/package/feeds/packages/avahi/files/avahi-daemon.conf @@ -0,0 +1,28 @@ +[server] +#host-name=foo +#domain-name=local +use-ipv4=yes +use-ipv6=yes +check-response-ttl=no +use-iff-running=no + +[publish] +publish-addresses=yes +publish-hinfo=yes +publish-workstation=no +publish-domain=yes +#publish-dns-servers=192.168.1.1 +#publish-resolv-conf-dns-servers=yes + +[reflector] +enable-reflector=no +reflect-ipv=no + +[rlimits] +#rlimit-as= +rlimit-core=0 +rlimit-data=4194304 +rlimit-fsize=0 +rlimit-nofile=30 +rlimit-stack=4194304 +rlimit-nproc=3 diff --git a/trunk/package/feeds/packages/avahi/files/avahi-daemon.init b/trunk/package/feeds/packages/avahi/files/avahi-daemon.init new file mode 100644 index 00000000..b2ae4580 --- /dev/null +++ b/trunk/package/feeds/packages/avahi/files/avahi-daemon.init @@ -0,0 +1,23 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006 OpenWrt.org +START=61 + +BIN=avahi-daemon +DEFAULT=/etc/default/$BIN +OPTIONS="-D" +RUN_D=/var/run/$BIN + +start() { + [ -f $DEFAULT ] && . $DEFAULT + mkdir -p $RUN_D + $BIN $OPTIONS +} + +stop() { + $BIN -k +} + +reload() { + $BIN -r +} + diff --git a/trunk/package/feeds/packages/avahi/files/service-http b/trunk/package/feeds/packages/avahi/files/service-http new file mode 100644 index 00000000..32620379 --- /dev/null +++ b/trunk/package/feeds/packages/avahi/files/service-http @@ -0,0 +1,10 @@ + + + + %h + + _http._tcp + 80 + path=/ + + diff --git a/trunk/package/feeds/packages/avahi/files/service-ssh b/trunk/package/feeds/packages/avahi/files/service-ssh new file mode 100644 index 00000000..b4458515 --- /dev/null +++ b/trunk/package/feeds/packages/avahi/files/service-ssh @@ -0,0 +1,9 @@ + + + + %h + + _ssh._tcp + 22 + + diff --git a/trunk/package/feeds/packages/avahi/patches/010-step_back_autotools-no-gettext.patch b/trunk/package/feeds/packages/avahi/patches/010-step_back_autotools-no-gettext.patch new file mode 100644 index 00000000..fab87aae --- /dev/null +++ b/trunk/package/feeds/packages/avahi/patches/010-step_back_autotools-no-gettext.patch @@ -0,0 +1,80 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -75,8 +75,7 @@ SUBDIRS = \ + avahi-compat-howl \ + avahi-autoipd \ + avahi-ui \ +- avahi-ui-sharp \ +- po ++ avahi-ui-sharp + + DX_INPUT = \ + $(srcdir)/avahi-common/address.h \ +--- a/avahi-python/avahi-discover/Makefile.am ++++ b/avahi-python/avahi-discover/Makefile.am +@@ -38,7 +38,6 @@ if HAVE_GDBM + pythonscripts += \ + avahi-discover + desktop_DATA += avahi-discover.desktop +-@INTLTOOL_DESKTOP_RULE@ + avahi_discover_PYTHON += __init__.py + endif + +@@ -46,7 +45,6 @@ if HAVE_DBM + pythonscripts += \ + avahi-discover + desktop_DATA += avahi-discover.desktop +-@INTLTOOL_DESKTOP_RULE@ + avahi_discover_PYTHON += __init__.py + endif + +--- a/avahi-ui/Makefile.am ++++ b/avahi-ui/Makefile.am +@@ -78,7 +78,6 @@ endif + + bin_PROGRAMS = bssh + desktop_DATA += bssh.desktop bvnc.desktop +-@INTLTOOL_DESKTOP_RULE@ + + bssh_SOURCES = bssh.c + +@@ -106,6 +105,4 @@ endif # HAVE_GLIB + endif + endif + +-@INTLTOOL_DESKTOP_RULE@ +- + CLEANFILES = $(desktop_DATA) $(desktop_DATA_in) +--- a/configure.ac ++++ b/configure.ac +@@ -23,7 +23,7 @@ AC_INIT([avahi],[0.6.29],[avahi (at) lis + AC_CONFIG_SRCDIR([avahi-core/server.c]) + AC_CONFIG_MACRO_DIR([common]) + AC_CONFIG_HEADERS([config.h]) +-AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax]) ++AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability tar-pax]) + + AC_SUBST(PACKAGE_URL, [http://avahi.org/]) + +@@ -43,8 +43,6 @@ AC_SUBST(HOWL_COMPAT_VERSION, [0.9.8]) + + AC_CANONICAL_HOST + +-AM_SILENT_RULES([yes]) +- + AC_CHECK_PROG([STOW], [stow], [yes], [no]) + + AS_IF([test "x$STOW" = "xyes" && test -d /usr/local/stow], [ +@@ -412,12 +410,6 @@ if test "x$have_kqueue" = "xyes" ; then + AC_DEFINE([HAVE_KQUEUE], 1, [Enable BSD kqueue() usage]) + fi + +-IT_PROG_INTLTOOL([0.35.0]) +-GETTEXT_PACKAGE=avahi +-AC_SUBST([GETTEXT_PACKAGE]) +-AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package]) +-AM_GLIB_GNU_GETTEXT +- + avahilocaledir='${prefix}/${DATADIRNAME}/locale' + AC_SUBST(avahilocaledir) + diff --git a/trunk/package/feeds/packages/bash/Makefile b/trunk/package/feeds/packages/bash/Makefile new file mode 100644 index 00000000..df97e097 --- /dev/null +++ b/trunk/package/feeds/packages/bash/Makefile @@ -0,0 +1,73 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +BASE_VERSION:=4.3 + +PKG_NAME:=bash +PKG_VERSION:=$(BASE_VERSION).33 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(BASE_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/bash +PKG_MD5SUM:=81348932d5da294953e15d4814c74dd1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BASE_VERSION) + +PKG_LICENSE:=GPL-3.0+ +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Marcel Denia + +PKG_CHECK_FORMAT_SECURITY:=0 +include $(INCLUDE_DIR)/package.mk + +define Package/bash + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The GNU Bourne Again SHell + DEPENDS:=+libncurses + URL:=http://www.gnu.org/software/bash/ +endef + +define Package/bash/description + Bash is an sh-compatible command language interpreter that executes + commands read from the standard input or from a file. Bash also + incorporates useful features from the Korn and C shells (ksh and csh). +endef + + +define Build/Configure + $(call Build/Configure/Default, \ + --without-bash-malloc \ + --bindir=/bin \ + ) +endef + + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/builtins LDFLAGS_FOR_BUILD= mkbuiltins + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SHELL="/bin/bash" \ + all install +endef + +define Package/bash/postinst +#!/bin/sh +grep bash $${IPKG_INSTROOT}/etc/shells || \ + echo "/bin/bash" >> $${IPKG_INSTROOT}/etc/shells + echo "/bin/rbash" >> $${IPKG_INSTROOT}/etc/shells +endef + +define Package/bash/install + $(INSTALL_DIR) $(1)/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/bin/bash $(1)/bin/ + ln -sf bash $(1)/bin/rbash +endef + + +$(eval $(call BuildPackage,bash)) diff --git a/trunk/package/feeds/packages/bash/patches/001-compile-fix.patch b/trunk/package/feeds/packages/bash/patches/001-compile-fix.patch new file mode 100644 index 00000000..7efa97b3 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/001-compile-fix.patch @@ -0,0 +1,15 @@ +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2369,7 +2369,11 @@ execute_pipeline (command, asynchronous, + /* If the `lastpipe' option is set with shopt, and job control is not + enabled, execute the last element of non-async pipelines in the + current shell environment. */ +- if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) ++ if (lastpipe_opt && ++#if defined(JOB_CONTROL) ++ job_control == 0 && ++#endif ++ asynchronous == 0 && pipe_out == NO_PIPE && prev > 0) + { + lstdin = move_to_high_fd (0, 1, -1); + if (lstdin > 0) diff --git a/trunk/package/feeds/packages/bash/patches/002-force-internal-readline.patch b/trunk/package/feeds/packages/bash/patches/002-force-internal-readline.patch new file mode 100644 index 00000000..050e4763 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/002-force-internal-readline.patch @@ -0,0 +1,24 @@ +--- a/configure ++++ b/configure +@@ -5430,8 +5430,7 @@ if test $opt_readline = yes; then + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in +- darwin[89]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; +- *) READLINE_LIB=-lreadline ;; ++ *) READLINE_LIB='${READLINE_LIBRARY}' ;; + esac + fi + else +--- a/configure.ac ++++ b/configure.ac +@@ -578,8 +578,7 @@ if test $opt_readline = yes; then + # static version specified as -llibname to override the + # dynamic version + case "${host_os}" in +- darwin[[89]]*|darwin10*) READLINE_LIB='${READLINE_LIBRARY}' ;; +- *) READLINE_LIB=-lreadline ;; ++ *) READLINE_LIB='${READLINE_LIBRARY}' ;; + esac + fi + else diff --git a/trunk/package/feeds/packages/bash/patches/101-upstream-bash43-001.patch b/trunk/package/feeds/packages/bash/patches/101-upstream-bash43-001.patch new file mode 100644 index 00000000..3231273a --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/101-upstream-bash43-001.patch @@ -0,0 +1,49 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-001 + +Bug-Reported-by: NBaH +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00092.html + +Bug-Description: + +A missing check for a valid option prevented `test -R' from working. There +is another problem that causes bash to look up the wrong variable name when +processing the argument to `test -R'. + +Patch (apply with `patch -p0'): + +--- a/test.c ++++ b/test.c +@@ -646,8 +646,8 @@ unary_test (op, arg) + return (v && invisible_p (v) == 0 && var_isset (v) ? TRUE : FALSE); + + case 'R': +- v = find_variable (arg); +- return (v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v) ? TRUE : FALSE); ++ v = find_variable_noref (arg); ++ return ((v && invisible_p (v) == 0 && var_isset (v) && nameref_p (v)) ? TRUE : FALSE); + } + + /* We can't actually get here, but this shuts up gcc. */ +@@ -723,6 +723,7 @@ test_unop (op) + case 'o': case 'p': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': case 'z': + case 'G': case 'L': case 'O': case 'S': case 'N': ++ case 'R': + return (1); + } + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 0 ++#define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/102-upstream-bash43-002.patch b/trunk/package/feeds/packages/bash/patches/102-upstream-bash43-002.patch new file mode 100644 index 00000000..35421e86 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/102-upstream-bash43-002.patch @@ -0,0 +1,49 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-002 + +Bug-Reported-by: Moe Tunes +Bug-Reference-ID: <53103F49.3070100@gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00086.html + +Bug-Description: + +A change to save state while running the DEBUG trap caused pipelines to hang +on systems which need process group synchronization while building pipelines. + +Patch (apply with `patch -p0'): + +--- a/trap.c ++++ b/trap.c +@@ -920,7 +920,8 @@ _run_trap_internal (sig, tag) + subst_assign_varlist = 0; + + #if defined (JOB_CONTROL) +- save_pipeline (1); /* XXX only provides one save level */ ++ if (sig != DEBUG_TRAP) /* run_debug_trap does this */ ++ save_pipeline (1); /* XXX only provides one save level */ + #endif + + /* If we're in a function, make sure return longjmps come here, too. */ +@@ -940,7 +941,8 @@ _run_trap_internal (sig, tag) + trap_exit_value = last_command_exit_value; + + #if defined (JOB_CONTROL) +- restore_pipeline (1); ++ if (sig != DEBUG_TRAP) /* run_debug_trap does this */ ++ restore_pipeline (1); + #endif + + subst_assign_varlist = save_subst_varlist; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 1 ++#define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/103-upstream-bash43-003.patch b/trunk/package/feeds/packages/bash/patches/103-upstream-bash43-003.patch new file mode 100644 index 00000000..7c9e56bc --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/103-upstream-bash43-003.patch @@ -0,0 +1,39 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-003 + +Bug-Reported-by: Anatol Pomozov +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html + +Bug-Description: + +When in callback mode, some readline commands can cause readline to seg +fault by passing invalid contexts to callback functions. + +Patch (apply with `patch -p0'): + +--- a/lib/readline/readline.c ++++ b/lib/readline/readline.c +@@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt) + r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ)); + + RL_CHECK_SIGNALS (); +- if (r == 0) /* success! */ ++ /* We only treat values < 0 specially to simulate recursion. */ ++ if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0)) /* success! or failure! */ + { + _rl_keyseq_chain_dispose (); + RL_UNSETSTATE (RL_STATE_MULTIKEY); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 2 ++#define PATCHLEVEL 3 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/104-upstream-bash43-004.patch b/trunk/package/feeds/packages/bash/patches/104-upstream-bash43-004.patch new file mode 100644 index 00000000..40ac35fd --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/104-upstream-bash43-004.patch @@ -0,0 +1,38 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-004 + +Bug-Reported-by: Daan van Rossum +Bug-Reference-ID: <20140307072523.GA14250@flash.uchicago.edu> +Bug-Reference-URL: + +Bug-Description: + +The `.' command in vi mode cannot undo multi-key commands beginning with +`c', `d', and `y' (command plus motion specifier). + +Patch (apply with `patch -p0'): + +--- a/lib/readline/readline.c ++++ b/lib/readline/readline.c +@@ -965,7 +965,7 @@ _rl_dispatch_subseq (key, map, got_subse + #if defined (VI_MODE) + if (rl_editing_mode == vi_mode && _rl_keymap == vi_movement_keymap && + key != ANYOTHERKEY && +- rl_key_sequence_length == 1 && /* XXX */ ++ _rl_dispatching_keymap == vi_movement_keymap && + _rl_vi_textmod_command (key)) + _rl_vi_set_last (key, rl_numeric_arg, rl_arg_sign); + #endif +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 3 ++#define PATCHLEVEL 4 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/105-upstream-bash43-005.patch b/trunk/package/feeds/packages/bash/patches/105-upstream-bash43-005.patch new file mode 100644 index 00000000..1cc54738 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/105-upstream-bash43-005.patch @@ -0,0 +1,50 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-005 + +Bug-Reported-by: David Sines +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00037.html + +Bug-Description: + +When in Posix mode, bash did not correctly interpret the ANSI-C-style +$'...' quoting mechanism when performing pattern substitution word +expansions within double quotes. + +Patch (apply with `patch -p0'): + +--- a/parse.y ++++ b/parse.y +@@ -3398,7 +3398,7 @@ parse_matched_pair (qc, open, close, len + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ +- if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') ++ if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs +--- a/y.tab.c ++++ b/y.tab.c +@@ -5710,7 +5710,7 @@ parse_matched_pair (qc, open, close, len + within a double-quoted ${...} construct "an even number of + unescaped double-quotes or single-quotes, if any, shall occur." */ + /* This was changed in Austin Group Interp 221 */ +- if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') ++ if MBTEST(posixly_correct && shell_compatibility_level > 41 && dolbrace_state != DOLBRACE_QUOTE && dolbrace_state != DOLBRACE_QUOTE2 && (flags & P_DQUOTE) && (flags & P_DOLBRACE) && ch == '\'') + continue; + + /* Could also check open == '`' if we want to parse grouping constructs +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 4 ++#define PATCHLEVEL 5 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/106-upstream-bash43-006.patch b/trunk/package/feeds/packages/bash/patches/106-upstream-bash43-006.patch new file mode 100644 index 00000000..c5f52b1d --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/106-upstream-bash43-006.patch @@ -0,0 +1,39 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-006 + +Bug-Reported-by: Eduardo A . Bustamante Lopez +Bug-Reference-ID: <20140228170013.GA16015@dualbus.me> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-02/msg00091.html + +Bug-Description: + +A shell that started with job control active but was not interactive left +the terminal in the wrong process group when exiting, causing its parent +shell to get a stop signal when it attempted to read from the terminal. + +Patch (apply with `patch -p0'): + +--- a/jobs.c ++++ b/jobs.c +@@ -4374,7 +4374,7 @@ without_job_control () + void + end_job_control () + { +- if (interactive_shell) /* XXX - should it be interactive? */ ++ if (interactive_shell || job_control) /* XXX - should it be just job_control? */ + { + terminate_stopped_jobs (); + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 5 ++#define PATCHLEVEL 6 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/107-upstream-bash43-007.patch b/trunk/package/feeds/packages/bash/patches/107-upstream-bash43-007.patch new file mode 100644 index 00000000..8578bd45 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/107-upstream-bash43-007.patch @@ -0,0 +1,45 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-007 + +Bug-Reported-by: geir.hauge@gmail.com +Bug-Reference-ID: <20140318093650.B181C1C5B0B@gina.itea.ntnu.no> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00095.html + +Bug-Description: + +Using compound assignments for associative arrays like + +assoc=( [x]= [y]=bar ) + +left the value corresponding to the key `x' NULL. This caused subsequent +lookups to interpret it as unset. + +Patch (apply with `patch -p0'): + +--- a/arrayfunc.c ++++ b/arrayfunc.c +@@ -597,6 +597,11 @@ assign_compound_array_list (var, nlist, + if (assoc_p (var)) + { + val = expand_assignment_string_to_string (val, 0); ++ if (val == 0) ++ { ++ val = (char *)xmalloc (1); ++ val[0] = '\0'; /* like do_assignment_internal */ ++ } + free_val = 1; + } + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 6 ++#define PATCHLEVEL 7 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/108-upstream-bash43-008.patch b/trunk/package/feeds/packages/bash/patches/108-upstream-bash43-008.patch new file mode 100644 index 00000000..24020216 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/108-upstream-bash43-008.patch @@ -0,0 +1,148 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-008 + +Bug-Reported-by: Stephane Chazelas +Bug-Reference-ID: <20140318135901.GB22158@chaz.gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00098.html + +Bug-Description: + +Some extended glob patterns incorrectly matched filenames with a leading +dot, regardless of the setting of the `dotglob' option. + +Patch (apply with `patch -p0'): + +--- a/lib/glob/gmisc.c ++++ b/lib/glob/gmisc.c +@@ -210,6 +210,7 @@ extglob_pattern_p (pat) + case '+': + case '!': + case '@': ++ case '?': + return (pat[1] == LPAREN); + default: + return 0; +--- a/lib/glob/glob.c ++++ b/lib/glob/glob.c +@@ -179,42 +179,50 @@ extglob_skipname (pat, dname, flags) + char *pat, *dname; + int flags; + { +- char *pp, *pe, *t; +- int n, r; ++ char *pp, *pe, *t, *se; ++ int n, r, negate; + ++ negate = *pat == '!'; + pp = pat + 2; +- pe = pp + strlen (pp) - 1; /*(*/ +- if (*pe != ')') +- return 0; +- if ((t = strchr (pp, '|')) == 0) /* easy case first */ ++ se = pp + strlen (pp) - 1; /* end of string */ ++ pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ ++ /* we should check for invalid extglob pattern here */ ++ /* if pe != se we have more of the pattern at the end of the extglob ++ pattern. Check the easy case first ( */ ++ if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) + { + *pe = '\0'; ++#if defined (HANDLE_MULTIBYTE) ++ r = mbskipname (pp, dname, flags); ++#else + r = skipname (pp, dname, flags); /*(*/ ++#endif + *pe = ')'; + return r; + } ++ ++ /* check every subpattern */ + while (t = glob_patscan (pp, pe, '|')) + { + n = t[-1]; + t[-1] = '\0'; ++#if defined (HANDLE_MULTIBYTE) ++ r = mbskipname (pp, dname, flags); ++#else + r = skipname (pp, dname, flags); ++#endif + t[-1] = n; + if (r == 0) /* if any pattern says not skip, we don't skip */ + return r; + pp = t; + } /*(*/ + +- if (pp == pe) /* glob_patscan might find end of pattern */ ++ /* glob_patscan might find end of pattern */ ++ if (pp == se) + return r; + +- *pe = '\0'; +-# if defined (HANDLE_MULTIBYTE) +- r = mbskipname (pp, dname, flags); /*(*/ +-# else +- r = skipname (pp, dname, flags); /*(*/ +-# endif +- *pe = ')'; +- return r; ++ /* but if it doesn't then we didn't match a leading dot */ ++ return 0; + } + #endif + +@@ -277,20 +285,23 @@ wextglob_skipname (pat, dname, flags) + int flags; + { + #if EXTENDED_GLOB +- wchar_t *pp, *pe, *t, n; +- int r; ++ wchar_t *pp, *pe, *t, n, *se; ++ int r, negate; + ++ negate = *pat == L'!'; + pp = pat + 2; +- pe = pp + wcslen (pp) - 1; /*(*/ +- if (*pe != L')') +- return 0; +- if ((t = wcschr (pp, L'|')) == 0) ++ se = pp + wcslen (pp) - 1; /*(*/ ++ pe = glob_patscan_wc (pp, se, 0); ++ ++ if (pe == se && *pe == ')' && (t = wcschr (pp, L'|')) == 0) + { + *pe = L'\0'; + r = wchkname (pp, dname); /*(*/ + *pe = L')'; + return r; + } ++ ++ /* check every subpattern */ + while (t = glob_patscan_wc (pp, pe, '|')) + { + n = t[-1]; +@@ -305,10 +316,8 @@ wextglob_skipname (pat, dname, flags) + if (pp == pe) /* glob_patscan_wc might find end of pattern */ + return r; + +- *pe = L'\0'; +- r = wchkname (pp, dname); /*(*/ +- *pe = L')'; +- return r; ++ /* but if it doesn't then we didn't match a leading dot */ ++ return 0; + #else + return (wchkname (pat, dname)); + #endif +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 7 ++#define PATCHLEVEL 8 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/109-upstream-bash43-009.patch b/trunk/package/feeds/packages/bash/patches/109-upstream-bash43-009.patch new file mode 100644 index 00000000..f222bd67 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/109-upstream-bash43-009.patch @@ -0,0 +1,51 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-009 + +Bug-Reported-by: Matthias Klose +Bug-Reference-ID: <53346FC8.6090005@debian.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00171.html + +Bug-Description: + +There is a problem with unsigned sign extension when attempting to reallocate +the input line when it is fewer than 3 characters long and there has been a +history expansion. The sign extension causes the shell to not reallocate the +line, which results in a segmentation fault when it writes past the end. + +Patch (apply with `patch -p0'): + +--- a/parse.y ++++ b/parse.y +@@ -2424,7 +2424,7 @@ shell_getc (remove_quoted_newline) + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { +- if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) ++ if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + +--- a/y.tab.c ++++ b/y.tab.c +@@ -4736,7 +4736,7 @@ shell_getc (remove_quoted_newline) + not already end in an EOF character. */ + if (shell_input_line_terminator != EOF) + { +- if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) ++ if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) + shell_input_line = (char *)xrealloc (shell_input_line, + 1 + (shell_input_line_size += 2)); + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 8 ++#define PATCHLEVEL 9 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/110-upstream-bash43-010.patch b/trunk/package/feeds/packages/bash/patches/110-upstream-bash43-010.patch new file mode 100644 index 00000000..22d9f1ba --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/110-upstream-bash43-010.patch @@ -0,0 +1,145 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-010 + +Bug-Reported-by: Albert Shih +Bug-Reference-ID: Wed, 5 Mar 2014 23:01:40 +0100 +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00028.html + +Bug-Description: + +Patch (apply with `patch -p0'): + +This patch changes the behavior of programmable completion to compensate +for two assumptions made by the bash-completion package. Bash-4.3 changed +to dequote the argument to programmable completion only under certain +circumstances, to make the behavior of compgen more consistent when run +from the command line -- closer to the behavior when run by a shell function +run as part of programmable completion. Bash-completion can pass quoted +arguments to compgen when the original word to be completed was not quoted, +expecting programmable completion to dequote the word before attempting +completion. + +This patch fixes two cases: + +1. An empty string that bash-completion passes to compgen as a quoted null + string (''). + +2. An unquoted word that bash-completion quotes using single quotes or + backslashes before passing it to compgen. + +In these cases, since readline did not detect a quote character in the original +word to be completed, bash-4.3 + +--- a/externs.h ++++ b/externs.h +@@ -324,6 +324,7 @@ extern char *sh_un_double_quote __P((cha + extern char *sh_backslash_quote __P((char *, const char *, int)); + extern char *sh_backslash_quote_for_double_quotes __P((char *)); + extern int sh_contains_shell_metas __P((char *)); ++extern int sh_contains_quotes __P((char *)); + + /* declarations for functions defined in lib/sh/spell.c */ + extern int spname __P((char *, char *)); +--- a/lib/sh/shquote.c ++++ b/lib/sh/shquote.c +@@ -311,3 +311,17 @@ sh_contains_shell_metas (string) + + return (0); + } ++ ++int ++sh_contains_quotes (string) ++ char *string; ++{ ++ char *s; ++ ++ for (s = string; s && *s; s++) ++ { ++ if (*s == '\'' || *s == '"' || *s == '\\') ++ return 1; ++ } ++ return 0; ++} +--- a/pcomplete.c ++++ b/pcomplete.c +@@ -183,6 +183,7 @@ ITEMLIST it_variables = { LIST_DYNAMIC, + + COMPSPEC *pcomp_curcs; + const char *pcomp_curcmd; ++const char *pcomp_curtxt; + + #ifdef DEBUG + /* Debugging code */ +@@ -753,6 +754,32 @@ pcomp_filename_completion_function (text + quoted strings. */ + dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + } ++ /* Intended to solve a mismatched assumption by bash-completion. If ++ the text to be completed is empty, but bash-completion turns it into ++ a quoted string ('') assuming that this code will dequote it before ++ calling readline, do the dequoting. */ ++ else if (iscompgen && iscompleting && ++ pcomp_curtxt && *pcomp_curtxt == 0 && ++ text && (*text == '\'' || *text == '"') && text[1] == text[0] && text[2] == 0 && ++ rl_filename_dequoting_function) ++ dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); ++ /* Another mismatched assumption by bash-completion. If compgen is being ++ run as part of bash-completion, and the argument to compgen is not ++ the same as the word originally passed to the programmable completion ++ code, dequote the argument if it has quote characters. It's an ++ attempt to detect when bash-completion is quoting its filename ++ argument before calling compgen. */ ++ /* We could check whether gen_shell_function_matches is in the call ++ stack by checking whether the gen-shell-function-matches tag is in ++ the unwind-protect stack, but there's no function to do that yet. ++ We could simply check whether we're executing in a function by ++ checking variable_context, and may end up doing that. */ ++ else if (iscompgen && iscompleting && rl_filename_dequoting_function && ++ pcomp_curtxt && text && ++ STREQ (pcomp_curtxt, text) == 0 && ++ variable_context && ++ sh_contains_quotes (text)) /* guess */ ++ dfn = (*rl_filename_dequoting_function) ((char *)text, rl_completion_quote_character); + else + dfn = savestring (text); + } +@@ -1522,7 +1549,7 @@ gen_progcomp_completions (ocmd, cmd, wor + COMPSPEC **lastcs; + { + COMPSPEC *cs, *oldcs; +- const char *oldcmd; ++ const char *oldcmd, *oldtxt; + STRINGLIST *ret; + + cs = progcomp_search (ocmd); +@@ -1545,14 +1572,17 @@ gen_progcomp_completions (ocmd, cmd, wor + + oldcs = pcomp_curcs; + oldcmd = pcomp_curcmd; ++ oldtxt = pcomp_curtxt; + + pcomp_curcs = cs; + pcomp_curcmd = cmd; ++ pcomp_curtxt = word; + + ret = gen_compspec_completions (cs, cmd, word, start, end, foundp); + + pcomp_curcs = oldcs; + pcomp_curcmd = oldcmd; ++ pcomp_curtxt = oldtxt; + + /* We need to conditionally handle setting *retryp here */ + if (retryp) +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 9 ++#define PATCHLEVEL 10 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/111-upstream-bash43-011.patch b/trunk/package/feeds/packages/bash/patches/111-upstream-bash43-011.patch new file mode 100644 index 00000000..b4c181a3 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/111-upstream-bash43-011.patch @@ -0,0 +1,40 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-011 + +Bug-Reported-by: Egmont Koblinger +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00153.html + +Bug-Description: + +The signal handling changes to bash and readline (to avoid running any code +in a signal handler context) cause the cursor to be placed on the wrong +line of a multi-line command after a ^C interrupts editing. + +Patch (apply with `patch -p0'): + +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -2677,7 +2677,8 @@ _rl_clean_up_for_exit () + { + if (_rl_echoing_p) + { +- _rl_move_vert (_rl_vis_botlin); ++ if (_rl_vis_botlin > 0) /* minor optimization plus bug fix */ ++ _rl_move_vert (_rl_vis_botlin); + _rl_vis_botlin = 0; + fflush (rl_outstream); + rl_restart_output (1, 0); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 10 ++#define PATCHLEVEL 11 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/112-upstream-bash43-012.patch b/trunk/package/feeds/packages/bash/patches/112-upstream-bash43-012.patch new file mode 100644 index 00000000..8fd2ea67 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/112-upstream-bash43-012.patch @@ -0,0 +1,38 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-012 + +Bug-Reported-by: Eduardo A. Bustamante López +Bug-Reference-ID: <5346B54C.4070205@case.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00051.html + +Bug-Description: + +When a SIGCHLD trap runs a command containing a shell builtin while +a script is running `wait' to wait for all running children to complete, +the SIGCHLD trap will not be run once for each child that terminates. + +Patch (apply with `patch -p0'): + +--- a/jobs.c ++++ b/jobs.c +@@ -3597,6 +3597,7 @@ run_sigchld_trap (nchild) + unwind_protect_int (jobs_list_frozen); + unwind_protect_pointer (the_pipeline); + unwind_protect_pointer (subst_assign_varlist); ++ unwind_protect_pointer (this_shell_builtin); + + /* We have to add the commands this way because they will be run + in reverse order of adding. We don't want maybe_set_sigchld_trap () +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 11 ++#define PATCHLEVEL 12 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/113-upstream-bash43-013.patch b/trunk/package/feeds/packages/bash/patches/113-upstream-bash43-013.patch new file mode 100644 index 00000000..63c6c1ed --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/113-upstream-bash43-013.patch @@ -0,0 +1,52 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-013 + +Bug-Reported-by: +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00069.html + +Bug-Description: + +Using reverse-i-search when horizontal scrolling is enabled does not redisplay +the entire line containing the successful search results. + +Patch (apply with `patch -p0'): +--- a/lib/readline/display.c ++++ b/lib/readline/display.c +@@ -1637,7 +1637,7 @@ update_line (old, new, current_line, oma + /* If we are changing the number of invisible characters in a line, and + the spot of first difference is before the end of the invisible chars, + lendiff needs to be adjusted. */ +- if (current_line == 0 && !_rl_horizontal_scroll_mode && ++ if (current_line == 0 && /* !_rl_horizontal_scroll_mode && */ + current_invis_chars != visible_wrap_offset) + { + if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) +@@ -1825,8 +1825,13 @@ update_line (old, new, current_line, oma + else + _rl_last_c_pos += bytes_to_insert; + ++ /* XXX - we only want to do this if we are at the end of the line ++ so we move there with _rl_move_cursor_relative */ + if (_rl_horizontal_scroll_mode && ((oe-old) > (ne-new))) +- goto clear_rest_of_line; ++ { ++ _rl_move_cursor_relative (ne-new, new); ++ goto clear_rest_of_line; ++ } + } + } + /* Otherwise, print over the existing material. */ +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 12 ++#define PATCHLEVEL 13 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/114-upstream-bash43-014.patch b/trunk/package/feeds/packages/bash/patches/114-upstream-bash43-014.patch new file mode 100644 index 00000000..99e16b9a --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/114-upstream-bash43-014.patch @@ -0,0 +1,95 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-014 + +Bug-Reported-by: Greg Wooledge +Bug-Reference-ID: <20140418202123.GB7660@eeg.ccf.org> +Bug-Reference-URL: http://lists.gnu.org/archive/html/help-bash/2014-04/msg00004.html + +Bug-Description: + +Under certain circumstances, $@ is expanded incorrectly in contexts where +word splitting is not performed. + +Patch (apply with `patch -p0'): +--- a/subst.c ++++ b/subst.c +@@ -3248,8 +3248,10 @@ cond_expand_word (w, special) + if (w->word == 0 || w->word[0] == '\0') + return ((char *)NULL); + ++ expand_no_split_dollar_star = 1; + w->flags |= W_NOSPLIT2; + l = call_expand_word_internal (w, 0, 0, (int *)0, (int *)0); ++ expand_no_split_dollar_star = 0; + if (l) + { + if (special == 0) /* LHS */ +@@ -7847,6 +7849,10 @@ param_expand (string, sindex, quoted, ex + We also want to make sure that splitting is done no matter what -- + according to POSIX.2, this expands to a list of the positional + parameters no matter what IFS is set to. */ ++ /* XXX - what to do when in a context where word splitting is not ++ performed? Even when IFS is not the default, posix seems to imply ++ that we behave like unquoted $* ? Maybe we should use PF_NOSPLIT2 ++ here. */ + temp = string_list_dollar_at (list, (pflags & PF_ASSIGNRHS) ? (quoted|Q_DOUBLE_QUOTES) : quoted); + + tflag |= W_DOLLARAT; +@@ -8816,6 +8822,7 @@ finished_with_string: + else + { + char *ifs_chars; ++ char *tstring; + + ifs_chars = (quoted_dollar_at || has_dollar_at) ? ifs_value : (char *)NULL; + +@@ -8830,11 +8837,36 @@ finished_with_string: + regardless of what else has happened to IFS since the expansion. */ + if (split_on_spaces) + list = list_string (istring, " ", 1); /* XXX quoted == 1? */ ++ /* If we have $@ (has_dollar_at != 0) and we are in a context where we ++ don't want to split the result (W_NOSPLIT2), and we are not quoted, ++ we have already separated the arguments with the first character of ++ $IFS. In this case, we want to return a list with a single word ++ with the separator possibly replaced with a space (it's what other ++ shells seem to do). ++ quoted_dollar_at is internal to this function and is set if we are ++ passed an argument that is unquoted (quoted == 0) but we encounter a ++ double-quoted $@ while expanding it. */ ++ else if (has_dollar_at && quoted_dollar_at == 0 && ifs_chars && quoted == 0 && (word->flags & W_NOSPLIT2)) ++ { ++ /* Only split and rejoin if we have to */ ++ if (*ifs_chars && *ifs_chars != ' ') ++ { ++ list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); ++ tstring = string_list (list); ++ } ++ else ++ tstring = istring; ++ tword = make_bare_word (tstring); ++ if (tstring != istring) ++ free (tstring); ++ goto set_word_flags; ++ } + else if (has_dollar_at && ifs_chars) + list = list_string (istring, *ifs_chars ? ifs_chars : " ", 1); + else + { + tword = make_bare_word (istring); ++set_word_flags: + if ((quoted & (Q_DOUBLE_QUOTES|Q_HERE_DOCUMENT)) || (quoted_state == WHOLLY_QUOTED)) + tword->flags |= W_QUOTED; + if (word->flags & W_ASSIGNMENT) +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 13 ++#define PATCHLEVEL 14 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/115-upstream-bash43-015.patch b/trunk/package/feeds/packages/bash/patches/115-upstream-bash43-015.patch new file mode 100644 index 00000000..ae8be2d9 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/115-upstream-bash43-015.patch @@ -0,0 +1,48 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-015 + +Bug-Reported-by: Clark Wang +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00095.html + +Bug-Description: + +When completing directory names, the directory name is dequoted twice. +This causes problems for directories with single and double quotes in +their names. + +Patch (apply with `patch -p0'): +--- a/bashline.c ++++ b/bashline.c +@@ -4167,9 +4167,16 @@ bash_directory_completion_matches (text) + int qc; + + qc = rl_dispatching ? rl_completion_quote_character : 0; +- dfn = bash_dequote_filename ((char *)text, qc); ++ /* If rl_completion_found_quote != 0, rl_completion_matches will call the ++ filename dequoting function, causing the directory name to be dequoted ++ twice. */ ++ if (rl_dispatching && rl_completion_found_quote == 0) ++ dfn = bash_dequote_filename ((char *)text, qc); ++ else ++ dfn = (char *)text; + m1 = rl_completion_matches (dfn, rl_filename_completion_function); +- free (dfn); ++ if (dfn != text) ++ free (dfn); + + if (m1 == 0 || m1[0] == 0) + return m1; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 14 ++#define PATCHLEVEL 15 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/116-upstream-bash43-016.patch b/trunk/package/feeds/packages/bash/patches/116-upstream-bash43-016.patch new file mode 100644 index 00000000..3ce37f62 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/116-upstream-bash43-016.patch @@ -0,0 +1,121 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-016 + +Bug-Reported-by: Pierre Gaston +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00100.html + +Bug-Description: + +An extended glob pattern containing a slash (`/') causes the globbing code +to misinterpret it as a directory separator. + +Patch (apply with `patch -p0'): +--- a/lib/glob/glob.c ++++ b/lib/glob/glob.c +@@ -123,6 +123,8 @@ static char **glob_dir_to_array __P((cha + extern char *glob_patscan __P((char *, char *, int)); + extern wchar_t *glob_patscan_wc __P((wchar_t *, wchar_t *, int)); + ++extern char *glob_dirscan __P((char *, int)); ++ + /* Compile `glob_loop.c' for single-byte characters. */ + #define CHAR unsigned char + #define INT int +@@ -187,6 +189,9 @@ extglob_skipname (pat, dname, flags) + se = pp + strlen (pp) - 1; /* end of string */ + pe = glob_patscan (pp, se, 0); /* end of extglob pattern (( */ + /* we should check for invalid extglob pattern here */ ++ if (pe == 0) ++ return 0; ++ + /* if pe != se we have more of the pattern at the end of the extglob + pattern. Check the easy case first ( */ + if (pe == se && *pe == ')' && (t = strchr (pp, '|')) == 0) +@@ -1015,7 +1020,7 @@ glob_filename (pathname, flags) + { + char **result; + unsigned int result_size; +- char *directory_name, *filename, *dname; ++ char *directory_name, *filename, *dname, *fn; + unsigned int directory_len; + int free_dirname; /* flag */ + int dflags; +@@ -1031,6 +1036,18 @@ glob_filename (pathname, flags) + + /* Find the filename. */ + filename = strrchr (pathname, '/'); ++#if defined (EXTENDED_GLOB) ++ if (filename && extended_glob) ++ { ++ fn = glob_dirscan (pathname, '/'); ++#if DEBUG_MATCHING ++ if (fn != filename) ++ fprintf (stderr, "glob_filename: glob_dirscan: fn (%s) != filename (%s)\n", fn ? fn : "(null)", filename); ++#endif ++ filename = fn; ++ } ++#endif ++ + if (filename == NULL) + { + filename = pathname; +--- a/lib/glob/gmisc.c ++++ b/lib/glob/gmisc.c +@@ -42,6 +42,8 @@ + #define WLPAREN L'(' + #define WRPAREN L')' + ++extern char *glob_patscan __P((char *, char *, int)); ++ + /* Return 1 of the first character of WSTRING could match the first + character of pattern WPAT. Wide character version. */ + int +@@ -375,3 +377,34 @@ bad_bracket: + + return matlen; + } ++ ++/* Skip characters in PAT and return the final occurrence of DIRSEP. This ++ is only called when extended_glob is set, so we have to skip over extglob ++ patterns x(...) */ ++char * ++glob_dirscan (pat, dirsep) ++ char *pat; ++ int dirsep; ++{ ++ char *p, *d, *pe, *se; ++ ++ d = pe = se = 0; ++ for (p = pat; p && *p; p++) ++ { ++ if (extglob_pattern_p (p)) ++ { ++ if (se == 0) ++ se = p + strlen (p) - 1; ++ pe = glob_patscan (p + 2, se, 0); ++ if (pe == 0) ++ continue; ++ else if (*pe == 0) ++ break; ++ p = pe - 1; /* will do increment above */ ++ continue; ++ } ++ if (*p == dirsep) ++ d = p; ++ } ++ return d; ++} +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 15 ++#define PATCHLEVEL 16 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/117-upstream-bash43-017.patch b/trunk/package/feeds/packages/bash/patches/117-upstream-bash43-017.patch new file mode 100644 index 00000000..9c7eecc9 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/117-upstream-bash43-017.patch @@ -0,0 +1,41 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-017 + +Bug-Reported-by: Dan Douglas +Bug-Reference-ID: <7781746.RhfoTROLxF@smorgbox> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00026.html + +Bug-Description: + +The code that creates local variables should not clear the `invisible' +attribute when returning an existing local variable. Let the code that +actually assigns a value clear it. + +Patch (apply with `patch -p0'): +--- a/variables.c ++++ b/variables.c +@@ -2197,10 +2197,7 @@ make_local_variable (name) + /* local foo; local foo; is a no-op. */ + old_var = find_variable (name); + if (old_var && local_p (old_var) && old_var->context == variable_context) +- { +- VUNSETATTR (old_var, att_invisible); /* XXX */ +- return (old_var); +- } ++ return (old_var); + + was_tmpvar = old_var && tempvar_p (old_var); + /* If we're making a local variable in a shell function, the temporary env +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 16 ++#define PATCHLEVEL 17 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/118-upstream-bash43-018.patch b/trunk/package/feeds/packages/bash/patches/118-upstream-bash43-018.patch new file mode 100644 index 00000000..095ca932 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/118-upstream-bash43-018.patch @@ -0,0 +1,38 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-018 + +Bug-Reported-by: Geir Hauge +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-05/msg00040.html + +Bug-Description: + +When assigning an array variable using the compound assignment syntax, +but using `declare' with the rhs of the compound assignment quoted, the +shell did not mark the variable as visible after successfully performing +the assignment. + +Patch (apply with `patch -p0'): +--- a/arrayfunc.c ++++ b/arrayfunc.c +@@ -179,6 +179,7 @@ bind_array_var_internal (entry, ind, key + array_insert (array_cell (entry), ind, newval); + FREE (newval); + ++ VUNSETATTR (entry, att_invisible); /* no longer invisible */ + return (entry); + } + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 17 ++#define PATCHLEVEL 18 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/119-upstream-bash43-019.patch b/trunk/package/feeds/packages/bash/patches/119-upstream-bash43-019.patch new file mode 100644 index 00000000..2d0fa440 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/119-upstream-bash43-019.patch @@ -0,0 +1,75 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-019 + +Bug-Reported-by: John Lenton +Bug-Reference-ID: +Bug-Reference-URL: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1317476 + +Bug-Description: + +The -t timeout option to `read' does not work when the -e option is used. + +Patch (apply with `patch -p0'): + +--- a/lib/readline/input.c ++++ b/lib/readline/input.c +@@ -534,8 +534,16 @@ rl_getc (stream) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); + else if (_rl_caught_signal == SIGHUP || _rl_caught_signal == SIGTERM) + return (RL_ISSTATE (RL_STATE_READCMD) ? READERR : EOF); ++ /* keyboard-generated signals of interest */ + else if (_rl_caught_signal == SIGINT || _rl_caught_signal == SIGQUIT) + RL_CHECK_SIGNALS (); ++ /* non-keyboard-generated signals of interest */ ++ else if (_rl_caught_signal == SIGALRM ++#if defined (SIGVTALRM) ++ || _rl_caught_signal == SIGVTALRM ++#endif ++ ) ++ RL_CHECK_SIGNALS (); + + if (rl_signal_event_hook) + (*rl_signal_event_hook) (); +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -442,7 +442,10 @@ read_builtin (list) + add_unwind_protect (reset_alarm, (char *)NULL); + #if defined (READLINE) + if (edit) +- add_unwind_protect (reset_attempted_completion_function, (char *)NULL); ++ { ++ add_unwind_protect (reset_attempted_completion_function, (char *)NULL); ++ add_unwind_protect (bashline_reset_event_hook, (char *)NULL); ++ } + #endif + falarm (tmsec, tmusec); + } +@@ -1021,6 +1024,7 @@ edit_line (p, itext) + + old_attempted_completion_function = rl_attempted_completion_function; + rl_attempted_completion_function = (rl_completion_func_t *)NULL; ++ bashline_set_event_hook (); + if (itext) + { + old_startup_hook = rl_startup_hook; +@@ -1032,6 +1036,7 @@ edit_line (p, itext) + + rl_attempted_completion_function = old_attempted_completion_function; + old_attempted_completion_function = (rl_completion_func_t *)NULL; ++ bashline_reset_event_hook (); + + if (ret == 0) + return ret; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 18 ++#define PATCHLEVEL 19 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/120-upstream-bash43-020.patch b/trunk/package/feeds/packages/bash/patches/120-upstream-bash43-020.patch new file mode 100644 index 00000000..abf0c301 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/120-upstream-bash43-020.patch @@ -0,0 +1,93 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-020 + +Bug-Reported-by: Jared Yanovich +Bug-Reference-ID: <20140417073654.GB26875@nightderanger.psc.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00065.html + +Bug-Description: + +When PS2 contains a command substitution, here-documents entered in an +interactive shell can sometimes cause a segmentation fault. + +Patch (apply with `patch -p0'): + +--- a/shell.h ++++ b/shell.h +@@ -168,7 +168,8 @@ typedef struct _sh_parser_state_t { + /* flags state affecting the parser */ + int expand_aliases; + int echo_input_at_read; +- ++ int need_here_doc; ++ + } sh_parser_state_t; + + typedef struct _sh_input_line_state_t { +--- a/parse.y ++++ b/parse.y +@@ -2642,7 +2642,7 @@ gather_here_documents () + int r; + + r = 0; +- while (need_here_doc) ++ while (need_here_doc > 0) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); +@@ -6075,6 +6075,7 @@ save_parser_state (ps) + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; ++ ps->need_here_doc = need_here_doc; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; +@@ -6123,6 +6124,7 @@ restore_parser_state (ps) + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; ++ need_here_doc = ps->need_here_doc; + + FREE (token); + token = ps->token; +--- a/y.tab.c ++++ b/y.tab.c +@@ -4954,7 +4954,7 @@ gather_here_documents () + int r; + + r = 0; +- while (need_here_doc) ++ while (need_here_doc > 0) + { + parser_state |= PST_HEREDOC; + make_here_document (redir_stack[r++], line_number); +@@ -8387,6 +8387,7 @@ save_parser_state (ps) + + ps->expand_aliases = expand_aliases; + ps->echo_input_at_read = echo_input_at_read; ++ ps->need_here_doc = need_here_doc; + + ps->token = token; + ps->token_buffer_size = token_buffer_size; +@@ -8435,6 +8436,7 @@ restore_parser_state (ps) + + expand_aliases = ps->expand_aliases; + echo_input_at_read = ps->echo_input_at_read; ++ need_here_doc = ps->need_here_doc; + + FREE (token); + token = ps->token; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 19 ++#define PATCHLEVEL 20 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/121-upstream-bash43-021.patch b/trunk/package/feeds/packages/bash/patches/121-upstream-bash43-021.patch new file mode 100644 index 00000000..b7367a08 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/121-upstream-bash43-021.patch @@ -0,0 +1,46 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-021 + +Bug-Reported-by: Jared Yanovich +Bug-Reference-ID: <20140625225019.GJ17044@nightderanger.psc.edu> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00070.html + +Bug-Description: + +When the readline `revert-all-at-newline' option is set, pressing newline +when the current line is one retrieved from history results in a double free +and a segmentation fault. + +Patch (apply with `patch -p0'): + +--- a/lib/readline/misc.c ++++ b/lib/readline/misc.c +@@ -461,6 +461,7 @@ _rl_revert_all_lines () + saved_undo_list = 0; + /* Set up rl_line_buffer and other variables from history entry */ + rl_replace_from_history (entry, 0); /* entry->line is now current */ ++ entry->data = 0; /* entry->data is now current undo list */ + /* Undo all changes to this history entry */ + while (rl_undo_list) + rl_do_undo (); +@@ -468,7 +469,6 @@ _rl_revert_all_lines () + the timestamp. */ + FREE (entry->line); + entry->line = savestring (rl_line_buffer); +- entry->data = 0; + } + entry = previous_history (); + } +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 20 ++#define PATCHLEVEL 21 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/122-upstream-bash43-022.patch b/trunk/package/feeds/packages/bash/patches/122-upstream-bash43-022.patch new file mode 100644 index 00000000..4762be2a --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/122-upstream-bash43-022.patch @@ -0,0 +1,47 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-022 + +Bug-Reported-by: scorp.dev.null@gmail.com +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html + +Bug-Description: + +Using nested pipelines within loops with the `lastpipe' option set can result +in a segmentation fault. + +Patch (apply with `patch -p0'): + +--- a/execute_cmd.c ++++ b/execute_cmd.c +@@ -2409,7 +2409,16 @@ execute_pipeline (command, asynchronous, + #endif + lstdin = wait_for (lastpid); + #if defined (JOB_CONTROL) +- exec_result = job_exit_status (lastpipe_jid); ++ /* If wait_for removes the job from the jobs table, use result of last ++ command as pipeline's exit status as usual. The jobs list can get ++ frozen and unfrozen at inconvenient times if there are multiple pipelines ++ running simultaneously. */ ++ if (INVALID_JOB (lastpipe_jid) == 0) ++ exec_result = job_exit_status (lastpipe_jid); ++ else if (pipefail_opt) ++ exec_result = exec_result | lstdin; /* XXX */ ++ /* otherwise we use exec_result */ ++ + #endif + unfreeze_jobs_list (); + } +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 21 ++#define PATCHLEVEL 22 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/123-upstream-bash43-023.patch b/trunk/package/feeds/packages/bash/patches/123-upstream-bash43-023.patch new file mode 100644 index 00000000..8684c137 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/123-upstream-bash43-023.patch @@ -0,0 +1,78 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-023 + +Bug-Reported-by: Tim Friske +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00056.html + +Bug-Description: + +Bash does not correctly parse process substitution constructs that contain +unbalanced parentheses as part of the contained command. + +Patch (apply with `patch -p0'): + +--- a/subst.h ++++ b/subst.h +@@ -82,7 +82,7 @@ extern char *extract_arithmetic_subst __ + /* Extract the <( or >( construct in STRING, and return a new string. + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position just after the matching ")". */ +-extern char *extract_process_subst __P((char *, char *, int *)); ++extern char *extract_process_subst __P((char *, char *, int *, int)); + #endif /* PROCESS_SUBSTITUTION */ + + /* Extract the name of the variable to bind to from the assignment string. */ +--- a/subst.c ++++ b/subst.c +@@ -1192,12 +1192,18 @@ extract_arithmetic_subst (string, sindex + Start extracting at (SINDEX) as if we had just seen "<(". + Make (SINDEX) get the position of the matching ")". */ /*))*/ + char * +-extract_process_subst (string, starter, sindex) ++extract_process_subst (string, starter, sindex, xflags) + char *string; + char *starter; + int *sindex; ++ int xflags; + { ++#if 0 + return (extract_delimited_string (string, sindex, starter, "(", ")", SX_COMMAND)); ++#else ++ xflags |= (no_longjmp_on_fatal_error ? SX_NOLONGJMP : 0); ++ return (xparse_dolparen (string, string+*sindex, sindex, xflags)); ++#endif + } + #endif /* PROCESS_SUBSTITUTION */ + +@@ -1785,7 +1791,7 @@ skip_to_delim (string, start, delims, fl + si = i + 2; + if (string[si] == '\0') + CQ_RETURN(si); +- temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si); ++ temp = extract_process_subst (string, (c == '<') ? "<(" : ">(", &si, 0); + free (temp); /* no SX_ALLOC here */ + i = si; + if (string[i] == '\0') +@@ -8249,7 +8255,7 @@ add_string: + else + t_index = sindex + 1; /* skip past both '<' and LPAREN */ + +- temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index); /*))*/ ++ temp1 = extract_process_subst (string, (c == '<') ? "<(" : ">(", &t_index, 0); /*))*/ + sindex = t_index; + + /* If the process substitution specification is `<()', we want to +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 22 ++#define PATCHLEVEL 23 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/124-upstream-bash43-024.patch b/trunk/package/feeds/packages/bash/patches/124-upstream-bash43-024.patch new file mode 100644 index 00000000..79414550 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/124-upstream-bash43-024.patch @@ -0,0 +1,45 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-024 + +Bug-Reported-by: Corentin Peuvrel +Bug-Reference-ID: <53CE9E5D.6050203@pom-monitoring.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-07/msg00021.html + +Bug-Description: + +Indirect variable references do not work correctly if the reference +variable expands to an array reference using a subscript other than 0 +(e.g., foo='bar[1]' ; echo ${!foo}). + +Patch (apply with `patch -p0'): + +--- a/subst.c ++++ b/subst.c +@@ -7374,7 +7374,13 @@ parameter_brace_expand (string, indexp, + } + + if (want_indir) +- tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); ++ { ++ tdesc = parameter_brace_expand_indir (name + 1, var_is_special, quoted, quoted_dollar_atp, contains_dollar_at); ++ /* Turn off the W_ARRAYIND flag because there is no way for this function ++ to return the index we're supposed to be using. */ ++ if (tdesc && tdesc->flags) ++ tdesc->flags &= ~W_ARRAYIND; ++ } + else + tdesc = parameter_brace_expand_word (name, var_is_special, quoted, PF_IGNUNBOUND|(pflags&(PF_NOSPLIT2|PF_ASSIGNRHS)), &ind); + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 23 ++#define PATCHLEVEL 24 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/125-upstream-bash43-025.patch b/trunk/package/feeds/packages/bash/patches/125-upstream-bash43-025.patch new file mode 100644 index 00000000..6b2ef4b3 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/125-upstream-bash43-025.patch @@ -0,0 +1,110 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-025 + +Bug-Reported-by: Stephane Chazelas +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +Under certain circumstances, bash will execute user code while processing the +environment for exported function definitions. + +Patch (apply with `patch -p0'): + +--- a/builtins/common.h ++++ b/builtins/common.h +@@ -33,6 +33,8 @@ + #define SEVAL_RESETLINE 0x010 + #define SEVAL_PARSEONLY 0x020 + #define SEVAL_NOLONGJMP 0x040 ++#define SEVAL_FUNCDEF 0x080 /* only allow function definitions */ ++#define SEVAL_ONECMD 0x100 /* only allow a single command */ + + /* Flags for describe_command, shared between type.def and command.def */ + #define CDESC_ALL 0x001 /* type -a */ +--- a/builtins/evalstring.c ++++ b/builtins/evalstring.c +@@ -308,6 +308,14 @@ parse_and_execute (string, from_file, fl + { + struct fd_bitmap *bitmap; + ++ if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) ++ { ++ internal_warning ("%s: ignoring function definition attempt", from_file); ++ should_jump_to_top_level = 0; ++ last_result = last_command_exit_value = EX_BADUSAGE; ++ break; ++ } ++ + bitmap = new_fd_bitmap (FD_BITMAP_SIZE); + begin_unwind_frame ("pe_dispose"); + add_unwind_protect (dispose_fd_bitmap, bitmap); +@@ -368,6 +376,9 @@ parse_and_execute (string, from_file, fl + dispose_command (command); + dispose_fd_bitmap (bitmap); + discard_unwind_frame ("pe_dispose"); ++ ++ if (flags & SEVAL_ONECMD) ++ break; + } + } + else +--- a/variables.c ++++ b/variables.c +@@ -358,13 +358,11 @@ initialize_shell_variables (env, privmod + temp_string[char_index] = ' '; + strcpy (temp_string + char_index + 1, string); + +- if (posixly_correct == 0 || legal_identifier (name)) +- parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST); +- +- /* Ancient backwards compatibility. Old versions of bash exported +- functions like name()=() {...} */ +- if (name[char_index - 1] == ')' && name[char_index - 2] == '(') +- name[char_index - 2] = '\0'; ++ /* Don't import function names that are invalid identifiers from the ++ environment, though we still allow them to be defined as shell ++ variables. */ ++ if (legal_identifier (name)) ++ parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); + + if (temp_var = find_function (name)) + { +@@ -381,10 +379,6 @@ initialize_shell_variables (env, privmod + last_command_exit_value = 1; + report_error (_("error importing function definition for `%s'"), name); + } +- +- /* ( */ +- if (name[char_index - 1] == ')' && name[char_index - 2] == '\0') +- name[char_index - 2] = '('; /* ) */ + } + #if defined (ARRAY_VARS) + # if ARRAY_EXPORT +--- a/subst.c ++++ b/subst.c +@@ -8047,7 +8047,9 @@ comsub: + + goto return0; + } +- else if (var = find_variable_last_nameref (temp1)) ++ else if (var && (invisible_p (var) || var_isset (var) == 0)) ++ temp = (char *)NULL; ++ else if ((var = find_variable_last_nameref (temp1)) && var_isset (var) && invisible_p (var) == 0) + { + temp = nameref_cell (var); + #if defined (ARRAY_VARS) +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 24 ++#define PATCHLEVEL 25 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/126-upstream-bash43-026.patch b/trunk/package/feeds/packages/bash/patches/126-upstream-bash43-026.patch new file mode 100644 index 00000000..e9535beb --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/126-upstream-bash43-026.patch @@ -0,0 +1,54 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-026 + +Bug-Reported-by: Tavis Ormandy +Bug-Reference-ID: +Bug-Reference-URL: http://twitter.com/taviso/statuses/514887394294652929 + +Bug-Description: + +Under certain circumstances, bash can incorrectly save a lookahead character and +return it on a subsequent call, even when reading a new line. + +Patch (apply with `patch -p0'): + +--- a/parse.y ++++ b/parse.y +@@ -2953,6 +2953,8 @@ reset_parser () + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + ++ eol_ungetc_lookahead = 0; ++ + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +--- a/y.tab.c ++++ b/y.tab.c +@@ -5265,6 +5265,8 @@ reset_parser () + FREE (word_desc_to_read); + word_desc_to_read = (WORD_DESC *)NULL; + ++ eol_ungetc_lookahead = 0; ++ + current_token = '\n'; /* XXX */ + last_read_token = '\n'; + token_to_read = '\n'; +@@ -8539,4 +8541,3 @@ set_line_mbstate () + } + } + #endif /* HANDLE_MULTIBYTE */ +- +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 25 ++#define PATCHLEVEL 26 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/127-upstream-bash43-027.patch b/trunk/package/feeds/packages/bash/patches/127-upstream-bash43-027.patch new file mode 100644 index 00000000..6e8a51a2 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/127-upstream-bash43-027.patch @@ -0,0 +1,176 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-027 + +Bug-Reported-by: Florian Weimer +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +This patch changes the encoding bash uses for exported functions to avoid +clashes with shell variables and to avoid depending only on an environment +variable's contents to determine whether or not to interpret it as a shell +function. + +Patch (apply with `patch -p0'): + +--- a/variables.c ++++ b/variables.c +@@ -83,6 +83,11 @@ + + #define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0') + ++#define BASHFUNC_PREFIX "BASH_FUNC_" ++#define BASHFUNC_PREFLEN 10 /* == strlen(BASHFUNC_PREFIX */ ++#define BASHFUNC_SUFFIX "%%" ++#define BASHFUNC_SUFFLEN 2 /* == strlen(BASHFUNC_SUFFIX) */ ++ + extern char **environ; + + /* Variables used here and defined in other files. */ +@@ -279,7 +284,7 @@ static void push_temp_var __P((PTR_T)); + static void propagate_temp_var __P((PTR_T)); + static void dispose_temporary_env __P((sh_free_func_t *)); + +-static inline char *mk_env_string __P((const char *, const char *)); ++static inline char *mk_env_string __P((const char *, const char *, int)); + static char **make_env_array_from_var_list __P((SHELL_VAR **)); + static char **make_var_export_array __P((VAR_CONTEXT *)); + static char **make_func_export_array __P((void)); +@@ -349,22 +354,33 @@ initialize_shell_variables (env, privmod + + /* If exported function, define it now. Don't import functions from + the environment in privileged mode. */ +- if (privmode == 0 && read_but_dont_execute == 0 && STREQN ("() {", string, 4)) ++ if (privmode == 0 && read_but_dont_execute == 0 && ++ STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) && ++ STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) && ++ STREQN ("() {", string, 4)) + { ++ size_t namelen; ++ char *tname; /* desired imported function name */ ++ ++ namelen = char_index - BASHFUNC_PREFLEN - BASHFUNC_SUFFLEN; ++ ++ tname = name + BASHFUNC_PREFLEN; /* start of func name */ ++ tname[namelen] = '\0'; /* now tname == func name */ ++ + string_length = strlen (string); +- temp_string = (char *)xmalloc (3 + string_length + char_index); ++ temp_string = (char *)xmalloc (namelen + string_length + 2); + +- strcpy (temp_string, name); +- temp_string[char_index] = ' '; +- strcpy (temp_string + char_index + 1, string); ++ memcpy (temp_string, tname, namelen); ++ temp_string[namelen] = ' '; ++ memcpy (temp_string + namelen + 1, string, string_length + 1); + + /* Don't import function names that are invalid identifiers from the + environment, though we still allow them to be defined as shell + variables. */ +- if (legal_identifier (name)) +- parse_and_execute (temp_string, name, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); ++ if (absolute_program (tname) == 0 && (posixly_correct == 0 || legal_identifier (tname))) ++ parse_and_execute (temp_string, tname, SEVAL_NONINT|SEVAL_NOHIST|SEVAL_FUNCDEF|SEVAL_ONECMD); + +- if (temp_var = find_function (name)) ++ if (temp_var = find_function (tname)) + { + VSETATTR (temp_var, (att_exported|att_imported)); + array_needs_making = 1; +@@ -377,8 +393,11 @@ initialize_shell_variables (env, privmod + array_needs_making = 1; + } + last_command_exit_value = 1; +- report_error (_("error importing function definition for `%s'"), name); ++ report_error (_("error importing function definition for `%s'"), tname); + } ++ ++ /* Restore original suffix */ ++ tname[namelen] = BASHFUNC_SUFFIX[0]; + } + #if defined (ARRAY_VARS) + # if ARRAY_EXPORT +@@ -2954,7 +2973,7 @@ assign_in_env (word, flags) + var->context = variable_context; /* XXX */ + + INVALIDATE_EXPORTSTR (var); +- var->exportstr = mk_env_string (name, value); ++ var->exportstr = mk_env_string (name, value, 0); + + array_needs_making = 1; + +@@ -3852,21 +3871,42 @@ merge_temporary_env () + /* **************************************************************** */ + + static inline char * +-mk_env_string (name, value) ++mk_env_string (name, value, isfunc) + const char *name, *value; ++ int isfunc; + { +- int name_len, value_len; +- char *p; ++ size_t name_len, value_len; ++ char *p, *q; + + name_len = strlen (name); + value_len = STRLEN (value); +- p = (char *)xmalloc (2 + name_len + value_len); +- strcpy (p, name); +- p[name_len] = '='; ++ ++ /* If we are exporting a shell function, construct the encoded function ++ name. */ ++ if (isfunc && value) ++ { ++ p = (char *)xmalloc (BASHFUNC_PREFLEN + name_len + BASHFUNC_SUFFLEN + value_len + 2); ++ q = p; ++ memcpy (q, BASHFUNC_PREFIX, BASHFUNC_PREFLEN); ++ q += BASHFUNC_PREFLEN; ++ memcpy (q, name, name_len); ++ q += name_len; ++ memcpy (q, BASHFUNC_SUFFIX, BASHFUNC_SUFFLEN); ++ q += BASHFUNC_SUFFLEN; ++ } ++ else ++ { ++ p = (char *)xmalloc (2 + name_len + value_len); ++ memcpy (p, name, name_len); ++ q = p + name_len; ++ } ++ ++ q[0] = '='; + if (value && *value) +- strcpy (p + name_len + 1, value); ++ memcpy (q + 1, value, value_len + 1); + else +- p[name_len + 1] = '\0'; ++ q[1] = '\0'; ++ + return (p); + } + +@@ -3952,7 +3992,7 @@ make_env_array_from_var_list (vars) + /* Gee, I'd like to get away with not using savestring() if we're + using the cached exportstr... */ + list[list_index] = USE_EXPORTSTR ? savestring (value) +- : mk_env_string (var->name, value); ++ : mk_env_string (var->name, value, function_p (var)); + + if (USE_EXPORTSTR == 0) + SAVE_EXPORTSTR (var, list[list_index]); +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 26 ++#define PATCHLEVEL 27 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/128-upstream-bash43-028.patch b/trunk/package/feeds/packages/bash/patches/128-upstream-bash43-028.patch new file mode 100644 index 00000000..b4b1b6dc --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/128-upstream-bash43-028.patch @@ -0,0 +1,1526 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-028 + +Bug-Reported-by: Florian Weimer +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +There are two local buffer overflows in parse.y that can cause the shell +to dump core when given many here-documents attached to a single command +or many nested loops. + +Patch (apply with `patch -p0'): + +--- a/parse.y ++++ b/parse.y +@@ -168,6 +168,9 @@ static char *read_a_line __P((int)); + + static int reserved_word_acceptable __P((int)); + static int yylex __P((void)); ++ ++static void push_heredoc __P((REDIRECT *)); ++static char *mk_alexpansion __P((char *)); + static int alias_expand_token __P((char *)); + static int time_command_acceptable __P((void)); + static int special_case_tokens __P((char *)); +@@ -265,7 +268,9 @@ int parser_state; + + /* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +-static REDIRECT *redir_stack[10]; ++#define HEREDOC_MAX 16 ++ ++static REDIRECT *redir_stack[HEREDOC_MAX]; + int need_here_doc; + + /* Where shell input comes from. History expansion is performed on each +@@ -307,7 +312,7 @@ static int global_extglob; + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ + #define MAX_CASE_NEST 128 +-static int word_lineno[MAX_CASE_NEST]; ++static int word_lineno[MAX_CASE_NEST+1]; + static int word_top = -1; + + /* If non-zero, it is the token that we want read_token to return +@@ -520,42 +525,42 @@ redirection: '>' WORD + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_reading_until, redir, 0); +- redir_stack[need_here_doc++] = $$; ++ push_heredoc ($$); + } + | NUMBER LESS_LESS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, 0); +- redir_stack[need_here_doc++] = $$; ++ push_heredoc ($$); + } + | REDIR_WORD LESS_LESS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); +- redir_stack[need_here_doc++] = $$; ++ push_heredoc ($$); + } + | LESS_LESS_MINUS WORD + { + source.dest = 0; + redir.filename = $2; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); +- redir_stack[need_here_doc++] = $$; ++ push_heredoc ($$); + } + | NUMBER LESS_LESS_MINUS WORD + { + source.dest = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, 0); +- redir_stack[need_here_doc++] = $$; ++ push_heredoc ($$); + } + | REDIR_WORD LESS_LESS_MINUS WORD + { + source.filename = $1; + redir.filename = $3; + $$ = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); +- redir_stack[need_here_doc++] = $$; ++ push_heredoc ($$); + } + | LESS_LESS_LESS WORD + { +@@ -2636,6 +2641,21 @@ yylex () + which allow ESAC to be the next one read. */ + static int esacs_needed_count; + ++static void ++push_heredoc (r) ++ REDIRECT *r; ++{ ++ if (need_here_doc >= HEREDOC_MAX) ++ { ++ last_command_exit_value = EX_BADUSAGE; ++ need_here_doc = 0; ++ report_syntax_error (_("maximum here-document count exceeded")); ++ reset_parser (); ++ exit_shell (last_command_exit_value); ++ } ++ redir_stack[need_here_doc++] = r; ++} ++ + void + gather_here_documents () + { +--- a/y.tab.c ++++ b/y.tab.c +@@ -168,7 +168,7 @@ + + + /* Copy the first part of user declarations. */ +-#line 21 "/usr/homes/chet/src/bash/src/parse.y" ++#line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + + #include "config.h" + +@@ -319,6 +319,9 @@ static char *read_a_line __P((int)); + + static int reserved_word_acceptable __P((int)); + static int yylex __P((void)); ++ ++static void push_heredoc __P((REDIRECT *)); ++static char *mk_alexpansion __P((char *)); + static int alias_expand_token __P((char *)); + static int time_command_acceptable __P((void)); + static int special_case_tokens __P((char *)); +@@ -416,7 +419,9 @@ int parser_state; + + /* Variables to manage the task of reading here documents, because we need to + defer the reading until after a complete command has been collected. */ +-static REDIRECT *redir_stack[10]; ++#define HEREDOC_MAX 16 ++ ++static REDIRECT *redir_stack[HEREDOC_MAX]; + int need_here_doc; + + /* Where shell input comes from. History expansion is performed on each +@@ -458,7 +463,7 @@ static int global_extglob; + or `for WORD' begins. This is a nested command maximum, since the array + index is decremented after a case, select, or for command is parsed. */ + #define MAX_CASE_NEST 128 +-static int word_lineno[MAX_CASE_NEST]; ++static int word_lineno[MAX_CASE_NEST+1]; + static int word_top = -1; + + /* If non-zero, it is the token that we want read_token to return +@@ -492,7 +497,7 @@ static REDIRECTEE redir; + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + typedef union YYSTYPE +-#line 324 "/usr/homes/chet/src/bash/src/parse.y" ++#line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ +@@ -503,7 +508,7 @@ typedef union YYSTYPE + PATTERN_LIST *pattern; + } + /* Line 193 of yacc.c. */ +-#line 507 "y.tab.c" ++#line 512 "y.tab.c" + YYSTYPE; + # define yystype YYSTYPE /* obsolescent; will be withdrawn */ + # define YYSTYPE_IS_DECLARED 1 +@@ -516,7 +521,7 @@ typedef union YYSTYPE + + + /* Line 216 of yacc.c. */ +-#line 520 "y.tab.c" ++#line 525 "y.tab.c" + + #ifdef short + # undef short +@@ -886,23 +891,23 @@ static const yytype_int8 yyrhs[] = + /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + static const yytype_uint16 yyrline[] = + { +- 0, 377, 377, 388, 397, 412, 422, 424, 428, 434, +- 440, 446, 452, 458, 464, 470, 476, 482, 488, 494, +- 500, 506, 512, 518, 525, 532, 539, 546, 553, 560, +- 566, 572, 578, 584, 590, 596, 602, 608, 614, 620, +- 626, 632, 638, 644, 650, 656, 662, 668, 674, 680, +- 686, 692, 700, 702, 704, 708, 712, 723, 725, 729, +- 731, 733, 749, 751, 755, 757, 759, 761, 763, 765, +- 767, 769, 771, 773, 775, 779, 784, 789, 794, 799, +- 804, 809, 814, 821, 826, 831, 836, 843, 848, 853, +- 858, 863, 868, 875, 880, 885, 892, 895, 898, 902, +- 904, 935, 942, 947, 964, 969, 986, 993, 995, 997, +- 1002, 1006, 1010, 1014, 1016, 1018, 1022, 1023, 1027, 1029, +- 1031, 1033, 1037, 1039, 1041, 1043, 1045, 1047, 1051, 1053, +- 1062, 1070, 1071, 1077, 1078, 1085, 1089, 1091, 1093, 1100, +- 1102, 1104, 1108, 1109, 1112, 1114, 1116, 1120, 1121, 1130, +- 1143, 1159, 1174, 1176, 1178, 1185, 1188, 1192, 1194, 1200, +- 1206, 1223, 1243, 1245, 1268, 1272, 1274, 1276 ++ 0, 382, 382, 393, 402, 417, 427, 429, 433, 439, ++ 445, 451, 457, 463, 469, 475, 481, 487, 493, 499, ++ 505, 511, 517, 523, 530, 537, 544, 551, 558, 565, ++ 571, 577, 583, 589, 595, 601, 607, 613, 619, 625, ++ 631, 637, 643, 649, 655, 661, 667, 673, 679, 685, ++ 691, 697, 705, 707, 709, 713, 717, 728, 730, 734, ++ 736, 738, 754, 756, 760, 762, 764, 766, 768, 770, ++ 772, 774, 776, 778, 780, 784, 789, 794, 799, 804, ++ 809, 814, 819, 826, 831, 836, 841, 848, 853, 858, ++ 863, 868, 873, 880, 885, 890, 897, 900, 903, 907, ++ 909, 940, 947, 952, 969, 974, 991, 998, 1000, 1002, ++ 1007, 1011, 1015, 1019, 1021, 1023, 1027, 1028, 1032, 1034, ++ 1036, 1038, 1042, 1044, 1046, 1048, 1050, 1052, 1056, 1058, ++ 1067, 1075, 1076, 1082, 1083, 1090, 1094, 1096, 1098, 1105, ++ 1107, 1109, 1113, 1114, 1117, 1119, 1121, 1125, 1126, 1135, ++ 1148, 1164, 1179, 1181, 1183, 1190, 1193, 1197, 1199, 1205, ++ 1211, 1228, 1248, 1250, 1273, 1277, 1279, 1281 + }; + #endif + +@@ -2093,7 +2098,7 @@ yyreduce: + switch (yyn) + { + case 2: +-#line 378 "/usr/homes/chet/src/bash/src/parse.y" ++#line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ +@@ -2107,7 +2112,7 @@ yyreduce: + break; + + case 3: +-#line 389 "/usr/homes/chet/src/bash/src/parse.y" ++#line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ +@@ -2119,7 +2124,7 @@ yyreduce: + break; + + case 4: +-#line 398 "/usr/homes/chet/src/bash/src/parse.y" ++#line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; +@@ -2137,7 +2142,7 @@ yyreduce: + break; + + case 5: +-#line 413 "/usr/homes/chet/src/bash/src/parse.y" ++#line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ +@@ -2148,17 +2153,17 @@ yyreduce: + break; + + case 6: +-#line 423 "/usr/homes/chet/src/bash/src/parse.y" ++#line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 7: +-#line 425 "/usr/homes/chet/src/bash/src/parse.y" ++#line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); } + break; + + case 8: +-#line 429 "/usr/homes/chet/src/bash/src/parse.y" ++#line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2167,7 +2172,7 @@ yyreduce: + break; + + case 9: +-#line 435 "/usr/homes/chet/src/bash/src/parse.y" ++#line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2176,7 +2181,7 @@ yyreduce: + break; + + case 10: +-#line 441 "/usr/homes/chet/src/bash/src/parse.y" ++#line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2185,7 +2190,7 @@ yyreduce: + break; + + case 11: +-#line 447 "/usr/homes/chet/src/bash/src/parse.y" ++#line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2194,7 +2199,7 @@ yyreduce: + break; + + case 12: +-#line 453 "/usr/homes/chet/src/bash/src/parse.y" ++#line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2203,7 +2208,7 @@ yyreduce: + break; + + case 13: +-#line 459 "/usr/homes/chet/src/bash/src/parse.y" ++#line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2212,7 +2217,7 @@ yyreduce: + break; + + case 14: +-#line 465 "/usr/homes/chet/src/bash/src/parse.y" ++#line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2221,7 +2226,7 @@ yyreduce: + break; + + case 15: +-#line 471 "/usr/homes/chet/src/bash/src/parse.y" ++#line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2230,7 +2235,7 @@ yyreduce: + break; + + case 16: +-#line 477 "/usr/homes/chet/src/bash/src/parse.y" ++#line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2239,7 +2244,7 @@ yyreduce: + break; + + case 17: +-#line 483 "/usr/homes/chet/src/bash/src/parse.y" ++#line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2248,7 +2253,7 @@ yyreduce: + break; + + case 18: +-#line 489 "/usr/homes/chet/src/bash/src/parse.y" ++#line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2257,7 +2262,7 @@ yyreduce: + break; + + case 19: +-#line 495 "/usr/homes/chet/src/bash/src/parse.y" ++#line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2266,7 +2271,7 @@ yyreduce: + break; + + case 20: +-#line 501 "/usr/homes/chet/src/bash/src/parse.y" ++#line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2275,7 +2280,7 @@ yyreduce: + break; + + case 21: +-#line 507 "/usr/homes/chet/src/bash/src/parse.y" ++#line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2284,7 +2289,7 @@ yyreduce: + break; + + case 22: +-#line 513 "/usr/homes/chet/src/bash/src/parse.y" ++#line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2293,67 +2298,67 @@ yyreduce: + break; + + case 23: +-#line 519 "/usr/homes/chet/src/bash/src/parse.y" ++#line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); +- redir_stack[need_here_doc++] = (yyval.redirect); ++ push_heredoc ((yyval.redirect)); + } + break; + + case 24: +-#line 526 "/usr/homes/chet/src/bash/src/parse.y" ++#line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, 0); +- redir_stack[need_here_doc++] = (yyval.redirect); ++ push_heredoc ((yyval.redirect)); + } + break; + + case 25: +-#line 533 "/usr/homes/chet/src/bash/src/parse.y" ++#line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_reading_until, redir, REDIR_VARASSIGN); +- redir_stack[need_here_doc++] = (yyval.redirect); ++ push_heredoc ((yyval.redirect)); + } + break; + + case 26: +-#line 540 "/usr/homes/chet/src/bash/src/parse.y" ++#line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); +- redir_stack[need_here_doc++] = (yyval.redirect); ++ push_heredoc ((yyval.redirect)); + } + break; + + case 27: +-#line 547 "/usr/homes/chet/src/bash/src/parse.y" ++#line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, 0); +- redir_stack[need_here_doc++] = (yyval.redirect); ++ push_heredoc ((yyval.redirect)); + } + break; + + case 28: +-#line 554 "/usr/homes/chet/src/bash/src/parse.y" ++#line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); + (yyval.redirect) = make_redirection (source, r_deblank_reading_until, redir, REDIR_VARASSIGN); +- redir_stack[need_here_doc++] = (yyval.redirect); ++ push_heredoc ((yyval.redirect)); + } + break; + + case 29: +-#line 561 "/usr/homes/chet/src/bash/src/parse.y" ++#line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2362,7 +2367,7 @@ yyreduce: + break; + + case 30: +-#line 567 "/usr/homes/chet/src/bash/src/parse.y" ++#line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2371,7 +2376,7 @@ yyreduce: + break; + + case 31: +-#line 573 "/usr/homes/chet/src/bash/src/parse.y" ++#line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2380,7 +2385,7 @@ yyreduce: + break; + + case 32: +-#line 579 "/usr/homes/chet/src/bash/src/parse.y" ++#line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.dest = (yyvsp[(2) - (2)].number); +@@ -2389,7 +2394,7 @@ yyreduce: + break; + + case 33: +-#line 585 "/usr/homes/chet/src/bash/src/parse.y" ++#line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2398,7 +2403,7 @@ yyreduce: + break; + + case 34: +-#line 591 "/usr/homes/chet/src/bash/src/parse.y" ++#line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2407,7 +2412,7 @@ yyreduce: + break; + + case 35: +-#line 597 "/usr/homes/chet/src/bash/src/parse.y" ++#line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.dest = (yyvsp[(2) - (2)].number); +@@ -2416,7 +2421,7 @@ yyreduce: + break; + + case 36: +-#line 603 "/usr/homes/chet/src/bash/src/parse.y" ++#line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2425,7 +2430,7 @@ yyreduce: + break; + + case 37: +-#line 609 "/usr/homes/chet/src/bash/src/parse.y" ++#line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2434,7 +2439,7 @@ yyreduce: + break; + + case 38: +-#line 615 "/usr/homes/chet/src/bash/src/parse.y" ++#line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2443,7 +2448,7 @@ yyreduce: + break; + + case 39: +-#line 621 "/usr/homes/chet/src/bash/src/parse.y" ++#line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2452,7 +2457,7 @@ yyreduce: + break; + + case 40: +-#line 627 "/usr/homes/chet/src/bash/src/parse.y" ++#line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2461,7 +2466,7 @@ yyreduce: + break; + + case 41: +-#line 633 "/usr/homes/chet/src/bash/src/parse.y" ++#line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2470,7 +2475,7 @@ yyreduce: + break; + + case 42: +-#line 639 "/usr/homes/chet/src/bash/src/parse.y" ++#line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2479,7 +2484,7 @@ yyreduce: + break; + + case 43: +-#line 645 "/usr/homes/chet/src/bash/src/parse.y" ++#line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2488,7 +2493,7 @@ yyreduce: + break; + + case 44: +-#line 651 "/usr/homes/chet/src/bash/src/parse.y" ++#line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.dest = 0; +@@ -2497,7 +2502,7 @@ yyreduce: + break; + + case 45: +-#line 657 "/usr/homes/chet/src/bash/src/parse.y" ++#line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; +@@ -2506,7 +2511,7 @@ yyreduce: + break; + + case 46: +-#line 663 "/usr/homes/chet/src/bash/src/parse.y" ++#line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; +@@ -2515,7 +2520,7 @@ yyreduce: + break; + + case 47: +-#line 669 "/usr/homes/chet/src/bash/src/parse.y" ++#line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 0; + redir.dest = 0; +@@ -2524,7 +2529,7 @@ yyreduce: + break; + + case 48: +-#line 675 "/usr/homes/chet/src/bash/src/parse.y" ++#line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; +@@ -2533,7 +2538,7 @@ yyreduce: + break; + + case 49: +-#line 681 "/usr/homes/chet/src/bash/src/parse.y" ++#line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; +@@ -2542,7 +2547,7 @@ yyreduce: + break; + + case 50: +-#line 687 "/usr/homes/chet/src/bash/src/parse.y" ++#line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2551,7 +2556,7 @@ yyreduce: + break; + + case 51: +-#line 693 "/usr/homes/chet/src/bash/src/parse.y" ++#line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2560,29 +2565,29 @@ yyreduce: + break; + + case 52: +-#line 701 "/usr/homes/chet/src/bash/src/parse.y" ++#line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 53: +-#line 703 "/usr/homes/chet/src/bash/src/parse.y" ++#line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 54: +-#line 705 "/usr/homes/chet/src/bash/src/parse.y" ++#line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; } + break; + + case 55: +-#line 709 "/usr/homes/chet/src/bash/src/parse.y" ++#line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.redirect) = (yyvsp[(1) - (1)].redirect); + } + break; + + case 56: +-#line 713 "/usr/homes/chet/src/bash/src/parse.y" ++#line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + register REDIRECT *t; + +@@ -2594,27 +2599,27 @@ yyreduce: + break; + + case 57: +-#line 724 "/usr/homes/chet/src/bash/src/parse.y" ++#line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); } + break; + + case 58: +-#line 726 "/usr/homes/chet/src/bash/src/parse.y" ++#line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); } + break; + + case 59: +-#line 730 "/usr/homes/chet/src/bash/src/parse.y" ++#line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); } + break; + + case 60: +-#line 732 "/usr/homes/chet/src/bash/src/parse.y" ++#line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 61: +-#line 734 "/usr/homes/chet/src/bash/src/parse.y" ++#line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + COMMAND *tc; + +@@ -2633,72 +2638,72 @@ yyreduce: + break; + + case 62: +-#line 750 "/usr/homes/chet/src/bash/src/parse.y" ++#line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 63: +-#line 752 "/usr/homes/chet/src/bash/src/parse.y" ++#line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 64: +-#line 756 "/usr/homes/chet/src/bash/src/parse.y" ++#line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 65: +-#line 758 "/usr/homes/chet/src/bash/src/parse.y" ++#line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 66: +-#line 760 "/usr/homes/chet/src/bash/src/parse.y" ++#line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 67: +-#line 762 "/usr/homes/chet/src/bash/src/parse.y" ++#line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 68: +-#line 764 "/usr/homes/chet/src/bash/src/parse.y" ++#line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 69: +-#line 766 "/usr/homes/chet/src/bash/src/parse.y" ++#line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 70: +-#line 768 "/usr/homes/chet/src/bash/src/parse.y" ++#line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 71: +-#line 770 "/usr/homes/chet/src/bash/src/parse.y" ++#line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 72: +-#line 772 "/usr/homes/chet/src/bash/src/parse.y" ++#line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 73: +-#line 774 "/usr/homes/chet/src/bash/src/parse.y" ++#line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 74: +-#line 776 "/usr/homes/chet/src/bash/src/parse.y" ++#line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 75: +-#line 780 "/usr/homes/chet/src/bash/src/parse.y" ++#line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2706,7 +2711,7 @@ yyreduce: + break; + + case 76: +-#line 785 "/usr/homes/chet/src/bash/src/parse.y" ++#line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2714,7 +2719,7 @@ yyreduce: + break; + + case 77: +-#line 790 "/usr/homes/chet/src/bash/src/parse.y" ++#line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2722,7 +2727,7 @@ yyreduce: + break; + + case 78: +-#line 795 "/usr/homes/chet/src/bash/src/parse.y" ++#line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2730,7 +2735,7 @@ yyreduce: + break; + + case 79: +-#line 800 "/usr/homes/chet/src/bash/src/parse.y" ++#line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2738,7 +2743,7 @@ yyreduce: + break; + + case 80: +-#line 805 "/usr/homes/chet/src/bash/src/parse.y" ++#line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2746,7 +2751,7 @@ yyreduce: + break; + + case 81: +-#line 810 "/usr/homes/chet/src/bash/src/parse.y" ++#line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2754,7 +2759,7 @@ yyreduce: + break; + + case 82: +-#line 815 "/usr/homes/chet/src/bash/src/parse.y" ++#line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2762,7 +2767,7 @@ yyreduce: + break; + + case 83: +-#line 822 "/usr/homes/chet/src/bash/src/parse.y" ++#line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2770,7 +2775,7 @@ yyreduce: + break; + + case 84: +-#line 827 "/usr/homes/chet/src/bash/src/parse.y" ++#line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2778,7 +2783,7 @@ yyreduce: + break; + + case 85: +-#line 832 "/usr/homes/chet/src/bash/src/parse.y" ++#line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2786,7 +2791,7 @@ yyreduce: + break; + + case 86: +-#line 837 "/usr/homes/chet/src/bash/src/parse.y" ++#line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2794,7 +2799,7 @@ yyreduce: + break; + + case 87: +-#line 844 "/usr/homes/chet/src/bash/src/parse.y" ++#line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2802,7 +2807,7 @@ yyreduce: + break; + + case 88: +-#line 849 "/usr/homes/chet/src/bash/src/parse.y" ++#line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2810,7 +2815,7 @@ yyreduce: + break; + + case 89: +-#line 854 "/usr/homes/chet/src/bash/src/parse.y" ++#line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2818,7 +2823,7 @@ yyreduce: + break; + + case 90: +-#line 859 "/usr/homes/chet/src/bash/src/parse.y" ++#line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2826,7 +2831,7 @@ yyreduce: + break; + + case 91: +-#line 864 "/usr/homes/chet/src/bash/src/parse.y" ++#line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2834,7 +2839,7 @@ yyreduce: + break; + + case 92: +-#line 869 "/usr/homes/chet/src/bash/src/parse.y" ++#line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2842,7 +2847,7 @@ yyreduce: + break; + + case 93: +-#line 876 "/usr/homes/chet/src/bash/src/parse.y" ++#line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2850,7 +2855,7 @@ yyreduce: + break; + + case 94: +-#line 881 "/usr/homes/chet/src/bash/src/parse.y" ++#line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2858,7 +2863,7 @@ yyreduce: + break; + + case 95: +-#line 886 "/usr/homes/chet/src/bash/src/parse.y" ++#line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2866,27 +2871,27 @@ yyreduce: + break; + + case 96: +-#line 893 "/usr/homes/chet/src/bash/src/parse.y" ++#line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); } + break; + + case 97: +-#line 896 "/usr/homes/chet/src/bash/src/parse.y" ++#line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); } + break; + + case 98: +-#line 899 "/usr/homes/chet/src/bash/src/parse.y" ++#line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); } + break; + + case 99: +-#line 903 "/usr/homes/chet/src/bash/src/parse.y" ++#line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 100: +-#line 905 "/usr/homes/chet/src/bash/src/parse.y" ++#line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + COMMAND *tc; + +@@ -2918,7 +2923,7 @@ yyreduce: + break; + + case 101: +-#line 936 "/usr/homes/chet/src/bash/src/parse.y" ++#line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL; +@@ -2926,7 +2931,7 @@ yyreduce: + break; + + case 102: +-#line 943 "/usr/homes/chet/src/bash/src/parse.y" ++#line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; +@@ -2934,7 +2939,7 @@ yyreduce: + break; + + case 103: +-#line 948 "/usr/homes/chet/src/bash/src/parse.y" ++#line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + COMMAND *tc; + +@@ -2954,7 +2959,7 @@ yyreduce: + break; + + case 104: +-#line 965 "/usr/homes/chet/src/bash/src/parse.y" ++#line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; +@@ -2962,7 +2967,7 @@ yyreduce: + break; + + case 105: +-#line 970 "/usr/homes/chet/src/bash/src/parse.y" ++#line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + COMMAND *tc; + +@@ -2982,7 +2987,7 @@ yyreduce: + break; + + case 106: +-#line 987 "/usr/homes/chet/src/bash/src/parse.y" ++#line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command))); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; +@@ -2990,117 +2995,117 @@ yyreduce: + break; + + case 107: +-#line 994 "/usr/homes/chet/src/bash/src/parse.y" ++#line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); } + break; + + case 108: +-#line 996 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); } + break; + + case 109: +-#line 998 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); } + break; + + case 110: +-#line 1003 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); } + break; + + case 111: +-#line 1007 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); } + break; + + case 112: +-#line 1011 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(2) - (3)].command); } + break; + + case 113: +-#line 1015 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); } + break; + + case 114: +-#line 1017 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); } + break; + + case 115: +-#line 1019 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); } + break; + + case 117: +-#line 1024 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); } + break; + + case 118: +-#line 1028 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); } + break; + + case 119: +-#line 1030 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); } + break; + + case 120: +-#line 1032 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); } + break; + + case 121: +-#line 1034 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); } + break; + + case 122: +-#line 1038 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 123: +-#line 1040 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 124: +-#line 1042 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 125: +-#line 1044 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 126: +-#line 1046 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 127: +-#line 1048 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 128: +-#line 1052 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 129: +-#line 1054 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); } + break; + + case 130: +-#line 1063 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + if (need_here_doc) +@@ -3109,14 +3114,14 @@ yyreduce: + break; + + case 132: +-#line 1072 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 134: +-#line 1079 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); +@@ -3126,17 +3131,17 @@ yyreduce: + break; + + case 136: +-#line 1090 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 137: +-#line 1092 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 138: +-#line 1094 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + if ((yyvsp[(1) - (4)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); +@@ -3146,37 +3151,37 @@ yyreduce: + break; + + case 139: +-#line 1101 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 140: +-#line 1103 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 141: +-#line 1105 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 144: +-#line 1113 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.number) = '\n'; } + break; + + case 145: +-#line 1115 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.number) = ';'; } + break; + + case 146: +-#line 1117 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.number) = yacc_EOF; } + break; + + case 149: +-#line 1131 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = (yyvsp[(1) - (1)].command); + if (need_here_doc) +@@ -3192,7 +3197,7 @@ yyreduce: + break; + + case 150: +-#line 1144 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + if ((yyvsp[(1) - (2)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); +@@ -3211,7 +3216,7 @@ yyreduce: + break; + + case 151: +-#line 1160 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + (yyval.command) = (yyvsp[(1) - (2)].command); + if (need_here_doc) +@@ -3227,17 +3232,17 @@ yyreduce: + break; + + case 152: +-#line 1175 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 153: +-#line 1177 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 154: +-#line 1179 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); +@@ -3247,22 +3252,22 @@ yyreduce: + break; + + case 155: +-#line 1186 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); } + break; + + case 156: +-#line 1189 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 157: +-#line 1193 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 158: +-#line 1195 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */ +@@ -3271,7 +3276,7 @@ yyreduce: + break; + + case 159: +-#line 1201 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number); +@@ -3280,7 +3285,7 @@ yyreduce: + break; + + case 160: +-#line 1207 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + ELEMENT x; + +@@ -3300,7 +3305,7 @@ yyreduce: + break; + + case 161: +-#line 1224 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + ELEMENT x; + +@@ -3321,12 +3326,12 @@ yyreduce: + break; + + case 162: +-#line 1244 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); } + break; + + case 163: +-#line 1246 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; +@@ -3352,28 +3357,28 @@ yyreduce: + break; + + case 164: +-#line 1269 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 165: +-#line 1273 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE; } + break; + + case 166: +-#line 1275 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + case 167: +-#line 1277 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + + /* Line 1267 of yacc.c. */ +-#line 3377 "y.tab.c" ++#line 3382 "y.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); +@@ -3587,7 +3592,7 @@ yyreturn: + } + + +-#line 1279 "/usr/homes/chet/src/bash/src/parse.y" ++#line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" + + + /* Initial size to allocate for tokens, and the +@@ -4948,6 +4953,21 @@ yylex () + which allow ESAC to be the next one read. */ + static int esacs_needed_count; + ++static void ++push_heredoc (r) ++ REDIRECT *r; ++{ ++ if (need_here_doc >= HEREDOC_MAX) ++ { ++ last_command_exit_value = EX_BADUSAGE; ++ need_here_doc = 0; ++ report_syntax_error (_("maximum here-document count exceeded")); ++ reset_parser (); ++ exit_shell (last_command_exit_value); ++ } ++ redir_stack[need_here_doc++] = r; ++} ++ + void + gather_here_documents () + { +@@ -8541,3 +8561,4 @@ set_line_mbstate () + } + } + #endif /* HANDLE_MULTIBYTE */ ++ +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 27 ++#define PATCHLEVEL 28 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/129-upstream-bash43-029.patch b/trunk/package/feeds/packages/bash/patches/129-upstream-bash43-029.patch new file mode 100644 index 00000000..be824034 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/129-upstream-bash43-029.patch @@ -0,0 +1,50 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-029 + +Bug-Reported-by: Michal Zalewski +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +When bash is parsing a function definition that contains a here-document +delimited by end-of-file (or end-of-string), it leaves the closing delimiter +uninitialized. This can result in an invalid memory access when the parsed +function is later copied. + +Patch (apply with `patch -p0'): + +--- a/make_cmd.c ++++ b/make_cmd.c +@@ -692,6 +692,7 @@ make_redirection (source, instruction, d + /* First do the common cases. */ + temp->redirector = source; + temp->redirectee = dest_and_filename; ++ temp->here_doc_eof = 0; + temp->instruction = instruction; + temp->flags = 0; + temp->rflags = flags; +--- a/copy_cmd.c ++++ b/copy_cmd.c +@@ -126,7 +126,7 @@ copy_redirect (redirect) + { + case r_reading_until: + case r_deblank_reading_until: +- new_redirect->here_doc_eof = savestring (redirect->here_doc_eof); ++ new_redirect->here_doc_eof = redirect->here_doc_eof ? savestring (redirect->here_doc_eof) : 0; + /*FALLTHROUGH*/ + case r_reading_string: + case r_appending_to: +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 28 ++#define PATCHLEVEL 29 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/130-upstream-bash43-030.patch b/trunk/package/feeds/packages/bash/patches/130-upstream-bash43-030.patch new file mode 100644 index 00000000..0eadc5c0 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/130-upstream-bash43-030.patch @@ -0,0 +1,1396 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-030 + +Bug-Reported-by: Michal Zalewski +Bug-Reference-ID: +Bug-Reference-URL: + +Bug-Description: + +A combination of nested command substitutions and function importing from +the environment can cause bash to execute code appearing in the environment +variable value following the function definition. + +Patch (apply with `patch -p0'): + +--- a/builtins/evalstring.c ++++ b/builtins/evalstring.c +@@ -308,12 +308,25 @@ parse_and_execute (string, from_file, fl + { + struct fd_bitmap *bitmap; + +- if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def) ++ if (flags & SEVAL_FUNCDEF) + { +- internal_warning ("%s: ignoring function definition attempt", from_file); +- should_jump_to_top_level = 0; +- last_result = last_command_exit_value = EX_BADUSAGE; +- break; ++ char *x; ++ ++ /* If the command parses to something other than a straight ++ function definition, or if we have not consumed the entire ++ string, or if the parser has transformed the function ++ name (as parsing will if it begins or ends with shell ++ whitespace, for example), reject the attempt */ ++ if (command->type != cm_function_def || ++ ((x = parser_remaining_input ()) && *x) || ++ (STREQ (from_file, command->value.Function_def->name->word) == 0)) ++ { ++ internal_warning (_("%s: ignoring function definition attempt"), from_file); ++ should_jump_to_top_level = 0; ++ last_result = last_command_exit_value = EX_BADUSAGE; ++ reset_parser (); ++ break; ++ } + } + + bitmap = new_fd_bitmap (FD_BITMAP_SIZE); +@@ -378,7 +391,10 @@ parse_and_execute (string, from_file, fl + discard_unwind_frame ("pe_dispose"); + + if (flags & SEVAL_ONECMD) +- break; ++ { ++ reset_parser (); ++ break; ++ } + } + } + else +--- a/parse.y ++++ b/parse.y +@@ -2538,6 +2538,16 @@ shell_ungetc (c) + eol_ungetc_lookahead = c; + } + ++char * ++parser_remaining_input () ++{ ++ if (shell_input_line == 0) ++ return 0; ++ if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len) ++ return '\0'; /* XXX */ ++ return (shell_input_line + shell_input_line_index); ++} ++ + #ifdef INCLUDE_UNUSED + /* Back the input pointer up by one, effectively `ungetting' a character. */ + static void +@@ -4027,8 +4037,8 @@ xparse_dolparen (base, string, indp, fla + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); +- if (interactive) +- token_to_read = 0; ++ ++ token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET +--- a/shell.h ++++ b/shell.h +@@ -180,6 +180,8 @@ typedef struct _sh_input_line_state_t { + } sh_input_line_state_t; + + /* Let's try declaring these here. */ ++extern char *parser_remaining_input __P((void)); ++ + extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *)); + extern void restore_parser_state __P((sh_parser_state_t *)); + +--- a/y.tab.c ++++ b/y.tab.c +@@ -168,7 +168,7 @@ + + + /* Copy the first part of user declarations. */ +-#line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 21 "/usr/src/local/bash/bash-4.3-patched/parse.y" + + #include "config.h" + +@@ -497,7 +497,7 @@ static REDIRECTEE redir; + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + typedef union YYSTYPE +-#line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 329 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + WORD_DESC *word; /* the word that we read. */ + int number; /* the number that we read. */ +@@ -2098,7 +2098,7 @@ yyreduce: + switch (yyn) + { + case 2: +-#line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 383 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + /* Case of regular command. Discard the error + safety net,and return the command just parsed. */ +@@ -2112,7 +2112,7 @@ yyreduce: + break; + + case 3: +-#line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 394 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + /* Case of regular command, but not a very + interesting one. Return a NULL command. */ +@@ -2124,7 +2124,7 @@ yyreduce: + break; + + case 4: +-#line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 403 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + /* Error during parsing. Return NULL command. */ + global_command = (COMMAND *)NULL; +@@ -2142,7 +2142,7 @@ yyreduce: + break; + + case 5: +-#line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 418 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + /* Case of EOF seen by itself. Do ignoreeof or + not. */ +@@ -2153,17 +2153,17 @@ yyreduce: + break; + + case 6: +-#line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 428 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 7: +-#line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 430 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); } + break; + + case 8: +-#line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 434 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2172,7 +2172,7 @@ yyreduce: + break; + + case 9: +-#line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 440 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2181,7 +2181,7 @@ yyreduce: + break; + + case 10: +-#line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 446 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2190,7 +2190,7 @@ yyreduce: + break; + + case 11: +-#line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 452 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2199,7 +2199,7 @@ yyreduce: + break; + + case 12: +-#line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 458 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2208,7 +2208,7 @@ yyreduce: + break; + + case 13: +-#line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 464 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2217,7 +2217,7 @@ yyreduce: + break; + + case 14: +-#line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 470 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2226,7 +2226,7 @@ yyreduce: + break; + + case 15: +-#line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 476 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2235,7 +2235,7 @@ yyreduce: + break; + + case 16: +-#line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 482 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2244,7 +2244,7 @@ yyreduce: + break; + + case 17: +-#line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 488 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2253,7 +2253,7 @@ yyreduce: + break; + + case 18: +-#line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 494 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2262,7 +2262,7 @@ yyreduce: + break; + + case 19: +-#line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 500 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2271,7 +2271,7 @@ yyreduce: + break; + + case 20: +-#line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 506 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2280,7 +2280,7 @@ yyreduce: + break; + + case 21: +-#line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 512 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2289,7 +2289,7 @@ yyreduce: + break; + + case 22: +-#line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 518 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2298,7 +2298,7 @@ yyreduce: + break; + + case 23: +-#line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 524 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2308,7 +2308,7 @@ yyreduce: + break; + + case 24: +-#line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 531 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2318,7 +2318,7 @@ yyreduce: + break; + + case 25: +-#line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 538 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2328,7 +2328,7 @@ yyreduce: + break; + + case 26: +-#line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 545 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2338,7 +2338,7 @@ yyreduce: + break; + + case 27: +-#line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 552 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2348,7 +2348,7 @@ yyreduce: + break; + + case 28: +-#line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 559 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2358,7 +2358,7 @@ yyreduce: + break; + + case 29: +-#line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 566 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2367,7 +2367,7 @@ yyreduce: + break; + + case 30: +-#line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 572 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2376,7 +2376,7 @@ yyreduce: + break; + + case 31: +-#line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 578 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2385,7 +2385,7 @@ yyreduce: + break; + + case 32: +-#line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 584 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.dest = (yyvsp[(2) - (2)].number); +@@ -2394,7 +2394,7 @@ yyreduce: + break; + + case 33: +-#line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 590 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2403,7 +2403,7 @@ yyreduce: + break; + + case 34: +-#line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 596 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2412,7 +2412,7 @@ yyreduce: + break; + + case 35: +-#line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 602 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.dest = (yyvsp[(2) - (2)].number); +@@ -2421,7 +2421,7 @@ yyreduce: + break; + + case 36: +-#line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 608 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2430,7 +2430,7 @@ yyreduce: + break; + + case 37: +-#line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 614 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = (yyvsp[(3) - (3)].number); +@@ -2439,7 +2439,7 @@ yyreduce: + break; + + case 38: +-#line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 620 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2448,7 +2448,7 @@ yyreduce: + break; + + case 39: +-#line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 626 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2457,7 +2457,7 @@ yyreduce: + break; + + case 40: +-#line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 632 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2466,7 +2466,7 @@ yyreduce: + break; + + case 41: +-#line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 638 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2475,7 +2475,7 @@ yyreduce: + break; + + case 42: +-#line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 644 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2484,7 +2484,7 @@ yyreduce: + break; + + case 43: +-#line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 650 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.filename = (yyvsp[(3) - (3)].word); +@@ -2493,7 +2493,7 @@ yyreduce: + break; + + case 44: +-#line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 656 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.dest = 0; +@@ -2502,7 +2502,7 @@ yyreduce: + break; + + case 45: +-#line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 662 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; +@@ -2511,7 +2511,7 @@ yyreduce: + break; + + case 46: +-#line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 668 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; +@@ -2520,7 +2520,7 @@ yyreduce: + break; + + case 47: +-#line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 674 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 0; + redir.dest = 0; +@@ -2529,7 +2529,7 @@ yyreduce: + break; + + case 48: +-#line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 680 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = (yyvsp[(1) - (3)].number); + redir.dest = 0; +@@ -2538,7 +2538,7 @@ yyreduce: + break; + + case 49: +-#line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 686 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.filename = (yyvsp[(1) - (3)].word); + redir.dest = 0; +@@ -2547,7 +2547,7 @@ yyreduce: + break; + + case 50: +-#line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 692 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2556,7 +2556,7 @@ yyreduce: + break; + + case 51: +-#line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 698 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + source.dest = 1; + redir.filename = (yyvsp[(2) - (2)].word); +@@ -2565,29 +2565,29 @@ yyreduce: + break; + + case 52: +-#line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 706 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 53: +-#line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 708 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; } + break; + + case 54: +-#line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 710 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; } + break; + + case 55: +-#line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 714 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.redirect) = (yyvsp[(1) - (1)].redirect); + } + break; + + case 56: +-#line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 718 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + register REDIRECT *t; + +@@ -2599,27 +2599,27 @@ yyreduce: + break; + + case 57: +-#line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 729 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); } + break; + + case 58: +-#line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 731 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); } + break; + + case 59: +-#line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 735 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); } + break; + + case 60: +-#line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 737 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 61: +-#line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 739 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + COMMAND *tc; + +@@ -2638,72 +2638,72 @@ yyreduce: + break; + + case 62: +-#line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 755 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 63: +-#line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 757 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 64: +-#line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 761 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 65: +-#line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 763 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 66: +-#line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 765 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 67: +-#line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 767 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); } + break; + + case 68: +-#line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 769 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 69: +-#line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 771 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 70: +-#line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 773 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 71: +-#line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 775 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 72: +-#line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 777 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 73: +-#line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 779 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 74: +-#line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 781 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 75: +-#line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 785 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2711,7 +2711,7 @@ yyreduce: + break; + + case 76: +-#line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 790 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2719,7 +2719,7 @@ yyreduce: + break; + + case 77: +-#line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 795 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2727,7 +2727,7 @@ yyreduce: + break; + + case 78: +-#line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 800 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2735,7 +2735,7 @@ yyreduce: + break; + + case 79: +-#line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 805 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2743,7 +2743,7 @@ yyreduce: + break; + + case 80: +-#line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 810 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2751,7 +2751,7 @@ yyreduce: + break; + + case 81: +-#line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 815 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2759,7 +2759,7 @@ yyreduce: + break; + + case 82: +-#line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 820 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2767,7 +2767,7 @@ yyreduce: + break; + + case 83: +-#line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 827 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2775,7 +2775,7 @@ yyreduce: + break; + + case 84: +-#line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 832 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2783,7 +2783,7 @@ yyreduce: + break; + + case 85: +-#line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 837 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2791,7 +2791,7 @@ yyreduce: + break; + + case 86: +-#line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 842 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno); + if (word_top > 0) word_top--; +@@ -2799,7 +2799,7 @@ yyreduce: + break; + + case 87: +-#line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 849 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2807,7 +2807,7 @@ yyreduce: + break; + + case 88: +-#line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 854 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2815,7 +2815,7 @@ yyreduce: + break; + + case 89: +-#line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 859 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2823,7 +2823,7 @@ yyreduce: + break; + + case 90: +-#line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 864 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2831,7 +2831,7 @@ yyreduce: + break; + + case 91: +-#line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 869 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2839,7 +2839,7 @@ yyreduce: + break; + + case 92: +-#line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 874 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2847,7 +2847,7 @@ yyreduce: + break; + + case 93: +-#line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 881 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2855,7 +2855,7 @@ yyreduce: + break; + + case 94: +-#line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 886 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2863,7 +2863,7 @@ yyreduce: + break; + + case 95: +-#line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 891 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]); + if (word_top > 0) word_top--; +@@ -2871,27 +2871,27 @@ yyreduce: + break; + + case 96: +-#line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 898 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); } + break; + + case 97: +-#line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 901 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); } + break; + + case 98: +-#line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 904 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); } + break; + + case 99: +-#line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 908 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 100: +-#line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 910 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + COMMAND *tc; + +@@ -2923,7 +2923,7 @@ yyreduce: + break; + + case 101: +-#line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 941 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL; +@@ -2931,7 +2931,7 @@ yyreduce: + break; + + case 102: +-#line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 948 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; +@@ -2939,7 +2939,7 @@ yyreduce: + break; + + case 103: +-#line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 953 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + COMMAND *tc; + +@@ -2959,7 +2959,7 @@ yyreduce: + break; + + case 104: +-#line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 970 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command)); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; +@@ -2967,7 +2967,7 @@ yyreduce: + break; + + case 105: +-#line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 975 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + COMMAND *tc; + +@@ -2987,7 +2987,7 @@ yyreduce: + break; + + case 106: +-#line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 992 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command))); + (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL; +@@ -2995,117 +2995,117 @@ yyreduce: + break; + + case 107: +-#line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 999 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); } + break; + + case 108: +-#line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1001 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); } + break; + + case 109: +-#line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1003 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); } + break; + + case 110: +-#line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1008 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); } + break; + + case 111: +-#line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1012 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); } + break; + + case 112: +-#line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1016 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(2) - (3)].command); } + break; + + case 113: +-#line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1020 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); } + break; + + case 114: +-#line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1022 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); } + break; + + case 115: +-#line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1024 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); } + break; + + case 117: +-#line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1029 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); } + break; + + case 118: +-#line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1033 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); } + break; + + case 119: +-#line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1035 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); } + break; + + case 120: +-#line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1037 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); } + break; + + case 121: +-#line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1039 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); } + break; + + case 122: +-#line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1043 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 123: +-#line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1045 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 124: +-#line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1047 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 125: +-#line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1049 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 126: +-#line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1051 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); } + break; + + case 127: +-#line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1053 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); } + break; + + case 128: +-#line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1057 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); } + break; + + case 129: +-#line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1059 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); } + break; + + case 130: +-#line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1068 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + if (need_here_doc) +@@ -3114,14 +3114,14 @@ yyreduce: + break; + + case 132: +-#line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1077 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = (yyvsp[(2) - (2)].command); + } + break; + + case 134: +-#line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1084 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&'); +@@ -3131,17 +3131,17 @@ yyreduce: + break; + + case 136: +-#line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1095 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 137: +-#line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1097 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 138: +-#line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1099 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + if ((yyvsp[(1) - (4)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&'); +@@ -3151,37 +3151,37 @@ yyreduce: + break; + + case 139: +-#line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1106 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 140: +-#line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1108 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); } + break; + + case 141: +-#line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1110 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 144: +-#line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1118 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.number) = '\n'; } + break; + + case 145: +-#line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1120 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.number) = ';'; } + break; + + case 146: +-#line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1122 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.number) = yacc_EOF; } + break; + + case 149: +-#line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1136 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = (yyvsp[(1) - (1)].command); + if (need_here_doc) +@@ -3197,7 +3197,7 @@ yyreduce: + break; + + case 150: +-#line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1149 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + if ((yyvsp[(1) - (2)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&'); +@@ -3216,7 +3216,7 @@ yyreduce: + break; + + case 151: +-#line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1165 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + (yyval.command) = (yyvsp[(1) - (2)].command); + if (need_here_doc) +@@ -3232,17 +3232,17 @@ yyreduce: + break; + + case 152: +-#line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1180 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); } + break; + + case 153: +-#line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1182 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); } + break; + + case 154: +-#line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1184 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + if ((yyvsp[(1) - (3)].command)->type == cm_connection) + (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&'); +@@ -3252,22 +3252,22 @@ yyreduce: + break; + + case 155: +-#line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1191 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); } + break; + + case 156: +-#line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1194 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 157: +-#line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1198 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 158: +-#line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1200 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */ +@@ -3276,7 +3276,7 @@ yyreduce: + break; + + case 159: +-#line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1206 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + if ((yyvsp[(2) - (2)].command)) + (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number); +@@ -3285,7 +3285,7 @@ yyreduce: + break; + + case 160: +-#line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1212 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + ELEMENT x; + +@@ -3305,7 +3305,7 @@ yyreduce: + break; + + case 161: +-#line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1229 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + ELEMENT x; + +@@ -3326,12 +3326,12 @@ yyreduce: + break; + + case 162: +-#line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1249 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); } + break; + + case 163: +-#line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1251 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { + /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */ + COMMAND *tc; +@@ -3357,22 +3357,22 @@ yyreduce: + break; + + case 164: +-#line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1274 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.command) = (yyvsp[(1) - (1)].command); } + break; + + case 165: +-#line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1278 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE; } + break; + + case 166: +-#line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1280 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + + case 167: +-#line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1282 "/usr/src/local/bash/bash-4.3-patched/parse.y" + { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; } + break; + +@@ -3592,7 +3592,7 @@ yyreturn: + } + + +-#line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y" ++#line 1284 "/usr/src/local/bash/bash-4.3-patched/parse.y" + + + /* Initial size to allocate for tokens, and the +@@ -4850,6 +4850,16 @@ shell_ungetc (c) + eol_ungetc_lookahead = c; + } + ++char * ++parser_remaining_input () ++{ ++ if (shell_input_line == 0) ++ return 0; ++ if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len) ++ return '\0'; /* XXX */ ++ return (shell_input_line + shell_input_line_index); ++} ++ + #ifdef INCLUDE_UNUSED + /* Back the input pointer up by one, effectively `ungetting' a character. */ + static void +@@ -6339,8 +6349,8 @@ xparse_dolparen (base, string, indp, fla + reset_parser (); + /* reset_parser clears shell_input_line and associated variables */ + restore_input_line_state (&ls); +- if (interactive) +- token_to_read = 0; ++ ++ token_to_read = 0; + + /* Need to find how many characters parse_and_execute consumed, update + *indp, if flags != 0, copy the portion of the string parsed into RET +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 29 ++#define PATCHLEVEL 30 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/131-upstream-bash43-031.patch b/trunk/package/feeds/packages/bash/patches/131-upstream-bash43-031.patch new file mode 100644 index 00000000..a22cb071 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/131-upstream-bash43-031.patch @@ -0,0 +1,96 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-031 + +Bug-Reported-by: lolilolicon +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00139.html + +Bug-Description: + +The new nameref assignment functionality introduced in bash-4.3 did not perform +enough validation on the variable value and would create variables with +invalid names. + +Patch (apply with `patch -p0'): + +--- a/subst.h ++++ b/subst.h +@@ -47,6 +47,7 @@ + #define ASS_MKASSOC 0x0004 + #define ASS_MKGLOBAL 0x0008 /* force global assignment */ + #define ASS_NAMEREF 0x0010 /* assigning to nameref variable */ ++#define ASS_FROMREF 0x0020 /* assigning from value of nameref variable */ + + /* Flags for the string extraction functions. */ + #define SX_NOALLOC 0x0001 /* just skip; don't return substring */ +--- a/variables.c ++++ b/variables.c +@@ -2516,10 +2516,27 @@ bind_variable_internal (name, value, tab + HASH_TABLE *table; + int hflags, aflags; + { +- char *newval; ++ char *newname, *newval; + SHELL_VAR *entry; ++#if defined (ARRAY_VARS) ++ arrayind_t ind; ++ char *subp; ++ int sublen; ++#endif + ++ newname = 0; ++#if defined (ARRAY_VARS) ++ if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name)) ++ { ++ newname = array_variable_name (name, &subp, &sublen); ++ if (newname == 0) ++ return (SHELL_VAR *)NULL; /* XXX */ ++ entry = hash_lookup (newname, table); ++ } ++ else ++#endif + entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table); ++ + /* Follow the nameref chain here if this is the global variables table */ + if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table) + { +@@ -2550,6 +2567,16 @@ bind_variable_internal (name, value, tab + var_setvalue (entry, make_variable_value (entry, value, 0)); + } + } ++#if defined (ARRAY_VARS) ++ else if (entry == 0 && newname) ++ { ++ entry = make_new_array_variable (newname); /* indexed array by default */ ++ if (entry == 0) ++ return entry; ++ ind = array_expand_index (name, subp, sublen); ++ bind_array_element (entry, ind, value, aflags); ++ } ++#endif + else if (entry == 0) + { + entry = make_new_variable (name, table); +@@ -2670,7 +2697,8 @@ bind_variable (name, value, flags) + normal. */ + if (nameref_cell (nv) == 0) + return (bind_variable_internal (nv->name, value, nvc->table, 0, flags)); +- return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags)); ++ /* XXX - bug here with ref=array[index] */ ++ return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags|ASS_FROMREF)); + } + else + v = nv; +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 30 ++#define PATCHLEVEL 31 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/132-upstream-bash43-032.patch b/trunk/package/feeds/packages/bash/patches/132-upstream-bash43-032.patch new file mode 100644 index 00000000..96a86c98 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/132-upstream-bash43-032.patch @@ -0,0 +1,42 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-032 + +Bug-Reported-by: crispusfairbairn@gmail.com +Bug-Reference-ID: +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00013.html + +Bug-Description: + +When bash is running in Posix mode, it allows signals -- including SIGCHLD -- +to interrupt the `wait' builtin, as Posix requires. However, the interrupt +causes bash to not run a SIGCHLD trap for all exited children. This patch +fixes the issue and restores the documented behavior in Posix mode. + +Patch (apply with `patch -p0'): + +--- a/jobs.c ++++ b/jobs.c +@@ -3339,7 +3339,9 @@ itrace("waitchld: waitpid returns %d blo + if (posixly_correct && this_shell_builtin && this_shell_builtin == wait_builtin) + { + interrupt_immediately = 0; +- trap_handler (SIGCHLD); /* set pending_traps[SIGCHLD] */ ++ /* This was trap_handler (SIGCHLD) but that can lose traps if ++ children_exited > 1 */ ++ queue_sigchld_trap (children_exited); + wait_signal_received = SIGCHLD; + /* If we're in a signal handler, let CHECK_WAIT_INTR pick it up; + run_pending_traps will call run_sigchld_trap later */ +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 31 ++#define PATCHLEVEL 32 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/133-upstream-bash43-033.patch b/trunk/package/feeds/packages/bash/patches/133-upstream-bash43-033.patch new file mode 100644 index 00000000..6210b5ea --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/133-upstream-bash43-033.patch @@ -0,0 +1,201 @@ + BASH PATCH REPORT + ================= + +Bash-Release: 4.3 +Patch-ID: bash43-033 + +Bug-Reported-by: mickael9@gmail.com, Jan Rome +Bug-Reference-ID: <20140907224046.382ED3610CC@mickael-laptop.localdomain>, + <540D661D.50908@gmail.com> +Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00029.html + http://lists.gnu.org/archive/html/bug-bash/2014-09/msg00030.html + +Bug-Description: + +Bash does not clean up the terminal state in all cases where bash or +readline modifies it and bash is subsequently terminated by a fatal signal. +This happens when the `read' builtin modifies the terminal settings, both +when readline is active and when it is not. It occurs most often when a script +installs a trap that exits on a signal without re-sending the signal to itself. + +Patch (apply with `patch -p0'): + +--- a/shell.c ++++ b/shell.c +@@ -73,6 +73,7 @@ + #endif + + #if defined (READLINE) ++# include + # include "bashline.h" + #endif + +@@ -909,6 +910,14 @@ exit_shell (s) + fflush (stdout); /* XXX */ + fflush (stderr); + ++ /* Clean up the terminal if we are in a state where it's been modified. */ ++#if defined (READLINE) ++ if (RL_ISSTATE (RL_STATE_TERMPREPPED) && rl_deprep_term_function) ++ (*rl_deprep_term_function) (); ++#endif ++ if (read_tty_modified ()) ++ read_tty_cleanup (); ++ + /* Do trap[0] if defined. Allow it to override the exit status + passed to us. */ + if (signal_is_trapped (0)) +--- a/builtins/read.def ++++ b/builtins/read.def +@@ -140,10 +140,12 @@ static void reset_alarm __P((void)); + procenv_t alrmbuf; + int sigalrm_seen; + +-static int reading; ++static int reading, tty_modified; + static SigHandler *old_alrm; + static unsigned char delim; + ++static struct ttsave termsave; ++ + /* In all cases, SIGALRM just sets a flag that we check periodically. This + avoids problems with the semi-tricky stuff we do with the xfree of + input_string at the top of the unwind-protect list (see below). */ +@@ -188,7 +190,6 @@ read_builtin (list) + struct stat tsb; + SHELL_VAR *var; + TTYSTRUCT ttattrs, ttset; +- struct ttsave termsave; + #if defined (ARRAY_VARS) + WORD_LIST *alist; + #endif +@@ -221,7 +222,7 @@ read_builtin (list) + USE_VAR(ps2); + USE_VAR(lastsig); + +- sigalrm_seen = reading = 0; ++ sigalrm_seen = reading = tty_modified = 0; + + i = 0; /* Index into the string that we are reading. */ + raw = edit = 0; /* Not reading raw input by default. */ +@@ -438,6 +439,8 @@ read_builtin (list) + retval = 128+SIGALRM; + goto assign_vars; + } ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + old_alrm = set_signal_handler (SIGALRM, sigalrm); + add_unwind_protect (reset_alarm, (char *)NULL); + #if defined (READLINE) +@@ -482,7 +485,10 @@ read_builtin (list) + i = silent ? ttfd_cbreak (fd, &ttset) : ttfd_onechar (fd, &ttset); + if (i < 0) + sh_ttyerror (1); ++ tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + } + } + else if (silent) /* turn off echo but leave term in canonical mode */ +@@ -497,7 +503,10 @@ read_builtin (list) + if (i < 0) + sh_ttyerror (1); + ++ tty_modified = 1; + add_unwind_protect ((Function *)ttyrestore, (char *)&termsave); ++ if (interactive_shell == 0) ++ initialize_terminating_signals (); + } + + /* This *must* be the top unwind-protect on the stack, so the manipulation +@@ -588,6 +597,8 @@ read_builtin (list) + } + else + lastsig = 0; ++ if (terminating_signal && tty_modified) ++ ttyrestore (&termsave); /* fix terminal before exiting */ + CHECK_TERMSIG; + eof = 1; + break; +@@ -978,6 +989,20 @@ ttyrestore (ttp) + struct ttsave *ttp; + { + ttsetattr (ttp->fd, ttp->attrs); ++ tty_modified = 0; ++} ++ ++void ++read_tty_cleanup () ++{ ++ if (tty_modified) ++ ttyrestore (&termsave); ++} ++ ++int ++read_tty_modified () ++{ ++ return (tty_modified); + } + + #if defined (READLINE) +--- a/builtins/common.h ++++ b/builtins/common.h +@@ -122,6 +122,10 @@ extern void bash_logout __P((void)); + /* Functions from getopts.def */ + extern void getopts_reset __P((int)); + ++/* Functions from read.def */ ++extern void read_tty_cleanup __P((void)); ++extern int read_tty_modified __P((void)); ++ + /* Functions from set.def */ + extern int minus_o_option_value __P((char *)); + extern void list_minus_o_opts __P((int, int)); +--- a/bashline.c ++++ b/bashline.c +@@ -202,6 +202,7 @@ extern int current_command_line_count, s + extern int last_command_exit_value; + extern int array_needs_making; + extern int posixly_correct, no_symbolic_links; ++extern int sigalrm_seen; + extern char *current_prompt_string, *ps1_prompt; + extern STRING_INT_ALIST word_token_alist[]; + extern sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; +@@ -4208,8 +4209,9 @@ bash_event_hook () + { + /* If we're going to longjmp to top_level, make sure we clean up readline. + check_signals will call QUIT, which will eventually longjmp to top_level, +- calling run_interrupt_trap along the way. */ +- if (interrupt_state) ++ calling run_interrupt_trap along the way. The check for sigalrm_seen is ++ to clean up the read builtin's state. */ ++ if (terminating_signal || interrupt_state || sigalrm_seen) + rl_cleanup_after_signal (); + bashline_reset_event_hook (); + check_signals_and_traps (); /* XXX */ +--- a/sig.c ++++ b/sig.c +@@ -532,8 +532,10 @@ termsig_sighandler (sig) + #if defined (READLINE) + /* Set the event hook so readline will call it after the signal handlers + finish executing, so if this interrupted character input we can get +- quick response. */ +- if (interactive_shell && interactive && no_line_editing == 0) ++ quick response. If readline is active or has modified the terminal we ++ need to set this no matter what the signal is, though the check for ++ RL_STATE_TERMPREPPED is possibly redundant. */ ++ if (RL_ISSTATE (RL_STATE_SIGHANDLER) || RL_ISSTATE (RL_STATE_TERMPREPPED)) + bashline_set_event_hook (); + #endif + +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 32 ++#define PATCHLEVEL 33 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/trunk/package/feeds/packages/bash/patches/900-no_doc.patch b/trunk/package/feeds/packages/bash/patches/900-no_doc.patch new file mode 100644 index 00000000..3e7be421 --- /dev/null +++ b/trunk/package/feeds/packages/bash/patches/900-no_doc.patch @@ -0,0 +1,13 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -741,10 +741,8 @@ reconfig: force + # $(MAKE) -f $(srcdir)/Makefile $(MFLAGS) srcdir=$(srcdir) + + doc documentation: force +- @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) ) + + info dvi ps: force +- @(cd $(DOCDIR) ; $(MAKE) $(MFLAGS) CFLAGS='$(CCFLAGS)' $@ ) + + force: + diff --git a/trunk/package/feeds/packages/bcp38/Makefile b/trunk/package/feeds/packages/bcp38/Makefile new file mode 100644 index 00000000..280bcc50 --- /dev/null +++ b/trunk/package/feeds/packages/bcp38/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2014 Openwrt.org +# +# This is free software, licensed under the GNU General Public License v2. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bcp38 +PKG_VERSION:=4 +PKG_RELEASE:=1 +PKG_LICENCE:=GPL-3.0+ + +include $(INCLUDE_DIR)/package.mk + +define Package/bcp38 + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=BCP38 compliance + URL:=https://github.com/dtaht/ceropackages-3.10 + MAINTAINER:=Toke Høiland-Jørgensen + DEPENDS:=+ipset +endef + +define Package/bcp38/description + bcp38 implements IETF BCP38 for home routers. See https://tools.ietf.org/html/bcp38. +endef + +define Package/bcp38/conffiles +/etc/config/bcp38 +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/bcp38/install + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/bcp38.config $(1)/etc/config/bcp38 + $(INSTALL_DIR) $(1)/usr/lib/bcp38 + $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/bcp38/run.sh + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/bcp38.defaults $(1)/etc/uci-defaults/bcp38 +endef + +define Package/bcp38/postinst +#!/bin/sh +[ -x /etc/uci-defaults/bcp38 ] && /etc/uci-defaults/bcp38 || exit 0 +endef + +define Package/bcp38/postrm +#!/bin/sh +uci delete firewall.bcp38 +uci commit +endef + +$(eval $(call BuildPackage,bcp38)) diff --git a/trunk/package/feeds/packages/bcp38/files/bcp38.config b/trunk/package/feeds/packages/bcp38/files/bcp38.config new file mode 100644 index 00000000..08e8e20b --- /dev/null +++ b/trunk/package/feeds/packages/bcp38/files/bcp38.config @@ -0,0 +1,22 @@ +config bcp38 + option enabled 0 + option interface 'eth1' + option detect_upstream 1 + list match '127.0.0.0/8' + list match '0.0.0.0/8' # RFC 1700 + list match '240.0.0.0/4' # RFC 5745 + list match '192.0.2.0/24' # RFC 5737 + list match '198.51.100.0/24' # RFC 5737 + list match '203.0.113.0/24' # RFC 5737 + list match '192.168.0.0/16' # RFC 1918 + list match '10.0.0.0/8' # RFC 1918 + list match '172.16.0.0/12' # RFC 1918 + list match '169.254.0.0/16' # RFC 3927 + +# list nomatch '172.26.0.0/21' # Example of something not to match +# There is a dhcp trigger to do this for the netmask of a +# double natted connection needed + +# I will argue that this level of indirection doesn't scale +# very well - see how to block china as an example +# http://www.okean.com/china.txt diff --git a/trunk/package/feeds/packages/bcp38/files/bcp38.defaults b/trunk/package/feeds/packages/bcp38/files/bcp38.defaults new file mode 100644 index 00000000..d7e0d806 --- /dev/null +++ b/trunk/package/feeds/packages/bcp38/files/bcp38.defaults @@ -0,0 +1,13 @@ +#!/bin/sh + +uci -q batch <<-EOT + delete firewall.bcp38 + set firewall.bcp38=include + set firewall.bcp38.type=script + set firewall.bcp38.path=/usr/lib/bcp38/run.sh + set firewall.bcp38.family=IPv4 + set firewall.bcp38.reload=1 + commit firewall +EOT + +exit 0 diff --git a/trunk/package/feeds/packages/bcp38/files/run.sh b/trunk/package/feeds/packages/bcp38/files/run.sh new file mode 100755 index 00000000..bafdf3bb --- /dev/null +++ b/trunk/package/feeds/packages/bcp38/files/run.sh @@ -0,0 +1,104 @@ +#!/bin/sh +# BCP38 filtering implementation for CeroWrt. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. +# +# Author: Toke Høiland-Jørgensen + +STOP=$1 +IPSET_NAME=bcp38-ipv4 +IPTABLES_CHAIN=BCP38 + +. /lib/functions.sh + +config_load bcp38 + +add_bcp38_rule() +{ + local subnet="$1" + local action="$2" + + if [ "$action" == "nomatch" ]; then + ipset add "$IPSET_NAME" "$subnet" nomatch + else + ipset add "$IPSET_NAME" "$subnet" + fi +} + +detect_upstream() +{ + local interface="$1" + + subnets=$(ip route show dev "$interface" | grep 'scope link' | awk '{print $1}') + for subnet in $subnets; do + # ipset test doesn't work for subnets, so strip out the subnet part + # and test for that; add as exception if there's a match + addr=$(echo $subnet | sed 's|/[0-9]\+$||') + ipset test "$IPSET_NAME" $addr 2>/dev/null && add_bcp38_rule $subnet nomatch + done +} + +run() { + local section="$1" + local enabled + local interface + local detect_upstream + config_get_bool enabled "$section" enabled 0 + config_get interface "$section" interface + config_get detect_upstream "$section" detect_upstream + + if [ "$enabled" -eq "1" -a -n "$interface" -a -z "$STOP" ] ; then + setup_ipset + setup_iptables "$interface" + config_list_foreach "$section" match add_bcp38_rule match + config_list_foreach "$section" nomatch add_bcp38_rule nomatch + [ "$detect_upstream" -eq "1" ] && detect_upstream "$interface" + fi + exit 0 +} + +setup_ipset() +{ + ipset create "$IPSET_NAME" hash:net family ipv4 + ipset flush "$IPSET_NAME" +} + +setup_iptables() +{ + local interface="$1" + iptables -N "$IPTABLES_CHAIN" 2>/dev/null + iptables -F "$IPTABLES_CHAIN" 2>/dev/null + + iptables -I output_rule -j "$IPTABLES_CHAIN" + iptables -I input_rule -j "$IPTABLES_CHAIN" + iptables -I forwarding_rule -j "$IPTABLES_CHAIN" + + # always accept DHCP traffic + iptables -A "$IPTABLES_CHAIN" -p udp --dport 67:68 --sport 67:68 -j RETURN + iptables -A "$IPTABLES_CHAIN" -o "$interface" -m set --match-set "$IPSET_NAME" dst -j REJECT --reject-with icmp-net-unreachable + iptables -A "$IPTABLES_CHAIN" -i "$interface" -m set --match-set "$IPSET_NAME" src -j DROP +} + +destroy_ipset() +{ + ipset flush "$IPSET_NAME" 2>/dev/null + ipset destroy "$IPSET_NAME" 2>/dev/null +} + +destroy_iptables() +{ + iptables -D output_rule -j "$IPTABLES_CHAIN" 2>/dev/null + iptables -D input_rule -j "$IPTABLES_CHAIN" 2>/dev/null + iptables -D forwarding_rule -j "$IPTABLES_CHAIN" 2>/dev/null + iptables -F "$IPTABLES_CHAIN" 2>/dev/null + iptables -X "$IPTABLES_CHAIN" 2>/dev/null +} + +destroy_iptables +destroy_ipset +config_foreach run bcp38 + +exit 0 diff --git a/trunk/package/feeds/packages/bind/Makefile b/trunk/package/feeds/packages/bind/Makefile new file mode 100644 index 00000000..e4ee053d --- /dev/null +++ b/trunk/package/feeds/packages/bind/Makefile @@ -0,0 +1,204 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# 2014 Noah Meyerhans +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bind +PKG_VERSION:=9.9.6-P1 +PKG_RELEASE:=2 +USERID:=bind=57:bind=57 + +PKG_MAINTAINER := Noah Meyerhans +PKG_LICENSE := BSD-3-Clause + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:= \ + ftp://ftp.isc.org/isc/bind9/$(PKG_VERSION) \ + http://www.mirrorservice.org/sites/ftp.isc.org/isc/bind9/$(PKG_VERSION) +PKG_MD5SUM:=ca9d8f4d26e740668d361bfc50d90fc7 + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 libtool.m4 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bind/Default + SECTION:=net + CATEGORY:=Network + DEPENDS:=+bind-libs + TITLE:=bind + URL:=https://www.isc.org/software/bind + SUBMENU:=IP Addresses and Names +endef + +define Package/bind-libs + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libopenssl + TITLE:=bind shared libraries + URL:=https://www.isc.org/software/bind +endef + +define Package/bind-server + $(call Package/bind/Default) + TITLE+= DNS server +endef + +define Package/bind-client + $(call Package/bind/Default) + TITLE+= dynamic DNS client +endef + +define Package/bind-tools + $(call Package/bind/Default) + TITLE+= administration tools (all) +endef + +define Package/bind-rndc + $(call Package/bind/Default) + TITLE+= administration tools (rndc and rndc-confgen only) +endef + +define Package/bind-check + $(call Package/bind/Default) + TITLE+= administration tools (named-checkconf and named-checkzone only) +endef + +define Package/bind-dnssec + $(call Package/bind/Default) + TITLE+= administration tools (dnssec-keygen and dnssec-signzone only) +endef + +define Package/bind-host + $(call Package/bind/Default) + TITLE+= simple DNS client +endef + +define Package/bind-dig + $(call Package/bind/Default) + TITLE+= DNS excavation tool +endef + +export BUILD_CC="$(TARGET_CC)" + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --with-randomdev="/dev/urandom" \ + --disable-threads \ + --disable-linux-caps \ + --with-openssl="$(STAGING_DIR)/usr" \ + --with-libtool \ + --with-libxml2=no \ + --enable-epoll=yes \ + --with-gost=no \ + --with-gssapi=no \ + --with-ecdsa=no \ + --with-readline=no + +CONFIGURE_VARS += \ + BUILD_CC="$(TARGET_CC)" \ + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/lib/dns \ + BUILD_CC="$(HOSTCC)" \ + CC="$(HOSTCC)" \ + CFLAGS="-O2" \ + LIBS="" \ + gen + $(call Build/Compile/Default) +endef + +define Package/bind-libs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib +endef + +define Package/bind-server/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc/bind + $(CP) \ + ./files/bind/db.0 \ + ./files/bind/db.127 \ + ./files/bind/db.255 \ + ./files/bind/db.local \ + ./files/bind/db.root \ + $(1)/etc/bind/ + $(CP) ./files/bind/named.conf.example $(1)/etc/bind/named.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/named.init $(1)/etc/init.d/named + find $(1)/etc/bind/ -name ".svn" | xargs rm -rf +endef + +define Package/bind-server/conffiles +/etc/bind/db.0 +/etc/bind/db.127 +/etc/bind/db.255 +/etc/bind/db.local +/etc/bind/db.root +/etc/bind/named.conf +endef + +define Package/bind-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nsupdate $(1)/usr/bin/ +endef + +define Package/bind-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/ +endef + +define Package/bind-rndc/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/rndc-confgen $(1)/usr/sbin/ +endef + +define Package/bind-check/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/ +endef + +define Package/bind-dnssec/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/ +endef + +define Package/bind-host/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/ +endef + +define Package/bind-dig/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dig $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bind-libs)) +$(eval $(call BuildPackage,bind-server)) +$(eval $(call BuildPackage,bind-client)) +$(eval $(call BuildPackage,bind-tools)) +$(eval $(call BuildPackage,bind-rndc)) +$(eval $(call BuildPackage,bind-check)) +$(eval $(call BuildPackage,bind-dnssec)) +$(eval $(call BuildPackage,bind-host)) +$(eval $(call BuildPackage,bind-dig)) diff --git a/trunk/package/feeds/packages/bind/files/bind/db.0 b/trunk/package/feeds/packages/bind/files/bind/db.0 new file mode 100644 index 00000000..e3aabdbe --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/bind/db.0 @@ -0,0 +1,12 @@ +; +; BIND reverse data file for broadcast zone +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. diff --git a/trunk/package/feeds/packages/bind/files/bind/db.127 b/trunk/package/feeds/packages/bind/files/bind/db.127 new file mode 100644 index 00000000..cd05bef1 --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/bind/db.127 @@ -0,0 +1,13 @@ +; +; BIND reverse data file for local loopback interface +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. +1.0.0 IN PTR localhost. diff --git a/trunk/package/feeds/packages/bind/files/bind/db.255 b/trunk/package/feeds/packages/bind/files/bind/db.255 new file mode 100644 index 00000000..e3aabdbe --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/bind/db.255 @@ -0,0 +1,12 @@ +; +; BIND reverse data file for broadcast zone +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. diff --git a/trunk/package/feeds/packages/bind/files/bind/db.local b/trunk/package/feeds/packages/bind/files/bind/db.local new file mode 100644 index 00000000..66b48923 --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/bind/db.local @@ -0,0 +1,13 @@ +; +; BIND data file for local loopback interface +; +$TTL 604800 +@ IN SOA localhost. root.localhost. ( + 1 ; Serial + 604800 ; Refresh + 86400 ; Retry + 2419200 ; Expire + 604800 ) ; Negative Cache TTL +; +@ IN NS localhost. +@ IN A 127.0.0.1 diff --git a/trunk/package/feeds/packages/bind/files/bind/db.root b/trunk/package/feeds/packages/bind/files/bind/db.root new file mode 100644 index 00000000..0eb52af7 --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/bind/db.root @@ -0,0 +1,45 @@ + +; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net. +;; global options: printcmd +;; Got answer: +;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944 +;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13 + +;; QUESTION SECTION: +;. IN NS + +;; ANSWER SECTION: +. 518400 IN NS A.ROOT-SERVERS.NET. +. 518400 IN NS B.ROOT-SERVERS.NET. +. 518400 IN NS C.ROOT-SERVERS.NET. +. 518400 IN NS D.ROOT-SERVERS.NET. +. 518400 IN NS E.ROOT-SERVERS.NET. +. 518400 IN NS F.ROOT-SERVERS.NET. +. 518400 IN NS G.ROOT-SERVERS.NET. +. 518400 IN NS H.ROOT-SERVERS.NET. +. 518400 IN NS I.ROOT-SERVERS.NET. +. 518400 IN NS J.ROOT-SERVERS.NET. +. 518400 IN NS K.ROOT-SERVERS.NET. +. 518400 IN NS L.ROOT-SERVERS.NET. +. 518400 IN NS M.ROOT-SERVERS.NET. + +;; ADDITIONAL SECTION: +A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4 +B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201 +C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12 +D.ROOT-SERVERS.NET. 3600000 IN A 128.8.10.90 +E.ROOT-SERVERS.NET. 3600000 IN A 192.203.230.10 +F.ROOT-SERVERS.NET. 3600000 IN A 192.5.5.241 +G.ROOT-SERVERS.NET. 3600000 IN A 192.112.36.4 +H.ROOT-SERVERS.NET. 3600000 IN A 128.63.2.53 +I.ROOT-SERVERS.NET. 3600000 IN A 192.36.148.17 +J.ROOT-SERVERS.NET. 3600000 IN A 192.58.128.30 +K.ROOT-SERVERS.NET. 3600000 IN A 193.0.14.129 +L.ROOT-SERVERS.NET. 3600000 IN A 199.7.83.42 +M.ROOT-SERVERS.NET. 3600000 IN A 202.12.27.33 + +;; Query time: 81 msec +;; SERVER: 198.41.0.4#53(a.root-servers.net.) +;; WHEN: Sun Feb 1 11:27:14 2004 +;; MSG SIZE rcvd: 436 + diff --git a/trunk/package/feeds/packages/bind/files/bind/named.conf.example b/trunk/package/feeds/packages/bind/files/bind/named.conf.example new file mode 100644 index 00000000..16245495 --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/bind/named.conf.example @@ -0,0 +1,45 @@ +// This is the primary configuration file for the BIND DNS server named. + +options { + directory "/tmp"; + + // If your ISP provided one or more IP addresses for stable + // nameservers, you probably want to use them as forwarders. + // Uncomment the following block, and insert the addresses replacing + // the all-0's placeholder. + + // forwarders { + // 0.0.0.0; + // }; + + auth-nxdomain no; # conform to RFC1035 +}; + +// prime the server with knowledge of the root servers +zone "." { + type hint; + file "/etc/bind/db.root"; +}; + +// be authoritative for the localhost forward and reverse zones, and for +// broadcast zones as per RFC 1912 + +zone "localhost" { + type master; + file "/etc/bind/db.local"; +}; + +zone "127.in-addr.arpa" { + type master; + file "/etc/bind/db.127"; +}; + +zone "0.in-addr.arpa" { + type master; + file "/etc/bind/db.0"; +}; + +zone "255.in-addr.arpa" { + type master; + file "/etc/bind/db.255"; +}; diff --git a/trunk/package/feeds/packages/bind/files/named.init b/trunk/package/feeds/packages/bind/files/named.init new file mode 100644 index 00000000..2ef7797b --- /dev/null +++ b/trunk/package/feeds/packages/bind/files/named.init @@ -0,0 +1,36 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 Noah Meyerhans +# Licensed under the terms of the GNU General Public License version 2 +# or (at your discretion) any later later version + +USE_PROCD=1 + +START=50 + +config_file=/etc/bind/named.conf +pid_file=/var/run/named/named.pid + +logdir=/var/log/named/ +cachedir=/var/cache/bind +libdir=/var/lib/bind +config_file=/etc/bind/named.conf + +fix_perms() { + for dir in $libdir $logdir $cachedir; do + test -e "$dir" || { + mkdir -p "$dir" + chgrp bind "$dir" + chmod g+w "$dir" + } + done +} + +start_service() { + user_exists bind 57 || user_add bind 57 + group_exists bind 57 || group_add bind 57 + fix_perms + procd_open_instance + procd_set_param command /usr/sbin/named -u bind -f -c $config_file + procd_set_param respawn + procd_close_instance +} diff --git a/trunk/package/feeds/packages/bind/patches/001-no-tests.patch b/trunk/package/feeds/packages/bind/patches/001-no-tests.patch new file mode 100644 index 00000000..c969c5e9 --- /dev/null +++ b/trunk/package/feeds/packages/bind/patches/001-no-tests.patch @@ -0,0 +1,26 @@ +Index: bind-9.9.4/bin/Makefile.in +=================================================================== +--- bind-9.9.4.orig/bin/Makefile.in ++++ bind-9.9.4/bin/Makefile.in +@@ -19,7 +19,7 @@ srcdir = @srcdir@ + VPATH = @srcdir@ + top_srcdir = @top_srcdir@ + +-SUBDIRS = named rndc dig dnssec tools tests nsupdate \ ++SUBDIRS = named rndc dig dnssec tools nsupdate \ + check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@ + TARGETS = + +Index: bind-9.9.4/lib/Makefile.in +=================================================================== +--- bind-9.9.4.orig/lib/Makefile.in ++++ bind-9.9.4/lib/Makefile.in +@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@ + # Attempt to disable parallel processing. + .NOTPARALLEL: + .NO_PARALLEL: +-SUBDIRS = isc isccc dns isccfg bind9 lwres tests ++SUBDIRS = isc isccc dns isccfg bind9 lwres + TARGETS = + + @BIND9_MAKE_RULES@ diff --git a/trunk/package/feeds/packages/bind/patches/002-autoconf-ar-fix.patch b/trunk/package/feeds/packages/bind/patches/002-autoconf-ar-fix.patch new file mode 100644 index 00000000..501fa7d3 --- /dev/null +++ b/trunk/package/feeds/packages/bind/patches/002-autoconf-ar-fix.patch @@ -0,0 +1,29 @@ +--- a/configure.in ++++ b/configure.in +@@ -93,26 +93,11 @@ esac + # + AC_CONFIG_FILES([make/rules make/includes]) + +-AC_PATH_PROG(AR, ar) +-ARFLAGS="cruv" +-AC_SUBST(AR) +-AC_SUBST(ARFLAGS) +- + # The POSIX ln(1) program. Non-POSIX systems may substitute + # "copy" or something. + LN=ln + AC_SUBST(LN) + +-case "$AR" in +- "") +- AC_MSG_ERROR([ +-ar program not found. Please fix your PATH to include the directory in +-which ar resides, or set AR in the environment with the full path to ar. +-]) +- +- ;; +-esac +- + # + # Etags. + # diff --git a/trunk/package/feeds/packages/bluelog/Makefile b/trunk/package/feeds/packages/bluelog/Makefile new file mode 100644 index 00000000..2fe10d87 --- /dev/null +++ b/trunk/package/feeds/packages/bluelog/Makefile @@ -0,0 +1,92 @@ +# +# Copyright (C) 2012-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bluelog +PKG_VERSION:=1.1.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.digifail.com/software/bluelog +PKG_MD5SUM:=614d0fe65bae68acff1d33d9f86e4805 + +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Nicolas Thill + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bluelog/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Bluetooth scanner and logger + URL:=http://www.digifail.com/software/bluelog.shtml + DEPENDS:=+bluez-libs +kmod-bluetooth +endef + +define Package/bluelog/Default/description + Bluelog is a simple Bluetooth scanner designed to tell you how many + discoverable devices there are in an area as quickly as possible. It is + intended to be used as a site survey tool, identifying the number of possible + Bluetooth targets there are in the surrounding environment. +endef + +define Package/bluelog + $(call Package/bluelog/Default) +endef + +define Package/bluelog/description + $(call Package/bluelog/Default/description) +endef + +define Package/bluelog-live + $(call Package/bluelog/Default) + TITLE+= (live output) + DEPENDS+= bluelog +endef + +define Package/bluelog-live/description + $(call Package/bluelog/Default/description) + This package contains the files for "Bluelog Live", an optional mode of + Bluelog which creates a real-time webpage of discovered Bluetooth devices. +endef + +TARGET_CFLAGS += -DOPENWRT + +MAKE_FLAGS += \ + LIBS="$(TARGET_LDFLAGS) -lbluetooth -lm" + +define Package/bluelog/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluelog $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bluelog.init $(1)/etc/init.d/bluelog +endef + +define Package/bluelog-live/install + $(INSTALL_DIR) $(1)/www/bluelog + $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/*.html $(1)/www/bluelog/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/bluelog/openwrt.css \ + $(1)/www/bluelog/style.css + $(INSTALL_DIR) $(1)/www/bluelog/images + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/bluelog/images/digifail_logo.png \ + $(PKG_INSTALL_DIR)/usr/share/bluelog/images/email.png \ + $(PKG_INSTALL_DIR)/usr/share/bluelog/images/favicon.png \ + $(PKG_INSTALL_DIR)/usr/share/bluelog/images/openwrt_logo.png \ + $(PKG_INSTALL_DIR)/usr/share/bluelog/images/qrcontact.png \ + $(1)/www/bluelog/images/ + $(INSTALL_DIR) $(1)/www/cgi-bin + $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/cgi-bin/* $(1)/www/cgi-bin/ +endef + +$(eval $(call BuildPackage,bluelog)) +$(eval $(call BuildPackage,bluelog-live)) diff --git a/trunk/package/feeds/packages/bluelog/files/bluelog.init b/trunk/package/feeds/packages/bluelog/files/bluelog.init new file mode 100644 index 00000000..efae2886 --- /dev/null +++ b/trunk/package/feeds/packages/bluelog/files/bluelog.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common + +START=65 + +SERVICE_DAEMONIZE=1 + +start() { + service_start /usr/bin/bluelog +} + +stop() { + service_stop /usr/bin/bluelog +} diff --git a/trunk/package/feeds/packages/bluez/Makefile b/trunk/package/feeds/packages/bluez/Makefile new file mode 100644 index 00000000..d2bc8fab --- /dev/null +++ b/trunk/package/feeds/packages/bluez/Makefile @@ -0,0 +1,129 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bluez +PKG_VERSION:=5.30 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/bluetooth/ +PKG_MD5SUM:=24ba1d1e8e7ef5b8f4033a3059d7600e + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Nicolas Thill + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/bluez/Default + TITLE:=Bluetooth + URL:=http://www.bluez.org/ +endef + +define Package/bluez-examples +$(call Package/bluez/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= python example apps + DEPENDS:=+python +endef + +define Package/bluez-examples/description + contains many examples apps for bluetooth, requiring python +endef + +define Package/bluez-libs +$(call Package/bluez/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= library + DEPENDS:=+libpthread +endef + +define Package/bluez-utils +$(call Package/bluez/Default) + SECTION:=utils + CATEGORY:=Utilities + TITLE+= utilities + DEPENDS:=+bluez-libs +libpthread +librt +dbus +glib2 +libical +libncurses +libreadline $(INTL_DEPENDS) $(ICONV_DEPENDS) +endef + +define Package/bluez-utils/conffiles +/etc/bluetooth/main.conf +/etc/bluetooth/network.conf +/etc/bluetooth/input.conf +/etc/bluetooth/proximity.conf +/etc/config/bluetooth +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared \ + --enable-client \ + --enable-datafiles \ + --enable-experimental \ + --enable-library \ + --enable-monitor \ + --enable-obex \ + --enable-threads \ + --enable-tools \ + --disable-android \ + --disable-cups \ + --disable-manpages \ + --disable-sixaxis \ + --disable-systemd \ + --disable-test \ + --disable-udev \ + +TARGET_CPPFLAGS += \ + -D_GNU_SOURCE + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/bluetooth $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/bluez.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/bluez-examples/install + $(INSTALL_DIR) $(1)/usr/bin/bluez + $(INSTALL_DATA) $(PKG_BUILD_DIR)/test/* $(1)/usr/bin/bluez/ +endef + +define Package/bluez-libs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbluetooth.so.* $(1)/usr/lib/ +endef + +define Package/bluez-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/bluetoothd $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/bluetooth/obexd $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/bluetooth.config $(1)/etc/config/bluetooth + $(INSTALL_DIR) $(1)/etc/dbus-1/system.d/ + $(INSTALL_DATA) ./files/bluetooth.dbus $(1)/etc/dbus-1/system.d/bluetooth.conf + $(INSTALL_DIR) $(1)/etc/bluetooth + $(INSTALL_DATA) $(PKG_BUILD_DIR)/src/main.conf $(1)/etc/bluetooth/main.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/network/network.conf $(1)/etc/bluetooth/network.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/input/input.conf $(1)/etc/bluetooth/input.conf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/profiles/proximity/proximity.conf $(1)/etc/bluetooth/proximity.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/bluetoothd.init $(1)/etc/init.d/bluetoothd +endef + +$(eval $(call BuildPackage,bluez-examples)) +$(eval $(call BuildPackage,bluez-libs)) +$(eval $(call BuildPackage,bluez-utils)) diff --git a/trunk/package/feeds/packages/bluez/files/bluetooth.config b/trunk/package/feeds/packages/bluez/files/bluetooth.config new file mode 100644 index 00000000..6f23617a --- /dev/null +++ b/trunk/package/feeds/packages/bluez/files/bluetooth.config @@ -0,0 +1,15 @@ +config bluetoothd +# option config /etc/bluetooth/main.conf + option enabled 1 + +config hciattach + option initspeed 115200 + option tty ttyS1 + option type csr + option speed 115200 + option flow noflow + option enabled 0 + +config rfcomm +# option config /etc/bluetooth/rfcomm.conf + option enabled 0 diff --git a/trunk/package/feeds/packages/bluez/files/bluetooth.dbus b/trunk/package/feeds/packages/bluez/files/bluetooth.dbus new file mode 100644 index 00000000..88545fac --- /dev/null +++ b/trunk/package/feeds/packages/bluez/files/bluetooth.dbus @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/package/feeds/packages/bluez/files/bluetoothd.init b/trunk/package/feeds/packages/bluez/files/bluetoothd.init new file mode 100644 index 00000000..75f4d966 --- /dev/null +++ b/trunk/package/feeds/packages/bluez/files/bluetoothd.init @@ -0,0 +1,13 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007 OpenWrt.org + +#start after dbus (60) +START=62 +USE_PROCD=1 +PROG=/usr/bin/bluetoothd + +start_service() { + procd_open_instance + procd_set_param command "$PROG" -n + procd_close_instance +} diff --git a/trunk/package/feeds/packages/bluez/files/givepin b/trunk/package/feeds/packages/bluez/files/givepin new file mode 100644 index 00000000..e52a3384 --- /dev/null +++ b/trunk/package/feeds/packages/bluez/files/givepin @@ -0,0 +1,14 @@ +#!/bin/sh + +# Write bluetooth PIN number here: +pin= + +if [ -z "$pin" ]; then + msg="Set bluetooth PIN in file $0" + logger -p user.err "$msg" + for i in /dev/pts/* ; do + [ -w $i ] && echo "$msg" > $i + done +else + echo "PIN:$pin" +fi diff --git a/trunk/package/feeds/packages/bluez/patches/200-uart-speed.patch b/trunk/package/feeds/packages/bluez/patches/200-uart-speed.patch new file mode 100644 index 00000000..ebe0153e --- /dev/null +++ b/trunk/package/feeds/packages/bluez/patches/200-uart-speed.patch @@ -0,0 +1,40 @@ +--- a/tools/hciattach.c ++++ b/tools/hciattach.c +@@ -101,20 +101,37 @@ int uart_speed(int s) + return B230400; + case 460800: + return B460800; ++/* FIX: Not all platform support this high serial speed ++ claudyus84 @gamil.com ++*/ ++#ifdef B500000 + case 500000: + return B500000; ++#endif ++#ifdef B576000 + case 576000: + return B576000; ++#endif ++#ifdef B921600 + case 921600: + return B921600; ++#endif ++#ifdef B1000000 + case 1000000: + return B1000000; ++#endif ++#ifdef B1152000 + case 1152000: + return B1152000; ++#endif ++#ifdef B1500000 + case 1500000: + return B1500000; ++#endif ++#ifdef B2000000 + case 2000000: + return B2000000; ++#endif + #ifdef B2500000 + case 2500000: + return B2500000; diff --git a/trunk/package/feeds/packages/bluez/patches/201-readline.patch b/trunk/package/feeds/packages/bluez/patches/201-readline.patch new file mode 100644 index 00000000..58396dcb --- /dev/null +++ b/trunk/package/feeds/packages/bluez/patches/201-readline.patch @@ -0,0 +1,52 @@ +--- a/Makefile.in ++++ b/Makefile.in +@@ -2055,7 +2055,7 @@ unit_tests = $(am__append_32) unit/test- + @CLIENT_TRUE@ monitor/uuid.h monitor/uuid.c + + @CLIENT_TRUE@client_bluetoothctl_LDADD = gdbus/libgdbus-internal.la @GLIB_LIBS@ @DBUS_LIBS@ \ +-@CLIENT_TRUE@ -lreadline ++@CLIENT_TRUE@ -lreadline -lncurses + + @MONITOR_TRUE@monitor_btmon_SOURCES = monitor/main.c monitor/bt.h \ + @MONITOR_TRUE@ monitor/display.h monitor/display.c \ +@@ -2226,7 +2226,7 @@ unit_tests = $(am__append_32) unit/test- + @EXPERIMENTAL_TRUE@tools_hcieventmask_LDADD = lib/libbluetooth-internal.la + @EXPERIMENTAL_TRUE@tools_btmgmt_SOURCES = tools/btmgmt.c src/uuid-helper.c client/display.c + @EXPERIMENTAL_TRUE@tools_btmgmt_LDADD = lib/libbluetooth-internal.la src/libshared-mainloop.la \ +-@EXPERIMENTAL_TRUE@ -lreadline ++@EXPERIMENTAL_TRUE@ -lreadline -lncurses + + @EXPERIMENTAL_TRUE@tools_btinfo_SOURCES = tools/btinfo.c monitor/bt.h + @EXPERIMENTAL_TRUE@tools_btinfo_LDADD = src/libshared-mainloop.la +@@ -2266,13 +2266,13 @@ unit_tests = $(am__append_32) unit/test- + @READLINE_TRUE@ client/display.h + + @READLINE_TRUE@attrib_gatttool_LDADD = lib/libbluetooth-internal.la \ +-@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline ++@READLINE_TRUE@ src/libshared-glib.la @GLIB_LIBS@ -lreadline -lncurses + + @READLINE_TRUE@tools_obex_client_tool_SOURCES = $(gobex_sources) $(btio_sources) \ + @READLINE_TRUE@ tools/obex-client-tool.c + + @READLINE_TRUE@tools_obex_client_tool_LDADD = lib/libbluetooth-internal.la \ +-@READLINE_TRUE@ @GLIB_LIBS@ -lreadline ++@READLINE_TRUE@ @GLIB_LIBS@ -lreadline -lncurses + + @READLINE_TRUE@tools_obex_server_tool_SOURCES = $(gobex_sources) $(btio_sources) \ + @READLINE_TRUE@ tools/obex-server-tool.c +@@ -2282,13 +2282,13 @@ unit_tests = $(am__append_32) unit/test- + @READLINE_TRUE@ client/display.h client/display.c + + @READLINE_TRUE@tools_bluetooth_player_LDADD = gdbus/libgdbus-internal.la \ +-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline ++@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses + + @READLINE_TRUE@tools_obexctl_SOURCES = tools/obexctl.c \ + @READLINE_TRUE@ client/display.h client/display.c + + @READLINE_TRUE@tools_obexctl_LDADD = gdbus/libgdbus-internal.la \ +-@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline ++@READLINE_TRUE@ @GLIB_LIBS@ @DBUS_LIBS@ -lreadline -lncurses + + @EXPERIMENTAL_TRUE@tools_gatt_service_SOURCES = tools/gatt-service.c + @EXPERIMENTAL_TRUE@tools_gatt_service_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ gdbus/libgdbus-internal.la diff --git a/trunk/package/feeds/packages/bmon/Makefile b/trunk/package/feeds/packages/bmon/Makefile new file mode 100644 index 00000000..44da26c0 --- /dev/null +++ b/trunk/package/feeds/packages/bmon/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bmon +PKG_VERSION:=3.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/tgraf/bmon/releases/download/v$(PKG_VERSION)/ +PKG_MD5SUM:=b7d0d055727f2cf1e452f26dfbf6a825 +PKG_MAINTAINER:=Baptiste Jonglez +PKG_LICENSE:=MIT + +include $(INCLUDE_DIR)/package.mk + +define Package/bmon + SECTION:=net + CATEGORY:=Network + DEPENDS:=+PACKAGE_libncursesw:libncursesw +!PACKAGE_libncursesw:libncurses +libnl +confuse + TITLE:=bmon is a portable bandwidth monitor + URL:=https://github.com/tgraf/bmon/ +endef + +define Package/bmon/description + bmon is a portable bandwidth monitor + and rate estimator running on various + operating systems. It supports various + input methods for different architectures. +endef + +CONFIGURE_ARGS += \ + --disable-cnt-workaround \ + +CONFIGURE_VARS += \ + ac_cv_lib_nl_nl_connect=no \ + +define Package/bmon/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bmon $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,bmon)) diff --git a/trunk/package/feeds/packages/bogofilter/Makefile b/trunk/package/feeds/packages/bogofilter/Makefile new file mode 100644 index 00000000..d31dfa8c --- /dev/null +++ b/trunk/package/feeds/packages/bogofilter/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bogofilter +PKG_VERSION:=1.2.4 +PKG_RELEASE:=3 + +PKG_LICENSE:=GPLv2 +PKG_LICENSE_FILES:=COPYING + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/bogofilter +PKG_MD5SUM:=d0a5eebb3274b23ceabe766a6443a1c5 + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bogofilter + SECTION:=mail + CATEGORY:=Mail + DEPENDS:=+libdb47 + TITLE:=bogofilter + MAINTAINER:=W. Michael Petullo + URL:=http://bogofilter.sourceforge.net/ +endef + +define Package/bogofilter/description + Bogofilter is a fast Bayesian spam filter +endef + +CONFIGURE_ARGS += \ + --disable-unicode \ + --with-libdb-prefix=$(STAGING_DIR) \ + --with-included-gsl + +define Package/bogofilter/install + $(INSTALL_DIR) $(1)/etc/ \ + $(1)/usr/bin \ + $(1)/usr/sbin + $(INSTALL_CONF) $(PKG_BUILD_DIR)/bogofilter.cf.example $(1)/etc/bogofilter.cf + $(INSTALL_BIN) ./files/postfix-bogofilter $(1)/usr/sbin/postfix-bogofilter + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_compact $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_copy $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_tar $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogofilter $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogolexer $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogotune $(1)/usr/bin/ + $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogoutil $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bogofilter)) diff --git a/trunk/package/feeds/packages/bogofilter/files/postfix-bogofilter b/trunk/package/feeds/packages/bogofilter/files/postfix-bogofilter new file mode 100755 index 00000000..952d8cda --- /dev/null +++ b/trunk/package/feeds/packages/bogofilter/files/postfix-bogofilter @@ -0,0 +1,34 @@ +#!/bin/sh + +FILTER=/usr/bin/bogofilter +FILTER_DIR=/mnt/sda1/var/spool/bogofilter +# WARNING! The -i is crucial, else you may see +# messages truncated at the first period that is alone on a line +# (which can happen with several kinds of messages, particularly +# quoted-printable) +# -G is ignored before Postfix 2.3 and tells it that the message +# does not originate on the local system (Gateway submission), +# so Postfix avoids some of the local expansions that can leave +# misleading traces in headers, such as local address +# canonicalizations. +POSTFIX="/usr/sbin/sendmail -G -i" +export BOGOFILTER_DIR=/etc/bogofilter + +# Exit codes from +EX_TEMPFAIL=75 +EX_UNAVAILABLE=69 + +cd $FILTER_DIR || \ + { echo $FILTER_DIR does not exist; exit $EX_TEMPFAIL; } + +# Clean up when done or when aborting. +trap "rm -f msg.$$ ; exit $EX_TEMPFAIL" 0 1 2 3 15 + +# bogofilter -e returns: 0 for OK, nonzero for error +rm -f msg.$$ || exit $EX_TEMPFAIL +$FILTER -p -e > msg.$$ || exit $EX_TEMPFAIL + +exec +# Dude, this "boost" is really one of the most crude stuff I ported yet. +# + + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/nls.mk +include $(INCLUDE_DIR)/target.mk + +PKG_NAME:=boost +PKG_VERSION:=1_57_0 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/boost +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_VERSION) +PKG_MD5SUM:=25f9a8ac28beeb5ab84aa98510305299 +PKG_LICENSE:=Boost Software License +PKG_MAINTAINER:=Carlos M. Ferreira + +PKG_BUILD_DEPENDS += boost/host +PKG_BUILD_PARALLEL:=0 +PKG_USE_MIPS16:=0 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/boost/Default + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Boost C++ source library + URL:=http://www.boost.org + DEPENDS:=+libstdcpp +libpthread +librt +endef + +define Package/boost/description/Default + Boost provides free peer-reviewed portable C++ source libraries +endef + +BOOST_LIBS = + +define Package/boost-libs +$(call Package/boost/Default) + TITLE+= (all libs) + DEPENDS+= $(BOOST_DEPENDS) + HIDDEN:=1 +endef + +define Package/boost-libs/description +$(call Package/boost/description/Default) + . + This meta package contains only dependencies to the other libraries from + the boost libraries collection. +endef + +# Create a meta-package of dependent libraries (for ALL) +define Package/boost-libs/install + true +endef + +define Package/boost + $(call Package/boost/Default) + TITLE+= packages + DEPENDS:=+ALL:boost-libs +ALL:boost-test +endef + +define Package/boost/config + menu "Select Boost libraries" + depends on PACKAGE_boost + + config boost-libs-all + bool "Include all Boost libraries" + select PACKAGE_boost-libs + + config boost-test-pkg + bool "Boost test package" + select PACKAGE_boost-test + + comment "Libraries" + + $(foreach lib,$(BOOST_LIBS), \ + config PACKAGE_boost-$(lib) + prompt "Boost $(lib) library" + + ) + + endmenu + +endef + +PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test + +define Package/boost-test + $(call Package/boost/Default) + TITLE+= (test) + HIDDEN:=1 +endef + +define Build/Configure +endef + +# 1: short name +# 2: dependencies on other boost libraries (short name) +# 3: dependencies on other packages +define DefineBoostLibrary + + BOOST_DEPENDS+= +boost-$(1) + BOOST_LIBS+= $(1) + + PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_boost-$(1) + + define Package/boost-$(1) + $(call Package/boost/Default) + TITLE+= ($(1)) + DEPENDS+= $$(foreach lib,$(2),+boost-$$(lib)) $(3) + HIDDEN:=1 + endef + + define Package/boost-$(1)/description + $(call Package/boost/description/Default) + . + This package contains the Boost $(1) library. + endef +endef + +$(eval $(call DefineBoostLibrary,atomic,system,)) +$(eval $(call DefineBoostLibrary,chrono,system,)) +$(eval $(call DefineBoostLibrary,container,,)) +$(eval $(call DefineBoostLibrary,context,,)) +$(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,)) +$(eval $(call DefineBoostLibrary,date_time,,)) +#$(eval $(call DefineBoostLibrary,exception,,)) +$(eval $(call DefineBoostLibrary,filesystem,system,)) +$(eval $(call DefineBoostLibrary,graph,regex,)) +#$(eval $(call DefineBoostLibrary,graph_parallel,,)) +$(eval $(call DefineBoostLibrary,iostreams,,+zlib)) +$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS))) +$(eval $(call DefineBoostLibrary,log,system chrono date_time thread filesystem regex,)) +$(eval $(call DefineBoostLibrary,math,,)) +#$(eval $(call DefineBoostLibrary,mpi,,)) +$(eval $(call DefineBoostLibrary,program_options,,)) +$(eval $(call DefineBoostLibrary,random,system,)) +$(eval $(call DefineBoostLibrary,python,,+PACKAGE_boost-python:python)) +$(eval $(call DefineBoostLibrary,regex,,)) +$(eval $(call DefineBoostLibrary,serialization,,)) +$(eval $(call DefineBoostLibrary,signals,,)) +$(eval $(call DefineBoostLibrary,system,,)) +$(eval $(call DefineBoostLibrary,thread,system chrono atomic,)) +$(eval $(call DefineBoostLibrary,timer,chrono)) +$(eval $(call DefineBoostLibrary,wave,date_time thread filesystem,)) + +define Host/Compile + # bjam does not provide a configure-script nor a Makefile + ( cd $(HOST_BUILD_DIR)/tools/build/src/engine ; ./build.sh gcc ) +endef + +CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR) +TARGET_LDFLAGS += -pthread -lrt + + +ifneq ($(findstring mips,$(ARCH)),) + BOOST_ABI = o32 + ifneq ($(findstring 64,$(ARCH)),) + BOOST_ABI = o64 + endif +else ifneq ($(findstring arm,$(ARCH)),) + BOOST_ABI = aapcs +else ifeq ($(ARCH),aarch64) + BOOST_ABI = aapcs +else + BOOST_ABI = sysv +endif + + +define Build/Compile + $(info Selected Boost API $(BOOST_ABI) for architecture $(ARCH) and cpu $(CPU_TYPE) $(CPU_SUBTYPE)) + ( cd $(PKG_BUILD_DIR) ; \ + echo "using gcc : $(ARCH) : $(GNU_TARGET_NAME)-gcc : \"$(TARGET_CFLAGS)\" \"$(TARGET_CXXFLAGS)\" \"$(TARGET_LDFLAGS)\" ;" > tools/build/src/user-config.jam ; \ + $(if $(CONFIG_PACKAGE_boost-python), \ + echo "using python : : $(STAGING_DIR_ROOT)/usr/bin/python : $(STAGING_DIR)/usr/include/python2.7/ ;" >> \ + tools/build/src/user-config.jam; \ + ) \ + bjam \ + '-sBUILD=release space on off' \ + --toolset=gcc-$(ARCH) --build-type=minimal --layout=system abi=$(BOOST_ABI) \ + --disable-long-double \ + $(CONFIGURE_ARGS) \ + --without-mpi \ + $(if $(CONFIG_PACKAGE_boost-test),,--without-test) \ + $(foreach lib,$(BOOST_LIBS), \ + $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib)) \ + ) \ + $(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_UCLIBC),on,off), \ + boost.locale.iconv=off) \ + \ + $(if $(CONFIG_PACKAGE_boost-iostreams),-sNO_BZIP2=1 -sZLIB_INCLUDE=$(STAGING_DIR)/usr/include \ + -sZLIB_LIBPATH=$(STAGING_DIR)/usr/lib) \ + install \ + ) +endef + +define Build/InstallDev + $(INSTALL_DIR) \ + $(1)/usr/include/boost/ + + $(CP) \ + $(PKG_INSTALL_DIR)/include/boost/* \ + $(1)/usr/include/boost/ \ + # copies _all_ header files - independent of <--with-library>-argument above + + if [ -d $(PKG_INSTALL_DIR)/lib ]; then \ + $(INSTALL_DIR) \ + $(1)/usr/lib; \ + $(CP) \ + $(PKG_INSTALL_DIR)/lib/*.a \ + $(1)/usr/lib/; \ + $(CP) \ + $(PKG_INSTALL_DIR)/lib/*.so* \ + $(1)/usr/lib/; \ + fi +endef + +define Host/Install + $(INSTALL_DIR) \ + $(STAGING_DIR_HOST)/bin + + $(CP) \ + $(HOST_BUILD_DIR)/tools/build/src/engine/bin.*/bjam \ + $(STAGING_DIR_HOST)/bin/ +endef + +define Package/boost/Default/install + $(INSTALL_DIR) \ + $(1)/usr/lib + + $(CP) \ + $(PKG_INSTALL_DIR)/lib/libboost_$(2)*.so* \ + $(1)/usr/lib/ +endef + +define Package/boost-test/install + $(INSTALL_DIR) \ + $(1)/usr/lib + + $(CP) \ + $(PKG_INSTALL_DIR)/lib/libboost_unit_test_framework*.so* \ + $(1)/usr/lib/ + + $(CP) \ + $(PKG_INSTALL_DIR)/lib/libboost_prg_exec_monitor*.so* \ + $(1)/usr/lib/ +endef + +define BuildBoostLibrary + define Package/boost-$(1)/install + $(call Package/boost/Default/install,$$(1),$(1)) + endef + + $$(eval $$(call BuildPackage,boost-$(1))) +endef + +$(eval $(call HostBuild)) + +$(foreach lib,$(BOOST_LIBS),$(eval $(call BuildBoostLibrary,$(lib)))) +$(eval $(call BuildPackage,boost-test)) + +$(eval $(call BuildPackage,boost-libs)) +$(eval $(call BuildPackage,boost)) diff --git a/trunk/package/feeds/packages/boost/patches/100-do-not-use-librt.patch b/trunk/package/feeds/packages/boost/patches/100-do-not-use-librt.patch new file mode 100644 index 00000000..a7560c6f --- /dev/null +++ b/trunk/package/feeds/packages/boost/patches/100-do-not-use-librt.patch @@ -0,0 +1,28 @@ +Index: boost_1_57_0/tools/build/src/tools/gcc.jam +=================================================================== +--- boost_1_57_0.orig/tools/build/src/tools/gcc.jam ++++ boost_1_57_0/tools/build/src/tools/gcc.jam +@@ -1037,7 +1037,7 @@ rule setup-threading ( targets * : sourc + case *bsd : option = -pthread ; # There is no -lrt on BSD. + case sgi : # gcc on IRIX does not support multi-threading. + case darwin : # No threading options. +- case * : option = -pthread ; libs = rt ; ++ case * : # pass appropriate options via OpenWrt + } + + if $(option) +Index: boost_1_57_0/tools/build/src/tools/gcc.py +=================================================================== +--- boost_1_57_0.orig/tools/build/src/tools/gcc.py ++++ boost_1_57_0/tools/build/src/tools/gcc.py +@@ -700,8 +700,8 @@ elif bjam.variable('UNIX'): + # Darwin has no threading options, don't set anything here. + pass + else: +- flags('gcc', 'OPTIONS', ['multi'], ['-pthread']) +- flags('gcc', 'FINDLIBS-SA', [], ['rt']) ++ # pass appropriate options via OpenWrt ++ pass + + def cpu_flags(toolset, variable, architecture, instruction_set, values, default=None): + #FIXME: for some reason this fails. Probably out of date feature code diff --git a/trunk/package/feeds/packages/btrfs-progs/Makefile b/trunk/package/feeds/packages/btrfs-progs/Makefile new file mode 100644 index 00000000..12513e15 --- /dev/null +++ b/trunk/package/feeds/packages/btrfs-progs/Makefile @@ -0,0 +1,65 @@ +# +# Copyright (C) 2009-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=btrfs-progs +PKG_VERSION:=3.19.1 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/ +PKG_MD5SUM:=ec3b3c99df18633ddc9e41f0680c5a51 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION) + +PKG_MAINTAINER:=Daniel Golle +PKG_LICENSE:=GPL-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=libacl + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/btrfs-progs + SECTION:=utils + CATEGORY:=Utilities + SUBMENU:=Filesystem + DEPENDS:=+libattr +libuuid +zlib +libblkid +liblzo +libpthread + TITLE:=Btrfs filesystems utilities + URL:=http://btrfs.wiki.kernel.org/ +endef + +define Package/btrfs-progs/description + Btrfs is a new copy on write filesystem for Linux aimed at implementing + advanced features while focusing on fault tolerance, repair and easy + administration. Initially developed by Oracle, Btrfs is licensed under the + GPL and open for contribution from anyone. +endef + +progs = btrfs btrfs-debug-tree btrfs-find-root btrfs-image btrfs-map-logical \ + btrfs-show-super btrfstune btrfs-zero-log fsck.btrfs mkfs.btrfs + +CONFIGURE_ARGS += \ + --disable-backtrace \ + --disable-convert \ + --disable-documentation + +define Package/btrfs-progs/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libbtrfs.so* $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(addprefix $(PKG_INSTALL_DIR)/usr/bin/, $(progs)) $(1)/usr/bin/ + $(LN) btrfs $(1)/usr/bin/btrfsck + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/btrfs-scan.init $(1)/etc/init.d/btrfs-scan +endef + +$(eval $(call BuildPackage,btrfs-progs)) diff --git a/trunk/package/feeds/packages/btrfs-progs/files/btrfs-scan.init b/trunk/package/feeds/packages/btrfs-progs/files/btrfs-scan.init new file mode 100644 index 00000000..762e0b84 --- /dev/null +++ b/trunk/package/feeds/packages/btrfs-progs/files/btrfs-scan.init @@ -0,0 +1,9 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=19 + +start() { + grep -q btrfs /proc/filesystems && /usr/bin/btrfs device scan +} + diff --git a/trunk/package/feeds/packages/btrfs-progs/patches/001-fix-xattr-h-include-location.patch b/trunk/package/feeds/packages/btrfs-progs/patches/001-fix-xattr-h-include-location.patch new file mode 100644 index 00000000..aff55855 --- /dev/null +++ b/trunk/package/feeds/packages/btrfs-progs/patches/001-fix-xattr-h-include-location.patch @@ -0,0 +1,79 @@ +Index: btrfs-progs-v3.19.1/mkfs.c +=================================================================== +--- btrfs-progs-v3.19.1.orig/mkfs.c ++++ btrfs-progs-v3.19.1/mkfs.c +@@ -31,7 +31,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include +Index: btrfs-progs-v3.19.1/props.c +=================================================================== +--- btrfs-progs-v3.19.1.orig/props.c ++++ btrfs-progs-v3.19.1/props.c +@@ -17,7 +17,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + +Index: btrfs-progs-v3.19.1/cmds-receive.c +=================================================================== +--- btrfs-progs-v3.19.1.orig/cmds-receive.c ++++ btrfs-progs-v3.19.1/cmds-receive.c +@@ -34,7 +34,7 @@ + #include + #include + #include +-#include ++#include + #include + + #include "ctree.h" +Index: btrfs-progs-v3.19.1/cmds-restore.c +=================================================================== +--- btrfs-progs-v3.19.1.orig/cmds-restore.c ++++ btrfs-progs-v3.19.1/cmds-restore.c +@@ -32,7 +32,7 @@ + #include + #include + #include +-#include ++#include + + #include "ctree.h" + #include "disk-io.h" +Index: btrfs-progs-v3.19.1/Makefile.in +=================================================================== +--- btrfs-progs-v3.19.1.orig/Makefile.in ++++ btrfs-progs-v3.19.1/Makefile.in +@@ -21,7 +21,7 @@ CFLAGS = @CFLAGS@ \ + LDFLAGS = @LDFLAGS@ \ + -rdynamic + +-LIBS = @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread ++LIBS = @ATTR_LIBS@ @UUID_LIBS@ @BLKID_LIBS@ @ZLIB_LIBS@ @LZO2_LIBS@ -L. -pthread + LIBBTRFS_LIBS = $(LIBS) + + # Static compilation flags +Index: btrfs-progs-v3.19.1/configure.ac +=================================================================== +--- btrfs-progs-v3.19.1.orig/configure.ac ++++ btrfs-progs-v3.19.1/configure.ac +@@ -115,6 +115,9 @@ dnl + dnl The default PKG_CHECK_MODULES() action-if-not-found is end the + dnl execution with error. The static libs are optional. + ++PKG_CHECK_MODULES(ATTR, [libattr]) ++PKG_STATIC(BLKID_LIBS_STATIC, [libattr]) ++ + PKG_CHECK_MODULES(BLKID, [blkid]) + PKG_STATIC(BLKID_LIBS_STATIC, [blkid]) + diff --git a/trunk/package/feeds/packages/bwm-ng/Config.in b/trunk/package/feeds/packages/bwm-ng/Config.in new file mode 100644 index 00000000..d822e12f --- /dev/null +++ b/trunk/package/feeds/packages/bwm-ng/Config.in @@ -0,0 +1,35 @@ +# bwm-ng advanced configuration + +menu "Configuration" + depends on PACKAGE_bwm-ng + +config BWMNG_CONFIGFILE + bool "enable configfile support" + default n + +config BWMNG_HTML + bool "enable html output" + default n + +config BWMNG_CSV + bool "enable csv output" + default n + +config BWMNG_EXTENDEDSTATS + bool "enable max, sum and avg stats" + default y + +config BWMNG_LIBNCURSES + bool "enable libncurses support" + default n + +config BWMNG_TIME + bool "enable accurate time calculating" + default y + +config BWMNG_GETOPT_LONG + bool "enable long options" + default n + +endmenu + diff --git a/trunk/package/feeds/packages/bwm-ng/Makefile b/trunk/package/feeds/packages/bwm-ng/Makefile new file mode 100644 index 00000000..be017cc0 --- /dev/null +++ b/trunk/package/feeds/packages/bwm-ng/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2014 OpenWrt.org +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bwm-ng +PKG_VERSION:=0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.gropp.org/bwm-ng +PKG_MD5SUM:=d3a02484fb7946371bfb4e10927cebfb +PKG_MAINTAINER:=Julen Landa Alustiza +PKG_LICENSE:=GPL2-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/bwm-ng + SECTION:=net + CATEGORY:=Network + DEPENDS:=+BWMNG_LIBNCURSES:libncurses + TITLE:=bwm-ng + URL:=http://www.gropp.org/?id=projects&sub=bwm-ng + MENU:=1 +endef + +define Package/bwm-ng/description + Bandwidth Monitor NG is a small and simple console-based live + network and disk io bandwidth monitor. +endef + +define Package/bwm-ng/config + source "$(SOURCE)/Config.in" +endef + +define Build/Configure + $(call Build/Configure/Default, \ + $(if $(CONFIG_BWMNG_CONFIGFILE),--enable,--disable)-configfile \ + $(if $(CONFIG_BWMNG_HTML),--enable,--disable)-html \ + $(if $(CONFIG_BWMNG_CSV),--enable,--disable)-csv \ + $(if $(CONFIG_BWMNG_EXTENDEDSTATS),--enable,--disable)-extendedstats \ + $(if $(CONFIG_BWMNG_LIBNCURSES),--with,--without)-ncurses \ + $(if $(CONFIG_BWMNG_TIME),--with,--without)-time \ + $(if $(CONFIG_BWMNG_GETOPT_LONG),--with,--without)-getopt_long \ + --with-strip \ + --with-procnetdev \ + --with-diskstats \ + ) +endef + +define Package/bwm-ng/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bwm-ng $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,bwm-ng)) diff --git a/trunk/package/feeds/packages/bzip2/Makefile b/trunk/package/feeds/packages/bzip2/Makefile new file mode 100644 index 00000000..c633344c --- /dev/null +++ b/trunk/package/feeds/packages/bzip2/Makefile @@ -0,0 +1,80 @@ +# +# Copyright (C) 2007-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bzip2 +PKG_VERSION:=1.0.6 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.bzip.org/$(PKG_VERSION) +PKG_MD5SUM:=00b516f4704d4a7cb50a1d97e6e8e15b +PKG_MAINTAINER:=Steven Barth + +PKG_LICENSE:=BZIP2 +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +define Package/libbz2 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:= + TITLE:=bzip2 library. + URL:=http://www.bzip.org/ +endef + +define Package/libbz2/description + bzip2 is a freely available, patent free, high-quality + data compressor. This packages provides libbz2 library. +endef + +define Package/bzip2 + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libbz2 + TITLE:=bzip2 is a compression utility. + URL:=http://www.bzip.org/ +endef + +define Package/bzip2/description + bzip2 is a freely available, patent free, high-quality + data compressor. This package provides the binary. +endef + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += --prefix=/usr + +MAKE_FLAGS += \ + -f Makefile-libbz2_so \ + CFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDLAGS)" \ + all + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/bzlib.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/ + $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0 + $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so +endef + +define Package/libbz2/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/ + $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0 +endef + +define Package/bzip2/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/bzip2-shared $(1)/usr/bin/bzip2 +endef + +$(eval $(call BuildPackage,libbz2)) +$(eval $(call BuildPackage,bzip2)) diff --git a/trunk/package/feeds/packages/c-ares/Makefile b/trunk/package/feeds/packages/c-ares/Makefile new file mode 100644 index 00000000..815a379a --- /dev/null +++ b/trunk/package/feeds/packages/c-ares/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2009-2010 OpenWrt.org +# Copyright (C) 2009 Jakob Pfeiffer +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=c-ares +PKG_VERSION:=1.10.0 +PKG_RELEASE:=1 +PKG_LICENSE:=MIT + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://c-ares.haxx.se/download +PKG_MD5SUM:=1196067641411a75d3cbebe074fd36d8 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libcares + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library for asyncronous DNS Requests (including name resolves) + URL:=http://c-ares.haxx.se/ + MAINTAINER:=Karl Palsson +endef + +define Package/libcares/description + c-ares is a C library for asynchronous DNS requests (including name resolves) + +C89 compatibility, MIT licensed, builds for and runs on POSIX, Windows, +Netware, Android and many more operating systems. + +endef + +define Package/libcares/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so.* $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1) + $(CP) $(PKG_INSTALL_DIR)/* $(1)/ +endef + +$(eval $(call BuildPackage,libcares)) diff --git a/trunk/package/feeds/packages/ccid/Makefile b/trunk/package/feeds/packages/ccid/Makefile new file mode 100644 index 00000000..ce059cbb --- /dev/null +++ b/trunk/package/feeds/packages/ccid/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2009-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ccid +PKG_VERSION:=1.4.18 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4111 +PKG_MD5SUM:=8d57342bda53aaee706ef2d02409c4f4 +PKG_MAINTAINER:=Daniel Golle +PKG_LICENSE:=LGPL-2.1+ +PKG_LICENSE_FILES:=COPYING + +PKG_FIXUP:=libtool +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/ccid + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libusb-1.0 +libpcsclite + TITLE:=Generic USB CCID smart card reader driver + URL:=http://pcsclite.alioth.debian.org/ccid.html +endef + +define Package/ccid/description + Generic USB CCID (Chip/Smart Card Interface Devices) driver and ICCD + (Integrated Circuit(s) Card Devices). +endef + +TARGET_CFLAGS += $(FPIC) + +TARGET_LDFLAGS += "-lpthread" + +CONFIGURE_ARGS += \ + --enable-embedded \ + --enable-usbdropdir=/usr/lib/pcsc/drivers + +define Package/ccid/install + $(INSTALL_DIR) $(1)/usr/lib/pcsc + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pcsc/drivers $(1)/usr/lib/pcsc/ +endef + +$(eval $(call BuildPackage,ccid)) diff --git a/trunk/package/feeds/packages/ccrypt/Makefile b/trunk/package/feeds/packages/ccrypt/Makefile new file mode 100644 index 00000000..2419ab74 --- /dev/null +++ b/trunk/package/feeds/packages/ccrypt/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2009-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ccrypt +PKG_VERSION:=1.10 +PKG_RELEASE:=2 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/ccrypt +PKG_MD5SUM:=44ddd763465c254df83f5d38851d04d7 +PKG_MAINTAINER:=Hannu Nyman +PKG_LICENSE:=GPLv2+ + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/ccrypt + SECTION:=utils + CATEGORY:=Utilities + TITLE:=ccrypt is a utility for encrypting and decrypting files and streams + URL:=http://ccrypt.sourceforge.net/ +endef + +define Package/ccrypt/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/ccrypt $(1)/usr/bin/ + ln -s ccrypt $(1)/usr/bin/ccencrypt + ln -s ccrypt $(1)/usr/bin/ccdecrypt + ln -s ccrypt $(1)/usr/bin/ccat +endef + +$(eval $(call BuildPackage,ccrypt)) diff --git a/trunk/package/feeds/packages/ccrypt/patches/001-no-intl.patch b/trunk/package/feeds/packages/ccrypt/patches/001-no-intl.patch new file mode 100644 index 00000000..4ac9abb2 --- /dev/null +++ b/trunk/package/feeds/packages/ccrypt/patches/001-no-intl.patch @@ -0,0 +1,89 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -123,17 +123,6 @@ AC_MSG_RESULT($UINT32_TYPE) + AC_DEFINE_UNQUOTED(UINT32_TYPE,$UINT32_TYPE,unsigned 32 bit integer type) + + dnl ---------------------------------------------------------------------- +-dnl Internationalization +- +-GETTEXT_PACKAGE=ccrypt +-AC_SUBST(GETTEXT_PACKAGE) +-AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext]) +- +-AM_GNU_GETTEXT +-AM_GNU_GETTEXT_VERSION([0.14.3]) +-IT_PO_SUBDIR(po) +- +-dnl ---------------------------------------------------------------------- + dnl Libtool (needed by intl/) + + LT_INIT +@@ -153,9 +142,7 @@ AC_SUBST(TAR) + dnl ---------------------------------------------------------------------- + AC_CONFIG_FILES([doc/ccrypt.1 + doc/ccguess.1 +- po/Makefile.in + m4/Makefile +- intl/Makefile + Makefile + src/Makefile + emacs/Makefile +--- a/Makefile.am ++++ b/Makefile.am +@@ -4,7 +4,7 @@ + + ## Process this file with automake to produce Makefile.in + +-SUBDIRS = m4 po intl src emacs doc check ++SUBDIRS = m4 src emacs doc check + + EXTRA_DIST = m4/ChangeLog config.rpath README-WIN + +--- a/Makefile.in ++++ b/Makefile.in +@@ -36,7 +36,7 @@ host_triplet = @host@ + subdir = . + DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ +- $(top_srcdir)/configure $(top_srcdir)/intl/Makefile.in \ ++ $(top_srcdir)/configure \ + ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL NEWS config.guess \ + config.rpath config.sub depcomp elisp-comp install-sh \ + ltmain.sh missing mkinstalldirs +@@ -66,7 +66,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat + configure.lineno config.status.lineno + mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs + CONFIG_HEADER = config.h +-CONFIG_CLEAN_FILES = intl/Makefile ++CONFIG_CLEAN_FILES = + CONFIG_CLEAN_VPATH_FILES = + SOURCES = + DIST_SOURCES = +@@ -277,7 +277,7 @@ target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-SUBDIRS = m4 po intl src emacs doc check ++SUBDIRS = m4 src emacs doc check + EXTRA_DIST = m4/ChangeLog config.rpath README-WIN + ACLOCAL_AMFLAGS = -I m4 + all: config.h +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -56,4 +56,4 @@ uninstall-local: + # internationalization stuff + localedir = $(datadir)/locale + INCLUDES = -I../intl -I$(top_srcdir)/intl -DLOCALEDIR=\"$(localedir)\" +-LIBS = @LIBINTL@ @LIBS@ ++LIBS = @LIBS@ +--- a/src/Makefile.in ++++ b/src/Makefile.in +@@ -159,7 +159,7 @@ LDFLAGS = @LDFLAGS@ + LIBICONV = @LIBICONV@ + LIBINTL = @LIBINTL@ + LIBOBJS = @LIBOBJS@ +-LIBS = @LIBINTL@ @LIBS@ ++LIBS = @LIBS@ + LIBTOOL = @LIBTOOL@ + LIPO = @LIPO@ + LN_S = @LN_S@ diff --git a/trunk/package/feeds/packages/check/Makefile b/trunk/package/feeds/packages/check/Makefile new file mode 100644 index 00000000..b565d4dd --- /dev/null +++ b/trunk/package/feeds/packages/check/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=check +PKG_VERSION:=0.9.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/check +PKG_MD5SUM:=38263d115d784c17aa3b959ce94be8b8 + +PKG_LICENSE:=LGPL-2.1+ +PKG_LICENSE_FILES:=COPYING.LESSER +PKG_MAINTAINER:=Nicolas Thill + +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/check + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Unit testing framework for C + URL:=http://check.sourceforge.net/ + DEPENDS:= +libpthread +librt +endef + +define Package/check/description + Check features a simple interface for defining unit tests, putting little in + the way of the developer. Tests are run in a separate address space, so Check + can catch both assertion failures and code errors that cause segmentation + faults or other signals. The output from unit tests can be used within source + code editors and IDEs. +endef + +TARGET_CFLAGS += $(FPIC) + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/check*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcheck.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/check.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/check/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcheck.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,check)) diff --git a/trunk/package/feeds/packages/cmdpad/Makefile b/trunk/package/feeds/packages/cmdpad/Makefile new file mode 100644 index 00000000..5b9f52d1 --- /dev/null +++ b/trunk/package/feeds/packages/cmdpad/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cmdpad +PKG_VERSION:=0.0.3 +PKG_RELEASE:=3 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz +PKG_SOURCE_URL:=@SF/cmdpad +PKG_MD5SUM:=6633b2354b7f23f9cd8e2bfb6e735965 + +PKG_MAINTAINER:=Ted Hess +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=doc/COPYING + +include $(INCLUDE_DIR)/package.mk + +define Package/cmdpad + SECTION:=utils + CATEGORY:=Utilities + TITLE:=execute commands when a key is pressed, released or hold down + URL:=http://cmdpad.sourceforge.net/index.php +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +define Package/cmdpad/description + cmdpad - execute commands when a key is pressed, released or hold down. + Should be started from /etc/rc or /etc/rc.local. To run it as deamon you + need to start it with '&'. All logs are printed to standard out and standard + error (to write the log to disk use cmdpad > /var/log/cmdpad). Cmdpad + searches for /etc/cmdpad.conf and load the key bindings. Then wait for + key event and check each command to see if it should be run. +endef + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) + +define Package/cmdpad/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/cmdpad $(1)/usr/sbin/ + $(INSTALL_CONF) $(PKG_BUILD_DIR)/src/cmdpad.conf $(1)/etc/ + $(INSTALL_BIN) ./files/cmdpad.init $(1)/etc/init.d/cmdpad +endef + +define Package/cmdpad/conffiles +/etc/cmdpad.conf +endef + +$(eval $(call BuildPackage,cmdpad)) diff --git a/trunk/package/feeds/packages/cmdpad/files/cmdpad.init b/trunk/package/feeds/packages/cmdpad/files/cmdpad.init new file mode 100644 index 00000000..f6120335 --- /dev/null +++ b/trunk/package/feeds/packages/cmdpad/files/cmdpad.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=93 + +SSD_DAEMONIZE=1 + +start() { + service_start /usr/sbin/cmdpad --quiet +} + +stop() { + service_stop /usr/sbin/cmdpad +} diff --git a/trunk/package/feeds/packages/cmdpad/patches/100-Makefile.patch b/trunk/package/feeds/packages/cmdpad/patches/100-Makefile.patch new file mode 100644 index 00000000..61a6c8f4 --- /dev/null +++ b/trunk/package/feeds/packages/cmdpad/patches/100-Makefile.patch @@ -0,0 +1,35 @@ +--- cmdpad-0.0.3/src/Makefile.orig 2008-01-05 23:29:44.000000000 +0100 ++++ cmdpad-0.0.3/src/Makefile 2008-01-05 23:30:23.000000000 +0100 +@@ -5,25 +5,25 @@ + TOP=.. + include $(TOP)/Makefile.common + +-INCLUDE= -I/usr/include +-LIBS= -L/usr/lib -lc +-CFLAGS= -g3 +-LDFLAGS= -Xlinker -Map -Xlinker $(PROG).map #,--stack,16Mb ++#INCLUDE= -I/usr/include ++#LIBS= -L/usr/lib -lc ++#CFLAGS= -g3 ++#LDFLAGS= -Xlinker -Map -Xlinker $(PROG).map #,--stack,16Mb + OBJ= main.o command.o parse.o + SCRIPTS= *.sh + + build: $(PROG) + + $(PROG): $(OBJ) +- gcc -o $(PROG) $(OBJ) $(LIBS) $(LDFLAGS) ++ $(GCC) -o $(PROG) $(OBJ) $(LIBS) $(LDFLAGS) + @echo "===============================================" + @echo "edit $(PROG).conf file to set default preferences" + + %.o : %.c +- gcc $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< ++ $(GCC) $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< + + %.o : %.c %.h +- gcc $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< ++ $(GCC) $(CFLAGS) -D__COPYLEFT__='$(COPYLEFT)' -c $< + + distclean clean: + rm $(PROG) *~ *.o -vf diff --git a/trunk/package/feeds/packages/cmdpad/patches/120-kernel26-compat.patch b/trunk/package/feeds/packages/cmdpad/patches/120-kernel26-compat.patch new file mode 100644 index 00000000..eb7beeb3 --- /dev/null +++ b/trunk/package/feeds/packages/cmdpad/patches/120-kernel26-compat.patch @@ -0,0 +1,15 @@ +--- cmdpad-0.0.3/src/parse.orig 2008-01-05 23:55:32.000000000 +0100 ++++ cmdpad-0.0.3/src/parse.c 2008-01-05 23:56:07.000000000 +0100 +@@ -289,6 +289,12 @@ + pchEventDevice = strdup( pchValue) ; + return 1 ; + } ++ if( (pchValue != NULL) && ++ (strncmp( pchValue, "/dev/event", 6) == 0) ) ++ { ++ pchEventDevice = strdup( pchValue) ; ++ return 1 ; ++ } + printf( "Option 'device' expects a /dev/input/eventX argument\n"); + return -1 ; + } diff --git a/trunk/package/feeds/packages/cmdpad/patches/130-no_zombie.patch b/trunk/package/feeds/packages/cmdpad/patches/130-no_zombie.patch new file mode 100644 index 00000000..aa4fc6a0 --- /dev/null +++ b/trunk/package/feeds/packages/cmdpad/patches/130-no_zombie.patch @@ -0,0 +1,18 @@ +--- cmdpad-0.0.3/src/command.c.orig 2003-03-29 17:54:12.000000000 +0100 ++++ cmdpad-0.0.3/src/command.c 2008-01-12 05:41:22.000000000 +0100 +@@ -68,6 +68,7 @@ + + void exec( char * command) + { ++ int status; + if( fork() == 0) { + char ** tmp ; + int i ; +@@ -88,6 +89,7 @@ + perror( "ERROR: execv") ; + exit( 1) ; + } // end if( fork()) ++ wait(&status); + } + + int getNumberofEntry() diff --git a/trunk/package/feeds/packages/cmdpad/patches/140-compile_fix.patch b/trunk/package/feeds/packages/cmdpad/patches/140-compile_fix.patch new file mode 100644 index 00000000..c7a9bb3d --- /dev/null +++ b/trunk/package/feeds/packages/cmdpad/patches/140-compile_fix.patch @@ -0,0 +1,11 @@ +--- a/src/parse.c ++++ b/src/parse.c +@@ -125,7 +125,7 @@ int readCommandLine( int argc, char *arg + + d2printf( "command line command %s found\n", pchCommandTranslations[ iCmd+1]) ; + +- vsnprintf( achCommand, sizeof( achCommand), ++ snprintf( achCommand, sizeof( achCommand), + pchCommandTranslations[ iCmd+1], + &argv[ i+1]) ; + diff --git a/trunk/package/feeds/packages/collectd/Makefile b/trunk/package/feeds/packages/collectd/Makefile new file mode 100644 index 00000000..61b05a88 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/Makefile @@ -0,0 +1,330 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=collectd +PKG_VERSION:=5.4.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://collectd.org/files/ +PKG_MD5SUM:=feff9fd0ed89e956d7cf12ba18cfc248 + +PKG_FIXUP:=autoreconf +PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4 +PKG_MAINTAINER:=Jo-Philipp Wich + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +COLLECTD_PLUGINS_DISABLED:= \ + amqp \ + apple_sensors \ + aquaero \ + battery \ + cgroups \ + cpufreq \ + curl_json \ + curl_xml \ + dbi \ + entropy \ + ethstat \ + genericjmx \ + gmond \ + hddtemp \ + ipmi \ + ipvs \ + java \ + libvirt \ + lpar \ + mbmon \ + md \ + memcachec \ + memcached \ + mic \ + monitorus \ + multimeter \ + netapp \ + nfs \ + notify_desktop \ + notify_email \ + numa \ + nut \ + openvz \ + oracle \ + perl \ + pf \ + pinba \ + python \ + redis \ + routeros \ + rrdcached \ + serial \ + sigrok \ + statsd \ + swap \ + tape \ + tokyotyrant \ + uuid \ + varnish \ + vserver \ + write_graphite \ + write_mongodb \ + write_redis \ + write_riemann \ + xmms \ + zfs_arc \ + +COLLECTD_PLUGINS_SELECTED:= \ + apache \ + apcups \ + ascent \ + bind \ + conntrack \ + contextswitch \ + cpu \ + csv \ + curl \ + df \ + disk \ + dns \ + email \ + exec \ + filecount \ + fscache \ + interface \ + iptables \ + irq \ + iwinfo \ + load \ + logfile \ + madwifi \ + memory \ + modbus \ + mysql \ + netlink \ + network \ + nginx \ + ntpd \ + olsrd \ + onewire \ + openvpn \ + ping \ + postgresql \ + powerdns \ + processes \ + protocols \ + rrdtool \ + sensors \ + snmp \ + syslog \ + table \ + tail \ + tcpconns \ + teamspeak2 \ + ted \ + thermal \ + unixsock \ + uptime \ + users \ + vmem \ + wireless \ + write_http \ + +PKG_CONFIG_DEPENDS:= \ + $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \ + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/collectd/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Lightweight system statistics collection daemon + URL:=http://verplant.org/collectd/ +endef + +define Package/collectd +$(call Package/collectd/Default) + DEPENDS:= +libpthread +zlib +libltdl +libip4tc + MENU:=1 +endef + +define Package/collectd/description + collectd is a small daemon which collects system information periodically + and provides mechanismns to store the values in a variety of ways. +endef + +ifneq ($(CONFIG_avr32),) + TARGET_CFLAGS += -fsigned-char +endif + +# common configure args +CONFIGURE_ARGS+= \ + --disable-debug \ + --enable-daemon \ + --enable-getifaddrs \ + --with-nan-emulation \ + --without-libgcrypt + +CONFIGURE_VARS+= \ + CFLAGS="$$$$CFLAGS $(FPIC)" \ + LDFLAGS="$$$$LDFLAGS -lm -lz" \ + KERNEL_DIR="$(LINUX_DIR)" \ + +CONFIGURE_PLUGIN= \ + $(foreach m, $(1), \ + $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \ + ) + +CONFIGURE_ARGS+= \ + $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \ + $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \ + +# exception: mod-ascent needs libxml2 +ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),) + CONFIGURE_VARS+= \ + CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2" +endif + +ifneq ($(CONFIG_BIG_ENDIAN),) + CONFIGURE_ARGS+= --with-fp-layout=endianflip +else + CONFIGURE_ARGS+= --with-fp-layout=nothing +endif + +ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),) + CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/" +endif + +ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),) + CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/" +endif + +# exception: mod-netlink needs libnetlink from iproute +ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),) + CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr" +endif + +# exception: mod-modbus needs libmodbus +ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),) + CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr" +endif + +# exception: mod-onewire needs libow-capi +ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),) + CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr" +endif + +# exception: mod-rrdtool needs rrdtool-1.0.x +ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),) + CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0" +endif + +define Package/collectd/conffiles +/etc/collectd.conf +endef + +define Package/collectd/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/share/collectd + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd +endef + +# 1: plugin name +# 2: plugin title/description +# 3: files +# 4: extra dependency +define BuildPlugin + + PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1) + + define Package/collectd-mod-$(1) + $$(call Package/collectd/Default) + TITLE:=$(2) plugin + DEPENDS:= collectd $(4) + endef + + define Package/collectd-mod-$(1)/install + $(INSTALL_DIR) $$(1)/usr/lib/collectd + for m in $(3); do \ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \ + $$(1)/usr/lib/collectd/ ; \ + done + endef + + $$(eval $$(call BuildPackage,collectd-mod-$(1))) + +endef + +$(eval $(call BuildPackage,collectd)) + +#$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES)) +$(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl)) +$(eval $(call BuildPlugin,apcups,apcups status input,apcups,)) +$(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2)) +$(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2)) +$(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,)) +$(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,)) +$(eval $(call BuildPlugin,cpu,CPU input,cpu,)) +$(eval $(call BuildPlugin,csv,CSV output,csv,)) +$(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl)) +#$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi)) +$(eval $(call BuildPlugin,df,disk space input,df,)) +$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,)) +$(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap)) +$(eval $(call BuildPlugin,email,email output,email,)) +$(eval $(call BuildPlugin,exec,process exec input,exec,)) +$(eval $(call BuildPlugin,filecount,file count input,filecount,)) +$(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,)) +$(eval $(call BuildPlugin,interface,network interfaces input,interface,)) +$(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc)) +$(eval $(call BuildPlugin,irq,interrupt usage input,irq,)) +$(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo)) +$(eval $(call BuildPlugin,load,system load input,load,)) +$(eval $(call BuildPlugin,logfile,log files output,logfile,)) +$(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,)) +#$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r)) +$(eval $(call BuildPlugin,memory,physical memory usage input,memory,)) +$(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus)) +$(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:ip @BROKEN)) +$(eval $(call BuildPlugin,network,network input/output,network)) +$(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl)) +$(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,)) +#$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut)) +$(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,)) +$(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN)) +$(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,)) +$(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping)) +$(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq)) +$(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,)) +$(eval $(call BuildPlugin,processes,process status input,processes,)) +$(eval $(call BuildPlugin,protocols,network protocols input,protocols,)) +$(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1)) +$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors)) +$(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp)) +$(eval $(call BuildPlugin,syslog,syslog output,syslog,)) +$(eval $(call BuildPlugin,tail,tail input,tail,)) +$(eval $(call BuildPlugin,table,table-like structured file input,table,)) +$(eval $(call BuildPlugin,teamspeak2,TeamSpeak2 input,teamspeak2,)) +$(eval $(call BuildPlugin,ted,The Energy Detective input,ted,@((!TARGET_avr32)||BROKEN))) # fails on avr32 because of warnings treated as errors +$(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,)) +$(eval $(call BuildPlugin,thermal,system temperatures input,thermal,)) +$(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,)) +$(eval $(call BuildPlugin,uptime,uptime status input,uptime,)) +$(eval $(call BuildPlugin,users,user logged in status input,users,)) +$(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,)) +$(eval $(call BuildPlugin,wireless,wireless status input,wireless,)) +$(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl)) diff --git a/trunk/package/feeds/packages/collectd/files/collectd.conf b/trunk/package/feeds/packages/collectd/files/collectd.conf new file mode 100644 index 00000000..2ef78fe7 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/files/collectd.conf @@ -0,0 +1,90 @@ +# +# OpenWrt Config file for collectd(1). +# Please read collectd.conf(5) for a list of options. +# http://collectd.org/ +# + +#Hostname "localhost" +#FQDNLookup true +BaseDir "/var/lib/collectd" +PIDFile "/var/run/collectd.pid" +#PluginDir "/usr/lib/collectd" +#TypesDB "/usr/share/collectd/types.db" +Interval 30 +ReadThreads 2 + +#LoadPlugin syslog +#LoadPlugin logfile + +# +# LogLevel info +# + +# +# LogLevel info +# File STDOUT +# Timestamp true +# + +LoadPlugin cpu +LoadPlugin df +LoadPlugin disk +LoadPlugin interface +LoadPlugin load +LoadPlugin memory +LoadPlugin network +#LoadPlugin ping +#LoadPlugin processes +#LoadPlugin rrdtool +#LoadPlugin serial +LoadPlugin wireless + +# +# FSType tmpfs +# IgnoreSelected true +# ReportByDevice false +# ReportReserved false +# ReportInodes false +# + +# +# Disk "/^[hs]d[a-f][0-9]?$/" +# IgnoreSelected false +# + +# +# Interface "eth0" +# Interface "br-lan" +# IgnoreSelected false +# + + +# Server "ff18::efc0:4a42" "25826" + Server "239.192.74.66" "25826" +# Listen "ff18::efc0:4a42" "25826" +# Listen "239.192.74.66" "25826" +# TimeToLive "128" +# Forward false +# CacheFlush 1800 +# ReportStats false + + +# +# Host "host.foo.bar" +# Interval 1.0 +# Timeout 0.9 +# TTL 255 +# SourceAddress "1.2.3.4" +# Device "eth0" +# MaxMissed -1 +# + +# +# Process "name" +# + +# +# DataDir "/var/lib/collectd/rrd" +# CacheTimeout 120 +# CacheFlush 900 +# diff --git a/trunk/package/feeds/packages/collectd/files/collectd.init b/trunk/package/feeds/packages/collectd/files/collectd.init new file mode 100644 index 00000000..8204c38a --- /dev/null +++ b/trunk/package/feeds/packages/collectd/files/collectd.init @@ -0,0 +1,15 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2006-2011 OpenWrt.org + +START=80 + +SERVICE_USE_PID=1 + +start() { + mkdir -m 0755 -p /var/lib/collectd + service_start /usr/sbin/collectd +} + +stop() { + service_stop /usr/sbin/collectd +} diff --git a/trunk/package/feeds/packages/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch b/trunk/package/feeds/packages/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch new file mode 100644 index 00000000..0e01744b --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/001-undefined-AM_PATH_LIBGCRYPT.patch @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/fake-am_path_libgcrypt.m4 +@@ -0,0 +1 @@ ++AC_DEFUN([AM_PATH_LIBGCRYPT],[:]) diff --git a/trunk/package/feeds/packages/collectd/patches/003-remove-werror.patch b/trunk/package/feeds/packages/collectd/patches/003-remove-werror.patch new file mode 100644 index 00000000..12a05ee7 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/003-remove-werror.patch @@ -0,0 +1,22 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -4,7 +4,7 @@ SUBDIRS += liboconfig + endif + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + AM_CPPFLAGS = -DPREFIX='"${prefix}"' +--- a/src/libcollectdclient/Makefile.am ++++ b/src/libcollectdclient/Makefile.am +@@ -1,7 +1,7 @@ + AUTOMAKE_OPTIONS = foreign no-dependencies + + if COMPILER_IS_GCC +-AM_CFLAGS = -Wall -Werror ++AM_CFLAGS = -Wall + endif + + pkginclude_HEADERS = collectd/client.h collectd/network.h collectd/network_buffer.h collectd/lcc_features.h diff --git a/trunk/package/feeds/packages/collectd/patches/100-rrdtool-add-rrasingle-option.patch b/trunk/package/feeds/packages/collectd/patches/100-rrdtool-add-rrasingle-option.patch new file mode 100644 index 00000000..30a71e8d --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/100-rrdtool-add-rrasingle-option.patch @@ -0,0 +1,57 @@ +--- a/src/rrdtool.c ++++ b/src/rrdtool.c +@@ -82,6 +82,7 @@ static const char *config_keys[] = + "HeartBeat", + "RRARows", + "RRATimespan", ++ "RRASingle", + "XFF", + "WritesPerSecond", + "RandomTimeout" +@@ -103,6 +104,8 @@ static rrdcreate_config_t rrdcreate_conf + /* timespans = */ NULL, + /* timespans_num = */ 0, + ++ /* rrasingle = */ 0, ++ + /* consolidation_functions = */ NULL, + /* consolidation_functions_num = */ 0, + +@@ -1093,6 +1096,14 @@ static int rrd_config (const char *key, + + free (value_copy); + } ++ else if (strcasecmp ("RRASingle", key) == 0) ++ { ++ if (IS_TRUE (value)) ++ { ++ rrdcreate_config.rrasingle = 1; ++ NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs"); ++ } ++ } + else if (strcasecmp ("XFF", key) == 0) + { + double tmp = atof (value); +--- a/src/utils_rrdcreate.c ++++ b/src/utils_rrdcreate.c +@@ -212,6 +212,9 @@ static int rra_get (char ***ret, const v + rts_num = rra_timespans_num; + } + ++ if (cfg->rrasingle) ++ rra_types_num = 1; ++ + rra_max = rts_num * rra_types_num; + + if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL) +--- a/src/utils_rrdcreate.h ++++ b/src/utils_rrdcreate.h +@@ -36,6 +36,8 @@ struct rrdcreate_config_s + int *timespans; + size_t timespans_num; + ++ int rrasingle; ++ + char **consolidation_functions; + size_t consolidation_functions_num; + diff --git a/trunk/package/feeds/packages/collectd/patches/110-net-device-stats.patch b/trunk/package/feeds/packages/collectd/patches/110-net-device-stats.patch new file mode 100644 index 00000000..91e73aa3 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/110-net-device-stats.patch @@ -0,0 +1,46 @@ +--- + src/interface.c | 33 ++++++++++++++++++++++++++++++++- + 1 file changed, 32 insertions(+), 1 deletion(-) + +--- a/src/interface.c ++++ b/src/interface.c +@@ -203,7 +203,38 @@ static int interface_read (void) + # define IFA_RX_ERROR rx_errors + # define IFA_TX_ERROR tx_errors + #else +-# error "No suitable type for `struct ifaddrs->ifa_data' found." ++struct net_device_stats { ++ unsigned long rx_packets; ++ unsigned long tx_packets; ++ unsigned long rx_bytes; ++ unsigned long tx_bytes; ++ unsigned long rx_errors; ++ unsigned long tx_errors; ++ unsigned long rx_dropped; ++ unsigned long tx_dropped; ++ unsigned long multicast; ++ unsigned long collisions; ++ unsigned long rx_length_errors; ++ unsigned long rx_over_errors; ++ unsigned long rx_crc_errors; ++ unsigned long rx_frame_errors; ++ unsigned long rx_fifo_errors; ++ unsigned long rx_missed_errors; ++ unsigned long tx_aborted_errors; ++ unsigned long tx_carrier_errors; ++ unsigned long tx_fifo_errors; ++ unsigned long tx_heartbeat_errors; ++ unsigned long tx_window_errors; ++ unsigned long rx_compressed; ++ unsigned long tx_compressed; ++}; ++# define IFA_DATA net_device_stats ++# define IFA_RX_BYTES rx_bytes ++# define IFA_TX_BYTES tx_bytes ++# define IFA_RX_PACKT rx_packets ++# define IFA_TX_PACKT tx_packets ++# define IFA_RX_ERROR rx_errors ++# define IFA_TX_ERROR tx_errors + #endif + + struct IFA_DATA *if_data; diff --git a/trunk/package/feeds/packages/collectd/patches/140-fix-fqdnlookup.patch b/trunk/package/feeds/packages/collectd/patches/140-fix-fqdnlookup.patch new file mode 100644 index 00000000..d40463e8 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/140-fix-fqdnlookup.patch @@ -0,0 +1,11 @@ +--- a/src/configfile.c ++++ b/src/configfile.c +@@ -105,7 +105,7 @@ static cf_global_option_t cf_global_opti + {"BaseDir", NULL, PKGLOCALSTATEDIR}, + {"PIDFile", NULL, PIDFILE}, + {"Hostname", NULL, NULL}, +- {"FQDNLookup", NULL, "true"}, ++ {"FQDNLookup", NULL, "false"}, + {"Interval", NULL, NULL}, + {"ReadThreads", NULL, "5"}, + {"WriteThreads", NULL, "5"}, diff --git a/trunk/package/feeds/packages/collectd/patches/150-fix-interface-af-link b/trunk/package/feeds/packages/collectd/patches/150-fix-interface-af-link new file mode 100644 index 00000000..806a6837 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/150-fix-interface-af-link @@ -0,0 +1,21 @@ +--- a/src/interface.c ++++ b/src/interface.c +@@ -244,8 +244,8 @@ struct net_device_stats { + + for (if_ptr = if_list; if_ptr != NULL; if_ptr = if_ptr->ifa_next) + { +- if (if_ptr->ifa_addr != NULL && if_ptr->ifa_addr->sa_family == AF_LINK) { +- if_data = (struct IFA_DATA *) if_ptr->ifa_data; ++ if ((if_data = (struct IFA_DATA *) if_ptr->ifa_data) == NULL) ++ continue; + + if_submit (if_ptr->ifa_name, "if_octets", + if_data->IFA_RX_BYTES, +@@ -256,7 +256,6 @@ struct net_device_stats { + if_submit (if_ptr->ifa_name, "if_errors", + if_data->IFA_RX_ERROR, + if_data->IFA_TX_ERROR); +- } + } + + freeifaddrs (if_list); diff --git a/trunk/package/feeds/packages/collectd/patches/200-fix-git-describe-error.patch b/trunk/package/feeds/packages/collectd/patches/200-fix-git-describe-error.patch new file mode 100644 index 00000000..ac0a3251 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/200-fix-git-describe-error.patch @@ -0,0 +1,11 @@ +--- a/version-gen.sh ++++ b/version-gen.sh +@@ -2,7 +2,7 @@ + + DEFAULT_VERSION="5.4.2.git" + +-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`" ++#VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`" + + if test -z "$VERSION"; then + VERSION="$DEFAULT_VERSION" diff --git a/trunk/package/feeds/packages/collectd/patches/400-fix-olsrd-get-all.patch b/trunk/package/feeds/packages/collectd/patches/400-fix-olsrd-get-all.patch new file mode 100644 index 00000000..b49a0e73 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/400-fix-olsrd-get-all.patch @@ -0,0 +1,11 @@ +--- a/src/olsrd.c ++++ b/src/olsrd.c +@@ -653,7 +653,7 @@ static int olsrd_read (void) /* {{{ */ + if (fh == NULL) + return (-1); + +- fputs ("\r\n", fh); ++ fputs ("/all \r\n", fh); + fflush (fh); + + while (fgets (buffer, sizeof (buffer), fh) != NULL) diff --git a/trunk/package/feeds/packages/collectd/patches/900-add-iwinfo-plugin.patch b/trunk/package/feeds/packages/collectd/patches/900-add-iwinfo-plugin.patch new file mode 100644 index 00000000..cc95c0c7 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/900-add-iwinfo-plugin.patch @@ -0,0 +1,279 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -580,6 +580,9 @@ AC_CHECK_HEADERS(net/pfvar.h, + have_termios_h="no" + AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) + ++# For the iwinfo plugin ++AC_CHECK_LIB(iwinfo, iwinfo_backend, [with_iwinfo="yes"], [with_iwinfo="no (libiwinfo not found)"], []) ++ + # + # Checks for typedefs, structures, and compiler characteristics. + # +@@ -4841,6 +4844,7 @@ plugin_interface="no" + plugin_ipmi="no" + plugin_ipvs="no" + plugin_irq="no" ++plugin_iwinfo="no" + plugin_libvirt="no" + plugin_load="no" + plugin_memory="no" +@@ -5179,6 +5183,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi], + AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) + AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics]) + AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics]) ++AC_PLUGIN([iwinfo], [$with_iwinfo], [Common iwinfo wireless statistics]) + AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine]) + AC_PLUGIN([libvirt], [$plugin_libvirt], [Virtual machine statistics]) + AC_PLUGIN([load], [$plugin_load], [System load]) +@@ -5480,6 +5485,7 @@ Configuration: + protobuf-c . . . . . $have_protoc_c + oracle . . . . . . . $with_oracle + python . . . . . . . $with_python ++ iwinfo . . . . . . . $with_iwinfo + + Features: + daemon mode . . . . . $enable_daemon +@@ -5524,6 +5530,7 @@ Configuration: + iptables . . . . . . $enable_iptables + ipvs . . . . . . . . $enable_ipvs + irq . . . . . . . . . $enable_irq ++ iwinfo . . . . . . . $enable_iwinfo + java . . . . . . . . $enable_java + libvirt . . . . . . . $enable_libvirt + load . . . . . . . . $enable_load +--- a/src/collectd.conf.in ++++ b/src/collectd.conf.in +@@ -109,6 +109,7 @@ + #@BUILD_PLUGIN_IPMI_TRUE@LoadPlugin ipmi + #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs + #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq ++#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo + #@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java + #@BUILD_PLUGIN_LIBVIRT_TRUE@LoadPlugin libvirt + @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load +@@ -502,6 +503,12 @@ + # IgnoreSelected true + # + ++# ++# Interface "ath0" ++# Interface "ra0" ++# Interface "wlan0" ++# ++ + # + # JVMArg "-verbose:jni" + # JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar" +--- a/src/collectd.conf.pod ++++ b/src/collectd.conf.pod +@@ -2077,6 +2077,27 @@ and all other interrupts are collected. + + =back + ++=head2 Plugin C ++ ++=over 4 ++ ++=item B I ++ ++Select this interface. By default all detected wireless interfaces will be ++collected. For a more detailed description see B below. ++ ++=item B I|I ++ ++If no configuration if given, the B-plugin will collect data from all ++detected wireless interfaces. You can use the B-option to pick the ++interfaces you're interested in. Sometimes, however, it's easier/preferred to ++collect all interfaces I a few ones. This option enables you to do ++that: By setting B to I the effect of B is ++inverted: All selected interfaces are ignored and all other interfaces are ++collected. ++ ++=back ++ + =head2 Plugin C + + The I plugin makes it possible to write extensions for collectd in Java. +--- /dev/null ++++ b/src/iwinfo.c +@@ -0,0 +1,150 @@ ++/** ++ * collectd - src/iwinfo.c ++ * Copyright (C) 2011 Jo-Philipp Wich ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License as published by the ++ * Free Software Foundation; only version 2 of the License is applicable. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License along ++ * with this program; if not, write to the Free Software Foundation, Inc., ++ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ **/ ++ ++#include "collectd.h" ++#include "common.h" ++#include "plugin.h" ++#include "utils_ignorelist.h" ++ ++#include ++#include ++ ++#define PROCNETDEV "/proc/net/dev" ++ ++static const char *config_keys[] = { ++ "Interface", ++ "IgnoreSelected" ++}; ++static int config_keys_num = STATIC_ARRAY_SIZE (config_keys); ++ ++static ignorelist_t *ignorelist = NULL; ++ ++static int iwinfo_config(const char *key, const char *value) ++{ ++ if (ignorelist == NULL) ++ ignorelist = ignorelist_create(1); ++ ++ if (ignorelist == NULL) ++ return 1; ++ ++ if (strcasecmp(key, "Interface") == 0) ++ ignorelist_add(ignorelist, value); ++ else if (strcasecmp(key, "IgnoreSelected") == 0) ++ ignorelist_set_invert(ignorelist, IS_TRUE(value) ? 0 : 1); ++ else ++ return -1; ++ ++ return 0; ++} ++ ++static void iwinfo_submit(const char *ifname, const char *type, int value) ++{ ++ value_t values[1]; ++ value_list_t vl = VALUE_LIST_INIT; ++ ++ values[0].gauge = value; ++ ++ vl.values = values; ++ vl.values_len = 1; ++ ++ sstrncpy(vl.host, hostname_g, sizeof(vl.host)); ++ sstrncpy(vl.plugin, "iwinfo", sizeof(vl.plugin)); ++ sstrncpy(vl.plugin_instance, ifname, sizeof(vl.plugin_instance)); ++ sstrncpy(vl.type, type, sizeof(vl.type)); ++ /*sstrncpy(vl.type_instance, "", sizeof(vl.type_instance));*/ ++ ++ plugin_dispatch_values(&vl); ++} ++ ++static void iwinfo_process(const char *ifname) ++{ ++ int val; ++ char buf[IWINFO_BUFSIZE]; ++ const struct iwinfo_ops *iw = iwinfo_backend(ifname); ++ ++ /* does appear to be a wifi iface */ ++ if (iw) ++ { ++ if (iw->bitrate(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "bitrate", val * 1000); ++ ++ if (iw->signal(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "signal_power", val); ++ ++ if (iw->noise(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "signal_noise", val); ++ ++ if (iw->quality(ifname, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "signal_quality", val); ++ ++ if (iw->assoclist(ifname, buf, &val)) ++ val = 0; ++ iwinfo_submit(ifname, "stations", ++ val / sizeof(struct iwinfo_assoclist_entry)); ++ } ++ ++ iwinfo_finish(); ++} ++ ++static int iwinfo_read(void) ++{ ++ char line[1024]; ++ char ifname[128]; ++ FILE *f; ++ ++ f = fopen(PROCNETDEV, "r"); ++ if (f == NULL) ++ { ++ char err[1024]; ++ WARNING("iwinfo: Unable to open " PROCNETDEV ": %s", ++ sstrerror(errno, err, sizeof(err))); ++ return -1; ++ } ++ ++ while (fgets(line, sizeof(line), f)) ++ { ++ if (!strchr(line, ':')) ++ continue; ++ ++ if (!sscanf(line, " %127[^:]", ifname)) ++ continue; ++ ++ if (ignorelist_match(ignorelist, ifname)) ++ continue; ++ ++ if (strstr(ifname, "mon.") || strstr(ifname, ".sta") || ++ strstr(ifname, "tmp.") || strstr(ifname, "wifi")) ++ continue; ++ ++ iwinfo_process(ifname); ++ } ++ ++ fclose(f); ++ ++ return 0; ++} ++ ++void module_register(void) ++{ ++ plugin_register_config("iwinfo", iwinfo_config, config_keys, config_keys_num); ++ plugin_register_read("iwinfo", iwinfo_read); ++} +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -530,6 +530,15 @@ collectd_LDADD += "-dlopen" irq.la + collectd_DEPENDENCIES += irq.la + endif + ++if BUILD_PLUGIN_IWINFO ++pkglib_LTLIBRARIES += iwinfo.la ++iwinfo_la_SOURCES = iwinfo.c ++iwinfo_la_LDFLAGS = -module -avoid-version ++iwinfo_la_LIBADD = -liwinfo ++collectd_LDADD += "-dlopen" iwinfo.la ++collectd_DEPENDENCIES += iwinfo.la ++endif ++ + if BUILD_PLUGIN_JAVA + pkglib_LTLIBRARIES += java.la + java_la_SOURCES = java.c +--- a/src/types.db ++++ b/src/types.db +@@ -195,7 +195,7 @@ voltage value:GAUGE:U:U + vs_memory value:GAUGE:0:9223372036854775807 + vs_processes value:GAUGE:0:65535 + vs_threads value:GAUGE:0:65535 +- ++stations value:GAUGE:0:256 + # + # Legacy types + # (required for the v5 upgrade target) diff --git a/trunk/package/feeds/packages/collectd/patches/920-fix-ping-droprate.patch b/trunk/package/feeds/packages/collectd/patches/920-fix-ping-droprate.patch new file mode 100644 index 00000000..f7432990 --- /dev/null +++ b/trunk/package/feeds/packages/collectd/patches/920-fix-ping-droprate.patch @@ -0,0 +1,11 @@ +--- a/src/ping.c ++++ b/src/ping.c +@@ -651,7 +651,7 @@ static int ping_read (void) /* {{{ */ + / ((double) (pkg_recv * (pkg_recv - 1)))); + + /* Calculate drop rate. */ +- droprate = ((double) (pkg_sent - pkg_recv)) / ((double) pkg_sent); ++ droprate = ((double) (pkg_sent - pkg_recv)) * 100 / ((double) pkg_sent); + + submit (hl->host, "ping", latency_average); + submit (hl->host, "ping_stddev", latency_stddev); diff --git a/trunk/package/feeds/packages/confuse/Makefile b/trunk/package/feeds/packages/confuse/Makefile new file mode 100644 index 00000000..5b236d5b --- /dev/null +++ b/trunk/package/feeds/packages/confuse/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=confuse +PKG_VERSION:=2.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://savannah.nongnu.org/download/confuse/ +PKG_MD5SUM:=45932fdeeccbb9ef4228f1c1a25e9c8f +PKG_MAINTAINER:=Steven Barth +PKG_LICENSE:=ISC + +PKG_FIXUP:=autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/confuse + SECTION:=libs + CATEGORY:=Libraries + TITLE:=libConfuse is a configuration file parser library + URL:=http://www.nongnu.org/confuse/ +endef + +define Package/confuse/description + libConfuse is a configuration file parser library, licensed under the + terms of the ISC license, and written in C. It supports sections and + (lists of) values (strings, integers, floats, booleans or other + sections), as well as some other features (such as single/double-quoted + strings, environment variable expansion, functions and nested include + statements). It makes it very easy to add configuration file capability + to a program using a simple API. + + The goal of libConfuse is not to be the configuration file parser + library with a gazillion of features. Instead, it aims to be easy to use + and quick to integrate with your code. libConfuse was called libcfg + before, but was changed to not confuse with other similar libraries. +endef + +TARGET_CFLAGS += $(FPIC) + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-rpath \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + +MAKE_FLAGS += \ + -C $(PKG_BUILD_DIR)/src \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/confuse.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfuse.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_BUILD_DIR)/*.pc $(1)/usr/lib/pkgconfig/ +endef + +define Build/UninstallDev + rm -rf \ + $(STAGING_DIR)/usr/include/confuse.h \ + $(STAGING_DIR)/usr/lib/libconfuse.{a,so*} +endef + +define Package/confuse/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libconfuse.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,confuse)) diff --git a/trunk/package/feeds/packages/coova-chilli/Config.in b/trunk/package/feeds/packages/coova-chilli/Config.in new file mode 100644 index 00000000..c0c671f0 --- /dev/null +++ b/trunk/package/feeds/packages/coova-chilli/Config.in @@ -0,0 +1,52 @@ +# CoovaChilli advanced configuration + +menu "Configuration" + depends on PACKAGE_coova-chilli + +config COOVACHILLI_PROXY + bool "Enable support for chilli proxy. Required for AAA Proxy through http" + default n + +config COOVACHILLI_REDIR + bool "Enable support for redir server. Required for uamregex" + default n + +config COOVACHILLI_MINIPORTAL + bool "Enable support Coova miniportal" + default n + +config COOVACHILLI_USERAGENT + bool "Enable recording user-agent" + default n + +config COOVACHILLI_DNSLOG + bool "Enable support to log DNS name queries" + default n + +config COOVACHILLI_UAMDOMAINFILE + bool "Enable loading of mass uamdomains from file" + default n + +config COOVACHILLI_LARGELIMITS + bool "Enable larger limits for use with non-embedded systems" + default n + +choice + prompt "SSL library" + default COOVACHILLI_NOSSL + +config COOVACHILLI_NOSSL + bool "No SSL support" + +config COOVACHILLI_MATRIXSSL + bool "MatrixSSL" + +config COOVACHILLI_CYASSL + bool "CyaSSL" + +config COOVACHILLI_OPENSSL + bool "OpenSSL" + +endchoice + +endmenu diff --git a/trunk/package/feeds/packages/coova-chilli/Makefile b/trunk/package/feeds/packages/coova-chilli/Makefile new file mode 100644 index 00000000..29bfca68 --- /dev/null +++ b/trunk/package/feeds/packages/coova-chilli/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=coova-chilli +PKG_VERSION:=1.3.0+20141128 +PKG_MAINTAINER:=Imre Kaloz +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/coova/coova-chilli +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=b93de20a288c01c2ba28e96e31ad6da01627f45f +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MD5SUM:=2adb27ec56172b18c5beee359dd7898d + +PKG_INSTALL:=1 + +PKG_CONFIG_DEPENDS := \ + COOVACHILLI_MINIPORTAL \ + COOVACHILLI_REDIR \ + COOVACHILLI_USERAGENT \ + COOVACHILLI_DNSLOG \ + COOVACHILLI_UAMDOMAINFILE \ + COOVACHILLI_LARGELIMITS \ + COOVACHILLI_NOSSL \ + COOVACHILLI_MATRIXSSL \ + COOVACHILLI_CYASSL \ + COOVACHILLI_OPENSSL + +include $(INCLUDE_DIR)/package.mk + +define Package/coova-chilli + SUBMENU:=Captive Portals + SECTION:=net + CATEGORY:=Network + DEPENDS:=+kmod-tun +librt +COOVACHILLI_MATRIXSSL:libmatrixssl +COOVACHILLI_CYASSL:libcyassl +COOVACHILLI_OPENSSL:libopenssl + TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version) + URL:=http://www.coova.org/CoovaChilli + MENU:=1 +endef + +define Package/coova-chilli/description + CoovaChilli is an open source access controller for wireless LAN + access points and is based on ChilliSpot. It is used for authenticating + users of a wireless (or wired) LAN. It supports web based login (UAM) + which is today's standard for public HotSpots and it supports Wireless + Protected Access (WPA) which is the standard of the future. + Authentication, authorization and accounting (AAA) is handled by your + favorite radius server. +endef + +define Package/coova-chilli/config + source "$(SOURCE)/Config.in" +endef + +define Build/Prepare +$(call Build/Prepare/Default) + ( cd $(PKG_BUILD_DIR) ; \ + [ -f ./configure ] || { \ + ./bootstrap ; \ + } \ + ) +endef + +define Build/Configure + $(call Build/Configure/Default, \ + $(if $(CONFIG_COOVACHILLI_PROXY),--enable,--disable)-chilliproxy \ + $(if $(CONFIG_COOVACHILLI_REDIR),--enable,--disable)-chilliredir \ + $(if $(CONFIG_COOVACHILLI_DNSLOG),--enable,--disable)-dnslog \ + $(if $(CONFIG_COOVACHILLI_MINIPORTAL),--enable,--disable)-miniportal \ + $(if $(CONFIG_COOVACHILLI_USERAGENT),--enable,--disable)-useragent \ + $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \ + $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \ + $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \ + $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyassl \ + $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \ + ) +endef + +define Package/coova-chilli/conffiles +/etc/chilli.conf +endef + +define Package/coova-chilli/install + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/chilli + $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_DATA) ./files/chilli.hotplug $(1)/etc/hotplug.d/iface/30-chilli + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,coova-chilli)) diff --git a/trunk/package/feeds/packages/coova-chilli/files/chilli.hotplug b/trunk/package/feeds/packages/coova-chilli/files/chilli.hotplug new file mode 100644 index 00000000..e12812b4 --- /dev/null +++ b/trunk/package/feeds/packages/coova-chilli/files/chilli.hotplug @@ -0,0 +1,7 @@ +#!/bin/sh + +[ "$ACTION" == "ifup" ] || exit 0 + +[ "$INTERFACE" = "wan" ] && { + /etc/init.d/chilli restart +} diff --git a/trunk/package/feeds/packages/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch b/trunk/package/feeds/packages/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch new file mode 100644 index 00000000..2efecbe2 --- /dev/null +++ b/trunk/package/feeds/packages/coova-chilli/patches/100-fix-sysinfo-redeclaration.patch @@ -0,0 +1,24 @@ +--- a/src/system.h ++++ b/src/system.h +@@ -83,10 +83,6 @@ + #include + #endif + +-#ifdef HAVE_SYS_SYSINFO_H +-#include +-#endif +- + #ifdef HAVE_TIME_H + #include + #endif +@@ -139,6 +135,10 @@ + #include + #endif + ++#ifdef HAVE_SYS_SYSINFO_H ++#include ++#endif ++ + #elif defined (__FreeBSD__) || defined (__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__) + #include + #include diff --git a/trunk/package/feeds/packages/coreutils/Makefile b/trunk/package/feeds/packages/coreutils/Makefile new file mode 100644 index 00000000..3b9f17d3 --- /dev/null +++ b/trunk/package/feeds/packages/coreutils/Makefile @@ -0,0 +1,116 @@ +# +# Copyright (C) 2008-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=coreutils +PKG_VERSION:=8.23 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/coreutils +PKG_MD5SUM:=abed135279f87ad6762ce57ff6d89c41 +PKG_BUILD_DEPENDS:=libpthread +PKG_MAINTAINER:=Jo-Philipp Wich + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +COREUTILS_APPLETS := \ + base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit \ + cut date dd dir dircolors dirname du echo env expand expr factor \ + false fmt fold groups head hostid id install join kill link ln logname \ + ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste \ + pathchk pinky pr printenv printf ptx pwd readlink realpath rm rmdir \ + runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred \ + shuf sleep sort split stat stdbuf stty sum sync tac tail tee test \ + timeout touch tr true truncate tsort tty uname unexpand uniq unlink \ + uptime users vdir wc who whoami yes + +DEPENDS_sort = +libpthread +DEPENDS_timeout = +librt +DEPENDS_expr = +libgmp +DEPENDS_factor = +libgmp +DEPENDS_cp = +libacl +DEPENDS_dir = +libacl +DEPENDS_install = +libacl +DEPENDS_ls = +libacl +DEPENDS_mv = +libacl +DEPENDS_vdir = +libacl + +define Package/coreutils/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=The GNU core utilities + URL:=http://www.gnu.org/software/coreutils/ +endef + +define Package/coreutils + $(call Package/coreutils/Default) + TITLE:=The GNU core utilities + MENU:=1 +endef + +define Package/coreutils/description + Full versions of standard GNU utilities. Normally, you would not use this + package, since the functionality in BusyBox is more than sufficient and + smaller. +endef + +define GenPlugin + define Package/$(1) + $(call Package/coreutils/Default) + DEPENDS:=coreutils $(DEPENDS_$(2)) + TITLE:=Utility $(2) from the GNU core utilities + endef + + define Package/$(1)/description + Full version of standard GNU $(2) utility. Normally, you would not use this + package, since the functionality in BusyBox is more than sufficient. + endef +endef + +$(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a)))) + +CONFIGURE_VARS += \ + gl_cv_func_mbrtowc_incomplete_state=yes \ + gl_cv_func_mbrtowc_retval=yes \ + gl_cv_func_wcrtomb_retval=yes + +ifneq ($(CONFIG_USE_UCLIBC),) + CONFIGURE_VARS += \ + ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes) +endif + +CONFIGURE_ARGS += \ + --disable-xattr \ + --enable-install-program=su + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + SHELL="/bin/bash" \ + all install +endef + +define Package/coreutils/install + true +endef + +define BuildPlugin + define Package/$(1)/install + $(INSTALL_DIR) $$(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/ + endef + + $$(eval $$(call BuildPackage,$(1))) +endef + +$(eval $(call BuildPackage,coreutils)) + +$(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a)))) diff --git a/trunk/package/feeds/packages/coreutils/patches/001-no_docs_man_tests.patch b/trunk/package/feeds/packages/coreutils/patches/001-no_docs_man_tests.patch new file mode 100644 index 00000000..60f2df2b --- /dev/null +++ b/trunk/package/feeds/packages/coreutils/patches/001-no_docs_man_tests.patch @@ -0,0 +1,89 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -17,7 +17,7 @@ + + ALL_RECURSIVE_TARGETS = + +-SUBDIRS = po . gnulib-tests ++SUBDIRS = po + + changelog_etc = \ + ChangeLog-2005 \ +@@ -213,6 +213,4 @@ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib + + include $(top_srcdir)/lib/local.mk + include $(top_srcdir)/src/local.mk +-include $(top_srcdir)/doc/local.mk +-include $(top_srcdir)/man/local.mk +-include $(top_srcdir)/tests/local.mk ++ +--- a/Makefile.in ++++ b/Makefile.in +@@ -159,8 +159,7 @@ build_triplet = @build@ + host_triplet = @host@ + DIST_COMMON = $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk \ + $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk \ +- $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk \ +- $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk \ ++ $(top_srcdir)/src/single-binary.mk \ + INSTALL NEWS README AUTHORS ChangeLog $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(top_srcdir)/lib/config.hin ABOUT-NLS \ +@@ -2276,11 +2275,7 @@ RECURSIVE_TARGETS = all-recursive check- + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +-am__can_run_installinfo = \ +- case $$AM_UPDATE_INFO_DIR in \ +- n|no|NO) false;; \ +- *) (install-info --version) >/dev/null 2>&1;; \ +- esac ++am__can_run_installinfo = false + am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; + am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ +@@ -2606,7 +2601,7 @@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ + EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ + ERRNO_H = @ERRNO_H@ + EXEEXT = @EXEEXT@ +-EXTRA_MANS = @EXTRA_MANS@ ++EXTRA_MANS = + FLOAT_H = @FLOAT_H@ + FNMATCH_H = @FNMATCH_H@ + GETADDRINFO_LIB = @GETADDRINFO_LIB@ +@@ -3820,7 +3815,7 @@ libexecdir = @libexecdir@ + lispdir = @lispdir@ + localedir = @localedir@ + localstatedir = @localstatedir@ +-man1_MANS = @man1_MANS@ ++man1_MANS = + mandir = @mandir@ + mkdir_p = @mkdir_p@ + oldincludedir = @oldincludedir@ +@@ -3843,7 +3838,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + ALL_RECURSIVE_TARGETS = distcheck-hook check-root +-SUBDIRS = po . gnulib-tests ++SUBDIRS = po + changelog_etc = \ + ChangeLog-2005 \ + ChangeLog-2006 \ +@@ -5767,7 +5762,7 @@ all: $(BUILT_SOURCES) + .SUFFIXES: .1 .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y + am--refresh: Makefile + @: +-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps) ++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ +@@ -5790,7 +5785,7 @@ Makefile: $(srcdir)/Makefile.in $(top_bu + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; +-$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk: ++$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk: + + $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck diff --git a/trunk/package/feeds/packages/coreutils/patches/002-fix_compile_with_uclibc.patch b/trunk/package/feeds/packages/coreutils/patches/002-fix_compile_with_uclibc.patch new file mode 100644 index 00000000..94187e4b --- /dev/null +++ b/trunk/package/feeds/packages/coreutils/patches/002-fix_compile_with_uclibc.patch @@ -0,0 +1,12 @@ +--- a/lib/pthread.in.h ++++ b/lib/pthread.in.h +@@ -252,6 +252,9 @@ pthread_mutex_unlock (pthread_mutex_t *m + + /* Approximate spinlocks with mutexes. */ + ++#ifdef __UCLIBC__ ++#define pthread_spinlock_t original_pthread_spinlock_t ++#endif + typedef pthread_mutex_t pthread_spinlock_t; + + _GL_PTHREAD_INLINE int diff --git a/trunk/package/feeds/packages/crtmpserver/Makefile b/trunk/package/feeds/packages/crtmpserver/Makefile new file mode 100644 index 00000000..5f2a31eb --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/Makefile @@ -0,0 +1,95 @@ +# +# Copyright (C) 2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=crtmpserver +PKG_REV:=811 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 +PKG_BUILD_PARALLEL:=2 +PKG_MAINTAINER:=Thomas Heil +PKG_LICENSE:=GPL-3.0 + + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=--username=anonymous --password= https://svn.rtmpd.com/crtmpserver/branches/1.0 +PKG_SOURCE_SUBDIR:=crtmpserver-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +include $(INCLUDE_DIR)/package.mk + +define Package/crtmpserver + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+libopenssl +libstdcpp +liblua + TITLE:=C++ RTMP Server + URL:=http://www.rtmpd.com/ +endef + +define Package/crtmpserver/description +C++ RTMP Server it is a high performance streaming server able to +stream (live or recorded) in the following technologies: + * To and from Flash (RTMP,RTMPE, RTMPS, RTMPT, RTMPTE) + * To and from embedded devices: iPhone, Android + * From surveillance cameras + * IP-TV using MPEG-TS and RTSP/RTCP/RTP protocols + +Also, crtmpserver can be used as a high performance rendes-vous +server. For example, it enables you to do: + * Audio/Video conferencing + * Online gaming + * Online collaboration + * Simple/complex chat applications +endef + +define Package/crtmpserver/conffiles +/etc/crtmpserver.lua +endef + +# XXX: this hack handles the usr/bin vs bin difference of backfire and trunk +TS_BASE:=$(wildcard $(TOOLCHAIN_DIR)/bin/$(TARGET_CC)) +TS_BASE:=$(dir $(if $(TS_BASE),$(TS_BASE),$(wildcard $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CC)))) + +define Build/Configure + (cd $(PKG_BUILD_DIR)/builders/make; \ + cp linux.mk linux-openwrt-uclibc.mk; \ + $(SED) 's,^TOOLCHAIN_BASE[[:space:]]*=.*,TOOLCHAIN_BASE=$(TS_BASE),' \ + -e 's,^TOOLCHAIN_PREFIX[[:space:]]*=.*,TOOLCHAIN_PREFIX=$(TARGET_CROSS),' \ + -e 's,^CCOMPILER[[:space:]]*=.*,CCOMPILER=$(TARGET_CC),' \ + -e 's,^CXXCOMPILER[[:space:]]*=.*,CXXCOMPILER=$(TARGET_CXX),' \ + -e 's,^OPTIMIZATIONS[[:space:]]*=.*,OPTIMIZATIONS=-O2,' \ + -e 's,^SSL_BASE[[:space:]]*=.*,SSL_BASE=$(STAGING_DIR)/usr,' \ + linux-openwrt-uclibc.mk) +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/builders/make \ + PLATFORM=linux-openwrt-uclibc -Wno-error -j6 +endef + +define Package/crtmpserver/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib/crtmpserver + $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/*.so $(1)/usr/lib/crtmpserver/ + $(foreach app,flvplayback samplefactory admin stresstest appselector vptests applestreamingclient proxypublish, \ + $(INSTALL_DIR) $(1)/usr/lib/crtmpserver/$(app); \ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/builders/make/output/dynamic/applications/$(app)/lib$(app).so \ + $(1)/usr/lib/crtmpserver/$(app)/; \ + ) + $(INSTALL_DIR) $(1)/etc + $(INSTALL_CONF) $(PKG_BUILD_DIR)/builders/make/output/dynamic/crtmpserver.lua $(1)/etc/ + $(INSTALL_DIR) $(1)/usr/share/crtmpserver/appselector + $(INSTALL_DIR) $(1)/usr/share/crtmpserver/media + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/crtmpserver.init $(1)/etc/init.d/crtmpserver +endef + +$(eval $(call BuildPackage,crtmpserver)) + diff --git a/trunk/package/feeds/packages/crtmpserver/files/crtmpserver.init b/trunk/package/feeds/packages/crtmpserver/files/crtmpserver.init new file mode 100644 index 00000000..cea35121 --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/files/crtmpserver.init @@ -0,0 +1,30 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2009-2010 OpenWrt.org + +START=99 +STOP=80 + +SERVICE_USE_PID=1 + +CRTMPSERVER_BIN="/usr/bin/crtmpserver" +CRTMPSERVER_CONFIG="/etc/crtmpserver.lua" +CRTMPSERVER_PID="/var/run/crtmpserver.pid" + +start() +{ + echo "start $CRTMPSERVER_BIN" + start-stop-daemon -S -x "$CRTMPSERVER_BIN" -- --daemon --pid="$CRTMPSERVER_PID" \ + "$CRTMPSERVER_CONFIG" +} +stop() { + + echo "stop $CRTMPSERVER_BIN" + start-stop-daemon -K -x $CRTMPSERVER_BIN -p $CRTMPSERVER_PID +} + +reload() +{ + stop + start +} + diff --git a/trunk/package/feeds/packages/crtmpserver/patches/010-link-crypt-for-lua.patch b/trunk/package/feeds/packages/crtmpserver/patches/010-link-crypt-for-lua.patch new file mode 100644 index 00000000..ec758188 --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/010-link-crypt-for-lua.patch @@ -0,0 +1,11 @@ +--- a/builders/make/compile.mk ++++ b/builders/make/compile.mk +@@ -67,7 +67,7 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny + + #common + COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include +-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml ++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt + COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp") + COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o) + diff --git a/trunk/package/feeds/packages/crtmpserver/patches/020-add-rpath.patch b/trunk/package/feeds/packages/crtmpserver/patches/020-add-rpath.patch new file mode 100644 index 00000000..1ea83203 --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/020-add-rpath.patch @@ -0,0 +1,13 @@ +--- a/builders/make/linux.mk ++++ b/builders/make/linux.mk +@@ -31,8 +31,8 @@ OPTIMIZATIONS = -O3 + COMPILE_FLAGS = $(FPIC) $(OPTIMIZATIONS) $(CFLAGS) + + #linking flags +-dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,"\$$ORIGIN" +-dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,"\$$ORIGIN" ++dynamic_lib_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-soname,$(DYNAMIC_LIB_PREFIX)$(1)$(DYNAMIC_LIB_SUFIX) -Wl,-rpath,/usr/lib/crtmpserver ++dynamic_exec_flags = $(FPIC) $(OPTIMIZATIONS) -Wl,-rpath,/usr/lib/crtmpserver + + #compile switches + PLATFORM_DEFINES = \ diff --git a/trunk/package/feeds/packages/crtmpserver/patches/030-default-config.patch b/trunk/package/feeds/packages/crtmpserver/patches/030-default-config.patch new file mode 100644 index 00000000..c37644ce --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/030-default-config.patch @@ -0,0 +1,60 @@ +--- a/builders/cmake/crtmpserver/crtmpserver.lua ++++ b/builders/cmake/crtmpserver/crtmpserver.lua +@@ -4,7 +4,7 @@ configuration= + { + -- if true, the server will run as a daemon. + -- NOTE: all console appenders will be ignored if this is a daemon +- daemon=false, ++ daemon=true, + -- the OS's path separator. Used in composing paths + pathSeparator="/", + +@@ -44,7 +44,7 @@ configuration= + { + -- this is the root directory of all applications + -- usually this is relative to the binary execuable +- rootDirectory="applications", ++ rootDirectory="/usr/lib/crtmpserver", + + + --this is where the applications array starts +@@ -68,7 +68,7 @@ configuration= + -- this is the folder from where the current application gets it's content. + -- It is optional. If not specified, it will be defaulted to: + -- //mediaFolder +- -- mediaFolder="/some/directory/where/media/files/are/stored" ++ mediaFolder="/usr/share/crtmpserver/appselector", + -- the application will also be known by that names. It is optional + --aliases= + --{ +@@ -89,13 +89,6 @@ configuration= + }, + { + ip="0.0.0.0", +- port=8081, +- protocol="inboundRtmps", +- sslKey="server.key", +- sslCert="server.crt" +- }, +- { +- ip="0.0.0.0", + port=8080, + protocol="inboundRtmpt" + }, +@@ -105,7 +98,7 @@ configuration= + description="FLV Playback Sample", + name="flvplayback", + protocol="dynamiclinklibrary", +- mediaFolder="/Volumes/android/backup/media/", ++ mediaFolder="/media/", + aliases= + { + "simpleLive", +@@ -183,6 +176,7 @@ configuration= + name="samplefactory", + description="asdsadasdsa", + protocol="dynamiclinklibrary", ++ mediaFolder="/usr/share/ctmpserver/media", + aliases= + { + "httpOutboundTest" diff --git a/trunk/package/feeds/packages/crtmpserver/patches/040-use-select.patch b/trunk/package/feeds/packages/crtmpserver/patches/040-use-select.patch new file mode 100644 index 00000000..466f86c9 --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/040-use-select.patch @@ -0,0 +1,13 @@ +Index: crtmpserver-r726/builders/make/linux.mk +=================================================================== +--- crtmpserver-r726.orig/builders/make/linux.mk ++++ crtmpserver-r726/builders/make/linux.mk +@@ -38,7 +38,7 @@ dynamic_exec_flags = $(FPIC) $(OPTIMIZAT + PLATFORM_DEFINES = \ + -DLINUX \ + -DLITTLE_ENDIAN_BYTE_ALIGNED \ +- -DNET_EPOLL ++ -DNET_SELECT + + SSL_BASE=/usr/local + diff --git a/trunk/package/feeds/packages/crtmpserver/patches/050-add-missing-make-defines.patch b/trunk/package/feeds/packages/crtmpserver/patches/050-add-missing-make-defines.patch new file mode 100644 index 00000000..f9ff617b --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/050-add-missing-make-defines.patch @@ -0,0 +1,57 @@ +--- a/builders/make/compile.mk ++++ b/builders/make/compile.mk +@@ -43,17 +43,22 @@ FEATURES_DEFINES = \ + -DHAS_PROTOCOL_RTP \ + -DHAS_PROTOCOL_TS \ + -DHAS_PROTOCOL_VAR \ ++ -DHAS_PROTOCOL_CLI \ ++ -DHAS_PROTOCOL_HLS \ ++ -DHAS_PROTOCOL_RAWHTTPSTREAM \ + -DHAS_LUA \ + -DHAS_MEDIA_MP3 \ + -DHAS_MEDIA_MP4 \ +- -DHAS_MEDIA_FLV ++ -DHAS_MEDIA_FLV \ ++ -DHAS_SYSLOG ++ + + + DEFINES = $(PLATFORM_DEFINES) $(FEATURES_DEFINES) + + #library paths + SSL_INCLUDE=-I$(SSL_BASE)/include +-SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto ++SSL_LIB=-L$(SSL_BASE)/lib -lssl -lcrypto -ldl + + #lua + LUA_INCLUDE=-I$(PROJECT_BASE_PATH)/3rdparty/lua-dev +@@ -67,25 +72,25 @@ TINYXML_OBJS = $(TINYXML_SRCS:.cpp=.tiny + + #common + COMMON_INCLUDE=$(LUA_INCLUDE) $(TINYXML_INCLUDE) $(SSL_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/common/include +-COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) -llua -ltinyxml -lcrypt ++COMMON_LIBS=$(SSL_LIB) -L$(OUTPUT_DYNAMIC) $(PROJECT_BASE_PATH)/builders/make/output/dynamic/liblua.so -ltinyxml -lcrypt -ldl + COMMON_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/common/src -type f -name "*.cpp") + COMMON_OBJS = $(COMMON_SRCS:.cpp=.common.o) + + #thelib + THELIB_INCLUDE=$(COMMON_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/thelib/include +-THELIB_LIBS=$(COMMON_LIBS) -L$(OUTPUT_DYNAMIC) -lcommon ++THELIB_LIBS=$(COMMON_LIBS) -L$(OUTPUT_DYNAMIC) -lcommon -ldl + THELIB_SRCS = $(shell find $(PROJECT_BASE_PATH)/sources/thelib/src -type f -name "*.cpp") + THELIB_OBJS = $(THELIB_SRCS:.cpp=.thelib.o) + + #tests + TESTS_INCLUDE=$(THELIB_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/tests/include +-TESTS_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib ++TESTS_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib -ldl + TESTS_SRCS=$(shell find $(PROJECT_BASE_PATH)/sources/tests/src -type f -name "*.cpp") + TESTS_OBJS=$(TESTS_SRCS:.cpp=.tests.o) + + #crtmpserver + CRTMPSERVER_INCLUDE=$(THELIB_INCLUDE) -I$(PROJECT_BASE_PATH)/sources/crtmpserver/include +-CRTMPSERVER_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib ++CRTMPSERVER_LIBS=$(THELIB_LIBS) -L$(OUTPUT_DYNAMIC) -lthelib -ldl + CRTMPSERVER_SRCS=$(shell find $(PROJECT_BASE_PATH)/sources/crtmpserver/src -type f -name "*.cpp") + CRTMPSERVER_OBJS_DYNAMIC=$(CRTMPSERVER_SRCS:.cpp=.crtmpserver_dynamic.o) + CRTMPSERVER_OBJS_STATIC=$(CRTMPSERVER_SRCS:.cpp=.crtmpserver_static.o) diff --git a/trunk/package/feeds/packages/crtmpserver/patches/060-add-missing-includes.patch b/trunk/package/feeds/packages/crtmpserver/patches/060-add-missing-includes.patch new file mode 100644 index 00000000..505b5f33 --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/060-add-missing-includes.patch @@ -0,0 +1,26 @@ +--- a/sources/common/include/common.h ++++ b/sources/common/include/common.h +@@ -20,6 +20,10 @@ + #ifndef _COMMON_H + #define _COMMON_H + ++#include ++#include ++#include ++ + #include "defines.h" + #include "platform/platform.h" + #include "utils/utils.h" +--- a/sources/common/src/utils/logging/fileloglocation.cpp ++++ b/sources/common/src/utils/logging/fileloglocation.cpp +@@ -18,6 +18,10 @@ + */ + + ++#include ++#include ++#include ++ + #include "utils/logging/fileloglocation.h" + #include "utils/lua/luautils.h" + diff --git a/trunk/package/feeds/packages/crtmpserver/patches/070-missing-include-gcc-47.patch b/trunk/package/feeds/packages/crtmpserver/patches/070-missing-include-gcc-47.patch new file mode 100644 index 00000000..94d80e79 --- /dev/null +++ b/trunk/package/feeds/packages/crtmpserver/patches/070-missing-include-gcc-47.patch @@ -0,0 +1,10 @@ +--- a/3rdparty/tinyxml/tinyxml.h ++++ b/3rdparty/tinyxml/tinyxml.h +@@ -39,6 +39,7 @@ distribution. + #include + #include + #include ++#include "lstate.h" + + // Help out windows: + #if defined( _DEBUG ) && !defined( DEBUG ) diff --git a/trunk/package/feeds/packages/cryptodev-linux/Makefile b/trunk/package/feeds/packages/cryptodev-linux/Makefile new file mode 100644 index 00000000..e9af4ca9 --- /dev/null +++ b/trunk/package/feeds/packages/cryptodev-linux/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id$ + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=cryptodev-linux +PKG_VERSION:=1.7 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.gna.org/cryptodev-linux/ +PKG_MD5SUM:=0b63b3481cf2c90386b35f057481d36b + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +CRYPTODEV_AUTOLOAD:= \ + cryptodev + +define KernelPackage/cryptodev + SUBMENU:=Cryptographic API modules + DEFAULT:=m if ALL + TITLE:=Driver for cryptographic acceleration + URL:=http://cryptodev-linux.org/ + MAINTAINER:=Nikos Mavrogiannopoulos + VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) + DEPENDS:=+kmod-crypto-core +kmod-crypto-authenc +kmod-crypto-hash + FILES:= \ + $(PKG_BUILD_DIR)/cryptodev.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,50,$(CRYPTODEV_AUTOLOAD)) +endef + +define KernelPackage/cryptodev/description + This is a driver for that allows to use the Linux kernel supported + hardware ciphers by user-space applications. +endef + +CRYPTODEV_MAKEOPTS= -C $(PKG_BUILD_DIR) \ + PATH="$(TARGET_PATH)" \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + TOOLPREFIX="$(KERNEL_CROSS)" \ + TOOLPATH="$(KERNEL_CROSS)" \ + KERNEL_DIR="$(LINUX_DIR)" \ + LDOPTS=" " \ + DOMULTI=1 + +define Build/Compile/cryptodev + $(MAKE) $(CRYPTODEV_MAKEOPTS) +endef + +define Build/Compile + $(call Build/Compile/cryptodev) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR)/usr/include/crypto + $(CP) $(PKG_BUILD_DIR)/crypto/cryptodev.h $(STAGING_DIR)/usr/include/crypto/ +endef + +define KernelPackage/cryptodev/install + $(INSTALL_DIR) $(1)/etc/modules.d + $(INSTALL_DATA) ./files/cryptodev.modules $(1)/etc/modules.d/80-cryptodev + $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION) + $(INSTALL_DIR) $(1)/usr/sbin +endef + +$(eval $(call KernelPackage,cryptodev)) diff --git a/trunk/package/feeds/packages/cryptodev-linux/files/cryptodev.modules b/trunk/package/feeds/packages/cryptodev-linux/files/cryptodev.modules new file mode 100644 index 00000000..fb39fcd6 --- /dev/null +++ b/trunk/package/feeds/packages/cryptodev-linux/files/cryptodev.modules @@ -0,0 +1 @@ +cryptodev diff --git a/trunk/package/feeds/packages/cryptsetup/Makefile b/trunk/package/feeds/packages/cryptsetup/Makefile new file mode 100644 index 00000000..fb7fc121 --- /dev/null +++ b/trunk/package/feeds/packages/cryptsetup/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cryptsetup +PKG_VERSION:=1.6.7 +PKG_RELEASE:=1 +PKG_LICENSE:=GPL-2.0+ LGPL-2.1+ +PKG_LICENSE_FILES:=COPYING COPYING.LGPL + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/linux/utils/cryptsetup/v1.6 +PKG_MD5SUM:=918406eb5d2e2f5a7348c432ea9b1473 +PKG_MAINTAINER:=Daniel Golle + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS+=-Wl,-rpath-link=$(STAGING_DIR)/usr/lib + +define Package/cryptsetup/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Cryptsetup + DEPENDS:=+libblkid +libuuid +libpopt +lvm2 +libdevmapper +@KERNEL_DIRECT_IO + URL:=http://code.google.com/p/cryptsetup/ +endef + +define Package/cryptsetup +$(call Package/cryptsetup/Default) + DEPENDS+=+libgcrypt + VARIANT:=gcrypt +endef + +define Package/cryptsetup-openssl +$(call Package/cryptsetup/Default) + TITLE+= (with openssl support) + DEPENDS+=+libopenssl + VARIANT:=openssl +endef + +define Package/cryptsetup/Default/description + Cryptsetup-luks +endef + +define Package/cryptsetup/description +$(call Package/cryptsetup/Default/description) +linked against libgcrypt +endef + + +define Package/cryptsetup-openssl/description +$(call Package/cryptsetup/Default/description) +linked against openssl +endef + +ifeq ($(BUILD_VARIANT),openssl) +CONFIGURE_ARGS+= \ + --with-crypto_backend=openssl +endif + +define Package/cryptsetup/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/src/.libs/cryptsetup $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/.libs/libcryptsetup.so* $(1)/usr/lib +endef + +Package/cryptsetup-openssl/install = $(Package/cryptsetup/install) + +$(eval $(call BuildPackage,cryptsetup)) +$(eval $(call BuildPackage,cryptsetup-openssl)) diff --git a/trunk/package/feeds/packages/cshark/Makefile b/trunk/package/feeds/packages/cshark/Makefile new file mode 100644 index 00000000..cbfbed5f --- /dev/null +++ b/trunk/package/feeds/packages/cshark/Makefile @@ -0,0 +1,75 @@ +# +# Copyright (C) 2014-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cshark +PKG_VERSION:=2015-03-13 +PKG_RELEASE=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/cloudshark/cshark.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=ab2ae2fbd72b6cbd57c95e3192edc3c1f475412b +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/cshark + SECTION:=net + CATEGORY:=Network + TITLE:=CloudShark capture tool + URL:=http://www.cloudshark.org/ + DEPENDS:=+libjson-c +libpcap +libuci +libubox +libuclient +libustream-polarssl + MAINTAINER:=Luka Perkov +endef + +define Package/luci-app-cshark + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=Cloudshark capture tool Web UI + DEPENDS:=+cshark +luci + MAINTAINER:=Luka Perkov +endef + +CMAKE_OPTIONS = \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_DEBUG=OFF \ + +define Package/cshark/conffiles +/etc/config/cshark +endef + +define Package/cshark/install + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/cshark \ + $(1)/sbin/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) \ + $(PKG_BUILD_DIR)/config/cshark \ + $(1)/etc/config/ + + $(INSTALL_DIR) $(1)/etc/ssl/certs + $(INSTALL_CONF) \ + $(PKG_BUILD_DIR)/config/ca-the_usertrust_network.pem \ + $(1)/etc/ssl/certs/ +endef + +define Package/luci-app-cshark/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci + $(CP) -R $(PKG_BUILD_DIR)/openwrt/luci/luasrc/* $(1)/usr/lib/lua/luci/ +endef + +$(eval $(call BuildPackage,cshark)) +$(eval $(call BuildPackage,luci-app-cshark)) diff --git a/trunk/package/feeds/packages/ctorrent-svn/Makefile b/trunk/package/feeds/packages/ctorrent-svn/Makefile new file mode 100644 index 00000000..60920632 --- /dev/null +++ b/trunk/package/feeds/packages/ctorrent-svn/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2006-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ctorrent-svn +PKG_REV:=322 +PKG_VERSION:=r$(PKG_REV) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://svn.code.sf.net/p/dtorrent/code/dtorrent/trunk +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) +PKG_SOURCE_PROTO:=svn + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_CHECK_FORMAT_SECURITY:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/ctorrent-svn/Default + SUBMENU:=BitTorrent + SECTION:=net + CATEGORY:=Network + DEPENDS:=+uclibcxx + TITLE:=console-based BitTorrent client + MAINTAINER:=Peter Wagner + URL:=http://www.rahul.net/dholmes/ctorrent/ +endef + +define Package/ctorrent-svn/Default/description + CTorrent is a BitTorrent client written in the C programming language, + known to be a very robust and mature programming language, which produces + fast and optimized application. +endef + +define Package/ctorrent-svn +$(call Package/ctorrent-svn/Default) + TITLE+= (with OpenSSL support) + DEPENDS+=+libopenssl + VARIANT:=ssl +endef + +define Package/ctorrent-svn/description +$(call Package/ctorrent-svn/Default/description) + This package is built with OpenSSL support. +endef + +define Package/ctorrent-svn-nossl +$(call Package/ctorrent-svn/Default) + TITLE+= (with builtin SHA-1) + VARIANT:=nossl +endef + +define Package/ctorrent-svn-nossl/description +$(call Package/ctorrent-svn/Default/description) + This package is built with builtin (Steve Reid's public-domain) SHA-1 support +endef + +CONFIGURE_VARS += \ + CXX="g++-uc" \ + LIBS="-nodefaultlibs -luClibc++ $(LIBGCC_S) -lc" + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --with-ssl=no +endif + +define Build/Configure + (cd $(PKG_BUILD_DIR); touch \ + configure.ac \ + aclocal.m4 \ + Makefile.in \ + config.h.in \ + configure \ + ); + $(call Build/Configure/Default) +endef + +define Package/ctorrent-svn/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ctorrent $(1)/usr/bin/ctorrent +endef + +Package/ctorrent-svn-nossl/install = $(Package/ctorrent-svn/install) + +$(eval $(call BuildPackage,ctorrent-svn)) +$(eval $(call BuildPackage,ctorrent-svn-nossl)) diff --git a/trunk/package/feeds/packages/ctorrent-svn/patches/100-compile-fix.patch b/trunk/package/feeds/packages/ctorrent-svn/patches/100-compile-fix.patch new file mode 100644 index 00000000..bb7d33fd --- /dev/null +++ b/trunk/package/feeds/packages/ctorrent-svn/patches/100-compile-fix.patch @@ -0,0 +1,88 @@ +diff --git a/btconfig.cpp b/btconfig.cpp +index e1badd0..aaa6feb 100644 +--- a/btconfig.cpp ++++ b/btconfig.cpp +@@ -828,7 +828,7 @@ void CfgCTCS(Config *config) + strncpy(CTCS.m_host, *cfg_ctcs, MAXHOSTNAMELEN-1); + CTCS.m_host[MAXHOSTNAMELEN-1] = '\0'; + if( (s = strchr(CTCS.m_host, ':')) ) *s='\0'; +- CTCS.m_port = atoi(s = (strchr(*cfg_ctcs, ':')+1)); ++ CTCS.m_port = atoi(s = (char*)(strchr(*cfg_ctcs, ':')+1)); + if( strchr(s, ':') ) + CONSOLE.Input("Enter CTCS password: ", CTCS.m_pass, CTCS_PASS_SIZE); + else *CTCS.m_pass = '\0'; +diff --git a/btcontent.cpp b/btcontent.cpp +index d84f450..88ccb50 100644 +--- a/btcontent.cpp ++++ b/btcontent.cpp +@@ -1408,27 +1408,27 @@ void btContent::CompletionCommand() + ptmp = cmdstr + strlen(cmdstr); + parg = strstr(parg, "&t") + 2; + strcat(pt, parg); +- pt = strstr(ptmp, "&t"); +- if( pd ) pd = strstr(ptmp, "&d"); +- if( pw ) pw = strstr(ptmp, "&w"); ++ pt = (char *)strstr(ptmp, "&t"); ++ if( pd ) pd = (char *)strstr(ptmp, "&d"); ++ if( pw ) pw = (char *)strstr(ptmp, "&w"); + } + if( pd && (!pt || pd < pt) && (!pw || pd < pw) ){ + strcpy(pd, m_btfiles.GetDataName()); + ptmp = cmdstr + strlen(cmdstr); + parg = strstr(parg, "&d") + 2; + strcat(pd, parg); +- pd = strstr(ptmp, "&d"); +- if( pt ) pt = strstr(ptmp, "&t"); +- if( pw ) pw = strstr(ptmp, "&w"); ++ pd = (char *)strstr(ptmp, "&d"); ++ if( pt ) pt = (char *)strstr(ptmp, "&t"); ++ if( pw ) pw = (char *)strstr(ptmp, "&w"); + } + if( pw && (!pt || pw < pt) && (!pd || pw < pd) ){ + strcpy(pw, wd); + ptmp = cmdstr + strlen(cmdstr); + parg = strstr(parg, "&w") + 2; + strcat(pw, parg); +- pw = strstr(ptmp, "&w"); +- if( pt ) pt = strstr(ptmp, "&t"); +- if( pd ) pd = strstr(ptmp, "&d"); ++ pw = (char *)strstr(ptmp, "&w"); ++ if( pt ) pt = (char *)strstr(ptmp, "&t"); ++ if( pd ) pd = (char *)strstr(ptmp, "&d"); + } + } + } +diff --git a/console.cpp b/console.cpp +index bdadb61..5ab2492 100644 +--- a/console.cpp ++++ b/console.cpp +@@ -511,11 +511,8 @@ void ConStream::Error(int sev, const char *message, ...) + va_list ap; + + va_start(ap, message); +- if( g_console_ready ) CONSOLE.Error(sev, message, ap); +- else{ + vfprintf(stderr, message, ap); + fflush(stderr); +- } + va_end(ap); + } + +@@ -1766,7 +1763,7 @@ void Console::Warning(int sev, const char *message, ...) + va_end(ap); + } + +- ++/* + void Console::Error(int sev, const char *message, va_list ap) + { + vsnprintf(m_buffer, sizeof(m_buffer), message, ap); +@@ -1778,7 +1775,7 @@ void Console::Error(int sev, const char *message, va_list ap) + m_warnings.AddMessage(sev, m_buffer); + if( sev && *cfg_ctcs ) CTCS.Send_Info(sev, m_buffer); + } +- ++*/ + + void Console::Debug(const char *message, ...) + { diff --git a/trunk/package/feeds/packages/ctorrent-svn/patches/300-negative.patch b/trunk/package/feeds/packages/ctorrent-svn/patches/300-negative.patch new file mode 100644 index 00000000..e1e1e650 --- /dev/null +++ b/trunk/package/feeds/packages/ctorrent-svn/patches/300-negative.patch @@ -0,0 +1,14 @@ +diff --git a/bencode.cpp b/bencode.cpp +index fef82ba..b7f14bc 100644 +--- a/bencode.cpp ++++ b/bencode.cpp +@@ -45,6 +45,9 @@ size_t buf_int(const char *b, size_t len, char beginchar, char endchar, + p++; + len--; + } ++ if( *p == '-'){ ++ p++; len--; ++ } + + for( psave = p; len && isdigit(*p); p++, len-- ); + diff --git a/trunk/package/feeds/packages/ctorrent/Makefile b/trunk/package/feeds/packages/ctorrent/Makefile new file mode 100644 index 00000000..16504e2a --- /dev/null +++ b/trunk/package/feeds/packages/ctorrent/Makefile @@ -0,0 +1,84 @@ +# +# Copyright (C) 2006-2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ctorrent +PKG_VERSION:=dnh3.3.2 +PKG_RELEASE:=6 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/dtorrent \ + http://www.rahul.net/dholmes/ctorrent/ +PKG_MD5SUM:=59b23dd05ff70791cd6449effa7fc3b6 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/ctorrent/Default + SUBMENU:=BitTorrent + SECTION:=net + CATEGORY:=Network + DEPENDS:=$(CXX_DEPENDS) + TITLE:=console-based BitTorrent client + MAINTAINER:=Peter Wagner + URL:=http://www.rahul.net/dholmes/ctorrent/ +endef + +define Package/ctorrent/Default/description + CTorrent is a BitTorrent client written in the C programming language, + known to be a very robust and mature programming language, which produces + fast and optimized application. +endef + +define Package/ctorrent +$(call Package/ctorrent/Default) + TITLE+= (with OpenSSL support) + DEPENDS+=+libopenssl + VARIANT:=ssl +endef + +define Package/ctorrent/description +$(call Package/ctorrent/Default/description) + This package is built with OpenSSL support. +endef + +define Package/ctorrent-nossl +$(call Package/ctorrent/Default) + TITLE+= (with builtin SHA-1) + VARIANT:=nossl +endef + +define Package/ctorrent-nossl/description +$(call Package/ctorrent/Default/description) + This package is built with builtin (Steve Reid's public-domain) SHA-1 support +endef + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" + +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += \ + --with-ssl="$(STAGING_DIR)/usr" +endif + +ifeq ($(BUILD_VARIANT),nossl) + CONFIGURE_ARGS += \ + --with-ssl=no +endif + +define Package/ctorrent/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/$(PKG_NAME) +endef + +Package/ctorrent-nossl/install = $(Package/ctorrent/install) + +$(eval $(call BuildPackage,ctorrent)) +$(eval $(call BuildPackage,ctorrent-nossl)) diff --git a/trunk/package/feeds/packages/ctorrent/patches/100-CVE-2009-1759.patch b/trunk/package/feeds/packages/ctorrent/patches/100-CVE-2009-1759.patch new file mode 100644 index 00000000..86ae1d7d --- /dev/null +++ b/trunk/package/feeds/packages/ctorrent/patches/100-CVE-2009-1759.patch @@ -0,0 +1,364 @@ +Patch for CVE-2009-1759. +Source: Upstream SVN, rev 302 from the dtorrent-3 branch. + +Index: a/bencode.h +=================================================================== +--- a/bencode.h (revision 300) ++++ b/bencode.h (revision 302) +@@ -25,7 +25,7 @@ + size_t decode_list(const char *b,size_t len,const char *keylist); + size_t decode_rev(const char *b,size_t len,const char *keylist); + size_t decode_query(const char *b,size_t len,const char *keylist,const char **ps,size_t *pi,int64_t *pl,int method); +-size_t decode_list2path(const char *b, size_t n, char *pathname); ++size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen); + size_t bencode_buf(const char *str,size_t len,FILE *fp); + size_t bencode_str(const char *str, FILE *fp); + size_t bencode_int(const uint64_t integer, FILE *fp); +Index: a/bencode.cpp +=================================================================== +--- a/bencode.cpp (revision 300) ++++ b/bencode.cpp (revision 302) +@@ -233,22 +233,28 @@ + return bencode_end_dict_list(fp); + } + +-size_t decode_list2path(const char *b, size_t n, char *pathname) ++size_t decode_list2path(const char *b, size_t n, char *pathname, size_t maxlen) + { + const char *pb = b; + const char *s = (char *) 0; ++ const char *endmax = pathname + maxlen - 1; + size_t r,q; + + if( 'l' != *pb ) return 0; + pb++; + n--; + if( !n ) return 0; +- for(; n;){ ++ while( n && pathname < endmax ){ + if(!(r = buf_str(pb, n, &s, &q)) ) return 0; ++ if( q >= maxlen ) return 0; + memcpy(pathname, s, q); + pathname += q; +- pb += r; n -= r; +- if( 'e' != *pb ){*pathname = PATH_SP, pathname++;} else break; ++ maxlen -= q; ++ pb += r; ++ n -= r; ++ if( 'e' == *pb ) break; ++ if( pathname >= endmax ) return 0; ++ *pathname++ = PATH_SP; + } + *pathname = '\0'; + return (pb - b + 1); +Index: a/btfiles.cpp +=================================================================== +--- a/btfiles.cpp (revision 300) ++++ b/btfiles.cpp (revision 302) +@@ -449,7 +449,8 @@ + return 0; + } + +-int btFiles::BuildFromMI(const char *metabuf, const size_t metabuf_len, const char *saveas) ++int btFiles::BuildFromMI(const char *metabuf, const size_t metabuf_len, ++ const char *saveas, unsigned char exam_only) + { + char path[MAXPATHLEN]; + const char *s, *p; +@@ -458,11 +459,19 @@ + int f_warned = 0; + + if( !decode_query(metabuf, metabuf_len, "info|name", &s, &q, (int64_t*)0, +- QUERY_STR) || MAXPATHLEN <= q ) ++ QUERY_STR) || MAXPATHLEN <= q ){ ++ errno = EINVAL; + return -1; ++ } + + memcpy(path, s, q); + path[q] = '\0'; ++ if( !exam_only && ++ (PATH_SP == path[0] || '/' == path[0] || 0==strncmp("..", path, 2)) ){ ++ CONSOLE.Warning(1, "error, unsafe path \"%s\" in torrent data", path); ++ errno = EINVAL; ++ return -1; ++ } + + r = decode_query(metabuf, metabuf_len, "info|files", (const char**)0, &q, + (int64_t*)0, QUERY_POS); +@@ -471,21 +480,31 @@ + BTFILE *pbf_last = (BTFILE*) 0; + BTFILE *pbf = (BTFILE*) 0; + size_t dl; ++ unsigned long nfiles = 0; ++ + if( decode_query(metabuf,metabuf_len,"info|length", +- (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ) ++ (const char**) 0,(size_t*) 0,(int64_t*) 0,QUERY_LONG) ){ ++ errno = EINVAL; + return -1; ++ } + + if( saveas ){ + m_directory = new char[strlen(saveas) + 1]; + #ifndef WINDOWS +- if(!m_directory) return -1; ++ if( !m_directory ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + strcpy(m_directory,saveas); + }else{ + int f_conv; + char *tmpfn = new char[strlen(path)*2+5]; + #ifndef WINDOWS +- if( !tmpfn ) return -1; ++ if( !tmpfn ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + if( f_conv = ConvertFilename(tmpfn, path, strlen(path)*2+5) ){ + if( arg_flg_convert_filenames ){ +@@ -493,6 +512,7 @@ + #ifndef WINDOWS + if( !m_directory ){ + delete []tmpfn; ++ errno = ENOMEM; + return -1; + } + #endif +@@ -507,7 +527,10 @@ + if( !f_conv || !arg_flg_convert_filenames ){ + m_directory = new char[strlen(path) + 1]; + #ifndef WINDOWS +- if( !m_directory ) return -1; ++ if( !m_directory ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + strcpy(m_directory,path); + } +@@ -517,24 +540,50 @@ + p = metabuf + r + 1; + q--; + for(; q && 'e' != *p; p += dl, q -= dl){ +- if(!(dl = decode_dict(p, q, (const char*) 0)) ) return -1; +- if( !decode_query(p, dl, "length", (const char**) 0, +- (size_t*) 0,&t,QUERY_LONG) ) return -1; ++ if( !(dl = decode_dict(p, q, (const char*) 0)) || ++ !decode_query(p, dl, "length", (const char**) 0, (size_t*) 0, &t, ++ QUERY_LONG) ){ ++ errno = EINVAL; ++ return -1; ++ } + pbf = _new_bfnode(); + #ifndef WINDOWS +- if( !pbf ) return -1; ++ if( !pbf ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif ++ nfiles++; + pbf->bf_length = t; + m_total_files_length += t; + r = decode_query(p, dl, "path", (const char **)0, &n, (int64_t*)0, + QUERY_POS); +- if( !r ) return -1; +- if(!decode_list2path(p + r, n, path)) return -1; ++ if( !r || !decode_list2path(p + r, n, path, sizeof(path)) ){ ++ CONSOLE.Warning(1, ++ "error, invalid path in torrent data for file %lu at offset %llu", ++ nfiles, m_total_files_length - t); ++ delete pbf; ++ errno = EINVAL; ++ return -1; ++ } ++ if( !exam_only && ++ (PATH_SP == path[0] || '/' == path[0] || 0==strncmp("..", path, 2)) ){ ++ CONSOLE.Warning(1, ++ "error, unsafe path \"%s\" in torrent data for file %lu", ++ path, nfiles); ++ delete pbf; ++ errno = EINVAL; ++ return -1; ++ } + ++ + int f_conv; + char *tmpfn = new char[strlen(path)*2+5]; + #ifndef WINDOWS +- if( !tmpfn ) return -1; ++ if( !tmpfn ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + if( f_conv = ConvertFilename(tmpfn, path, strlen(path)*2+5) ){ + if( arg_flg_convert_filenames ){ +@@ -542,6 +591,7 @@ + #ifndef WINDOWS + if( !pbf->bf_filename ){ + delete []tmpfn; ++ errno = ENOMEM; + return -1; + } + #endif +@@ -556,7 +606,10 @@ + if( !f_conv || !arg_flg_convert_filenames ){ + pbf->bf_filename = new char[strlen(path) + 1]; + #ifndef WINDOWS +- if( !pbf->bf_filename ) return -1; ++ if( !pbf->bf_filename ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + strcpy(pbf->bf_filename, path); + } +@@ -564,30 +617,42 @@ + pbf_last = pbf; + } + }else{ +- if( !decode_query(metabuf,metabuf_len,"info|length", +- (const char**) 0,(size_t*) 0,&t,QUERY_LONG) ) ++ if( !decode_query(metabuf,metabuf_len, "info|length", ++ (const char**)0, (size_t*) 0, &t, QUERY_LONG) ){ ++ errno = EINVAL; + return -1; ++ } + m_btfhead = _new_bfnode(); + #ifndef WINDOWS +- if( !m_btfhead) return -1; ++ if( !m_btfhead ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + m_btfhead->bf_length = m_total_files_length = t; + if( saveas ){ + m_btfhead->bf_filename = new char[strlen(saveas) + 1]; + #ifndef WINDOWS +- if(!m_btfhead->bf_filename ) return -1; ++ if( !m_btfhead->bf_filename ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + strcpy(m_btfhead->bf_filename, saveas); + }else if( arg_flg_convert_filenames ){ + char *tmpfn = new char[strlen(path)*2+5]; + #ifndef WINDOWS +- if( !tmpfn ) return -1; ++ if( !tmpfn ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + ConvertFilename(tmpfn, path, strlen(path)*2+5); + m_btfhead->bf_filename = new char[strlen(tmpfn) + 1]; + #ifndef WINDOWS + if( !m_btfhead->bf_filename ){ + delete []tmpfn; ++ errno = ENOMEM; + return -1; + } + #endif +@@ -596,7 +661,10 @@ + }else{ + m_btfhead->bf_filename = new char[strlen(path) + 1]; + #ifndef WINDOWS +- if(!m_btfhead->bf_filename ) return -1; ++ if( !m_btfhead->bf_filename ){ ++ errno = ENOMEM; ++ return -1; ++ } + #endif + strcpy(m_btfhead->bf_filename, path); + } +@@ -694,6 +762,32 @@ + size_t btFiles::FillMetaInfo(FILE* fp) + { + BTFILE *p; ++ const char *refname, *s; ++ char path[MAXPATHLEN]; ++ ++ refname = m_directory ? m_directory : m_btfhead->bf_filename; ++ while( (s = strchr(refname, PATH_SP)) && *(s + 1) ){ ++ refname = s + 1; ++ } ++ if( m_directory && '.' == *refname ){ ++ char dir[MAXPATHLEN]; ++ if( getcwd(dir, sizeof(dir)) && 0==chdir(m_directory) ){ ++ if( getcwd(path, sizeof(path)) ){ ++ refname = path; ++ while( (s = strchr(refname, PATH_SP)) && *(s + 1) ){ ++ refname = s + 1; ++ } ++ } ++ chdir(dir); ++ } ++ } ++ if( '/' == *refname || '\0' == *refname || '.' == *refname ){ ++ CONSOLE.Warning(1, "error, inappropriate file or directory name \"%s\"", ++ m_directory ? m_directory : m_btfhead->bf_filename); ++ errno = EINVAL; ++ return 0; ++ } ++ + if( m_directory ){ + // multi files + if( bencode_str("files", fp) != 1 ) return 0; +@@ -715,16 +809,15 @@ + if(bencode_end_dict_list(fp) != 1 ) return 0; + + if(bencode_str("name", fp) != 1) return 0; +- return bencode_str(m_directory, fp); +- ++ return bencode_str(refname, fp); + }else{ + if( bencode_str("length", fp) != 1 ) return 0; + if( bencode_int(m_btfhead->bf_length, fp) != 1) return 0; + + if( bencode_str("name", fp) != 1 ) return 0; +- return bencode_str(m_btfhead->bf_filename, fp); ++ return bencode_str(refname, fp); + } +- return 1; ++ return 0; + } + + +Index: a/btcontent.cpp +=================================================================== +--- a/btcontent.cpp (revision 300) ++++ b/btcontent.cpp (revision 302) +@@ -357,7 +357,11 @@ + + cfg_req_queue_length = (m_piece_length / cfg_req_slice_size) * 2 - 1; + +- if( m_btfiles.BuildFromMI(b, flen, saveas) < 0 ) ERR_RETURN(); ++ if( m_btfiles.BuildFromMI(b, flen, saveas, arg_flg_exam_only) < 0 ){ ++ if( EINVAL == errno ) ++ CONSOLE.Warning(1, "Torrent metainfo file data is invalid or unusable."); ++ ERR_RETURN(); ++ } + + delete []b; + b = (char *)0; +Index: a/btfiles.h +=================================================================== +--- a/btfiles.h (revision 300) ++++ b/btfiles.h (revision 302) +@@ -61,7 +61,7 @@ + + int BuildFromFS(const char *pathname); + int BuildFromMI(const char *metabuf, const size_t metabuf_len, +- const char *saveas); ++ const char *saveas, unsigned char exam_only); + + char *GetDataName() const; + uint64_t GetTotalLength() const { return m_total_files_length; } diff --git a/trunk/package/feeds/packages/ctorrent/patches/100-negative-ints.patch b/trunk/package/feeds/packages/ctorrent/patches/100-negative-ints.patch new file mode 100644 index 00000000..864ce1b6 --- /dev/null +++ b/trunk/package/feeds/packages/ctorrent/patches/100-negative-ints.patch @@ -0,0 +1,13 @@ +--- a/bencode.cpp ++++ b/bencode.cpp +@@ -44,6 +44,10 @@ size_t buf_long(const char *b,size_t len + p++; len--; + } + ++ if( *p == '-'){ ++ p++; len--; ++ } ++ + for(psave = p; len && isdigit(*p); p++,len--) ; + + if(!len || MAX_INT_SIZ < (p - psave) || *p != endchar) return 0; diff --git a/trunk/package/feeds/packages/cyrus-sasl/Makefile b/trunk/package/feeds/packages/cyrus-sasl/Makefile new file mode 100644 index 00000000..dfc21d2e --- /dev/null +++ b/trunk/package/feeds/packages/cyrus-sasl/Makefile @@ -0,0 +1,112 @@ +# +# Copyright (C) 2006-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=cyrus-sasl +PKG_VERSION:=2.1.26 +PKG_RELEASE:=3 + +PKG_MAINTAINER:=W. Michael Petullo + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=ftp://ftp.cyrusimap.org/cyrus-sasl/ +PKG_MD5SUM:=a7f4e5e559a0e37b3ffc438c9456e425 + +PKG_LICENSE:=BSD-4c BSD +PKG_LICENSE_FILES:=COPYING cmulocal/COPYING saslauthd/COPYING + +PKG_FIXUP:=autoreconf +PKG_MACRO_PATHS:=cmulocal config ../cmulocal ../config +PKG_AUTOMAKE_PATHS:=. saslauthd sasldb +PKG_REMOVE_FILES:=aclocal.m4 saslauthd/aclocal.m4 config/libtool.m4 + +include $(INCLUDE_DIR)/package.mk + +define Package/libsasl2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=A general purpose authentication library + URL:=http://asg.web.cmu.edu/sasl/ + DEPENDS:=+libopenssl +endef + +TARGET_CFLAGS += $(FPIC) +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-sample \ + --enable-staticdlopen \ + --disable-java \ + --disable-alwaystrue \ + --disable-checkapop \ + --enable-cram \ + --enable-digest \ + --without-auth-sasldb \ + --disable-otp \ + --disable-srp \ + --disable-srp-setpass \ + --disable-krb4 \ + --disable-gssapi \ + --disable-gss_mutexes \ + --enable-plain \ + --enable-anon \ + --disable-login \ + --disable-ntlm \ + --disable-sql \ + --disable-ldapdb \ + --without-dblib \ + --without-gdbm \ + --with-devrandom="/dev/urandom" \ + --without-pam \ + --without-saslauthd \ + --without-authdaemond \ + --without-pwcheck \ + --with-ipctype=unix \ + --with-openssl="$(STAGING_DIR)/usr" \ + --without-des \ + --without-opie \ + --without-ldap \ + --without-mysql \ + --without-pgsql \ + --without-sqlite \ + --without-rc4 \ + --without-dmalloc \ + --without-sfio \ + --disable-sample + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/include \ + CC="$(HOSTCC)" \ + LINK="$(HOSTCC) -o makemd5 -lc" \ + CFLAGS="" \ + CPPFLAGS="" \ + makemd5 + $(MAKE) -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + all install +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/sasl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsasl2.{a,so*} $(1)/usr/lib/ + ln -sf libsasl2.a $(1)/usr/lib/libsasl.a + ln -sf libsasl2.so $(1)/usr/lib/libsasl.so + $(INSTALL_DIR) $(1)/usr/lib/sasl2 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sasl2/lib*.{a,so*} $(1)/usr/lib/sasl2/ +endef + +define Package/libsasl2/install + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsasl2.so* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/sasl2 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/sasl2/lib*.so* $(1)/usr/lib/sasl2/ +endef + +$(eval $(call BuildPackage,libsasl2)) diff --git a/trunk/package/feeds/packages/dansguardian/Makefile b/trunk/package/feeds/packages/dansguardian/Makefile new file mode 100644 index 00000000..eefefaa3 --- /dev/null +++ b/trunk/package/feeds/packages/dansguardian/Makefile @@ -0,0 +1,78 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=dansguardian +PKG_VERSION:=2.12.0.3 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPL-2.0 +PKG_MAINTAINER:=Luka Perkov + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=@SF/dansguardian +PKG_MD5SUM:=2a88d0392cd28eaec02b7ee727b2e253 + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/dansguardian + SECTION:=net + DEPENDS:=+libpthread $(CXX_DEPENDS) +zlib + CATEGORY:=Network + SUBMENU:=Web Servers/Proxies + TITLE:=DansGuardian + URL:=http://dansguardian.org +endef + +define Package/dansguardian/conffiles +/etc/dansguardian/dansguardianf1.conf +/etc/config/dansguardian +endef + +CONFIGURE_VARS += \ + INCLUDES="" \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + LIBS="-lpthread" \ + +define Build/Configure + $(call Build/Configure/Default,\ + --disable-clamav \ + --with-sysconfsubdir=dansguardian \ + --with-proxyuser=root \ + --with-proxygroup=root \ + --disable-pcre \ + ) +endef + +define Package/dansguardian/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dansguardian $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/etc + $(CP) $(PKG_INSTALL_DIR)/etc/dansguardian $(1)/etc/ + $(INSTALL_CONF) ./files/dansguardianf1.conf $(1)/etc/dansguardian/dansguardianf1.conf + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/dansguardian.config $(1)/etc/config/dansguardian + + $(INSTALL_DIR) $(1)/usr/share/dansguardian + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/dansguardian/transparent1x1.gif $(1)/usr/share/dansguardian/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/dansguardian/blockedflash.swf $(1)/usr/share/dansguardian/ + + $(INSTALL_DIR) $(1)/usr/share/dansguardian/languages/ukenglish + $(CP) $(PKG_INSTALL_DIR)/usr/share/dansguardian/languages/ukenglish/* $(1)/usr/share/dansguardian/languages/ukenglish/ + + $(INSTALL_DIR) $(1)/etc/init.d/ + $(INSTALL_BIN) ./files/dansguardian.init $(1)/etc/init.d/dansguardian +endef + +$(eval $(call BuildPackage,dansguardian)) diff --git a/trunk/package/feeds/packages/dansguardian/files/dansguardian.config b/trunk/package/feeds/packages/dansguardian/files/dansguardian.config new file mode 100644 index 00000000..86640aff --- /dev/null +++ b/trunk/package/feeds/packages/dansguardian/files/dansguardian.config @@ -0,0 +1,71 @@ +config dansguardian 'dansguardian' + option config_file '/etc/dansguardian/dansguardianf1.conf' + option accessdeniedaddress 'http://YOURSERVER.YOURDOMAIN/cgi-bin/dansguardian.pl' + option bannediplist '/etc/dansguardian/lists/bannediplist' + option contentscanexceptions 'off' + option contentscannertimeout '60' + option createlistcachefiles 'on' + option custombannedflashfile '/usr/share/dansguardian/blockedflash.swf' + option custombannedimagefile '/usr/share/dansguardian/transparent1x1.gif' + option deletedownloadedtempfiles 'on' + option downloadmanager '/etc/dansguardian/downloadmanagers/default.conf' + option exceptioniplist '/etc/dansguardian/lists/exceptioniplist' + option filecachedir '/tmp' + option filtergroups '1' + option filtergroupslist '/etc/dansguardian/lists/filtergroupslist' + option filterip '' + option filterports '8080' + option forcequicksearch 'off' + option forwardedfor 'off' + option hexdecodecontent 'off' + option initialtrickledelay '20' + option ipcfilename '/tmp/.dguardianipc' + option ipipcfilename '/tmp/.dguardianipipc' + option languagedir '/usr/share/dansguardian/languages' + option language 'ukenglish' + option logadblocks 'off' + option logchildprocesshandling 'off' + option logclienthostnames 'off' + option logconnectionhandlingerrors 'on' + option logexceptionhits '2' + option logfileformat '1' + option loglevel '2' + option loglocation '/dev/null' + option logsyslog 'on' + option loguseragent 'off' + option maxagechildren '500' + option maxchildren '120' + option maxcontentfilecachescansize '20000' + option maxcontentfiltersize '256' + option maxcontentramcachescansize '2000' + option maxips '0' + option maxsparechildren '32' + option maxuploadsize '-1' + option minchildren '8' + option minsparechildren '4' + option nodaemon 'off' + option nologger 'off' + option nonstandarddelimiter 'on' + option perroomblockingdirectory '/etc/dansguardian/lists/bannedrooms/' + option phrasefiltermode '2' + option prefercachedlists 'off' + option preforkchildren '6' + option preservecase '0' + option proxyip '127.0.0.1' + option proxyport '3128' + option proxytimeout '20' + option recheckreplacedurls 'off' + option reportinglevel '3' + option reverseaddresslookups 'off' + option reverseclientiplookups 'off' + option scancleancache 'on' + option showweightedfound 'on' + option softrestart 'off' + option trickledelay '10' + option urlcacheage '900' + option urlcachenumber '1000' + option urlipcfilename '/tmp/.dguardianurlipc' + option usecustombannedflash 'on' + option usecustombannedimage 'on' + option usexforwardedfor 'off' + option weightedphrasemode '2' diff --git a/trunk/package/feeds/packages/dansguardian/files/dansguardian.init b/trunk/package/feeds/packages/dansguardian/files/dansguardian.init new file mode 100644 index 00000000..67ec6bd5 --- /dev/null +++ b/trunk/package/feeds/packages/dansguardian/files/dansguardian.init @@ -0,0 +1,190 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2015 OpenWrt.org + +START=90 +STOP=10 + +USE_PROCD=1 +PROG=/usr/sbin/dansguardian +CONFIGFILE="/tmp/dansguardian/dansguardian.conf" + +validate_dansguardian_section() { + uci_validate_section dansguardian dansguardian "${1}" \ + 'config_file:string' \ + 'accessdeniedaddress:string' \ + 'bannediplist:string' \ + 'contentscanexceptions:string' \ + 'contentscannertimeout:uinteger' \ + 'createlistcachefiles:string' \ + 'custombannedflashfile:string' \ + 'custombannedimagefile:string' \ + 'deletedownloadedtempfiles:string' \ + 'downloadmanager:string' \ + 'exceptioniplist:string' \ + 'filecachedir:string' \ + 'filtergroups:uinteger' \ + 'filtergroupslist:string' \ + 'filterip:ipaddr' \ + 'filterports:port:8080' \ + 'forcequicksearch:string' \ + 'forwardedfor:string' \ + 'hexdecodecontent:string' \ + 'initialtrickledelay:uinteger' \ + 'ipcfilename:string' \ + 'ipipcfilename:string' \ + 'languagedir:string' \ + 'language:string' \ + 'logadblocks:string' \ + 'logchildprocesshandling:string' \ + 'logclienthostnames:string' \ + 'logconnectionhandlingerrors:string' \ + 'logexceptionhits:range(0,2)' \ + 'logfileformat:range(1,4)' \ + 'loglevel:range(0,3)' \ + 'loglocation:string' \ + 'loguseragent:string' \ + 'maxagechildren:uinteger' \ + 'maxchildren:uinteger' \ + 'maxcontentfilecachescansize:uinteger' \ + 'maxcontentfiltersize:uinteger' \ + 'maxcontentramcachescansize:uinteger' \ + 'maxips:uinteger' \ + 'maxsparechildren:uinteger' \ + 'maxuploadsize:integer' \ + 'minchildren:uinteger' \ + 'minsparechildren:uinteger' \ + 'nodaemon:string' \ + 'nologger:string' \ + 'nonstandarddelimiter:string' \ + 'perroomblockingdirectory:string' \ + 'phrasefiltermode:range(0,3)' \ + 'prefercachedlists:string' \ + 'preforkchildren:uinteger' \ + 'preservecase:range(0,2)' \ + 'proxyip:ipaddr' \ + 'proxyport:port:3128' \ + 'proxytimeout:range(20,30)' \ + 'recheckreplacedurls:string' \ + 'reportinglevel:range(-1,3)' \ + 'reverseaddresslookups:string' \ + 'reverseclientiplookups:string' \ + 'scancleancache:string' \ + 'showweightedfound:string' \ + 'softrestart:string' \ + 'trickledelay:uinteger' \ + 'urlcacheage:uinteger' \ + 'urlcachenumber:uinteger' \ + 'urlipcfilename:string' \ + 'usecustombannedflash:string' \ + 'usecustombannedimage:string' \ + 'usexforwardedfor:string' \ + 'weightedphrasemode:range(0,2)' +} + +start_service() { + local config_file accessdeniedaddress bannediplist contentscanexceptions contentscannertimeout \ + createlistcachefiles custombannedflashfile custombannedimagefile deletedownloadedtempfiles \ + downloadmanager exceptioniplist filecachedir filtergroups filtergroupslist filterip filterports \ + forcequicksearch forwardedfor hexdecodecontent initialtrickledelay ipcfilename ipipcfilename \ + language languagedir logadblocks logchildprocesshandling logclienthostnames logconnectionhandlingerrors \ + logexceptionhits logfileformat loglevel loguseragent maxagechildren maxchildren maxcontentfilecachescansize \ + maxcontentfiltersize maxcontentramcachescansize maxips maxsparechildren maxuploadsize minchildren minsparechildren \ + nodaemon nologger nonstandarddelimiter perroomblockingdirectory phrasefiltermode prefercachedlists preforkchildren \ + preservecase proxyip proxyport proxytimeout recheckreplacedurls reportinglevel reverseaddresslookups \ + reverseclientiplookups scancleancache showweightedfound softrestart trickledelay urlcacheage urlcachenumber \ + urlipcfilename usecustombannedflash usecustombannedimage usexforwardedfor weightedphrasemode + + validate_dansguardian_section dansguardian || { + echo "validation failed" + return 1 + } + + mkdir -p $(dirname $CONFIGFILE) + ln -sf $config_file $(dirname $CONFIGFILE) + + echo "accessdeniedaddress = " $accessdeniedaddress > $CONFIGFILE + echo "bannediplist = " $bannediplist >> $CONFIGFILE + echo "contentscanexceptions = " $contentscanexceptions >> $CONFIGFILE + echo "contentscannertimeout = " $contentscannertimeout >> $CONFIGFILE + echo "createlistcachefiles = " $createlistcachefiles >> $CONFIGFILE + echo "custombannedflashfile = " $custombannedflashfile >> $CONFIGFILE + echo "custombannedimagefile = " $custombannedimagefile >> $CONFIGFILE + echo "deletedownloadedtempfiles = " $deletedownloadedtempfiles >> $CONFIGFILE + echo "downloadmanager = " $downloadmanager >> $CONFIGFILE + echo "exceptioniplist = " $exceptioniplist >> $CONFIGFILE + echo "filecachedir = " $filecachedir >> $CONFIGFILE + echo "filtergroups = " $filtergroups >> $CONFIGFILE + echo "filtergroupslist = " $filtergroupslist >> $CONFIGFILE + echo "filterip = " $filterip >> $CONFIGFILE + echo "filterports = " $filterports >> $CONFIGFILE + echo "forcequicksearch = " $forcequicksearch >> $CONFIGFILE + echo "forwardedfor = " $forwardedfor >> $CONFIGFILE + echo "hexdecodecontent = " $hexdecodecontent >> $CONFIGFILE + echo "initialtrickledelay = " $initialtrickledelay >> $CONFIGFILE + echo "ipcfilename = " $ipcfilename >> $CONFIGFILE + echo "ipipcfilename = " $ipipcfilename >> $CONFIGFILE + echo "language = " $language >> $CONFIGFILE + echo "languagedir = " $languagedir >> $CONFIGFILE + echo "logadblocks = " $logadblocks >> $CONFIGFILE + echo "logchildprocesshandling = " $logchildprocesshandling >> $CONFIGFILE + echo "logclienthostnames = " $logclienthostnames >> $CONFIGFILE + echo "logconnectionhandlingerrors = " $logconnectionhandlingerrors >> $CONFIGFILE + echo "logexceptionhits = " $logexceptionhits >> $CONFIGFILE + echo "logfileformat = " $logfileformat >> $CONFIGFILE + echo "loglevel = " $loglevel >> $CONFIGFILE + echo "loglocation = " $loglocation >> $CONFIGFILE + echo "loguseragent = " $loguseragent >> $CONFIGFILE + echo "maxagechildren = " $maxagechildren >> $CONFIGFILE + echo "maxchildren = " $maxchildren >> $CONFIGFILE + echo "maxcontentfilecachescansize = " $maxcontentfilecachescansize >> $CONFIGFILE + echo "maxcontentfiltersize = " $maxcontentfiltersize >> $CONFIGFILE + echo "maxcontentramcachescansize = " $maxcontentramcachescansize >> $CONFIGFILE + echo "maxips = " $maxips >> $CONFIGFILE + echo "maxsparechildren = " $maxsparechildren >> $CONFIGFILE + echo "maxuploadsize = " $maxuploadsize >> $CONFIGFILE + echo "minchildren = " $minchildren >> $CONFIGFILE + echo "minsparechildren = " $minsparechildren >> $CONFIGFILE + echo "nodaemon = " $nodaemon >> $CONFIGFILE + echo "nologger = " $nologger >> $CONFIGFILE + echo "nonstandarddelimiter = " $nonstandarddelimiter >> $CONFIGFILE + echo "perroomblockingdirectory = " $perroomblockingdirectory >> $CONFIGFILE + echo "phrasefiltermode = " $phrasefiltermode >> $CONFIGFILE + echo "prefercachedlists = " $prefercachedlists >> $CONFIGFILE + echo "preforkchildren = " $preforkchildren >> $CONFIGFILE + echo "preservecase = " $preservecase >> $CONFIGFILE + echo "proxyip = " $proxyip >> $CONFIGFILE + echo "proxyport = " $proxyport >> $CONFIGFILE + echo "proxytimeout = " $proxytimeout >> $CONFIGFILE + echo "recheckreplacedurls = " $recheckreplacedurls >> $CONFIGFILE + echo "reportinglevel = " $reportinglevel >> $CONFIGFILE + echo "reverseaddresslookups = " $reverseaddresslookups >> $CONFIGFILE + echo "reverseclientiplookups = " $reverseclientiplookups >> $CONFIGFILE + echo "scancleancache = " $scancleancache >> $CONFIGFILE + echo "showweightedfound = " $showweightedfound >> $CONFIGFILE + echo "softrestart = " $softrestart >> $CONFIGFILE + echo "trickledelay = " $trickledelay >> $CONFIGFILE + echo "urlcacheage = " $urlcacheage >> $CONFIGFILE + echo "urlcachenumber = " $urlcachenumber >> $CONFIGFILE + echo "urlipcfilename = " $urlipcfilename >> $CONFIGFILE + echo "usecustombannedflash = " $usecustombannedflash >> $CONFIGFILE + echo "usecustombannedimage = " $usecustombannedimage >> $CONFIGFILE + echo "usexforwardedfor = " $usexforwardedfor >> $CONFIGFILE + echo "weightedphrasemode = " $weightedphrasemode >> $CONFIGFILE + + procd_open_instance + procd_set_param command $PROG -N -c "$CONFIGFILE" + procd_set_param file $CONFIGFILE + procd_set_param respawn + procd_close_instance +} + +stop_service() +{ + dansguardian -s | awk -F':' '{ print $2}' | xargs kill -9 +} + +service_triggers() +{ + procd_add_reload_trigger "dansguardian" + procd_add_validation validate_dansguardian_section +} diff --git a/trunk/package/feeds/packages/dansguardian/files/dansguardianf1.conf b/trunk/package/feeds/packages/dansguardian/files/dansguardianf1.conf new file mode 100644 index 00000000..01e09aec --- /dev/null +++ b/trunk/package/feeds/packages/dansguardian/files/dansguardianf1.conf @@ -0,0 +1,348 @@ +# DansGuardian filter group config file for version 2.12.0.0 + + +# Filter group mode +# This option determines whether members of this group have their web access +# unfiltered, filtered, or banned. This mechanism replaces the "banneduserlist" +# and "exceptionuserlist" files from previous versions. +# +# 0 = banned +# 1 = filtered +# 2 = unfiltered (exception) +# +# Only filter groups with a mode of 1 need to define phrase, URL, site, extension, +# mimetype and PICS lists; in other modes, these options are ignored to conserve +# memory. +# +# Defaults to 0 if unspecified. +# Unauthenticated users are treated as being in the first filter group. +groupmode = 1 + +# Filter group name +# Used to fill in the -FILTERGROUP- placeholder in the HTML template file, and to +# name the group in the access logs +# Defaults to empty string +#groupname = '' + +# Content filtering files location +bannedphraselist = '/etc/dansguardian/lists/bannedphraselist' +weightedphraselist = '/etc/dansguardian/lists/weightedphraselist' +exceptionphraselist = '/etc/dansguardian/lists/exceptionphraselist' +bannedsitelist = '/etc/dansguardian/lists/bannedsitelist' +greysitelist = '/etc/dansguardian/lists/greysitelist' +exceptionsitelist = '/etc/dansguardian/lists/exceptionsitelist' +bannedurllist = '/etc/dansguardian/lists/bannedurllist' +greyurllist = '/etc/dansguardian/lists/greyurllist' +exceptionurllist = '/etc/dansguardian/lists/exceptionurllist' +exceptionregexpurllist = '/etc/dansguardian/lists/exceptionregexpurllist' +bannedregexpurllist = '/etc/dansguardian/lists/bannedregexpurllist' +picsfile = '/etc/dansguardian/lists/pics' +contentregexplist = '/etc/dansguardian/lists/contentregexplist' +urlregexplist = '/etc/dansguardian/lists/urlregexplist' + +# Filetype filtering +# +# Blanket download blocking +# If enabled, all files will be blocked, unless they match the +# exceptionextensionlist or exceptionmimetypelist. +# These lists do not override virus scanning. +# Exception lists defined above override all types of filtering, including +# the blanket download block. +# Defaults to disabled. +# (on | off) +# +blockdownloads = off +exceptionextensionlist = '/etc/dansguardian/lists/exceptionextensionlist' +exceptionmimetypelist = '/etc/dansguardian/lists/exceptionmimetypelist' +# +# Use the following lists to block specific kinds of file downloads. +# The two exception lists above can be used to override these. +# +bannedextensionlist = '/etc/dansguardian/lists/bannedextensionlist' +bannedmimetypelist = '/etc/dansguardian/lists/bannedmimetypelist' +# +# In either file filtering mode, the following list can be used to override +# MIME type & extension blocks for particular domains & URLs (trusted download sites). +# +exceptionfilesitelist = '/etc/dansguardian/lists/exceptionfilesitelist' +exceptionfileurllist = '/etc/dansguardian/lists/exceptionfileurllist' + +# Categorise without blocking: +# Supply categorised lists here and the category string shall be logged against +# matching requests, but matching these lists does not perform any filtering +# action. +#logsitelist = '/etc/dansguardian/lists/logsitelist' +#logurllist = '/etc/dansguardian/lists/logurllist' +#logregexpurllist = '/etc/dansguardian/lists/logregexpurllist' + +# Outgoing HTTP header rules: +# Optional lists for blocking based on, and modification of, outgoing HTTP +# request headers. Format for headerregexplist is one modification rule per +# line, similar to content/URL modifications. Format for +# bannedregexpheaderlist is one regular expression per line, with matching +# headers causing a request to be blocked. +# Headers are matched/replaced on a line-by-line basis, not as a contiguous +# block. +# Use for example, to remove cookies or prevent certain user-agents. +headerregexplist = '/etc/dansguardian/lists/headerregexplist' +bannedregexpheaderlist = '/etc/dansguardian/lists/bannedregexpheaderlist' + +# Weighted phrase mode +# Optional; overrides the weightedphrasemode option in dansguardian.conf +# for this particular group. See documentation for supported values in +# that file. +#weightedphrasemode = 0 + +# Naughtiness limit +# This the limit over which the page will be blocked. Each weighted phrase is given +# a value either positive or negative and the values added up. Phrases to do with +# good subjects will have negative values, and bad subjects will have positive +# values. See the weightedphraselist file for examples. +# As a guide: +# 50 is for young children, 100 for old children, 160 for young adults. +naughtynesslimit = 50 + +# Search term blocking +# Search terms can be extracted from search URLs and filtered using the +# bannedphraselist, weightedphraselist and exceptionphraselist, with a separate +# threshold for blocking than that used for normal page content. +# To do this, the first two options below must be enabled. +# +# Search engine regular expression list +# List of regular expressions for matching search engine URLs. It is assumed +# that the search terms themselves will be contained within the first submatch +# of each expression. +#searchengineregexplist = '/etc/dansguardian/lists/searchengineregexplist' +# +# Search term limit +# The limit over which requests will be blocked for containing search terms +# which match the weightedphraselist. This should usually be lower than the +# 'naughtynesslimit' value above, because the amount of text being filtered +# is only a few words, rather than a whole page. +# This option must be uncommented if searchengineregexplist is uncommented. +# A value of 0 here indicates that search terms should be extracted, +# for logging/reporting purposes, but no filtering should be performed +# on the resulting text. +#searchtermlimit = 30 +# +# Search term lists +# If the three lines below are uncommented, search term blocking will use +# the banned, weighted & exception phrases from these lists, instead of using +# the same phrase lists as for page content. This is optional but recommended, +# as weights for individual phrases in the "normal" lists may not be +# appropriate for blocking when those phrases appear in a much smaller block +# of text. +# Please note that all or none of the below should be uncommented, not a +# mixture. +#bannedsearchtermlist = '/etc/dansguardian/lists/bannedsearchtermlist' +#weightedsearchtermlist = '/etc/dansguardian/lists/weightedsearchtermlist' +#exceptionsearchtermlist = '/etc/dansguardian/lists/exceptionsearchtermlist' + +# Category display threshold +# This option only applies to pages blocked by weighted phrase filtering. +# Defines the minimum score that must be accumulated within a particular +# category in order for it to show up on the block pages' category list. +# All categories under which the page scores positively will be logged; those +# that were not displayed to the user appear in brackets. +# +# -1 = display only the highest scoring category +# 0 = display all categories (default) +# > 0 = minimum score for a category to be displayed +categorydisplaythreshold = 0 + +# Embedded URL weighting +# When set to something greater than zero, this option causes URLs embedded within a +# page's HTML (from links, image tags, etc.) to be extracted and checked against the +# bannedsitelist and bannedurllist. Each link to a banned page causes the amount set +# here to be added to the page's weighting. +# The behaviour of this option with regards to multiple occurrences of a site/URL is +# affected by the weightedphrasemode setting. +# +# NB: Currently, this feature uses regular expressions that require the PCRE library. +# As such, it is only available if you compiled DansGuardian with '--enable-pcre=yes'. +# You can check compile-time options by running 'dansguardian -v'. +# +# Set to 0 to disable. +# Defaults to 0. +# WARNING: This option is highly CPU intensive! +embeddedurlweight = 0 + +# Enable PICS rating support +# +# Defaults to disabled +# (on | off) +enablepics = off + +# Temporary Denied Page Bypass +# This provides a link on the denied page to bypass the ban for a few minutes. To be +# secure it uses a random hashed secret generated at daemon startup. You define the +# number of seconds the bypass will function for before the deny will appear again. +# To allow the link on the denied page to appear you will need to edit the template.html +# or dansguardian.pl file for your language. +# 300 = enable for 5 minutes +# 0 = disable ( defaults to 0 ) +# -1 = enable but you require a separate program/CGI to generate a valid link +bypass = 0 + +# Temporary Denied Page Bypass Secret Key +# Rather than generating a random key you can specify one. It must be more than 8 chars. +# '' = generate a random one (recommended and default) +# 'Mary had a little lamb.' = an example +# '76b42abc1cd0fdcaf6e943dcbc93b826' = an example +bypasskey = '' + +# Infection/Scan Error Bypass +# Similar to the 'bypass' setting, but specifically for bypassing files scanned and found +# to be infected, or files that trigger scanner errors - for example, archive types with +# recognised but unsupported compression schemes, or corrupt archives. +# The option specifies the number of seconds for which the bypass link will be valid. +# 300 = enable for 5 minutes +# 0 = disable (default) +# -1 = enable, but require a separate program/CGI to generate a valid link +infectionbypass = 0 + +# Infection/Scan Error Bypass Secret Key +# Same as the 'bypasskey' option, but used for infection bypass mode. +infectionbypasskey = '' + +# Infection/Scan Error Bypass on Scan Errors Only +# Enable this option to allow infectionbypass links only when virus scanning fails, +# not when a file is found to contain a virus. +# on = enable (default and highly recommended) +# off = disable +infectionbypasserrorsonly = on + +# Disable content scanning +# If you enable this option you will disable content scanning for this group. +# Content scanning primarily is AV scanning (if enabled) but could include +# other types. +# (on|off) default = off. +disablecontentscan = off + +# Enable Deep URL Analysis +# When enabled, DG looks for URLs within URLs, checking against the bannedsitelist and +# bannedurllist. This can be used, for example, to block images originating from banned +# sites from appearing in Google Images search results, as the original URLs are +# embedded in the thumbnail GET requests. +# (on|off) default = off +deepurlanalysis = off + +# reportinglevel +# +# -1 = log, but do not block - Stealth mode +# 0 = just say 'Access Denied' +# 1 = report why but not what denied phrase +# 2 = report fully +# 3 = use HTML template file (accessdeniedaddress ignored) - recommended +# +# If defined, this overrides the global setting in dansguardian.conf for +# members of this filter group. +# +#reportinglevel = 3 + +# accessdeniedaddress is the address of your web server to which the cgi +# dansguardian reporting script was copied. Only used in reporting levels +# 1 and 2. +# +# This webserver must be either: +# 1. Non-proxied. Either a machine on the local network, or listed as an +# exception in your browser's proxy configuration. +# 2. Added to the exceptionsitelist. Option 1 is preferable; this option is +# only for users using both transparent proxying and a non-local server +# to host this script. +# +# If defined, this overrides the global setting in dansguardian.conf for +# members of this filter group. +# +#accessdeniedaddress = 'http://YOURSERVER.YOURDOMAIN/cgi-bin/dansguardian.pl' + +# HTML Template override +# If defined, this specifies a custom HTML template file for members of this +# filter group, overriding the global setting in dansguardian.conf. This is +# only used in reporting level 3. +# +# The default template file path is //template.html +# e.g. /usr/share/dansguardian/languages/ukenglish/template.html when using 'ukenglish' +# language. +# +# This option generates a file path of the form: +# // +# e.g. /usr/share/dansguardian/languages/ukenglish/custom.html +# +#htmltemplate = 'custom.html' + +# Email reporting - original patch by J. Gauthier + +# Use SMTP +# If on, will enable system wide events to be reported by email. +# need to configure mail program (see 'mailer' in global config) +# and email recipients +# default usesmtp = off +#!! Not compiled !!usesmtp = off + +# mailfrom +# who the email would come from +# example: mailfrom = 'dansguardian@mycompany.com' +#!! Not compiled !!mailfrom = '' + +# avadmin +# who the virus emails go to (if notify av is on) +# example: avadmin = 'admin@mycompany.com' +#!! Not compiled !!avadmin = '' + +# contentdmin +# who the content emails go to (when thresholds are exceeded) +# and contentnotify is on +# example: contentadmin = 'admin@mycompany.com' +#!! Not compiled !!contentadmin = '' + +# avsubject +# Subject of the email sent when a virus is caught. +# only applicable if notifyav is on +# default avsubject = 'dansguardian virus block' +#!! Not compiled !!avsubject = 'dansguardian virus block' + +# content +# Subject of the email sent when violation thresholds are exceeded +# default contentsubject = 'dansguardian violation' +#!! Not compiled !!contentsubject = 'dansguardian violation' + +# notifyAV +# This will send a notification, if usesmtp/notifyav is on, any time an +# infection is found. +# Important: If this option is off, viruses will still be recorded like a +# content infraction. +#!! Not compiled !!notifyav = off + +# notifycontent +# This will send a notification, if usesmtp is on, based on thresholds +# below +#!! Not compiled !!notifycontent = off + +# thresholdbyuser +# results are only predictable with user authenticated configs +# if enabled the violation/threshold count is kept track of by the user +#!! Not compiled !!thresholdbyuser = off + +#violations +# number of violations before notification +# setting to 0 will never trigger a notification +#!! Not compiled !!violations = 0 + +#threshold +# this is in seconds. If 'violations' occur in 'threshold' seconds, then +# a notification is made. +# if this is set to 0, then whenever the set number of violations are made a +# notifaction will be sent. +#!! Not compiled !!threshold = 0 + +#SSL certificate checking +# Check that ssl certificates for servers on https connections are valid +# and signed by a ca in the configured path +sslcertcheck = off + +#SSL man in the middle +# Forge ssl certificates for all sites, decrypt the data then re encrypt it +# using a different private key. Used to filter ssl sites +sslmitm = off + diff --git a/trunk/package/feeds/packages/dansguardian/patches/001-compile.patch b/trunk/package/feeds/packages/dansguardian/patches/001-compile.patch new file mode 100644 index 00000000..db8efa43 --- /dev/null +++ b/trunk/package/feeds/packages/dansguardian/patches/001-compile.patch @@ -0,0 +1,29 @@ +--- a/configure ++++ b/configure +@@ -827,7 +827,7 @@ sysconfdir='${prefix}/etc' + sharedstatedir='${prefix}/com' + localstatedir='${prefix}/var' + includedir='${prefix}/include' +-oldincludedir='/usr/include' ++oldincludedir='${prefix}/usr/include' + docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' + infodir='${datarootdir}/info' + htmldir='${docdir}' +@@ -5265,7 +5265,7 @@ $as_echo_n "checking for zlib... " >&6; + # Check whether --with-zlib was given. + if test "${with_zlib+set}" = set; then : + withval=$with_zlib; # check for header & func (in library) in given prefix +- CPPFLAGS="${CPPFLAGS} -I${withval}/include" ++ CPPFLAGS="${CPPFLAGS}" + if test "x$staticzlib" = "xtrue"; then + LIBS="-Bstatic -L${withval} -lz -Bdynamic ${LIBS}" + else +@@ -7095,7 +7095,7 @@ $as_echo "#define ENABLE_NTLM /**/" >>co + if test "${with_libiconv+set}" = set; then : + withval=$with_libiconv; # check for header & func (in library) in given prefix + if test "x$withval" != "x"; then +- CPPFLAGS="${CPPFLAGS} -I${withval}/include" ++ CPPFLAGS="${CPPFLAGS}" + LIBS="-L${withval}/lib -liconv ${LIBS}" + else + LIBS="-liconv ${LIBS}" diff --git a/trunk/package/feeds/packages/davfs2/Makefile b/trunk/package/feeds/packages/davfs2/Makefile new file mode 100644 index 00000000..96de63c2 --- /dev/null +++ b/trunk/package/feeds/packages/davfs2/Makefile @@ -0,0 +1,69 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=davfs2 +PKG_VERSION:=1.5.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/ +PKG_MD5SUM:=376bc9346454135cba78afacbcb23f86 + +PKG_FIXUP:=gettext-version autoreconf + +include $(INCLUDE_DIR)/package.mk + +define Package/davfs2 + SECTION:=net + CATEGORY:=Network + SUBMENU:=Filesystem + DEPENDS=+libopenssl +libneon +libiconv +libintl +libexpat +kmod-fuse +libfuse + TITLE:=Mount a WebDAV resource as a regular file system. + URL:=http://savannah.nongnu.org/projects/davfs2/ + MAINTAINER:=Federico Di Marco +endef + +define Package/davfs2/description + Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-protocol, + allows authoring of resources on a remote web server.davfs2 provides the ability to + access such resources like a typical filesystem, allowing for use by standard + applications with no built-in support for WebDAV. + + davfs2 is designed to fully integrate into the filesystem semantics of Unix-like + systems (mount, umount, etc.). davfs2 makes mounting by unprivileged users as easy + and secure as possible. + + davfs2 does extensive caching to make the file system responsive, to avoid + unnecessary network traffic and to prevent data loss, and to cope for slow or + unreliable connections. + + davfs2 will work with most WebDAV servers needing little or no configuration. +endef + +define Package/davfs2/conffiles +/etc/davfs2/davfs2.conf +endef + +TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include + +CONFIGURE_VARS += \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib" + +CONFIGURE_ARGS += --with-neon="$(STAGING_DIR)/usr" + +define Package/davfs2/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mount.davfs $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/umount.davfs $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/davfs2 + $(INSTALL_DATA) files/$(PKG_NAME).conf $(1)/etc/davfs2 +endef + +$(eval $(call BuildPackage,davfs2)) diff --git a/trunk/package/feeds/packages/davfs2/files/davfs2.conf b/trunk/package/feeds/packages/davfs2/files/davfs2.conf new file mode 100644 index 00000000..4cf501be --- /dev/null +++ b/trunk/package/feeds/packages/davfs2/files/davfs2.conf @@ -0,0 +1,9 @@ +# +# davfs2 configuration file +# please see http://linux.die.net/man/5/davfs2.conf for details +# + +dav_user nobody +dav_group nogroup +cache_dir /tmp/davfs2 +cache_size 4 diff --git a/trunk/package/feeds/packages/davfs2/patches/010-main_code_fix.patch b/trunk/package/feeds/packages/davfs2/patches/010-main_code_fix.patch new file mode 100644 index 00000000..aa36fdfa --- /dev/null +++ b/trunk/package/feeds/packages/davfs2/patches/010-main_code_fix.patch @@ -0,0 +1,35 @@ +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -32,8 +32,8 @@ mount_davfs_SOURCES = cache.c dav_coda.c + kernel_interface.h mount_davfs.h webdav.h + umount_davfs_SOURCES = umount_davfs.c defaults.h + +-AM_CFLAGS = -Wall -Werror=format-security \ +- -fstack-protector --param=ssp-buffer-size=4 ++AM_CFLAGS = -Wall -Werror=format-security ++# -fstack-protector --param=ssp-buffer-size=4 -- removed ssp not supported in openwrt + DEFS = -DPROGRAM_NAME=\"mount.davfs\" \ + -DDAV_SYS_CONF_DIR=\"$(pkgsysconfdir)\" \ + -DDAV_LOCALSTATE_DIR=\"$(dav_localstatedir)\" \ +--- a/src/cache.c ++++ b/src/cache.c +@@ -58,7 +58,7 @@ + #ifdef HAVE_SYS_TYPES_H + #include + #endif +-#include ++#include + + #include + #include +--- a/src/webdav.c ++++ b/src/webdav.c +@@ -2033,7 +2033,7 @@ ssl_verify(void *userdata, int failures, + len = getline(&s, &n, stdin); + if (len < 0) + abort(); +- if (rpmatch(s) > 0) ++ if ((s[0]=='y' || s[0]=='Y') > 0) + ret = 0; + free(s); + } diff --git a/trunk/package/feeds/packages/db47/Makefile b/trunk/package/feeds/packages/db47/Makefile new file mode 100644 index 00000000..563d47c8 --- /dev/null +++ b/trunk/package/feeds/packages/db47/Makefile @@ -0,0 +1,100 @@ +# +# Copyright (C) 2009-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/uclibc++.mk + +BASE_VERSION:=4.7.25 + +PKG_NAME:=db47 +PKG_VERSION:=$(BASE_VERSION).4.NC +PKG_RELEASE:=3 + +PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC +PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz +PKG_SOURCE_URL:=http://download.oracle.com/berkeley-db/ +PKG_MD5SUM:=073ab7f20d24b3872a51ca762f5090e7 + +PKG_MAINTAINER:=Marcel Denia +PKG_LICENSE:=Sleepycat +PKG_LICENSE_FILES:=LICENSE + +PKG_FIXUP:=autoreconf +PKG_LIBTOOL_PATHS:=. build_unix +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libdb47 + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libxml2 + TITLE:=Berkeley DB library (4.7) + URL:=http://www.oracle.com/us/products/database/berkeley-db + PROVIDES:=libdb47-full +endef + +define Package/libdb47/description + Berkeley DB library (4.7). +endef + +define Package/libdb47xx + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libdb47 $(CXX_DEPENDS) + TITLE:=Berkeley DB library (4.7) for C++ + URL:=http://www.oracle.com/us/products/database/berkeley-db + PROVIDES:=libdb47xx-full +endef + +define Package/libdb47xx/description + Berkeley DB library (4.7). C++ wrapper. +endef + +CONFIGURE_PATH = build_unix +CONFIGURE_CMD = ../dist/configure + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-java \ + --with-mutex=UNIX/fcntl \ + --disable-tcl \ + --disable-rpc \ + --enable-compat185 \ + --disable-debug \ + $(if $(CONFIG_PACKAGE_libdb47xx),--enable-cxx,--disable-cxx) + +TARGET_CFLAGS += $(FPIC) + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/build_unix \ + DESTDIR="$(PKG_INSTALL_DIR)" all + $(MAKE) -C $(PKG_BUILD_DIR)/build_unix \ + DESTDIR="$(PKG_INSTALL_DIR)" install +endef + +define Package/libdb47/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/ +endef + +define Package/libdb47xx/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb_cxx-*.so $(1)/usr/lib/ +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/db.h $(1)/usr/include/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/db_cxx.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb*.{a,so} $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libdb47)) +$(eval $(call BuildPackage,libdb47xx)) diff --git a/trunk/package/feeds/packages/db47/patches/010-patch.4.7.25.1.patch b/trunk/package/feeds/packages/db47/patches/010-patch.4.7.25.1.patch new file mode 100644 index 00000000..f1fd4727 --- /dev/null +++ b/trunk/package/feeds/packages/db47/patches/010-patch.4.7.25.1.patch @@ -0,0 +1,55 @@ +--- a/sequence/sequence.c ++++ b/sequence/sequence.c +@@ -187,7 +187,11 @@ __seq_open_pp(seq, txn, keyp, flags) + if ((ret = __db_get_flags(dbp, &tflags)) != 0) + goto err; + +- if (DB_IS_READONLY(dbp)) { ++ /* ++ * We can let replication clients open sequences, but must ++ * check later that they do not update them. ++ */ ++ if (F_ISSET(dbp, DB_AM_RDONLY)) { + ret = __db_rdonly(dbp->env, "DB_SEQUENCE->open"); + goto err; + } +@@ -244,6 +248,11 @@ retry: if ((ret = __db_get(dbp, ip, + if ((ret != DB_NOTFOUND && ret != DB_KEYEMPTY) || + !LF_ISSET(DB_CREATE)) + goto err; ++ if (IS_REP_CLIENT(env) && ++ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) { ++ ret = __db_rdonly(env, "DB_SEQUENCE->open"); ++ goto err; ++ } + ret = 0; + + rp = &seq->seq_record; +@@ -296,7 +305,12 @@ retry: if ((ret = __db_get(dbp, ip, + */ + rp = seq->seq_data.data; + if (rp->seq_version == DB_SEQUENCE_OLDVER) { +-oldver: rp->seq_version = DB_SEQUENCE_VERSION; ++oldver: if (IS_REP_CLIENT(env) && ++ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) { ++ ret = __db_rdonly(env, "DB_SEQUENCE->open"); ++ goto err; ++ } ++ rp->seq_version = DB_SEQUENCE_VERSION; + if (!F_ISSET(env, ENV_LITTLEENDIAN)) { + if (IS_DB_AUTO_COMMIT(dbp, txn)) { + if ((ret = +@@ -707,6 +721,13 @@ __seq_get(seq, txn, delta, retp, flags) + + MUTEX_LOCK(env, seq->mtx_seq); + ++ if (handle_check && IS_REP_CLIENT(env) && ++ !F_ISSET(dbp, DB_AM_NOT_DURABLE)) { ++ ret = __db_rdonly(env, "DB_SEQUENCE->get"); ++ goto err; ++ } ++ ++ + if (rp->seq_min + delta > rp->seq_max) { + __db_errx(env, "Sequence overflow"); + ret = EINVAL; diff --git a/trunk/package/feeds/packages/db47/patches/020-patch.4.7.25.2.patch b/trunk/package/feeds/packages/db47/patches/020-patch.4.7.25.2.patch new file mode 100644 index 00000000..ddf830a3 --- /dev/null +++ b/trunk/package/feeds/packages/db47/patches/020-patch.4.7.25.2.patch @@ -0,0 +1,42 @@ +--- a/lock/lock.c ++++ b/lock/lock.c +@@ -1274,10 +1274,12 @@ __lock_put_internal(lt, lockp, obj_ndx, + SH_TAILQ_REMOVE( + <->obj_tab[obj_ndx], sh_obj, links, __db_lockobj); + if (sh_obj->lockobj.size > sizeof(sh_obj->objdata)) { +- LOCK_REGION_LOCK(env); ++ if (region->part_t_size != 1) ++ LOCK_REGION_LOCK(env); + __env_alloc_free(<->reginfo, + SH_DBT_PTR(&sh_obj->lockobj)); +- LOCK_REGION_UNLOCK(env); ++ if (region->part_t_size != 1) ++ LOCK_REGION_UNLOCK(env); + } + SH_TAILQ_INSERT_HEAD( + &FREE_OBJS(lt, part_id), sh_obj, links, __db_lockobj); +@@ -1467,15 +1469,21 @@ retry: SH_TAILQ_FOREACH(sh_obj, <->obj + if (obj->size <= sizeof(sh_obj->objdata)) + p = sh_obj->objdata; + else { +- LOCK_REGION_LOCK(env); ++ /* ++ * If we have only one partition, the region is locked. ++ */ ++ if (region->part_t_size != 1) ++ LOCK_REGION_LOCK(env); + if ((ret = + __env_alloc(<->reginfo, obj->size, &p)) != 0) { + __db_errx(env, + "No space for lock object storage"); +- LOCK_REGION_UNLOCK(env); ++ if (region->part_t_size != 1) ++ LOCK_REGION_UNLOCK(env); + goto err; + } +- LOCK_REGION_UNLOCK(env); ++ if (region->part_t_size != 1) ++ LOCK_REGION_UNLOCK(env); + } + + memcpy(p, obj->data, obj->size); diff --git a/trunk/package/feeds/packages/db47/patches/030-patch.4.7.25.3.patch b/trunk/package/feeds/packages/db47/patches/030-patch.4.7.25.3.patch new file mode 100644 index 00000000..59b00e65 --- /dev/null +++ b/trunk/package/feeds/packages/db47/patches/030-patch.4.7.25.3.patch @@ -0,0 +1,211 @@ +--- a/lock/lock_deadlock.c ++++ b/lock/lock_deadlock.c +@@ -121,7 +121,7 @@ __lock_detect(env, atype, rejectp) + DB_LOCKTAB *lt; + db_timespec now; + locker_info *idmap; +- u_int32_t *bitmap, *copymap, **deadp, **free_me, *tmpmap; ++ u_int32_t *bitmap, *copymap, **deadp, **deadlist, *tmpmap; + u_int32_t i, cid, keeper, killid, limit, nalloc, nlockers; + u_int32_t lock_max, txn_max; + int ret, status; +@@ -133,7 +133,8 @@ __lock_detect(env, atype, rejectp) + if (IS_REP_CLIENT(env)) + atype = DB_LOCK_MINWRITE; + +- free_me = NULL; ++ copymap = tmpmap = NULL; ++ deadlist = NULL; + + lt = env->lk_handle; + if (rejectp != NULL) +@@ -179,11 +180,11 @@ __lock_detect(env, atype, rejectp) + memcpy(copymap, bitmap, nlockers * sizeof(u_int32_t) * nalloc); + + if ((ret = __os_calloc(env, sizeof(u_int32_t), nalloc, &tmpmap)) != 0) +- goto err1; ++ goto err; + + /* Find a deadlock. */ + if ((ret = +- __dd_find(env, bitmap, idmap, nlockers, nalloc, &deadp)) != 0) ++ __dd_find(env, bitmap, idmap, nlockers, nalloc, &deadlist)) != 0) + return (ret); + + /* +@@ -204,8 +205,7 @@ __lock_detect(env, atype, rejectp) + txn_max = TXN_MAXIMUM; + + killid = BAD_KILLID; +- free_me = deadp; +- for (; *deadp != NULL; deadp++) { ++ for (deadp = deadlist; *deadp != NULL; deadp++) { + if (rejectp != NULL) + ++*rejectp; + killid = (u_int32_t)(*deadp - bitmap) / nalloc; +@@ -342,11 +342,12 @@ dokill: if (killid == BAD_KILLID) { + __db_msg(env, + "Aborting locker %lx", (u_long)idmap[killid].id); + } +- __os_free(env, tmpmap); +-err1: __os_free(env, copymap); +- +-err: if (free_me != NULL) +- __os_free(env, free_me); ++err: if(copymap != NULL) ++ __os_free(env, copymap); ++ if (deadlist != NULL) ++ __os_free(env, deadlist); ++ if(tmpmap != NULL) ++ __os_free(env, tmpmap); + __os_free(env, bitmap); + __os_free(env, idmap); + +@@ -360,6 +361,17 @@ err: if (free_me != NULL) + + #define DD_INVALID_ID ((u_int32_t) -1) + ++/* ++ * __dd_build -- ++ * Build the lock dependency bit maps. ++ * Notes on syncronization: ++ * LOCK_SYSTEM_LOCK is used to hold objects locked when we have ++ * a single partition. ++ * LOCK_LOCKERS is held while we are walking the lockers list and ++ * to single thread the use of lockerp->dd_id. ++ * LOCK_DD protects the DD list of objects. ++ */ ++ + static int + __dd_build(env, atype, bmp, nlockers, allocp, idmap, rejectp) + ENV *env; +@@ -393,6 +405,7 @@ __dd_build(env, atype, bmp, nlockers, al + * In particular we do not build the conflict array and our caller + * needs to expect this. + */ ++ LOCK_SYSTEM_LOCK(lt, region); + if (atype == DB_LOCK_EXPIRE) { + skip: LOCK_DD(env, region); + op = SH_TAILQ_FIRST(®ion->dd_objs, __db_lockobj); +@@ -430,17 +443,18 @@ skip: LOCK_DD(env, region); + OBJECT_UNLOCK(lt, region, indx); + } + UNLOCK_DD(env, region); ++ LOCK_SYSTEM_UNLOCK(lt, region); + goto done; + } + + /* +- * We'll check how many lockers there are, add a few more in for +- * good measure and then allocate all the structures. Then we'll +- * verify that we have enough room when we go back in and get the +- * mutex the second time. ++ * Allocate after locking the region ++ * to make sure the structures are large enough. + */ +-retry: count = region->stat.st_nlockers; ++ LOCK_LOCKERS(env, region); ++ count = region->stat.st_nlockers; + if (count == 0) { ++ UNLOCK_LOCKERS(env, region); + *nlockers = 0; + return (0); + } +@@ -448,50 +462,37 @@ retry: count = region->stat.st_nlockers; + if (FLD_ISSET(env->dbenv->verbose, DB_VERB_DEADLOCK)) + __db_msg(env, "%lu lockers", (u_long)count); + +- count += 20; + nentries = (u_int32_t)DB_ALIGN(count, 32) / 32; + +- /* +- * Allocate enough space for a count by count bitmap matrix. +- * +- * XXX +- * We can probably save the malloc's between iterations just +- * reallocing if necessary because count grew by too much. +- */ ++ /* Allocate enough space for a count by count bitmap matrix. */ + if ((ret = __os_calloc(env, (size_t)count, +- sizeof(u_int32_t) * nentries, &bitmap)) != 0) ++ sizeof(u_int32_t) * nentries, &bitmap)) != 0) { ++ UNLOCK_LOCKERS(env, region); + return (ret); ++ } + + if ((ret = __os_calloc(env, + sizeof(u_int32_t), nentries, &tmpmap)) != 0) { ++ UNLOCK_LOCKERS(env, region); + __os_free(env, bitmap); + return (ret); + } + + if ((ret = __os_calloc(env, + (size_t)count, sizeof(locker_info), &id_array)) != 0) { ++ UNLOCK_LOCKERS(env, region); + __os_free(env, bitmap); + __os_free(env, tmpmap); + return (ret); + } + + /* +- * Now go back in and actually fill in the matrix. +- */ +- if (region->stat.st_nlockers > count) { +- __os_free(env, bitmap); +- __os_free(env, tmpmap); +- __os_free(env, id_array); +- goto retry; +- } +- +- /* + * First we go through and assign each locker a deadlock detector id. + */ + id = 0; +- LOCK_LOCKERS(env, region); + SH_TAILQ_FOREACH(lip, ®ion->lockers, ulinks, __db_locker) { + if (lip->master_locker == INVALID_ROFF) { ++ DB_ASSERT(env, id < count); + lip->dd_id = id++; + id_array[lip->dd_id].id = lip->id; + switch (atype) { +@@ -510,7 +511,6 @@ retry: count = region->stat.st_nlockers; + lip->dd_id = DD_INVALID_ID; + + } +- UNLOCK_LOCKERS(env, region); + + /* + * We only need consider objects that have waiters, so we use +@@ -669,7 +669,6 @@ again: memset(bitmap, 0, count * sizeof + * status after building the bit maps so that we will not detect + * a blocked transaction without noting that it is already aborting. + */ +- LOCK_LOCKERS(env, region); + for (id = 0; id < count; id++) { + if (!id_array[id].valid) + continue; +@@ -738,6 +737,7 @@ get_lock: id_array[id].last_lock = R_OF + id_array[id].in_abort = 1; + } + UNLOCK_LOCKERS(env, region); ++ LOCK_SYSTEM_UNLOCK(lt, region); + + /* + * Now we can release everything except the bitmap matrix that we +@@ -839,6 +839,7 @@ __dd_abort(env, info, statusp) + ret = 0; + + /* We must lock so this locker cannot go away while we abort it. */ ++ LOCK_SYSTEM_LOCK(lt, region); + LOCK_LOCKERS(env, region); + + /* +@@ -895,6 +896,7 @@ __dd_abort(env, info, statusp) + done: OBJECT_UNLOCK(lt, region, info->last_ndx); + err: + out: UNLOCK_LOCKERS(env, region); ++ LOCK_SYSTEM_UNLOCK(lt, region); + return (ret); + } + diff --git a/trunk/package/feeds/packages/db47/patches/040-patch.4.7.25.4.patch b/trunk/package/feeds/packages/db47/patches/040-patch.4.7.25.4.patch new file mode 100644 index 00000000..7db40612 --- /dev/null +++ b/trunk/package/feeds/packages/db47/patches/040-patch.4.7.25.4.patch @@ -0,0 +1,118 @@ +--- a/dbinc/repmgr.h ++++ b/dbinc/repmgr.h +@@ -374,6 +374,7 @@ typedef struct { + #define SITE_FROM_EID(eid) (&db_rep->sites[eid]) + #define EID_FROM_SITE(s) ((int)((s) - (&db_rep->sites[0]))) + #define IS_VALID_EID(e) ((e) >= 0) ++#define IS_KNOWN_REMOTE_SITE(e) ((e) >= 0 && ((u_int)(e)) < db_rep->site_cnt) + #define SELF_EID INT_MAX + + #define IS_PEER_POLICY(p) ((p) == DB_REPMGR_ACKS_ALL_PEERS || \ +--- a/rep/rep_elect.c ++++ b/rep/rep_elect.c +@@ -33,7 +33,7 @@ static int __rep_elect_init + static int __rep_fire_elected __P((ENV *, REP *, u_int32_t)); + static void __rep_elect_master __P((ENV *, REP *)); + static int __rep_tally __P((ENV *, REP *, int, u_int32_t *, u_int32_t, roff_t)); +-static int __rep_wait __P((ENV *, db_timeout_t *, int *, int, u_int32_t)); ++static int __rep_wait __P((ENV *, db_timeout_t *, int, u_int32_t)); + + /* + * __rep_elect -- +@@ -55,7 +55,7 @@ __rep_elect(dbenv, given_nsites, nvotes, + ENV *env; + LOG *lp; + REP *rep; +- int done, eid, elected, full_elect, locked, in_progress, need_req; ++ int done, elected, full_elect, locked, in_progress, need_req; + int ret, send_vote, t_ret; + u_int32_t ack, ctlflags, egen, nsites, orig_tally, priority, realpri; + u_int32_t tiebreaker; +@@ -181,8 +181,7 @@ __rep_elect(dbenv, given_nsites, nvotes, + REP_SYSTEM_UNLOCK(env); + (void)__rep_send_message(env, DB_EID_BROADCAST, + REP_MASTER_REQ, NULL, NULL, 0, 0); +- ret = __rep_wait(env, &to, &eid, +- 0, REP_F_EPHASE0); ++ ret = __rep_wait(env, &to, 0, REP_F_EPHASE0); + REP_SYSTEM_LOCK(env); + F_CLR(rep, REP_F_EPHASE0); + switch (ret) { +@@ -286,11 +285,11 @@ restart: + REP_SYSTEM_LOCK(env); + goto vote; + } +- ret = __rep_wait(env, &to, &eid, full_elect, REP_F_EPHASE1); ++ ret = __rep_wait(env, &to, full_elect, REP_F_EPHASE1); + switch (ret) { + case 0: + /* Check if election complete or phase complete. */ +- if (eid != DB_EID_INVALID && !IN_ELECTION(rep)) { ++ if (!IN_ELECTION(rep)) { + RPRINT(env, DB_VERB_REP_ELECT, + (env, "Ended election phase 1")); + goto edone; +@@ -398,15 +397,12 @@ phase2: + REP_SYSTEM_LOCK(env); + goto i_won; + } +- ret = __rep_wait(env, &to, &eid, full_elect, REP_F_EPHASE2); ++ ret = __rep_wait(env, &to, full_elect, REP_F_EPHASE2); + RPRINT(env, DB_VERB_REP_ELECT, + (env, "Ended election phase 2 %d", ret)); + switch (ret) { + case 0: +- if (eid != DB_EID_INVALID) +- goto edone; +- ret = DB_REP_UNAVAIL; +- break; ++ goto edone; + case DB_REP_EGENCHG: + if (to > timeout) + to = timeout; +@@ -1050,13 +1046,6 @@ __rep_elect_master(env, rep) + ENV *env; + REP *rep; + { +- /* +- * We often come through here twice, sometimes even more. We mustn't +- * let the redundant calls affect stats counting. But rep_elect relies +- * on this first part for setting eidp. +- */ +- rep->master_id = rep->eid; +- + if (F_ISSET(rep, REP_F_MASTERELECT | REP_F_MASTER)) { + /* We've been through here already; avoid double counting. */ + return; +@@ -1093,10 +1082,10 @@ __rep_fire_elected(env, rep, egen) + (timeout > 5000000) ? 500000 : ((timeout >= 10) ? timeout / 10 : 1); + + static int +-__rep_wait(env, timeoutp, eidp, full_elect, flags) ++__rep_wait(env, timeoutp, full_elect, flags) + ENV *env; + db_timeout_t *timeoutp; +- int *eidp, full_elect; ++ int full_elect; + u_int32_t flags; + { + DB_REP *db_rep; +@@ -1174,7 +1163,6 @@ __rep_wait(env, timeoutp, eidp, full_ele + F_CLR(rep, REP_F_EGENUPDATE); + ret = DB_REP_EGENCHG; + } else if (phase_over) { +- *eidp = rep->master_id; + done = 1; + ret = 0; + } +--- a/repmgr/repmgr_net.c ++++ b/repmgr/repmgr_net.c +@@ -100,6 +100,8 @@ __repmgr_send(dbenv, control, rec, lsnp, + control, rec, &nsites_sent, &npeers_sent)) != 0) + goto out; + } else { ++ DB_ASSERT(env, IS_KNOWN_REMOTE_SITE(eid)); ++ + /* + * If this is a request that can be sent anywhere, then see if + * we can send it to our peer (to save load on the master), but diff --git a/trunk/package/feeds/packages/dbus/Makefile b/trunk/package/feeds/packages/dbus/Makefile new file mode 100644 index 00000000..c8bd4155 --- /dev/null +++ b/trunk/package/feeds/packages/dbus/Makefile @@ -0,0 +1,213 @@ +# +# Copyright (C) 2007-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +# Make sure to also update the dbus-x package +PKG_NAME:=dbus +PKG_VERSION:=1.9.14 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://dbus.freedesktop.org/releases/dbus/ +PKG_MD5SUM:=32cd0d16067422bfd691e2f647b432b0 +PKG_MAINTAINER:=Steven Barth +PKG_LICENSE:=AFL-2.1 + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +TARGET_LDFLAGS+= \ + -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \ + +define Package/dbus/Default + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Simple interprocess messaging system + URL:=http://dbus.freedesktop.org/ +endef + +define Package/dbus/Default/description + D-Bus is a message bus system, a simple way for applications to talk to one + another. In addition to interprocess communication, D-Bus helps coordinate + process lifecycle; it makes it simple and reliable to code a "single instance" + application or daemon, and to launch applications and daemons on demand when + their services are needed. +endef + +define Package/libdbus +$(call Package/dbus/Default) + CATEGORY:=Libraries + TITLE+= (library) + DEPENDS:= +libpthread +endef + +define Package/libdbus/Description +$(call Package/dbus/Default/description) + This package contains the D-Bus shared library. +endef + +define Package/dbus +$(call Package/dbus/Default) + TITLE+= (daemon) + DEPENDS:= +libexpat +libdbus +endef + +define Package/dbus/Description +$(call Package/dbus/Default/description) + This package contains the D-Bus daemon. +endef + +define Package/dbus-utils +$(call Package/dbus/Default) + TITLE+= (utilities) + DEPENDS:= dbus +endef + +define Package/dbus-utils/Description +$(call Package/dbus/Default/description) + This package contains D-Bus utilities. +endef + + +define Build/Prepare + $(Build/Prepare/Default) + $(SED) 's/-Wl,--gc-sections/--gc-sections/' $(PKG_BUILD_DIR)/configure +endef + +CONFIGURE_ARGS += \ + --enable-shared \ + --enable-static \ + --disable-abstract-sockets \ + --disable-ansi \ + --disable-asserts \ + --disable-console-owner-file \ + --disable-doxygen-docs \ + --disable-compiler_coverage \ + --disable-selinux \ + --disable-tests \ + --disable-verbose-mode \ + --disable-xml-docs \ + --with-xml="expat" \ + --with-dbus-user=root \ + --with-dbus-daemondir="/usr/sbin" \ + --with-system-socket="/var/run/dbus/system_bus_socket" \ + --with-system-pid-file="/var/run/dbus.pid" \ + --without-x \ + --libexecdir=/usr/lib/dbus-1 + +CONFIGURE_VARS+= \ + ac_cv_have_abstract_sockets="yes" \ + ac_cv_lib_expat_XML_ParserCreate_MM="yes" \ + +HOST_CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + --disable-abstract-sockets \ + --disable-ansi \ + --disable-asserts \ + --disable-console-owner-file \ + --disable-docygen-docs \ + --disable-compiler_coverage \ + --disable-selinux \ + --disable-tests \ + --disable-verbose-mode \ + --disable-xml-docs \ + --with-dbus-user=root \ + --with-dbus-daemondir="$(STAGIND_DIR_HOST)/bin" \ + --with-system-socket="$(STAGING_DIR_HOST)/var/run/dbus/system_bus_socket" \ + --with-system-pid-file="$(STAGING_DIR_HOST)/var/run/dbus.pid" \ + --without-x \ + --libexecdir="$(STAGING_DIR_HOST)/lib/dbus-1" + +HOST_CONFIGURE_VARS+= \ + ac_cv_have_abstract_sockets="yes" \ + ac_cv_lib_expat_XML_ParserCreate_MM="yes" \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/dbus-1.0 \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib/dbus-1.0/include/dbus/ + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/dbus-1.0/include/dbus/*.h \ + $(1)/usr/lib/dbus-1.0/include/dbus/ + + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/libdbus-1.{so*,la,a} \ + $(1)/usr/lib/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/dbus-1.0 \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/dbus-1.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/dbus/conffiles +/etc/dbus-1/session.conf +/etc/dbus-1/system.conf +endef + +define Package/libdbus/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libdbus-1.so.* \ + $(1)/usr/lib/ +endef + +define Package/dbus/install + $(INSTALL_DIR) $(1)/etc + $(CP) \ + $(PKG_INSTALL_DIR)/etc/dbus-1 \ + $(1)/etc/ + + $(INSTALL_DIR) $(1)/usr/lib/dbus-1 + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/lib/dbus-1/dbus-daemon-launch-helper \ + $(1)/usr/lib/dbus-1/ + + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/sbin/dbus-daemon \ + $(1)/usr/sbin/ + + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dbus-uuidgen \ + $(1)/usr/bin/ + + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dbus-launch \ + $(1)/usr/bin/dbus-launch.real + $(INSTALL_BIN) \ + ./files/dbus-launch \ + $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) \ + ./files/dbus.init \ + $(1)/etc/init.d/dbus +endef + +define Package/dbus-utils/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) \ + $(PKG_INSTALL_DIR)/usr/bin/dbus-{send,monitor,cleanup-sockets} \ + $(1)/usr/bin/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,libdbus)) +$(eval $(call BuildPackage,dbus)) +$(eval $(call BuildPackage,dbus-utils)) diff --git a/trunk/package/feeds/packages/dbus/files/dbus-launch b/trunk/package/feeds/packages/dbus/files/dbus-launch new file mode 100644 index 00000000..7c3f9228 --- /dev/null +++ b/trunk/package/feeds/packages/dbus/files/dbus-launch @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Simple wrapper script which allows us to build dbus without general x support +# If an application needs x support in dbus-launch it has to depend on the +# dbus-launch-x package. The script is used to prefer dbus-launch with x over +# the dbus-lauch without x. + +if [ -f /usr/bin/dbus-launch-x ]; then + exec /usr/bin/dbus-launch-x $@ +else + exec /usr/bin/dbus-launch.real $@ +fi diff --git a/trunk/package/feeds/packages/dbus/files/dbus.init b/trunk/package/feeds/packages/dbus/files/dbus.init new file mode 100644 index 00000000..42940837 --- /dev/null +++ b/trunk/package/feeds/packages/dbus/files/dbus.init @@ -0,0 +1,17 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2007-2011 OpenWrt.org + +START=60 + +SERVICE_PID_FILE=/var/run/dbus.pid + +start() { + mkdir -m 0755 -p /var/lib/dbus + mkdir -m 0755 -p /var/run/dbus + [ -x /usr/bin/dbus-uuidgen ] && /usr/bin/dbus-uuidgen --ensure + service_start /usr/sbin/dbus-daemon --system +} + +stop() { + service_stop /usr/sbin/dbus-daemon && rm $SERVICE_PID_FILE +} diff --git a/trunk/package/feeds/packages/dbus/patches/100-fix-poll-select.patch b/trunk/package/feeds/packages/dbus/patches/100-fix-poll-select.patch new file mode 100644 index 00000000..64f65251 --- /dev/null +++ b/trunk/package/feeds/packages/dbus/patches/100-fix-poll-select.patch @@ -0,0 +1,13 @@ +Index: dbus-1.9.4/tools/tool-common.c +=================================================================== +--- dbus-1.9.4.orig/tools/tool-common.c ++++ dbus-1.9.4/tools/tool-common.c +@@ -29,6 +29,8 @@ + #include + #include + ++#include ++ + #ifdef DBUS_WIN + #include + #endif diff --git a/trunk/package/feeds/packages/ddns-scripts/Makefile b/trunk/package/feeds/packages/ddns-scripts/Makefile new file mode 100644 index 00000000..f739cb72 --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/Makefile @@ -0,0 +1,216 @@ +# +# Copyright (C) 2008-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ddns-scripts +# Version == major.minor.patch +# increase on new functionality (minor) or patches (patch) +PKG_VERSION:=2.4.1 +# Release == build +# increase on changes of services files or tld_names.dat +PKG_RELEASE:=1 + +PKG_LICENSE:=GPL-2.0 +PKG_MAINTAINER:=Christian Schoenebeck + +include $(INCLUDE_DIR)/package.mk + +# no default dependencies +PKG_DEFAULT_DEPENDS= + +define Package/$(PKG_NAME)/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + PKGARCH:=all +endef + +##### ********************************** +define Package/$(PKG_NAME) + $(call Package/$(PKG_NAME)/Default) + TITLE:=Dynamic DNS Client scripts (with IPv6 support) +endef +# shown in LuCI package description +define Package/$(PKG_NAME)/description + Dynamic DNS Client scripts (with IPv6 support) - Info: http://wiki.openwrt.org/doc/howto/ddns.client +endef +# shown in menuconfig +define Package/$(PKG_NAME)/config + help + A highly configurable set of scripts for doing dynamic dns updates. + - IPv6 support + - force communication to IPv4 or IPv6 only + - DNS server support + - using BIND host if installed + - DNS requests via TCP + - Proxy server support + - log file support + - support to run once + . + Version: $(PKG_VERSION)-$(PKG_RELEASE) + Info : http://wiki.openwrt.org/doc/howto/ddns.client + . + $(PKG_MAINTAINER) +endef + +##### ********************************** +define Package/$(PKG_NAME)_cloudflare + $(call Package/$(PKG_NAME)/Default) + TITLE:=DDNS extension for CloudFlare + DEPENDS:=$(PKG_NAME) +endef +define Package/$(PKG_NAME)_cloudflare/description + Dynamic DNS Client scripts extension for CloudFlare +endef + +##### ********************************** +define Package/$(PKG_NAME)_no-ip_com + $(call Package/$(PKG_NAME)/Default) + TITLE:=DDNS extension for No-IP.com + DEPENDS:=$(PKG_NAME) +endef +define Package/$(PKG_NAME)_no-ip_com/description + Dynamic DNS Client scripts extension for No-IP.com +endef + +##### ********************************** +define Package/$(PKG_NAME)_nsupdate + $(call Package/$(PKG_NAME)/Default) + TITLE:=DDNS extension using Bind nsupdate + DEPENDS:=$(PKG_NAME) +bind-client +endef +define Package/$(PKG_NAME)_nsupdate/description + Dynamic DNS Client scripts extension for direct updates using Bind nsupdate +endef +define Package/$(PKG_NAME)_nsupdate/config + help + The script directly updates a PowerDNS (or maybe bind server) via nsupdate + from bind-client package. It requires + "option dns_server" to be set to the server to be used by nsupdate. + "option username" should be set to the key name and + "option password" to the base64 encoded shared secret. + +endef + +##### ********************************** +define Build/Configure +endef +define Build/Compile + $(CP) ./files $(PKG_BUILD_DIR) + for FILE in `find $(PKG_BUILD_DIR)/files -type f`; do \ + $(SED) 's/^\s*#/#/' \ + -e '/^#\s\|^#$$$$/d' \ + -e 's/\s#\s.*$$$$//' \ + -e 's/\s*$$$$//' \ + -e '/^\/\/\s/d' \ + -e '/^\s*$$$$/d' $$$$FILE; \ + done + gzip -9 $(PKG_BUILD_DIR)/files/tld_names.dat +endef + +define Package/$(PKG_NAME)/conffiles +/etc/config/ddns +endef + +##### ********************************** +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.hotplug $(1)/etc/hotplug.d/iface/95-ddns + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.init $(1)/etc/init.d/ddns + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) $(PKG_BUILD_DIR)/files/ddns.config $(1)/etc/config/ddns + + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/services* $(1)/usr/lib/ddns + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/dynamic_*.sh $(1)/usr/lib/ddns +endef +define Package/$(PKG_NAME)/postinst + #!/bin/sh + # if run within buildroot exit + [ -n "$${IPKG_INSTROOT}" ] && exit 0 + + # add new section "ddns" "global" if not exists + uci -q get ddns.global > /dev/null || uci -q set ddns.global='ddns' + uci -q get ddns.global.date_format > /dev/null || uci -q set ddns.global.date_format='%F %R' + uci -q get ddns.global.log_lines > /dev/null || uci -q set ddns.global.log_lines='250' + uci -q get ddns.global.allow_local_ip > /dev/null || uci -q set ddns.global.allow_local_ip='0' + uci -q commit ddns + + # clear LuCI indexcache + rm -f /tmp/luci-indexcache >/dev/null 2>&1 + + exit 0 +endef +define Package/$(PKG_NAME)/prerm + #!/bin/sh + # if run within buildroot exit + [ -n "$${IPKG_INSTROOT}" ] && exit 0 + + # stop running scripts + /etc/init.d/ddns disable + /etc/init.d/ddns stop + + # clear LuCI indexcache + rm -f /tmp/luci-indexcache >/dev/null 2>&1 + + exit 0 +endef + +##### ********************************** +define Package/$(PKG_NAME)_cloudflare/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_CloudFlare.sh $(1)/usr/lib/ddns + $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/tld_names.dat.gz $(1)/usr/lib/ddns +endef +define Package/$(PKG_NAME)_cloudflare/postinst + #!/bin/sh + echo -e '"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services + echo -e '"CloudFlare"\t"update_CloudFlare.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6 +endef +define Package/$(PKG_NAME)_cloudflare/prerm + #!/bin/sh + /bin/sed -i '/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services + /bin/sed -i '/update_CloudFlare\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6 +endef + +##### ********************************** +define Package/$(PKG_NAME)_no-ip_com/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_No-IP.com.sh $(1)/usr/lib/ddns +endef +define Package/$(PKG_NAME)_no-ip_com/postinst + #!/bin/sh + echo -e '"No-IP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services + echo -e '"NoIP.com"\t"update_No-IP.com.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services +endef +define Package/$(PKG_NAME)_no-ip_com/prerm + #!/bin/sh + /bin/sed -i '/update_No-IP\.com\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services +endef + +##### ********************************** +define Package/$(PKG_NAME)_nsupdate/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/update_nsupdate.sh $(1)/usr/lib/ddns +endef +define Package/$(PKG_NAME)_nsupdate/postinst + #!/bin/sh + echo -e '"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services + echo -e '"Bind-nsupdate"\t"update_nsupdate.sh"' >> $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6 +endef +define Package/$(PKG_NAME)_nsupdate/prerm + #!/bin/sh + /bin/sed -i '/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services + /bin/sed -i '/update_nsupdate\.sh/ d' $${IPKG_INSTROOT}/usr/lib/ddns/services_ipv6 +endef + +##### ********************************** +$(eval $(call BuildPackage,$(PKG_NAME))) +$(eval $(call BuildPackage,$(PKG_NAME)_cloudflare)) +$(eval $(call BuildPackage,$(PKG_NAME)_no-ip_com)) +$(eval $(call BuildPackage,$(PKG_NAME)_nsupdate)) diff --git a/trunk/package/feeds/packages/ddns-scripts/files/ddns.config b/trunk/package/feeds/packages/ddns-scripts/files/ddns.config new file mode 100644 index 00000000..5d69bb17 --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/files/ddns.config @@ -0,0 +1,31 @@ +# +# Please read ddns.sample +# or http://wiki.openwrt.org/doc/uci/ddns +# +config ddns "global" + option date_format "%F %R" +# option run_dir "/var/run/ddns" +# option log_dir "/var/log/ddns" + option log_lines "250" + option allow_local_ip "0" + + +config service "myddns_ipv4" + option service_name "dyndns.com" + option domain "yourhost.example.com" + option username "your_username" + option password "your_password" + option interface "wan" + option ip_source "network" + option ip_network "wan" + +config service "myddns_ipv6" + option update_url "http://[USERNAME]:[PASSWORD]@your.provider.net/nic/update?hostname=[DOMAIN]&myip=[IP]" + option domain "yourhost.example.com" + option username "your_username" + option password "your_password" + option use_ipv6 "1" + option interface "wan6" + option ip_source "network" + option ip_network "wan6" + diff --git a/trunk/package/feeds/packages/ddns-scripts/files/ddns.hotplug b/trunk/package/feeds/packages/ddns-scripts/files/ddns.hotplug new file mode 100644 index 00000000..dfb35f6d --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/files/ddns.hotplug @@ -0,0 +1,14 @@ +#!/bin/sh + +# there are other ACTIONs like ifupdate we don't need +# so parse dynamic_dns_functions.sh only when needed +case "$ACTION" in + ifup) + . /usr/lib/ddns/dynamic_dns_functions.sh + /etc/init.d/ddns enabled && start_daemon_for_all_ddns_sections "$INTERFACE" + ;; + ifdown) + . /usr/lib/ddns/dynamic_dns_functions.sh + stop_daemon_for_all_ddns_sections "$INTERFACE" + ;; +esac diff --git a/trunk/package/feeds/packages/ddns-scripts/files/ddns.init b/trunk/package/feeds/packages/ddns-scripts/files/ddns.init new file mode 100644 index 00000000..2cc9b90f --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/files/ddns.init @@ -0,0 +1,28 @@ +#!/bin/sh /etc/rc.common +START=95 +STOP=10 + +boot() { + return 0 +} + +reload() { + killall -1 dynamic_dns_updater.sh 2>/dev/null # send SIGHUP + return 0 +} + +restart() { + stop + sleep 1 # give time to shutdown + start +} + +start() { + . /usr/lib/ddns/dynamic_dns_functions.sh + start_daemon_for_all_ddns_sections +} + +stop() { + killall dynamic_dns_updater.sh 2>/dev/null + return 0 # if killall fails, ignore +} diff --git a/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_functions.sh b/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_functions.sh new file mode 100755 index 00000000..0023f88f --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_functions.sh @@ -0,0 +1,1124 @@ +#!/bin/sh +# /usr/lib/ddns/dynamic_dns_functions.sh +# +# Original written by Eric Paul Bishop, January 2008 +#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# (Loosely) based on the script on the one posted by exobyte in the forums here: +# http://forum.openwrt.org/viewtopic.php?id=14040 +# +# extended and partial rewritten in August 2014 by +#.Christian Schoenebeck +# to support: +# - IPv6 DDNS services +# - setting DNS Server to retrieve current IP including TCP transport +# - Proxy Server to send out updates or retrieving WEB based IP detection +# - force_interval=0 to run once (useful for cron jobs etc.) +# - the usage of BIND's host instead of BusyBox's nslookup if installed (DNS via TCP) +# - extended Verbose Mode and log file support for better error detection +# +# function timeout +# copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh +# @author Anthony Thyssen 6 April 2011 +# +# variables in small chars are read from /etc/config/ddns +# variables in big chars are defined inside these scripts as global vars +# variables in big chars beginning with "__" are local defined inside functions only +# set -vx #script debugger + +. /lib/functions.sh +. /lib/functions/network.sh + +# GLOBAL VARIABLES # +SECTION_ID="" # hold config's section name +VERBOSE_MODE=1 # default mode is log to console, but easily changed with parameter + +LOGFILE="" # logfile - all files are set in dynamic_dns_updater.sh +PIDFILE="" # pid file +UPDFILE="" # store UPTIME of last update +DATFILE="" # save stdout data of WGet and other external programs called +ERRFILE="" # save stderr output of WGet and other external programs called +TLDFILE=/usr/lib/ddns/tld_names.dat.gz # TLD file used by split_FQDN + +CHECK_SECONDS=0 # calculated seconds out of given +FORCE_SECONDS=0 # interval and unit +RETRY_SECONDS=0 # in configuration + +LAST_TIME=0 # holds the uptime of last successful update +CURR_TIME=0 # holds the current uptime +NEXT_TIME=0 # calculated time for next FORCED update +EPOCH_TIME=0 # seconds since 1.1.1970 00:00:00 + +REGISTERED_IP="" # holds the IP read from DNS +LOCAL_IP="" # holds the local IP read from the box + +URL_USER="" # url encoded $username from config file +URL_PASS="" # url encoded $password from config file + +ERR_LAST=0 # used to save $? return code of program and function calls +ERR_UPDATE=0 # error counter on different local and registered ip + +PID_SLEEP=0 # ProcessID of current background "sleep" + +# allow NON-public IP's +ALLOW_LOCAL_IP=$(uci -q get ddns.global.allow_local_ip) || ALLOW_LOCAL_IP=0 + +# directory to store run information to. +RUNDIR=$(uci -q get ddns.global.run_dir) || RUNDIR="/var/run/ddns" +[ -d $RUNDIR ] || mkdir -p -m755 $RUNDIR + +# directory to store log files +LOGDIR=$(uci -q get ddns.global.log_dir) || LOGDIR="/var/log/ddns" +[ -d $LOGDIR ] || mkdir -p -m755 $LOGDIR + +# number of lines to before rotate logfile +LOGLINES=$(uci -q get ddns.global.log_lines) || LOGLINES=250 +LOGLINES=$((LOGLINES + 1)) # correct sed handling + +# format to show date information in log and luci-app-ddns default ISO 8601 format +DATE_FORMAT=$(uci -q get ddns.global.date_format) || DATE_FORMAT="%F %R" +DATE_PROG="date +'$DATE_FORMAT'" + +# regular expression to detect IPv4 / IPv6 +# IPv4 0-9 1-3x "." 0-9 1-3x "." 0-9 1-3x "." 0-9 1-3x +IPV4_REGEX="[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}" +# IPv6 ( ( 0-9a-f 1-4char ":") min 1x) ( ( 0-9a-f 1-4char )optional) ( (":" 0-9a-f 1-4char ) min 1x) +IPV6_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)" + +# detect if called by dynamic_dns_lucihelper.sh script, disable retrys (empty variable == false) +[ "$(basename $0)" = "dynamic_dns_lucihelper.sh" ] && LUCI_HELPER="TRUE" || LUCI_HELPER="" + +# USE_CURL if GNU Wget and cURL installed normally Wget is used by do_transfer() +# to change this use global option use_curl '1' +USE_CURL=$(uci -q get ddns.global.use_curl) || USE_CURL=0 # read config +[ -x /usr/bin/curl ] || USE_CURL=0 # check for cURL + +# loads all options for a given package and section +# also, sets all_option_variables to a list of the variable names +# $1 = ddns, $2 = SECTION_ID +load_all_config_options() +{ + local __PKGNAME="$1" + local __SECTIONID="$2" + local __VAR + local __ALL_OPTION_VARIABLES="" + + # this callback loads all the variables in the __SECTIONID section when we do + # config_load. We need to redefine the option_cb for different sections + # so that the active one isn't still active after we're done with it. For reference + # the $1 variable is the name of the option and $2 is the name of the section + config_cb() + { + if [ ."$2" = ."$__SECTIONID" ]; then + option_cb() + { + __ALL_OPTION_VARIABLES="$__ALL_OPTION_VARIABLES $1" + } + else + option_cb() { return 0; } + fi + } + + config_load "$__PKGNAME" + + # Given SECTION_ID not found so no data, so return 1 + [ -z "$__ALL_OPTION_VARIABLES" ] && return 1 + + for __VAR in $__ALL_OPTION_VARIABLES + do + config_get "$__VAR" "$__SECTIONID" "$__VAR" + done + return 0 +} + +# read's all service sections from ddns config +# $1 = Name of variable to store +load_all_service_sections() { + local __DATA="" + config_cb() + { + # only look for section type "service", ignore everything else + [ "$1" = "service" ] && __DATA="$__DATA $2" + } + config_load "ddns" + + eval "$1=\"$__DATA\"" + return +} + +# starts updater script for all given sections or only for the one given +# $1 = interface (Optional: when given only scripts are started +# configured for that interface) +# used by /etc/hotplug.d/iface/25-ddns on IFUP +# and by /etc/init.d/ddns start +start_daemon_for_all_ddns_sections() +{ + local __EVENTIF="$1" + local __SECTIONS="" + local __SECTIONID="" + local __IFACE="" + + load_all_service_sections __SECTIONS + for __SECTIONID in $__SECTIONS; do + config_get __IFACE "$__SECTIONID" interface "wan" + [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue + /usr/lib/ddns/dynamic_dns_updater.sh $__SECTIONID 0 >/dev/null 2>&1 & + done +} + +# stop sections process incl. childs (sleeps) +# $1 = section +stop_section_processes() { + local __PID=0 + local __PIDFILE="$RUNDIR/$1.pid" + [ $# -ne 1 ] && write_log 12 "Error calling 'stop_section_processes()' - wrong number of parameters" + + [ -e "$__PIDFILE" ] && { + __PID=$(cat $__PIDFILE) + ps | grep "^[\t ]*$__PID" >/dev/null 2>&1 && kill $__PID || __PID=0 # terminate it + } + [ $__PID -eq 0 ] # report if process was running +} + +# stop updater script for all defines sections or only for one given +# $1 = interface (optional) +# used by /etc/hotplug.d/iface/25-ddns on 'ifdown' +# and by /etc/init.d/ddns stop +# needed because we also need to kill "sleep" child processes +stop_daemon_for_all_ddns_sections() { + local __EVENTIF="$1" + local __SECTIONS="" + local __SECTIONID="" + local __IFACE="" + + load_all_service_sections __SECTIONS + for __SECTIONID in $__SECTIONS; do + config_get __IFACE "$__SECTIONID" interface "wan" + [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue + stop_section_processes "$__SECTIONID" + done +} + +# reports to console, logfile, syslog +# $1 loglevel 7 == Debug to 0 == EMERG +# value +10 will exit the scripts +# $2..n text to report +write_log() { + local __LEVEL __EXIT __CMD __MSG + local __TIME=$(date +%H%M%S) + [ $1 -ge 10 ] && { + __LEVEL=$(($1-10)) + __EXIT=1 + } || { + __LEVEL=$1 + __EXIT=0 + } + shift # remove loglevel + [ $__EXIT -eq 0 ] && __MSG="$*" || __MSG="$* - TERMINATE" + case $__LEVEL in # create log message and command depending on loglevel + 0) __CMD="logger -p user.emerg -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME EMERG : $__MSG" ;; + 1) __CMD="logger -p user.alert -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME ALERT : $__MSG" ;; + 2) __CMD="logger -p user.crit -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME CRIT : $__MSG" ;; + 3) __CMD="logger -p user.err -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME ERROR : $__MSG" ;; + 4) __CMD="logger -p user.warn -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME WARN : $__MSG" ;; + 5) __CMD="logger -p user.notice -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME note : $__MSG" ;; + 6) __CMD="logger -p user.info -t ddns-scripts[$$] $SECTION_ID: $__MSG" + __MSG=" $__TIME info : $__MSG" ;; + 7) __MSG=" $__TIME : $__MSG";; + *) return;; + esac + + # verbose echo + [ $VERBOSE_MODE -gt 0 -o $__EXIT -gt 0 ] && echo -e "$__MSG" + # write to logfile + if [ ${use_logfile:-1} -eq 1 -o $VERBOSE_MODE -gt 1 ]; then + echo -e "$__MSG" >> $LOGFILE + # VERBOSE_MODE > 1 then NO loop so NO truncate log to $LOGLINES lines + [ $VERBOSE_MODE -gt 1 ] || sed -i -e :a -e '$q;N;'$LOGLINES',$D;ba' $LOGFILE + fi + [ $LUCI_HELPER ] && return # nothing else todo when running LuCI helper script + [ $__LEVEL -eq 7 ] && return # no syslog for debug messages + __CMD=$(echo -e "$__CMD" | tr -d '\n' | tr '\t' ' ') # remove \n \t chars + [ $__EXIT -eq 1 ] && { + $__CMD # force syslog before exit + exit 1 + } + [ $use_syslog -eq 0 ] && return + [ $((use_syslog + __LEVEL)) -le 7 ] && $__CMD + return +} + +# replace all special chars to their %hex value +# used for USERNAME and PASSWORD in update_url +# unchanged: "-"(minus) "_"(underscore) "."(dot) "~"(tilde) +# to verify: "'"(single quote) '"'(double quote) # because shell delimiter +# "$"(Dollar) # because used as variable output +# tested with the following string stored via Luci Application as password / username +# A B!"#AA$1BB%&'()*+,-./:;<=>?@[\]^_`{|}~ without problems at Dollar or quotes +urlencode() { + # $1 Name of Variable to store encoded string to + # $2 string to encode + local __STR __LEN __CHAR __OUT + local __ENC="" + local __POS=1 + + [ $# -ne 2 ] && write_log 12 "Error calling 'urlencode()' - wrong number of parameters" + + __STR="$2" # read string to encode + __LEN=${#__STR} # get string length + + while [ $__POS -le $__LEN ]; do + # read one chat of the string + __CHAR=$(expr substr "$__STR" $__POS 1) + + case "$__CHAR" in + [-_.~a-zA-Z0-9] ) + # standard char + __OUT="${__CHAR}" + ;; + * ) + # special char get %hex code + __OUT=$(printf '%%%02x' "'$__CHAR" ) + ;; + esac + __ENC="${__ENC}${__OUT}" # append to encoded string + __POS=$(( $__POS + 1 )) # increment position + done + + eval "$1=\"$__ENC\"" # transfer back to variable + return 0 +} + +# extract url or script for given DDNS Provider from +# file /usr/lib/ddns/services for IPv4 or from +# file /usr/lib/ddns/services_ipv6 for IPv6 +# $1 Name of Variable to store url to +# $2 Name of Variable to store script to +get_service_data() { + local __LINE __FILE __NAME __URL __SERVICES __DATA + local __SCRIPT="" + local __OLD_IFS=$IFS + local __NEWLINE_IFS=' +' # __NEWLINE_IFS + [ $# -ne 2 ] && write_log 12 "Error calling 'get_service_data()' - wrong number of parameters" + + __FILE="/usr/lib/ddns/services" # IPv4 + [ $use_ipv6 -ne 0 ] && __FILE="/usr/lib/ddns/services_ipv6" # IPv6 + + # remove any lines not containing data, and then make sure fields are enclosed in double quotes + __SERVICES=$(cat $__FILE | grep "^[\t ]*[^#]" | \ + awk ' gsub("\x27", "\"") { if ($1~/^[^\"]*$/) $1="\""$1"\"" }; { if ( $NF~/^[^\"]*$/) $NF="\""$NF"\"" }; { print $0 }') + + IFS=$__NEWLINE_IFS + for __LINE in $__SERVICES; do + # grep out proper parts of data and use echo to remove quotes + __NAME=$(echo $__LINE | grep -o "^[\t ]*\"[^\"]*\"" | xargs -r -n1 echo) + __DATA=$(echo $__LINE | grep -o "\"[^\"]*\"[\t ]*$" | xargs -r -n1 echo) + + if [ "$__NAME" = "$service_name" ]; then + break # found so leave for loop + fi + done + IFS=$__OLD_IFS + + # check if URL or SCRIPT is given + __URL=$(echo "$__DATA" | grep "^http") + [ -z "$__URL" ] && __SCRIPT="/usr/lib/ddns/$__DATA" + + eval "$1=\"$__URL\"" + eval "$2=\"$__SCRIPT\"" + return 0 +} + +# Calculate seconds from interval and unit +# $1 Name of Variable to store result in +# $2 Number and +# $3 Unit of time interval +get_seconds() { + [ $# -ne 3 ] && write_log 12 "Error calling 'get_seconds()' - wrong number of parameters" + case "$3" in + "days" ) eval "$1=$(( $2 * 86400 ))";; + "hours" ) eval "$1=$(( $2 * 3600 ))";; + "minutes" ) eval "$1=$(( $2 * 60 ))";; + * ) eval "$1=$2";; + esac + return 0 +} + +timeout() { + #.copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh + # only did the following changes + # - commented out "#!/bin/bash" and usage section + # - replace exit by return for usage as function + # - some reformatting + # + # timeout [-SIG] time [--] command args... + # + # Run the given command until completion, but kill it if it runs too long. + # Specifically designed to exit immediately (no sleep interval) and clean up + # nicely without messages or leaving any extra processes when finished. + # + # Example use + # timeout 5 countdown + # + # Based on notes in my "Shell Script Hints", section "Command Timeout" + # http://www.ict.griffith.edu.au/~anthony/info/shell/script.hints + # + # This script uses a lot of tricks to terminate both the background command, + # the timeout script, and even the sleep process. It also includes trap + # commands to prevent sub-shells reporting expected "Termination Errors". + # + # It took years of occasional trials, errors and testing to get a pure bash + # timeout command working as well as this does. + # + #.Anthony Thyssen 6 April 2011 + # +# PROGNAME=$(type $0 | awk '{print $3}') # search for executable on path +# PROGDIR=$(dirname $PROGNAME) # extract directory of program +# PROGNAME=$(basename $PROGNAME) # base name of program + + # output the script comments as docs +# Usage() { +# echo >&2 "$PROGNAME:" "$@" +# sed >&2 -n '/^###/q; /^#/!q; s/^#//; s/^ //; 3s/^/Usage: /; 2,$ p' "$PROGDIR/$PROGNAME" +# exit 10; +# } + + SIG=-TERM + + while [ $# -gt 0 ]; do + case "$1" in + --) + # forced end of user options + shift; + break ;; +# -\?|--help|--doc*) +# Usage ;; + [0-9]*) + TIMEOUT="$1" ;; + -*) + SIG="$1" ;; + *) + # unforced end of user options + break ;; + esac + shift # next option + done + + # run main command in backgrounds and get its pid + "$@" & + command_pid=$! + + # timeout sub-process abort countdown after ABORT seconds! also backgrounded + sleep_pid=0 + ( + # cleanup sleep process + trap 'kill -TERM $sleep_pid; return 1' 1 2 3 15 + # sleep timeout period in background + sleep $TIMEOUT & + sleep_pid=$! + wait $sleep_pid + # Abort the command + kill $SIG $command_pid >/dev/null 2>&1 + return 1 + ) & + timeout_pid=$! + + # Wait for main command to finished or be timed out + wait $command_pid + status=$? + + # Clean up timeout sub-shell - if it is still running! + kill $timeout_pid 2>/dev/null + wait $timeout_pid 2>/dev/null + + # Uncomment to check if a LONG sleep still running (no sleep should be) + # sleep 1 + # echo "-----------" + # /bin/ps j # uncomment to show if abort "sleep" is still sleeping + + return $status +} + +# verify given host and port is connectable +# $1 Host/IP to verify +# $2 Port to verify +verify_host_port() { + local __HOST=$1 + local __PORT=$2 + local __IP __IPV4 __IPV6 __RUNPROG __PROG __ERR + # return codes + # 1 system specific error + # 2 nslookup/host error + # 3 nc (netcat) error + # 4 unmatched IP version + + [ $# -ne 2 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters" + + # check if ip or FQDN was given + __IPV4=$(echo $__HOST | grep -m 1 -o "$IPV4_REGEX$") # do not detect ip in 0.0.0.0.example.com + __IPV6=$(echo $__HOST | grep -m 1 -o "$IPV6_REGEX") + # if FQDN given get IP address + [ -z "$__IPV4" -a -z "$__IPV6" ] && { + if [ -x /usr/bin/host ]; then # use BIND host if installed + __PROG="BIND host" + __RUNPROG="/usr/bin/host -t ANY $__HOST >$DATFILE 2>$ERRFILE" + else # use BusyBox nslookup + __PROG="BusyBox nslookup" + __RUNPROG="/usr/bin/nslookup $__HOST >$DATFILE 2>$ERRFILE" + fi + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG + __ERR=$? + # command error + [ $__ERR -gt 0 ] && { + write_log 3 "DNS Resolver Error - $__PROG Error '$__ERR'" + write_log 7 "$(cat $ERRFILE)" + return 2 + } + # extract IP address + if [ -x /usr/bin/host ]; then # use BIND host if installed + __IPV4=$(cat $DATFILE | awk -F "address " '/has address/ {print $2; exit}' ) + __IPV6=$(cat $DATFILE | awk -F "address " '/has IPv6/ {print $2; exit}' ) + else # use BusyBox nslookup + __IPV4=$(cat $DATFILE | sed -ne "3,\$ { s/^Address[0-9 ]\{0,\}: \($IPV4_REGEX\).*$/\\1/p }") + __IPV6=$(cat $DATFILE | sed -ne "3,\$ { s/^Address[0-9 ]\{0,\}: \($IPV6_REGEX\).*$/\\1/p }") + fi + } + + # check IP version if forced + if [ $force_ipversion -ne 0 ]; then + __ERR=0 + [ $use_ipv6 -eq 0 -a -z "$__IPV4" ] && __ERR=4 + [ $use_ipv6 -eq 1 -a -z "$__IPV6" ] && __ERR=6 + [ $__ERR -gt 0 ] && { + [ $LUCI_HELPER ] && return 4 + write_log 14 "Verify host Error '4' - Forced IP Version IPv$__ERR don't match" + } + fi + + # verify nc command + # busybox nc compiled without -l option "NO OPT l!" -> critical error + /usr/bin/nc --help 2>&1 | grep -i "NO OPT l!" >/dev/null 2>&1 && \ + write_log 12 "Busybox nc (netcat) compiled without '-l' option, error 'NO OPT l!'" + # busybox nc compiled with extensions + /usr/bin/nc --help 2>&1 | grep "\-w" >/dev/null 2>&1 && __NCEXT="TRUE" + + # connectivity test + # run busybox nc to HOST PORT + # busybox might be compiled with "FEATURE_PREFER_IPV4_ADDRESS=n" + # then nc will try to connect via IPv6 if there is any IPv6 available on any host interface + # not worrying, if there is an IPv6 wan address + # so if not "force_ipversion" to use_ipv6 then connect test via ipv4, if available + [ $force_ipversion -ne 0 -a $use_ipv6 -ne 0 -o -z "$__IPV4" ] && __IP=$__IPV6 || __IP=$__IPV4 + + if [ -n "$__NCEXT" ]; then # BusyBox nc compiled with extensions (timeout support) + __RUNPROG="/usr/bin/nc -w 1 $__IP $__PORT $DATFILE 2>$ERRFILE" + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG + __ERR=$? + [ $__ERR -eq 0 ] && return 0 + write_log 3 "Connect error - BusyBox nc (netcat) Error '$__ERR'" + write_log 7 "$(cat $ERRFILE)" + return 3 + else # nc compiled without extensions (no timeout support) + __RUNPROG="timeout 2 -- /usr/bin/nc $__IP $__PORT $DATFILE 2>$ERRFILE" + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG + __ERR=$? + [ $__ERR -eq 0 ] && return 0 + write_log 3 "Connect error - BusyBox nc (netcat) timeout Error '$__ERR'" + return 3 + fi +} + +# verify given DNS server if connectable +# $1 DNS server to verify +verify_dns() { + local __ERR=255 # last error buffer + local __CNT=0 # error counter + + [ $# -ne 1 ] && write_log 12 "Error calling 'verify_dns()' - wrong number of parameters" + write_log 7 "Verify DNS server '$1'" + + while [ $__ERR -ne 0 ]; do + # DNS uses port 53 + verify_host_port "$1" "53" + __ERR=$? + if [ $LUCI_HELPER ]; then # no retry if called by LuCI helper script + return $__ERR + elif [ $__ERR -ne 0 -a $VERBOSE_MODE -gt 1 ]; then # VERBOSE_MODE > 1 then NO retry + write_log 4 "Verify DNS server '$1' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error" + return $__ERR + elif [ $__ERR -ne 0 ]; then + __CNT=$(( $__CNT + 1 )) # increment error counter + # if error count > retry_count leave here + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "Verify DNS server '$1' failed after $retry_count retries" + + write_log 4 "Verify DNS server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP # enable trap-handler + PID_SLEEP=0 + fi + done + return 0 +} + +# analyze and verify given proxy string +# $1 Proxy-String to verify +verify_proxy() { + # complete entry user:password@host:port + # inside user and password NO '@' of ":" allowed + # host and port only host:port + # host only host ERROR unsupported + # IPv4 address instead of host 123.234.234.123 + # IPv6 address instead of host [xxxx:....:xxxx] in square bracket + local __TMP __HOST __PORT + local __ERR=255 # last error buffer + local __CNT=0 # error counter + + [ $# -ne 1 ] && write_log 12 "Error calling 'verify_proxy()' - wrong number of parameters" + write_log 7 "Verify Proxy server 'http://$1'" + + # try to split user:password "@" host:port + __TMP=$(echo $1 | awk -F "@" '{print $2}') + # no "@" found - only host:port is given + [ -z "$__TMP" ] && __TMP="$1" + # now lets check for IPv6 address + __HOST=$(echo $__TMP | grep -m 1 -o "$IPV6_REGEX") + # IPv6 host address found read port + if [ -n "$__HOST" ]; then + # IPv6 split at "]:" + __PORT=$(echo $__TMP | awk -F "]:" '{print $2}') + else + __HOST=$(echo $__TMP | awk -F ":" '{print $1}') + __PORT=$(echo $__TMP | awk -F ":" '{print $2}') + fi + # No Port detected - EXITING + [ -z "$__PORT" ] && { + [ $LUCI_HELPER ] && return 5 + write_log 14 "Invalid Proxy server Error '5' - proxy port missing" + } + + while [ $__ERR -gt 0 ]; do + verify_host_port "$__HOST" "$__PORT" + __ERR=$? + if [ $LUCI_HELPER ]; then # no retry if called by LuCI helper script + return $__ERR + elif [ $__ERR -gt 0 -a $VERBOSE_MODE -gt 1 ]; then # VERBOSE_MODE > 1 then NO retry + write_log 4 "Verify Proxy server '$1' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error" + return $__ERR + elif [ $__ERR -gt 0 ]; then + __CNT=$(( $__CNT + 1 )) # increment error counter + # if error count > retry_count leave here + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "Verify Proxy server '$1' failed after $retry_count retries" + + write_log 4 "Verify Proxy server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP # enable trap-handler + PID_SLEEP=0 + fi + done + return 0 +} + +do_transfer() { + # $1 # URL to use + local __URL="$1" + local __ERR=0 + local __CNT=0 # error counter + local __PROG __RUNPROG + + [ $# -ne 1 ] && write_log 12 "Error in 'do_transfer()' - wrong number of parameters" + + # lets prefer GNU Wget because it does all for us - IPv4/IPv6/HTTPS/PROXY/force IP version + grep -i "\+ssl" /usr/bin/wget >/dev/null 2>&1 # check for Wget with SSL support + if [ $? -eq 0 -a $USE_CURL -eq 0 ]; then # except global option use_curl is set to "1" + __PROG="/usr/bin/wget -nv -t 1 -O $DATFILE -o $ERRFILE" # non_verbose no_retry outfile errfile + # force network/ip to use for communication + if [ -n "$bind_network" ]; then + local __BINDIP + # set correct program to detect IP + [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" || __RUNPROG="network_get_ipaddr6" + eval "$__RUNPROG __BINDIP $bind_network" || \ + write_log 13 "Can not detect local IP using '$__RUNPROG $bind_network' - Error: '$?'" + write_log 7 "Force communication via IP '$__BINDIP'" + __PROG="$__PROG --bind-address=$__BINDIP" + fi + # force ip version to use + if [ $force_ipversion -eq 1 ]; then + [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6" # force IPv4/IPv6 + fi + # set certificate parameters + if [ $use_https -eq 1 ]; then + if [ "$cacert" = "IGNORE" ]; then # idea from Ticket #15327 to ignore server cert + __PROG="$__PROG --no-check-certificate" + elif [ -f "$cacert" ]; then + __PROG="$__PROG --ca-certificate=${cacert}" + elif [ -d "$cacert" ]; then + __PROG="$__PROG --ca-directory=${cacert}" + else # exit here because it makes no sense to start loop + write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication" + fi + fi + # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set) + [ -z "$proxy" ] && __PROG="$__PROG --no-proxy" + + __RUNPROG="$__PROG '$__URL'" # build final command + __PROG="GNU Wget" # reuse for error logging + + # 2nd choice is cURL IPv4/IPv6/HTTPS + # libcurl might be compiled without Proxy Support (default in trunk) + elif [ -x /usr/bin/curl ]; then + __PROG="/usr/bin/curl -RsS -o $DATFILE --stderr $ERRFILE" + # force network/interface-device to use for communication + if [ -n "$bind_network" ]; then + local __DEVICE + network_get_physdev __DEVICE $bind_network || \ + write_log 13 "Can not detect local device using 'network_get_physdev $bind_network' - Error: '$?'" + write_log 7 "Force communication via device '$__DEVICE'" + __PROG="$__PROG --interface $__DEVICE" + fi + # force ip version to use + if [ $force_ipversion -eq 1 ]; then + [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6" # force IPv4/IPv6 + fi + # set certificate parameters + if [ $use_https -eq 1 ]; then + if [ "$cacert" = "IGNORE" ]; then # idea from Ticket #15327 to ignore server cert + __PROG="$__PROG --insecure" # but not empty better to use "IGNORE" + elif [ -f "$cacert" ]; then + __PROG="$__PROG --cacert $cacert" + elif [ -d "$cacert" ]; then + __PROG="$__PROG --capath $cacert" + else # exit here because it makes no sense to start loop + write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication" + fi + fi + # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set) + # or check if libcurl compiled with proxy support + if [ -z "$proxy" ]; then + __PROG="$__PROG --noproxy '*'" + else + # if libcurl has no proxy support and proxy should be used then force ERROR + # libcurl currently no proxy support by default + grep -i "all_proxy" /usr/lib/libcurl.so* >/dev/null 2>&1 || \ + write_log 13 "cURL: libcurl compiled without Proxy support" + fi + + __RUNPROG="$__PROG '$__URL'" # build final command + __PROG="cURL" # reuse for error logging + + # busybox Wget (did not support neither IPv6 nor HTTPS) + elif [ -x /usr/bin/wget ]; then + __PROG="/usr/bin/wget -q -O $DATFILE" + # force network/ip not supported + [ -n "$__BINDIP" ] && \ + write_log 14 "BusyBox Wget: FORCE binding to specific address not supported" + # force ip version not supported + [ $force_ipversion -eq 1 ] && \ + write_log 14 "BusyBox Wget: Force connecting to IPv4 or IPv6 addresses not supported" + # https not supported + [ $use_https -eq 1 ] && \ + write_log 14 "BusyBox Wget: no HTTPS support" + # disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set) + [ -z "$proxy" ] && __PROG="$__PROG -Y off" + + __RUNPROG="$__PROG '$__URL' 2>$ERRFILE" # build final command + __PROG="Busybox Wget" # reuse for error logging + + else + write_log 13 "Neither 'Wget' nor 'cURL' installed or executable" + fi + + while : ; do + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG # DO transfer + __ERR=$? # save error code + [ $__ERR -eq 0 ] && return 0 # no error leave + [ $LUCI_HELPER ] && return 1 # no retry if called by LuCI helper script + + write_log 3 "$__PROG Error: '$__ERR'" + write_log 7 "$(cat $ERRFILE)" # report error + + [ $VERBOSE_MODE -gt 1 ] && { + # VERBOSE_MODE > 1 then NO retry + write_log 4 "Transfer failed - Verbose Mode: $VERBOSE_MODE - NO retry on error" + return 1 + } + + __CNT=$(( $__CNT + 1 )) # increment error counter + # if error count > retry_count leave here + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "Transfer failed after $retry_count retries" + + write_log 4 "Transfer failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP # enable trap-handler + PID_SLEEP=0 + done + # we should never come here there must be a programming error + write_log 12 "Error in 'do_transfer()' - program coding error" +} + +send_update() { + # $1 # IP to set at DDNS service provider + local __IP + + [ $# -ne 1 ] && write_log 12 "Error calling 'send_update()' - wrong number of parameters" + + if [ $ALLOW_LOCAL_IP -eq 0 ]; then + # verify given IP / no private IPv4's / no IPv6 addr starting with fxxx of with ":" + [ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^100\.6[4-9]\.|^100\.[7-9][0-9]\.|^100\.1[0-1][0-9]\.|^100\.12[0-7]\.|^127|^169\.254|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168)") + [ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]") + [ -z "$__IP" ] && write_log 14 "Private or invalid or no IP '$1' given! Please check your configuration" + else + __IP="$1" + fi + + if [ -n "$update_script" ]; then + write_log 7 "parsing script '$update_script'" + . $update_script + else + local __URL __ERR + + # do replaces in URL + __URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \ + -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g") + [ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#') + + do_transfer "$__URL" || return 1 + + write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)" + + return 0 + # TODO analyze providers answer + # "good" or "nochg" = dyndns.com compatible API + # grep -i -E "good|nochg" $DATFILE >/dev/null 2>&1 + # return $? # "0" if found + fi +} + +get_local_ip () { + # $1 Name of Variable to store local IP (LOCAL_IP) + local __CNT=0 # error counter + local __RUNPROG __DATA __URL __ERR + + [ $# -ne 1 ] && write_log 12 "Error calling 'get_local_ip()' - wrong number of parameters" + write_log 7 "Detect local IP on '$ip_source'" + + while : ; do + case $ip_source in + network) + # set correct program + [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \ + || __RUNPROG="network_get_ipaddr6" + eval "$__RUNPROG __DATA $ip_network" || \ + write_log 13 "Can not detect local IP using $__RUNPROG '$ip_network' - Error: '$?'" + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on network '$ip_network'" + ;; + interface) + write_log 7 "#> ifconfig $ip_interface >$DATFILE 2>$ERRFILE" + ifconfig $ip_interface >$DATFILE 2>$ERRFILE + __ERR=$? + if [ $__ERR -eq 0 ]; then + if [ $use_ipv6 -eq 0 ]; then + __DATA=$(awk ' + /inet addr:/ { # Filter IPv4 + # inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 + $1=""; # remove inet + $3=""; # remove Bcast: ... + $4=""; # remove Mask: ... + FS=":"; # separator ":" + $0=$0; # reread to activate separator + $1=""; # remove addr + FS=" "; # set back separator to default " " + $0=$0; # reread to activate separator (remove whitespaces) + print $1; # print IPv4 addr + }' $DATFILE + ) + else + __DATA=$(awk ' + /inet6/ && /: [0-9a-eA-E]/ && !/\/128/ { # Filter IPv6 exclude fxxx and /128 prefix + # inet6 addr: 2001:db8::xxxx:xxxx/32 Scope:Global + FS="/"; # separator "/" + $0=$0; # reread to activate separator + $2=""; # remove everything behind "/" + FS=" "; # set back separator to default " " + $0=$0; # reread to activate separator + print $3; # print IPv6 addr + }' $DATFILE + ) + fi + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on interface '$ip_interface'" + else + write_log 3 "ifconfig Error: '$__ERR'" + write_log 7 "$(cat $ERRFILE)" # report error + fi + ;; + script) + write_log 7 "#> $ip_script >$DATFILE 2>$ERRFILE" + eval $ip_script >$DATFILE 2>$ERRFILE + __ERR=$? + if [ $__ERR -eq 0 ]; then + __DATA=$(cat $DATFILE) + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected via script '$ip_script'" + else + write_log 3 "$ip_script Error: '$__ERR'" + write_log 7 "$(cat $ERRFILE)" # report error + fi + ;; + web) + do_transfer "$ip_url" + # use correct regular expression + [ $use_ipv6 -eq 0 ] \ + && __DATA=$(grep -m 1 -o "$IPV4_REGEX" $DATFILE) \ + || __DATA=$(grep -m 1 -o "$IPV6_REGEX" $DATFILE) + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on web at '$ip_url'" + ;; + *) + write_log 12 "Error in 'get_local_ip()' - unhandled ip_source '$ip_source'" + ;; + esac + # valid data found return here + [ -n "$__DATA" ] && { + eval "$1=\"$__DATA\"" + return 0 + } + + [ $LUCI_HELPER ] && return 1 # no retry if called by LuCI helper script + + write_log 7 "Data detected:\n$(cat $DATFILE)" + + [ $VERBOSE_MODE -gt 1 ] && { + # VERBOSE_MODE > 1 then NO retry + write_log 4 "Get local IP via '$ip_source' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error" + return 1 + } + + __CNT=$(( $__CNT + 1 )) # increment error counter + # if error count > retry_count leave here + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "Get local IP via '$ip_source' failed after $retry_count retries" + write_log 4 "Get local IP via '$ip_source' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP # enable trap-handler + PID_SLEEP=0 + done + # we should never come here there must be a programming error + write_log 12 "Error in 'get_local_ip()' - program coding error" +} + +get_registered_ip() { + # $1 Name of Variable to store public IP (REGISTERED_IP) + # $2 (optional) if set, do not retry on error + local __CNT=0 # error counter + local __ERR=255 + local __REGEX __PROG __RUNPROG __DATA + # return codes + # 1 no IP detected + + [ $# -lt 1 -o $# -gt 2 ] && write_log 12 "Error calling 'get_registered_ip()' - wrong number of parameters" + write_log 7 "Detect registered/public IP" + + # set correct regular expression + [ $use_ipv6 -eq 0 ] && __REGEX="$IPV4_REGEX" || __REGEX="$IPV6_REGEX" + + if [ -x /usr/bin/host ]; then + __PROG="/usr/bin/host" + [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -t A" || __PROG="$__PROG -t AAAA" + if [ $force_ipversion -eq 1 ]; then # force IP version + [ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6" + fi + [ $force_dnstcp -eq 1 ] && __PROG="$__PROG -T" # force TCP + + __RUNPROG="$__PROG $domain $dns_server >$DATFILE 2>$ERRFILE" + __PROG="BIND host" + elif [ -x /usr/bin/nslookup ]; then # last use BusyBox nslookup + [ $force_ipversion -ne 0 -o $force_dnstcp -ne 0 ] && \ + write_log 14 "Busybox nslookup - no support to 'force IP Version' or 'DNS over TCP'" + + __RUNPROG="/usr/bin/nslookup $domain $dns_server >$DATFILE 2>$ERRFILE" + __PROG="BusyBox nslookup" + else # there must be an error + write_log 12 "Error in 'get_registered_ip()' - no supported Name Server lookup software accessible" + fi + + while : ; do + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG + __ERR=$? + if [ $__ERR -ne 0 ]; then + write_log 3 "$__PROG error: '$__ERR'" + write_log 7 "$(cat $ERRFILE)" + else + if [ "$__PROG" = "BIND host" ]; then + __DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' ) + else + __DATA=$(cat $DATFILE | sed -ne "3,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" ) + fi + [ -n "$__DATA" ] && { + write_log 7 "Registered IP '$__DATA' detected" + eval "$1=\"$__DATA\"" # valid data found + return 0 # leave here + } + write_log 4 "NO valid IP found" + __ERR=127 + fi + + [ $LUCI_HELPER ] && return $__ERR # no retry if called by LuCI helper script + [ -n "$2" ] && return $__ERR # $2 is given -> no retry + [ $VERBOSE_MODE -gt 1 ] && { + # VERBOSE_MODE > 1 then NO retry + write_log 4 "Get registered/public IP for '$domain' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error" + return $__ERR + } + + __CNT=$(( $__CNT + 1 )) # increment error counter + # if error count > retry_count leave here + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "Get registered/public IP for '$domain' failed after $retry_count retries" + + write_log 4 "Get registered/public IP for '$domain' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP # enable trap-handler + PID_SLEEP=0 + done + # we should never come here there must be a programming error + write_log 12 "Error in 'get_registered_ip()' - program coding error" +} + +get_uptime() { + # $1 Variable to store result in + [ $# -ne 1 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters" + local __UPTIME=$(cat /proc/uptime) + eval "$1=\"${__UPTIME%%.*}\"" +} + +trap_handler() { + # $1 trap signal + # $2 optional (exit status) + local __PIDS __PID + local __ERR=${2:-0} + local __OLD_IFS=$IFS + local __NEWLINE_IFS=' +' # __NEWLINE_IFS + + [ $PID_SLEEP -ne 0 ] && kill -$1 $PID_SLEEP 2>/dev/null # kill pending sleep if exist + + case $1 in + 0) if [ $__ERR -eq 0 ]; then + write_log 5 "PID '$$' exit normal at $(eval $DATE_PROG)\n" + else + write_log 4 "PID '$$' exit WITH ERROR '$__ERR' at $(eval $DATE_PROG)\n" + fi ;; + 1) write_log 6 "PID '$$' received 'SIGHUP' at $(eval $DATE_PROG)" + # reload config via starting the script again + eval "/usr/lib/ddns/dynamic_dns_updater.sh $SECTION_ID $VERBOSE_MODE &" + exit 0 ;; # and leave this one + 2) write_log 5 "PID '$$' terminated by 'SIGINT' at $(eval $DATE_PROG)\n";; + 3) write_log 5 "PID '$$' terminated by 'SIGQUIT' at $(eval $DATE_PROG)\n";; + 15) write_log 5 "PID '$$' terminated by 'SIGTERM' at $(eval $DATE_PROG)\n";; + *) write_log 13 "Unhandled signal '$1' in 'trap_handler()'";; + esac + + __PIDS=$(pgrep -P $$) # get my childs (pgrep prints with "newline") + IFS=$__NEWLINE_IFS + for __PID in $__PIDS; do + kill -$1 $__PID # terminate it + done + IFS=$__OLD_IFS + + # remove out and err file + [ -f $DATFILE ] && rm -f $DATFILE + [ -f $ERRFILE ] && rm -f $ERRFILE + + # exit with correct handling: + # remove trap handling settings and send kill to myself + trap - 0 1 2 3 15 + [ $1 -gt 0 ] && kill -$1 $$ +} + +split_FQDN() { + # $1 FQDN to split + # $2 name of variable to store TLD + # $3 name of variable to store (reg)Domain + # $4 name of variable to store Host/Subdomain + + [ $# -ne 4 ] && write_log 12 "Error calling 'split_FQDN()' - wrong number of parameters" + [ -z "$1" ] && write_log 12 "Error calling 'split_FQDN()' - missing FQDN to split" + [ -f $TLDFILE ] || write_log 12 "Error calling 'split_FQDN()' - missing file '$TLDFILE'" + + local _HOST _FDOM _CTLD _FTLD + local _SET="$@" # save given function parameters + + local _PAR=$(echo "$1" | tr [A-Z] [a-z] | tr "." " ") # to lower and replace DOT with SPACE + set -- $_PAR # set new as function parameters + _PAR="" # clear variable for later reuse + while [ -n "$1" ] ; do # as long we have parameters + _PAR="$1 $_PAR" # invert order of parameters + shift + done + set -- $_PAR # use new as function parameters + _PAR="" # clear variable + + while [ -n "$1" ] ; do # as long we have parameters + if [ -z "$_CTLD" ]; then # first loop + _CTLD="$1" # CURRENT TLD to look at + shift + else + _CTLD="$1.$_CTLD" # Next TLD to look at + shift + fi + # check if TLD exact match in tld_names.dat, save TLD + zcat $TLDFILE | grep -E "^$_CTLD$" >/dev/null 2>&1 && { + _FTLD="$_CTLD" # save found + _FDOM="$1" # save domain next step might be invalid + continue + } + # check if match any "*" in tld_names.dat, + zcat $TLDFILE | grep -E "^\*.$_CTLD$" >/dev/null 2>&1 && { + [ -z "$1" ] && break # no more data break + # check if next level TLD match excludes "!" in tld_names.dat + if zcat $TLDFILE | grep -E "^!$1.$_CTLD$" >/dev/null 2>&1 ; then + _FTLD="$_CTLD" # Yes + else + _FTLD="$1.$_CTLD" + shift + fi + _FDOM="$1"; shift + } + [ -n "$_FTLD" ] && break # we have something valid, break + done + + # the leftover parameters are the HOST/SUBDOMAIN + while [ -n "$1" ]; do + _HOST="$1 $HOST" # remember we need to invert + shift + done + _HOST=$(echo $_HOST | tr " " ".") # insert DOT + + set -- $_SET # set back parameters from function call + [ -n "$_FTLD" ] && { + eval "$2=$_FTLD" # set TLD + eval "$3=$_FDOM" # set registrable domain + eval "$4=$_HOST" # set HOST/SUBDOMAIN + return 0 + } + eval "$2=''" # clear TLD + eval "$3=''" # clear registrable domain + eval "$4=''" # clear HOST/SUBDOMAIN + return 1 +} diff --git a/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_lucihelper.sh b/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_lucihelper.sh new file mode 100755 index 00000000..0f8bb5aa --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_lucihelper.sh @@ -0,0 +1,102 @@ +#!/bin/sh +# /usr/lib/ddns/luci_dns_helper.sh +# +#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# +# Written in August 2014 by +#.Christian Schoenebeck +# This script is used by luci-app-ddns +# - getting registered IP +# - check if possible to get local IP +# - verifing given DNS- or Proxy-Server +# +# variables in small chars are read from /etc/config/ddns as parameter given here +# variables in big chars are defined inside these scripts as gloval vars +# variables in big chars beginning with "__" are local defined inside functions only +# set -vx #script debugger + +[ $# -lt 2 ] && exit 1 + +. /usr/lib/ddns/dynamic_dns_functions.sh # global vars are also defined here + +# preset some variables, wrong or not set in dynamic_dns_functions.sh +SECTION_ID="lucihelper" +LOGFILE="$LOGDIR/$SECTION_ID.log" +DATFILE="$RUNDIR/$SECTION_ID.$$.dat" # save stdout data of WGet and other extern programs called +ERRFILE="$RUNDIR/$SECTION_ID.$$.err" # save stderr output of WGet and other extern programs called +VERBOSE_MODE=0 # no console logging +# global variables normally set by reading DDNS UCI configuration +use_syslog=0 # no syslog +use_logfile=0 # by default no logfile, can be changed here + +__RET=0 +case "$1" in + get_registered_ip) + local IP + domain=$2 # Hostname/Domain + use_ipv6=${3:-"0"} # Use IPv6 - default IPv4 + force_ipversion=${4:-"0"} # Force IP Version - default 0 - No + force_dnstcp=${5:-"0"} # Force TCP on DNS - default 0 - No + dns_server=${6:-""} # DNS server - default No DNS + write_log 7 "-----> get_registered_ip IP" + get_registered_ip IP + __RET=$? + [ $__RET -ne 0 ] && IP="" + echo -n "$IP" # suppress LF + ;; + verify_dns) + # $2 : dns-server to verify # no need for force_dnstcp because + # verify with nc (netcat) uses tcp anyway + use_ipv6=${3:-"0"} # Use IPv6 - default IPv4 + force_ipversion=${4:-"0"} # Force IP Version - default 0 - No + write_log 7 "-----> verify_dns '$2'" + verify_dns "$2" + __RET=$? + ;; + verify_proxy) + # $2 : proxy string to verify + use_ipv6=${3:-"0"} # Use IPv6 - default IPv4 + force_ipversion=${4:-"0"} # Force IP Version - default 0 - No + write_log 7 "-----> verify_proxy '$2'" + verify_proxy "$2" + __RET=$? + ;; + get_local_ip) + local IP + use_ipv6="$2" # Use IPv6 + ip_source="$3" # IP source + ip_network="$4" # set if source = "network" otherwise "-" + ip_url="$5" # set if source = "web" otherwise "-" + ip_interface="$6" # set if source = "interface" itherwiase "-" + ip_script="$7" # set if source = "script" otherwise "-" + proxy="$8" # proxy if set + force_ipversion="0" # not needed but must be set + use_https="0" # not needed but must be set + [ -n "$proxy" -a "$ip_source" = "web" ] && { + # proxy defined, used for ip_source=web + export HTTP_PROXY="http://$proxy" + export HTTPS_PROXY="http://$proxy" + export http_proxy="http://$proxy" + export https_proxy="http://$proxy" + } + # don't need IP only the return code + [ "$ip_source" = "web" -o "$ip_source" = "script" ] && { + # we wait only 3 seconds for an + # answer from "web" or "script" + write_log 7 "-----> timeout 3 -- get_local_ip IP" + timeout 3 -- get_local_ip IP + } || { + write_log 7 "-----> get_local_ip IP" + get_local_ip IP + } + __RET=$? + ;; + *) + __RET=255 + ;; +esac + +# remove out and err file +[ -f $DATFILE ] && rm -f $DATFILE +[ -f $ERRFILE ] && rm -f $ERRFILE +return $__RET \ No newline at end of file diff --git a/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_updater.sh b/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_updater.sh new file mode 100644 index 00000000..a0143a73 --- /dev/null +++ b/trunk/package/feeds/packages/ddns-scripts/files/dynamic_dns_updater.sh @@ -0,0 +1,334 @@ +#!/bin/sh +# /usr/lib/ddns/dynamic_dns_updater.sh +# +# Original written by Eric Paul Bishop, January 2008 +#.Distributed under the terms of the GNU General Public License (GPL) version 2.0 +# (Loosely) based on the script on the one posted by exobyte in the forums here: +# http://forum.openwrt.org/viewtopic.php?id=14040 +# +# extended and partial rewritten in August 2014 by +#.Christian Schoenebeck +# to support: +# - IPv6 DDNS services +# - DNS Server to retrieve registered IP including TCP transport (Ticket 7820) +# - Proxy Server to send out updates +# - force_interval=0 to run once (Luci Ticket 538) +# - the usage of BIND's host command instead of BusyBox's nslookup if installed +# - extended Verbose Mode and log file support for better error detection +# - wait for interface to fully come up, before the first update is done +# +# variables in small chars are read from /etc/config/ddns +# variables in big chars are defined inside these scripts as global vars +# variables in big chars beginning with "__" are local defined inside functions only +# set -vx #script debugger + +[ $# -lt 1 -o -n "${2//[0-3]/}" -o ${#2} -gt 1 ] && { + echo -e "\n USAGE:" + echo -e " $0 [SECTION] [VERBOSE_MODE]\n" + echo " [SECTION] - service section as defined in /etc/config/ddns" + echo " [VERBOSE_MODE] - '0' NO output to console" + echo " '1' output to console" + echo " '2' output to console AND logfile" + echo " + run once WITHOUT retry on error" + echo " '3' output to console AND logfile" + echo " + run once WITHOUT retry on error" + echo -e " + NOT sending update to DDNS service\n" + exit 1 +} + +. /usr/lib/ddns/dynamic_dns_functions.sh # global vars are also defined here + +SECTION_ID="$1" +VERBOSE_MODE=${2:-1} # default mode is log to console + +# set file names +PIDFILE="$RUNDIR/$SECTION_ID.pid" # Process ID file +UPDFILE="$RUNDIR/$SECTION_ID.update" # last update successful send (system uptime) +DATFILE="$RUNDIR/$SECTION_ID.dat" # save stdout data of WGet and other extern programs called +ERRFILE="$RUNDIR/$SECTION_ID.err" # save stderr output of WGet and other extern programs called +LOGFILE="$LOGDIR/$SECTION_ID.log" # log file + +# VERBOSE_MODE > 1 delete logfile if exist to create an empty one +# only with this data of this run for easier diagnostic +# new one created by write_log function +[ $VERBOSE_MODE -gt 1 -a -f $LOGFILE ] && rm -f $LOGFILE + +# TRAP handler +trap "trap_handler 0 \$?" 0 # handle script exit with exit status +trap "trap_handler 1" 1 # SIGHUP Hangup / reload config +trap "trap_handler 2" 2 # SIGINT Terminal interrupt +trap "trap_handler 3" 3 # SIGQUIT Terminal quit +# trap "trap_handler 9" 9 # SIGKILL no chance to trap +trap "trap_handler 15" 15 # SIGTERM Termination + +################################################################################ +# Leave this comment here, to clearly document variable names that are expected/possible +# Use load_all_config_options to load config options, which is a much more flexible solution. +# +# config_load "ddns" +# config_get $SECTION_ID