--- /dev/null
+Please make sure that the issue subject starts with `<package-name>: ` so that it's easily identifiable.
+
+This repo here is ONLY for packages maintained in this repo. For base packages residing in the same repo as the build system and maintained by core devs, please consider opening tickets there for more timely responses
+
+ - OpenWrt: https://dev.openwrt.org/newticket
+ - LEDE: https://bugs.lede-project.org/
+ - Most LuCI packages: https://github.com/openwrt/luci/issues
+
+Thanks for your contribution
+Please remove this text (before ---) and fill the following template
+-------------------------------
+
+Maintainer: @<github-user> (find it by checking history of the package Makefile)
+Environment: (put here arch, model, OpenWRT/LEDE version)
+
+Description:
+
+```
+Formating code blocks by wrapping them with pairs of ```
+```
include $(TOPDIR)/rules.mk
PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.81
+PKG_VERSION:=1.0.83
PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=06d2fc8005113da0c74aa4c8ff82d659
+PKG_MD5SUM:=877fe5281a0e424bd6c71d121cbb725b8f56694e66558cd47c20c3aa87ceff72
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=debian/copyright
CATEGORY:=Administration
TITLE:=Bootstrap a basic Debian system
URL:=http://wiki.debian.org/Debootstrap
- DEPENDS:= +coreutils +coreutils-chroot +coreutils-sha1sum +ar
+ DEPENDS:= +coreutils +coreutils-chroot +coreutils-sha1sum +ar +xz
endef
define Package/debootstrap/description
$(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
+ $(CP) $(PKG_BUILD_DIR)/usr/share/debootstrap/scripts/* $(1)/usr/share/debootstrap/scripts
endef
$(eval $(call BuildPackage,debootstrap))
#
-# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=htop
-PKG_VERSION:=2.0.1
+PKG_VERSION:=2.0.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://hisham.hm/htop/releases/$(PKG_VERSION)/
-PKG_MD5SUM:=f75fe92b4defaa80d99109830f34b5e2
+PKG_MD5SUM:=7d354d904bad591a931ad57e99fea84a
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
--- /dev/null
+--- a/configure.ac
++++ b/configure.ac
+@@ -2,7 +2,7 @@
+ # Process this file with autoconf to produce a configure script.
+
+ AC_PREREQ(2.65)
+-LT_PREREQ([2.4.2])
++LT_PREREQ([2.4.0])
+ AC_INIT([htop],[2.0.2],[hisham@gobolinux.org])
+
+ SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
include $(TOPDIR)/rules.mk
PKG_NAME:=netdata
-PKG_VERSION:=20160508-devel
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Sebastian Careba <nitroshift@yahoo.com>
+PKG_VERSION:=1.4.0
+PKG_RELEASE:=2
+PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/firehol/netdata
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=0ec2db444011f5b6ebf41dab45502c27cd544af2
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://firehol.org/download/netdata/releases/v$(PKG_VERSION)
+PKG_SOURCE_VERSION:=3028b87ee19e8550df6b9decc49733d595e0bd6e
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
define Package/netdata
SECTION:=admin
CATEGORY:=Administration
- DEPENDS:=+zlib
+ DEPENDS:=+zlib +libuuid
TITLE:=Real-time performance monitoring tool
URL:=http://netdata.firehol.org/
endef
endef
define Package/netdata/install
- $(INSTALL_DIR) $(1)/etc/netdata
- $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/netdata/apps_groups.conf $(1)/etc/netdata
- $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/netdata/charts.d.conf $(1)/etc/netdata
- $(INSTALL_CONF) ./files/netdata.conf $(1)/etc/netdata
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/netdata.init $(1)/etc/init.d/netdata
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdata $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/usr/share/netdata
- $(INSTALL_DIR) $(1)/usr/lib/netdata
+ mkdir -p $(1)/etc/netdata
+ $(CP) $(PKG_INSTALL_DIR)/etc/netdata $(1)/etc
+ $(CP) ./files/netdata.conf $(1)/etc/netdata
+ mkdir -p $(1)/usr/share/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/share/netdata $(1)/usr/share
+ rm $(1)/usr/share/netdata/web/images/animated.gif
+ rm -rf $(1)/usr/share/netdata/web/old
+ rm $(1)/usr/share/netdata/web/demo*html
+ rm $(1)/usr/share/netdata/web/fonts/*.svg
+ rm $(1)/usr/share/netdata/web/fonts/*.ttf
+ rm $(1)/usr/share/netdata/web/fonts/*.woff
+ rm $(1)/usr/share/netdata/web/fonts/*.otf
+ mkdir -p $(1)/usr/lib/netdata
$(CP) $(PKG_INSTALL_DIR)/usr/lib/netdata $(1)/usr/lib
+ rm $(1)/usr/lib/netdata/python.d/python-modules-installer.sh
+ rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml2
+ rm -rf $(1)/usr/lib/netdata/python.d/python_modules/pyyaml3
chmod 4755 $(1)/usr/lib/netdata/plugins.d/apps.plugin
+ mkdir -p $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/netdata.init $(1)/etc/init.d/netdata
+ mkdir -p $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/netdata $(1)/usr/sbin
endef
$(eval $(call BuildPackage,netdata))
+### NetData Configuration
+
+### Notes about plugins
+###
+### charts.d - REQUIRES Bash, enable here and edit charts.d.conf
+### apps - none atm
+### node.d - REQURIES node.js
+### tc - QoS stats (if wanted)
+### cgcroups - No support in OpenWRT/LEDE by default
+### health - Disabled by default
+### KSM - No support in OpenWRT/LEDE by default
+### python.d - REQUIRES python and PyYAML, edit python.d.conf to enable
+
[global]
run as user = nobody
web files owner = root
apps = no
node.d = no
tc = no
+ cgroups = no
+
+[health]
+ enabled = no
+
+[plugin:proc]
+ /sys/kernel/mm/ksm = no
#!/bin/sh /etc/rc.common
START=99
+USE_PROCD=1
-start() {
- service_start /usr/sbin/netdata
-}
+APPBINARY=/usr/sbin/netdata
+CONFIGFILE=/etc/netdata/netdata.conf
-stop() {
- service_stop /usr/sbin/netdata
-}
+ start_service() {
+ mkdir -m 0755 -p /var/cache/netdata
+ chown nobody /var/cache/netdata
+ mkdir -m 0755 -p /var/lib/netdata
+ chown nobody /var/lib/netdata
+ mkdir -m 0755 -p /var/log/netdata
+ chown nobody /var/log/netdata
+ procd_open_instance
+ procd_set_param command $APPBINARY -nd -c $CONFIGFILE
+ procd_set_param file $CONFIGFILE
+ procd_set_param respawn
+ procd_close_instance
+ }
--- /dev/null
+diff --git a/conf.d/charts.d.conf b/conf.d/charts.d.conf
+index acb2a6f..8111859 100644
+--- a/conf.d/charts.d.conf
++++ b/conf.d/charts.d.conf
+@@ -30,7 +30,7 @@
+
+ # the default enable/disable for all charts.d collectors
+ # the default is "yes"
+-# enable_all_charts="yes"
++enable_all_charts="no"
+
+ # BY DEFAULT ENABLED MODULES
+ # ap=yes
+diff --git a/conf.d/python.d.conf b/conf.d/python.d.conf
+index 940bd91..78e2f0a 100644
+--- a/conf.d/python.d.conf
++++ b/conf.d/python.d.conf
+@@ -7,7 +7,7 @@
+ #
+
+ # Enable / disable the whole python.d.plugin (all its modules)
+-enabled: yes
++enabled: no
+
+ # Prevent log flood
+ # Define how many log messages can be written to log file in one log_interval
endef
define Host/Install
- $(INSTALL_DIR) $(STAGING_DIR)/host/bin
- $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(STAGING_DIR)/host/bin/
+ $(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin
+ $(CP) $(HOST_BUILD_DIR)/lib/util/mksig{list,name} $(HOST_BUILD_PREFIX)/bin/
endef
$(eval $(call HostBuild))
PKG_NAME:=autoconf
PKG_VERSION:=2.69
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=@GNU/autoconf
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=82d05e03b93e45f5a39b828dc9c6c29b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MD5SUM:=50f97f4159805e374639a73e2636f22e
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
include $(INCLUDE_DIR)/package.mk
+CONFIGURE_VARS += M4=m4 EMACS=no
+
define Package/autoconf
SECTION:=devel
CATEGORY:=Development
define Package/autoconf/install
$(INSTALL_DIR) $(1)/usr/bin
- $(SED) 's|$(STAGING_DIR_HOST)|/usr|g' $(PKG_INSTALL_DIR)/usr/bin/autom4te
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/share/autoconf
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/autoconf/INSTALL \
PKG_NAME:=automake
PKG_VERSION:=1.15
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE_URL:=@GNU/automake
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=716946a105ca228ab545fc37a70df3a3
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MD5SUM:=9a1ddb0e053474d9d1105cfe39b0c48d
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
with the GNU Coding Standards.
endef
+FIX_PATHS = $(SED) '1c \#!/usr/bin/perl' -e 's| /[^ ]*/bin/perl| /usr/bin/perl|g'
+
define Package/automake/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/automake-$(PKG_VERSION) \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
$(1)/usr/bin/aclocal-$(PKG_VERSION)
$(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
- $(SED) 's|$(STAGING_DIR_HOST)|/usr|g' \
- $(1)/usr/bin/automake-$(PKG_VERSION)
- $(SED) 's|$(STAGING_DIR_HOST)|/usr|g' \
- $(1)/usr/bin/aclocal-$(PKG_VERSION)
+ $(FIX_PATHS) $(1)/usr/bin/automake-$(PKG_VERSION)
+ $(FIX_PATHS) $(1)/usr/bin/aclocal-$(PKG_VERSION)
$(INSTALL_DIR) $(1)/usr/share/automake-$(PKG_VERSION)
for dir in \
# 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_VERSION:=5.4.0
PKG_RELEASE:=1
PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION)
-
+PKG_MD5SUM:=4c626ac2a83ef30dfb9260e6f59c2b30
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=7c60f24fab389f77af203d2516ee110f
PKG_INSTALL:=1
PKG_FIXUP:=libtool
PKG_BUILD_PARALLEL:=1
# 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
+ NM="$(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)nm" \
+ STRIP="$(STRIP)" \
+ STRIP_KMOD="$(STRIP) --strip-debug" \
+ $(SCRIPT_DIR)/rstrip.sh
define Package/gcc
SECTION:=devel
CATEGORY:=Development
TITLE:=gcc
- MAINTAINER:=Christian Beier <cb@shoutrlabs.com>
+ MAINTAINER:=Noble Pepper <gccmaintain@noblepepper.com>
DEPENDS:= +binutils +libstdcpp
endef
build a native toolchain for compiling on target
endef
+GMPSRC=gmp-4.3.2
+
+define Download/gmp
+ URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
+ FILE:=$(GMPSRC).tar.bz2
+ MD5SUM:=dd60683d7057917e34630b4a787932e8
+endef
+$(eval $(call Download,gmp))
+
+MPCSRC=mpc-0.8.1
+
+define Download/mpc
+ URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
+ FILE:=$(MPCSRC).tar.gz
+ MD5SUM:=5b34aa804d514cc295414a963aedb6bf
+endef
+$(eval $(call Download,mpc))
+
+MPFRSRC=mpfr-2.4.2
+
+define Download/mpfr
+ URL:=ftp://gcc.gnu.org/pub/gcc/infrastructure/
+ FILE:=$(MPFRSRC).tar.bz2
+ MD5SUM:=89e59fe665e2b3ad44a6789f40b059a0
+endef
+$(eval $(call Download,mpfr))
define Build/Prepare
$(PKG_UNPACK)
-# we have to download additional stuff before patching
- (cd $(PKG_BUILD_DIR) && ./contrib/download_prerequisites)
+# we have to download and unpack additional stuff before patching
+ tar -C $(PKG_BUILD_DIR) -xvjf $(DL_DIR)/$(GMPSRC).tar.bz2
+ ln -sf $(PKG_BUILD_DIR)/$(GMPSRC) $(PKG_BUILD_DIR)/gmp
+ tar -C $(PKG_BUILD_DIR) -xvzf $(DL_DIR)/$(MPCSRC).tar.gz
+ ln -sf $(PKG_BUILD_DIR)/$(MPCSRC) $(PKG_BUILD_DIR)/mpc
+ tar -C $(PKG_BUILD_DIR) -xvjf $(DL_DIR)/$(MPFRSRC).tar.bz2
+ ln -sf $(PKG_BUILD_DIR)/$(MPFRSRC) $(PKG_BUILD_DIR)/mpfr
$(Build/Patch)
# poor man's fix for `none-openwrt-linux' not recognized when building with musl
cp $(PKG_BUILD_DIR)/config.sub $(PKG_BUILD_DIR)/mpfr/
--with-bugurl=$(BUGURL) \
--with-pkgversion="$(PKGVERSION)" \
--enable-shared \
- --disable-__cxa_atexit \
+ $(if $(CONFIG_LIBC_USE_GLIBC),--enable,--disable)-__cxa_atexit \
+ --with-default-libstdcxx-abi=gcc4-compatible \
--enable-target-optspace \
--with-gnu-ld \
--disable-nls \
+ --disable-libsanitizer \
+ --disable-libvtv \
+ --disable-libcilkrts \
--disable-libmudflap \
--disable-multilib \
--disable-libgomp \
--with-host-libstdcxx=-lstdc++ \
--prefix=/usr \
--libexecdir=/usr/lib \
+ --with-local-prefix=/usr \
$(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
DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
endef
+ENVCFLAGS:="$(TARGET_OPTIMIZATION) $(EXTRA_OPTIMIZATION)
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+ ifeq ($(CONFIG_arm),y)
+ ENVCFLAGS+= -mfloat-abi=soft
+ else
+ ENVCFLAGS+= -msoft-float
+ endif
+endif
+ENVCFLAGS+="
+
+ENVLDFLAGS:="-Wl,-rpath=/usr/lib -Wl,--dynamic-linker=/usr/lib/$(DYNLINKER) -L/usr/lib"
+
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
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 -ar $(TOOLCHAIN_DIR)/include $(1)/usr
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
+ cp -a $(TOOLCHAIN_DIR)/lib/libm.a $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
+ rm -f $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libgo*
+ rm -f $(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/libcc1*
+ echo '#!/bin/sh' > $(1)/usr/bin/gcc_env.sh
+ echo 'export LDFLAGS=$(ENVLDFLAGS)' >> $(1)/usr/bin/gcc_env.sh
+ echo 'export CFLAGS=$(ENVCFLAGS)' >> $(1)/usr/bin/gcc_env.sh
+ chmod +x $(1)/usr/bin/gcc_env.sh
endef
$(eval $(call BuildPackage,gcc))
--- /dev/null
+Revert of:
+
+commit 275035b56823b26d5fb7e90fad945b998648edf2
+Author: bergner <bergner@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu Sep 5 14:09:07 2013 +0000
+
+ PR target/58139
+ * reginfo.c (choose_hard_reg_mode): Scan through all mode classes
+ looking for widest mode.
+
+
+ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4
+
+
+--- a/gcc/reginfo.c
++++ b/gcc/reginfo.c
+@@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
++ if (found_mode != VOIDmode)
++ return found_mode;
++
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
++ if (found_mode != VOIDmode)
++ return found_mode;
++
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
++ if (found_mode != VOIDmode)
++ return found_mode;
++
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
+ mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if ((unsigned) hard_regno_nregs[regno][mode] == nregs
+ && HARD_REGNO_MODE_OK (regno, mode)
+- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))
+- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode))
++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
+ found_mode = mode;
+
+ if (found_mode != VOIDmode)
--- /dev/null
+--- a/include/filenames.h
++++ b/include/filenames.h
+@@ -43,11 +43,6 @@ extern "C" {
+ # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
+ # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
+ #else /* not DOSish */
+-# if defined(__APPLE__)
+-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
+-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
+-# endif
+-# endif /* __APPLE__ */
+ # define HAS_DRIVE_SPEC(f) (0)
+ # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
+ # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
-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 {
+@@ -75,9 +75,10 @@
+ (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];
+ [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
+ as many as four (32-bit HOST_WIDE_INT, 128-bit REAL_VALUE_TYPE).
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
-@@ -4326,18 +4326,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
+@@ -2941,18 +2941,10 @@ doc/gcc.info: $(TEXI_GCC_FILES)
doc/gccint.info: $(TEXI_GCCINT_FILES)
doc/cppinternals.info: $(TEXI_CPPINT_FILES)
+++ /dev/null
-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 <sys/sdt.h> 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 <sys/sdt.h> 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
--- /dev/null
+--- a/gcc/calls.c
++++ b/gcc/calls.c
+@@ -225,6 +225,12 @@ prepare_call_address (tree fndecl_or_typ
+ && targetm.small_register_classes_for_mode_p (FUNCTION_MODE))
+ ? force_not_mem (memory_address (FUNCTION_MODE, funexp))
+ : memory_address (FUNCTION_MODE, funexp));
++ else if (flag_pic && !flag_plt && fndecl_or_type
++ && TREE_CODE (fndecl_or_type) == FUNCTION_DECL
++ && !targetm.binds_local_p (fndecl_or_type))
++ {
++ funexp = force_reg (Pmode, funexp);
++ }
+ else if (! sibcallp)
+ {
+ #ifndef NO_FUNCTION_CSE
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -1779,6 +1779,10 @@ fpie
+ Common Report Var(flag_pie,1) Negative(fPIC)
+ Generate position-independent code for executables if possible (small mode)
+
++fplt
++Common Report Var(flag_plt) Init(1)
++Use PLT for PIC calls (-fno-plt: load the address from GOT at call site)
++
+ fplugin=
+ Common Joined RejectNegative Var(common_deferred_options) Defer
+ Specify a plugin to load
--- /dev/null
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -8001,9 +8001,17 @@ mask_low_and_shift_p (machine_mode mode,
+ bool
+ and_operands_ok (machine_mode mode, rtx op1, rtx op2)
+ {
+- return (memory_operand (op1, mode)
+- ? and_load_operand (op2, mode)
+- : and_reg_operand (op2, mode));
++ if (!memory_operand (op1, mode))
++ return and_reg_operand (op2, mode);
++
++ if (!and_load_operand (op2, mode))
++ return false;
++
++ if (!TARGET_MIPS16 || si_mask_operand(op2, mode))
++ return true;
++
++ op1 = XEXP (op1, 0);
++ return !(REG_P (op1) && REGNO (op1) == STACK_POINTER_REGNUM);
+ }
+
+ /* The canonical form of a mask-low-and-shift-left operation is
+++ /dev/null
---- a/gcc/config.gcc
-+++ b/gcc/config.gcc
-@@ -549,7 +549,7 @@ case ${target} in
- esac
-
- # Common C libraries.
--tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
-+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
-
- # Common parts for widely ported systems.
- case ${target} in
-@@ -652,6 +652,9 @@ case ${target} in
- *-*-*uclibc*)
- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
- ;;
-+ *-*-*musl*)
-+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
-+ ;;
- *)
- tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
- ;;
---- a/gcc/config/arm/linux-eabi.h
-+++ b/gcc/config/arm/linux-eabi.h
-@@ -77,6 +77,10 @@
- %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
- %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
-
-+/* musl has no "classic" (i.e. broken) mode */
-+#undef MUSL_DYNAMIC_LINKER
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-arm.so.1"
-+
- /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
- use the GNU/Linux version, not the generic BPABI version. */
- #undef LINK_SPEC
---- a/gcc/config/i386/linux.h
-+++ b/gcc/config/i386/linux.h
-@@ -21,3 +21,4 @@ along with GCC; see the file COPYING3.
-
- #define GNU_USER_LINK_EMULATION "elf_i386"
- #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
---- a/gcc/config/i386/linux64.h
-+++ b/gcc/config/i386/linux64.h
-@@ -30,3 +30,7 @@ see the files COPYING3 and COPYING.RUNTI
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
- #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
- #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
-+
-+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
-+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
-+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
---- a/gcc/config/linux.h
-+++ b/gcc/config/linux.h
-@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI
- #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
- #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
- #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
-+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL)
- #else
- #define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
- #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
- #define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
-+#define OPTION_MUSL (linux_libc == LIBC_MUSL)
- #endif
-
- #define GNU_USER_TARGET_OS_CPP_BUILTINS() \
-@@ -53,18 +55,21 @@ see the files COPYING3 and COPYING.RUNTI
- uClibc or Bionic is the default C library and whether
- -muclibc or -mglibc or -mbionic has been passed to change the default. */
-
--#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
-- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
-+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \
-+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
-
- #if DEFAULT_LIBC == LIBC_GLIBC
--#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
-- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
-+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
-+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
- #elif DEFAULT_LIBC == LIBC_UCLIBC
--#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
-- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
-+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
-+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
- #elif DEFAULT_LIBC == LIBC_BIONIC
--#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
-- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
-+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
-+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
-+#elif DEFAULT_LIBC == LIBC_MUSL
-+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
-+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
- #else
- #error "Unsupported DEFAULT_LIBC"
- #endif /* DEFAULT_LIBC */
-@@ -84,16 +89,16 @@ see the files COPYING3 and COPYING.RUNTI
-
- #define GNU_USER_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
-- BIONIC_DYNAMIC_LINKER)
-+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
- #define GNU_USER_DYNAMIC_LINKER32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
-- BIONIC_DYNAMIC_LINKER32)
-+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
- #define GNU_USER_DYNAMIC_LINKER64 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
-- BIONIC_DYNAMIC_LINKER64)
-+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
- #define GNU_USER_DYNAMIC_LINKERX32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
-- BIONIC_DYNAMIC_LINKERX32)
-+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
-
- /* Determine whether the entire c99 runtime
- is present in the runtime library. */
---- a/gcc/config/linux.opt
-+++ b/gcc/config/linux.opt
-@@ -30,3 +30,7 @@ Use GNU C library
- muclibc
- Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
- Use uClibc C library
-+
-+mmusl
-+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
-+Use musl C library
---- a/gcc/config/mips/linux.h
-+++ b/gcc/config/mips/linux.h
-@@ -18,3 +18,5 @@ along with GCC; see the file COPYING3.
- <http://www.gnu.org/licenses/>. */
-
- #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
-+
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips.so.1"
---- a/gcc/config/rs6000/linux64.h
-+++ b/gcc/config/rs6000/linux64.h
-@@ -364,17 +364,21 @@ extern int dot_symbols;
- #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
- #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
- #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
-+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
-+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
- #if DEFAULT_LIBC == LIBC_UCLIBC
--#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
-+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
- #elif DEFAULT_LIBC == LIBC_GLIBC
--#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
-+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
-+#elif DEFAULT_LIBC == LIBC_MUSL
-+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
- #else
- #error "Unsupported DEFAULT_LIBC"
- #endif
- #define GNU_USER_DYNAMIC_LINKER32 \
-- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
-+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
- #define GNU_USER_DYNAMIC_LINKER64 \
-- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
-+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
-
-
- #define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
---- a/gcc/config/rs6000/sysv4.h
-+++ b/gcc/config/rs6000/sysv4.h
-@@ -789,15 +789,18 @@ extern int fixuplabelno;
-
- #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
- #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
- #if DEFAULT_LIBC == LIBC_UCLIBC
--#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
-+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
-+#elif DEFAULT_LIBC == LIBC_MUSL
-+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
- #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
--#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
-+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
- #else
- #error "Unsupported DEFAULT_LIBC"
- #endif
- #define GNU_USER_DYNAMIC_LINKER \
-- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
-+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
-
- #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
- %{rdynamic:-export-dynamic} \
---- a/gcc/ginclude/stddef.h
-+++ b/gcc/ginclude/stddef.h
-@@ -181,6 +181,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
- #ifndef _GCC_SIZE_T
- #ifndef _SIZET_
- #ifndef __size_t
-+#ifndef __DEFINED_size_t /* musl */
- #define __size_t__ /* BeOS */
- #define __SIZE_T__ /* Cray Unicos/Mk */
- #define _SIZE_T
-@@ -197,6 +198,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
- #define ___int_size_t_h
- #define _GCC_SIZE_T
- #define _SIZET_
-+#define __DEFINED_size_t /* musl */
- #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
- || defined(__FreeBSD_kernel__)
- /* __size_t is a typedef on FreeBSD 5, must not trash it. */
-@@ -214,6 +216,7 @@ typedef __SIZE_TYPE__ size_t;
- typedef long ssize_t;
- #endif /* __BEOS__ */
- #endif /* !(defined (__GNUG__) && defined (size_t)) */
-+#endif /* __DEFINED_size_t */
- #endif /* __size_t */
- #endif /* _SIZET_ */
- #endif /* _GCC_SIZE_T */
---- a/libgomp/config/posix/time.c
-+++ b/libgomp/config/posix/time.c
-@@ -28,6 +28,8 @@
- The following implementation uses the most simple POSIX routines.
- If present, POSIX 4 clocks should be used instead. */
-
-+#define _POSIX_C_SOURCE 199309L /* for clocks */
-+
- #include "libgomp.h"
- #include <unistd.h>
- #if TIME_WITH_SYS_TIME
---- a/libitm/config/arm/hwcap.cc
-+++ b/libitm/config/arm/hwcap.cc
-@@ -40,7 +40,11 @@ int GTM_hwcap HIDDEN = 0
-
- #ifdef __linux__
- #include <unistd.h>
-+#ifdef __GLIBC__
- #include <sys/fcntl.h>
-+#else
-+#include <fcntl.h>
-+#endif
- #include <elf.h>
-
- static void __attribute__((constructor))
---- a/libitm/config/linux/x86/tls.h
-+++ b/libitm/config/linux/x86/tls.h
-@@ -25,16 +25,19 @@
- #ifndef LIBITM_X86_TLS_H
- #define LIBITM_X86_TLS_H 1
-
--#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
-+#if defined(__GLIBC_PREREQ)
-+#if __GLIBC_PREREQ(2, 10)
- /* Use slots in the TCB head rather than __thread lookups.
- GLIBC has reserved words 10 through 13 for TM. */
- #define HAVE_ARCH_GTM_THREAD 1
- #define HAVE_ARCH_GTM_THREAD_DISP 1
- #endif
-+#endif
-
- #include "config/generic/tls.h"
-
--#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
-+#if defined(__GLIBC_PREREQ)
-+#if __GLIBC_PREREQ(2, 10)
- namespace GTM HIDDEN {
-
- #ifdef __x86_64__
-@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
-
- } // namespace GTM
- #endif /* >= GLIBC 2.10 */
-+#endif
-
- #endif // LIBITM_X86_TLS_H
---- a/libstdc++-v3/configure.host
-+++ b/libstdc++-v3/configure.host
-@@ -264,6 +264,13 @@ case "${host_os}" in
- os_include_dir="os/bsd/freebsd"
- ;;
- gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
-+ # check for musl by target
-+ case "${host_os}" in
-+ *-musl*)
-+ os_include_dir="os/generic"
-+ ;;
-+ *)
-+
- if [ "$uclibc" = "yes" ]; then
- os_include_dir="os/uclibc"
- elif [ "$bionic" = "yes" ]; then
-@@ -272,6 +279,9 @@ case "${host_os}" in
- os_include_dir="os/gnu-linux"
- fi
- ;;
-+
-+ esac
-+ ;;
- hpux*)
- os_include_dir="os/hpux"
- ;;
---- a/gcc/config/mips/linux64.h
-+++ b/gcc/config/mips/linux64.h
-@@ -27,6 +27,9 @@ along with GCC; see the file COPYING3.
- #define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
- #define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
- #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
-+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mips.so.1"
-+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips.so.1"
-+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips.so.1"
- #define GNU_USER_DYNAMIC_LINKERN32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
-- BIONIC_DYNAMIC_LINKERN32)
-+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
---- a/gcc/config/sparc/linux64.h 2013-09-10 10:02:45.663973856 +0100
-+++ b/gcc/config/sparc/linux64.h 2013-09-10 10:03:17.871972435 +0100
-@@ -104,6 +104,9 @@
- #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
- #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
-
-+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-sparc.so.1"
-+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-sparc.so.1"
-+
- #ifdef SPARC_BI_ARCH
-
- #undef SUBTARGET_EXTRA_SPECS
-
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 8 May 2015 08:25:47 +0000 (+0000)
+Subject: [PATCH 2/13] musl libc config
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29c16f8ef226fbf98af373a4b2ceb
+
+[PATCH 2/13] musl libc config
+
+2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config.gcc (LIBC_MUSL): New tm_defines macro.
+ * config/linux.h (OPTION_MUSL): Define.
+ (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER32,)
+ (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32,)
+ (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,)
+ (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,)
+ (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define.
+ * config/linux.opt (mmusl): New option.
+ * doc/invoke.texi (GNU/Linux Options): Document -mmusl.
+ * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*.
+ (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*.
+ * configure: Regenerate.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -575,7 +575,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"
+
+ # 32-bit x86 processors supported by --with-arch=. Each processor
+ # MUST be separated by exactly one space.
+@@ -720,6 +720,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/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() \
+@@ -50,21 +52,25 @@ see the files COPYING3 and COPYING.RUNTI
+ } while (0)
+
+ /* 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. */
++ uClibc or Bionic or musl is the default C library and whether
++ -muclibc or -mglibc or -mbionic or -mmusl 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 */
+@@ -81,24 +87,100 @@ see the files COPYING3 and COPYING.RUNTI
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+ #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32"
++/* Should be redefined for each target that supports musl. */
++#define MUSL_DYNAMIC_LINKER "/dev/null"
++#define MUSL_DYNAMIC_LINKER32 "/dev/null"
++#define MUSL_DYNAMIC_LINKER64 "/dev/null"
++#define MUSL_DYNAMIC_LINKERX32 "/dev/null"
+
+ #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)
+
+ /* Whether we have Bionic libc runtime */
+ #undef TARGET_HAS_BIONIC
+ #define TARGET_HAS_BIONIC (OPTION_BIONIC)
+
++/* musl avoids problematic includes by rearranging the include directories.
++ * Unfortunately, this is mostly duplicated from cppdefault.c */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
++
+ #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
+ /* This is a *uclinux* target. We don't define below macros to normal linux
+ versions, because doing so would require *uclinux* targets to include
+--- a/gcc/config/linux.opt
++++ b/gcc/config/linux.opt
+@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_l
+ Use GNU C library
+
+ muclibc
+-Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
++Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl)
+ Use uClibc C library
++
++mmusl
++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic)
++Use musl C library
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27833,6 +27833,9 @@ if test "${gcc_cv_libc_provides_ssp+set}
+ else
+ gcc_cv_libc_provides_ssp=no
+ case "$target" in
++ *-*-musl*)
++ # All versions of musl provide stack protector
++ gcc_cv_libc_provides_ssp=yes;;
+ *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ # glibc 2.4 and later provides __stack_chk_fail and
+ # either __stack_chk_guard, or TLS access to stack guard canary.
+@@ -27865,6 +27868,7 @@ fi
+ # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
+ # simply assert that glibc does provide this, which is true for all
+ # realistically usable GNU/Hurd configurations.
++ # All supported versions of musl provide it as well
+ gcc_cv_libc_provides_ssp=yes;;
+ *-*-darwin* | *-*-freebsd*)
+ ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
+@@ -27961,6 +27965,9 @@ case "$target" in
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5287,6 +5287,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
+ gcc_cv_libc_provides_ssp,
+ [gcc_cv_libc_provides_ssp=no
+ case "$target" in
++ *-*-musl*)
++ # All versions of musl provide stack protector
++ gcc_cv_libc_provides_ssp=yes;;
+ *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
+ # glibc 2.4 and later provides __stack_chk_fail and
+ # either __stack_chk_guard, or TLS access to stack guard canary.
+@@ -5313,6 +5316,7 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
+ # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
+ # simply assert that glibc does provide this, which is true for all
+ # realistically usable GNU/Hurd configurations.
++ # All supported versions of musl provide it as well
+ gcc_cv_libc_provides_ssp=yes;;
+ *-*-darwin* | *-*-freebsd*)
+ AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
+@@ -5386,6 +5390,9 @@ case "$target" in
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
++ *-linux-musl*)
++ gcc_cv_target_dl_iterate_phdr=yes
++ ;;
+ esac
+ GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
+ if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -667,7 +667,7 @@ Objective-C and Objective-C++ Dialects}.
+ -mcpu=@var{cpu}}
+
+ @emph{GNU/Linux Options}
+-@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol
++@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
+ -tno-android-cc -tno-android-ld}
+
+ @emph{H8/300 Options}
+@@ -15340,13 +15340,19 @@ These @samp{-m} options are defined for
+ @item -mglibc
+ @opindex mglibc
+ Use the GNU C library. This is the default except
+-on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets.
++on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
++@samp{*-*-linux-*android*} targets.
+
+ @item -muclibc
+ @opindex muclibc
+ Use uClibc C library. This is the default on
+ @samp{*-*-linux-*uclibc*} targets.
+
++@item -mmusl
++@opindex mmusl
++Use the musl C library. This is the default on
++@samp{*-*-linux-*musl*} targets.
++
+ @item -mbionic
+ @opindex mbionic
+ Use Bionic C library. This is the default on
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 27 May 2015 13:17:11 +0000 (+0000)
+Subject: [PATCH 4/13] arm musl support
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=de799bd087ab9a179768fea75bd195a31d3432a4
+
+[PATCH 4/13] arm musl support
+
+On behalf of szabolcs.nagy@arm.com
+
+2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca>
+
+ * config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,6 +77,23 @@
+ %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+ %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+
++/* For ARM musl currently supports four dynamic linkers:
++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
++ musl does not support the legacy OABI mode.
++ All the dynamic linkers live in /lib.
++ We default to soft-float, EL. */
++#undef MUSL_DYNAMIC_LINKER
++#if TARGET_BIG_ENDIAN_DEFAULT
++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
++#endif
++#define MUSL_DYNAMIC_LINKER \
++ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.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
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 8 May 2015 15:16:50 +0000 (+0000)
+Subject: [PATCH 6/13] mips musl support
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c887472b587bef87d433c51cf1ebc8
+
+[PATCH 6/13] mips musl support
+
+2015-05-08 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/mips/linux.h (MUSL_DYNAMIC_LINKER32): Define.
+ (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERN32): Define.
+ (GNU_USER_DYNAMIC_LINKERN32): Update.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3.
+ #define UCLIBC_DYNAMIC_LINKERN32 \
+ "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
+
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1"
++#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1"
++
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+- BIONIC_DYNAMIC_LINKERN32)
++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32)
--- /dev/null
+
+gcc/Changelog:
+
+2015-04-24 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config.gcc (secure_plt): Add *-linux*-musl*.
+ * config/rs6000/linux64.h (MUSL_DYNAMIC_LINKER32): Define.
+ (MUSL_DYNAMIC_LINKER64): Define.
+ (GNU_USER_DYNAMIC_LINKER32): Update.
+ (GNU_USER_DYNAMIC_LINKER64): Update.
+ (CHOOSE_DYNAMIC_LINKER): Update.
+
+ * config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define.
+ * config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Update.
+ (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER_E,)
+ (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,)
+ (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,)
+ (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define.
+ (LINK_SECURE_PLT_DEFAULT_SPEC): Define.
+ (CHOOSE_DYNAMIC_LINKER, LINK_TARGET_SPEC, LINK_OS_LINUX_SPEC): Update.
+
+ * config/rs6000/sysv4le.h (MUSL_DYNAMIC_LINKER_E): Define.
+
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -365,17 +365,21 @@ extern int dot_symbols;
+ #endif
+ #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" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".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)
+
+ #undef DEFAULT_ASM_ENDIAN
+ #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN)
+--- a/gcc/config/rs6000/secureplt.h
++++ b/gcc/config/rs6000/secureplt.h
+@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3.
+ <http://www.gnu.org/licenses/>. */
+
+ #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
+ #ifndef CC1_SECURE_PLT_DEFAULT_SPEC
+ #define CC1_SECURE_PLT_DEFAULT_SPEC ""
+ #endif
++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
++#define LINK_SECURE_PLT_DEFAULT_SPEC ""
++#endif
+
+ /* Pass -G xxx to the compiler. */
+ #undef CC1_SPEC
+@@ -574,7 +577,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
+ %{R*} \
+ %(link_shlib) \
+ %{!T*: %(link_start) } \
+-%(link_os)"
++%(link_os)" \
++"%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
+
+ /* Shared libraries are not default. */
+ #define LINK_SHLIB_SPEC "\
+@@ -757,17 +761,22 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
+
+ #define LINK_START_LINUX_SPEC ""
+
++#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","")
++
+ #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" MUSL_DYNAMIC_LINKER_E ".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} \
+@@ -889,6 +898,7 @@ ncrtn.o%s"
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
+ { "link_os_default", LINK_OS_DEFAULT_SPEC }, \
+ { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \
++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \
+ { "cpp_os_ads", CPP_OS_ADS_SPEC }, \
+ { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \
+ { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \
+@@ -943,3 +953,72 @@ ncrtn.o%s"
+ /* This target uses the sysv4.opt file. */
+ #define TARGET_USES_SYSV4_OPT 1
+
++/* Include order changes for musl, same as in generic linux.h. */
++#if DEFAULT_LIBC == LIBC_MUSL
++#define INCLUDE_DEFAULTS_MUSL_GPP \
++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \
++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \
++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \
++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
++
++#ifdef LOCAL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_LOCAL \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \
++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_LOCAL
++#endif
++
++#ifdef PREFIX_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_PREFIX \
++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_PREFIX
++#endif
++
++#ifdef CROSS_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_CROSS \
++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#ifdef TOOL_INCLUDE_DIR
++#define INCLUDE_DEFAULTS_MUSL_TOOL \
++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
++#else
++#define INCLUDE_DEFAULTS_MUSL_TOOL
++#endif
++
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++#define INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \
++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
++#else
++#define INCLUDE_DEFAULTS_MUSL_NATIVE
++#endif
++
++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
++# undef INCLUDE_DEFAULTS_MUSL_LOCAL
++# define INCLUDE_DEFAULTS_MUSL_LOCAL
++# undef INCLUDE_DEFAULTS_MUSL_NATIVE
++# define INCLUDE_DEFAULTS_MUSL_NATIVE
++#else
++# undef INCLUDE_DEFAULTS_MUSL_CROSS
++# define INCLUDE_DEFAULTS_MUSL_CROSS
++#endif
++
++#undef INCLUDE_DEFAULTS
++#define INCLUDE_DEFAULTS \
++ { \
++ INCLUDE_DEFAULTS_MUSL_GPP \
++ INCLUDE_DEFAULTS_MUSL_PREFIX \
++ INCLUDE_DEFAULTS_MUSL_CROSS \
++ INCLUDE_DEFAULTS_MUSL_TOOL \
++ INCLUDE_DEFAULTS_MUSL_NATIVE \
++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \
++ { 0, 0, 0, 0, 0, 0 } \
++ }
++#endif
+--- a/gcc/config/rs6000/sysv4le.h
++++ b/gcc/config/rs6000/sysv4le.h
+@@ -31,3 +31,5 @@
+ /* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */
+ #define LINUX64_DEFAULT_ABI_ELFv2
+
++#undef MUSL_DYNAMIC_LINKER_E
++#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le")
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2416,6 +2416,10 @@ powerpc*-*-linux*)
+ powerpc*-*-linux*paired*)
+ tm_file="${tm_file} rs6000/750cl.h" ;;
+ esac
++ case ${target} in
++ *-linux*-musl*)
++ enable_secureplt=yes ;;
++ esac
+ if test x${enable_secureplt} = xyes; then
+ tm_file="rs6000/secureplt.h ${tm_file}"
+ fi
--- /dev/null
+gcc/Changelog:
+
+2015-04-27 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define.
+ (MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define.
+
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,6 +43,28 @@ along with GCC; see the file COPYING3.
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
++#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN
++#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}"
++#else
++#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}"
++#endif
++
++#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 )
++/* "-nofpu" if any nofpu option is specified */
++#define MUSL_DYNAMIC_LINKER_FP \
++ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \
++ "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \
++ "m5-compact-nofpu:-nofpu}"
++#else
++/* "-nofpu" if none of the hard fpu options are specified */
++#define MUSL_DYNAMIC_LINKER_FP \
++ "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}"
++#endif
++
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER \
++ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1"
++
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 15 May 2015 13:20:01 +0000 (+0000)
+Subject: [PATCH 9/13] x86 musl support
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=5551c8d927c17f60837f15f8dfe46f945ba3fa9c
+
+[PATCH 9/13] x86 musl support
+
+On behalf of Szabolcs Nagy.
+
+2015-05-15 Gregor Richards <gregor.richards@uwaterloo.ca>
+
+ * config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define.
+ * config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define.
+ (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3.
+
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++
++#undef MUSL_DYNAMIC_LINKER
++#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,10 @@ 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"
++
++#undef MUSL_DYNAMIC_LINKER32
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
++#undef MUSL_DYNAMIC_LINKER64
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
++#undef MUSL_DYNAMIC_LINKERX32
++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
--- /dev/null
+From: jgreenhalgh <jgreenhalgh@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 27 May 2015 16:46:39 +0000 (+0000)
+Subject: [PATCH 3/13] aarch64 musl support
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=b3ff21cf0531be91bc3fb8200296a7633090ec78
+
+[PATCH 3/13] aarch64 musl support
+
+gcc/Changelog:
+
+2015-05-27 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/aarch64/aarch64-linux.h (MUSL_DYNAMIC_LINKER): Define.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -23,6 +23,9 @@
+
+ #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+
++#undef MUSL_DYNAMIC_LINKER
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++
+ #undef ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Apr 2015 14:18:16 +0000 (+0000)
+Subject: fixincludes update for musl support
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2dc727de2e87c2756a514cbb43cea23c99deaa3d
+
+fixincludes update for musl support
+
+On behalf of Szabolcs.Nagy@arm.com
+
+2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
+
+ * mkfixinc.sh: Add *-musl* with no fixes.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/fixincludes/mkfixinc.sh
++++ b/fixincludes/mkfixinc.sh
+@@ -19,7 +19,8 @@ case $machine in
+ powerpc-*-eabi* | \
+ powerpc-*-rtems* | \
+ powerpcle-*-eabisim* | \
+- powerpcle-*-eabi* )
++ powerpcle-*-eabi* | \
++ *-musl* )
+ # IF there is no include fixing,
+ # THEN create a no-op fixer and exit
+ (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000)
+Subject: libstdc++, libgfortran gthr workaround for musl
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61
+
+libstdc++, libgfortran gthr workaround for musl
+
+On behalf of szabolcs.nagy@arm.com
+
+[libstdc++-v3/]
+2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define.
+ * configure.host (os_include_dir): Set to "os/generic" for linux-musl*.
+
+[libgfortran/]
+2015-04-22 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*.
+ * configure: Regenerate.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/libgfortran/acinclude.m4
++++ b/libgfortran/acinclude.m4
+@@ -100,7 +100,7 @@ void foo (void);
+ [Define to 1 if the target supports #pragma weak])
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
+ AC_DEFINE(GTHREAD_USE_WEAK, 0,
+ [Define to 0 if the target shouldn't use #pragma weak])
+ ;;
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con
+
+ fi
+ case "$host" in
+- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* )
++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* )
+
+ $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h
+
+--- a/libstdc++-v3/config/os/generic/os_defines.h
++++ b/libstdc++-v3/config/os/generic/os_defines.h
+@@ -33,4 +33,9 @@
+ // System-specific #define, typedefs, corrections, etc, go here. This
+ // file will come before all others.
+
++// Disable the weak reference logic in gthr.h for os/generic because it
++// is broken on every platform unless there is implementation specific
++// workaround in gthr-posix.h and at link-time for static linking.
++#define _GLIBCXX_GTHREAD_USE_WEAK 0
++
+ #endif
+--- a/libstdc++-v3/configure.host
++++ b/libstdc++-v3/configure.host
+@@ -273,6 +273,9 @@ case "${host_os}" in
+ freebsd*)
+ os_include_dir="os/bsd/freebsd"
+ ;;
++ linux-musl*)
++ os_include_dir="os/generic"
++ ;;
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
+ if [ "$uclibc" = "yes" ]; then
+ os_include_dir="os/uclibc"
--- /dev/null
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -727,7 +727,9 @@ proper position among the other output f
+ #endif
+
+ #ifndef LINK_SSP_SPEC
+-#ifdef TARGET_LIBC_PROVIDES_SSP
++#if DEFAULT_LIBC == LIBC_MUSL
++#define LINK_SSP_SPEC "-lssp_nonshared"
++#elif defined(TARGET_LIBC_PROVIDES_SSP)
+ #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
+ "|fstack-protector-strong|fstack-protector-explicit:}"
+ #else
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Apr 2015 14:11:25 +0000 (+0000)
+Subject: libitm fixes for musl support
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=e53a4d49c3d03ab8eaddb073cf972c1c46d75338
+
+libitm fixes for musl support
+
+On behalf of Szabolcs.Nagy@arm.com
+
+2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
+
+ * config/arm/hwcap.cc: Use fcntl.h instead of sys/fcntl.h.
+ * config/linux/x86/tls.h: Only use __GLIBC_PREREQ if defined.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222325 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/libitm/config/arm/hwcap.cc
++++ b/libitm/config/arm/hwcap.cc
+@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0
+
+ #ifdef __linux__
+ #include <unistd.h>
+-#include <sys/fcntl.h>
++#include <fcntl.h>
+ #include <elf.h>
+
+ static void __attribute__((constructor))
+--- a/libitm/config/linux/x86/tls.h
++++ b/libitm/config/linux/x86/tls.h
+@@ -25,16 +25,19 @@
+ #ifndef LIBITM_X86_TLS_H
+ #define LIBITM_X86_TLS_H 1
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ /* Use slots in the TCB head rather than __thread lookups.
+ GLIBC has reserved words 10 through 13 for TM. */
+ #define HAVE_ARCH_GTM_THREAD 1
+ #define HAVE_ARCH_GTM_THREAD_DISP 1
+ #endif
++#endif
+
+ #include "config/generic/tls.h"
+
+-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
++#if defined(__GLIBC_PREREQ)
++#if __GLIBC_PREREQ(2, 10)
+ namespace GTM HIDDEN {
+
+ #ifdef __x86_64__
+@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a
+
+ } // namespace GTM
+ #endif /* >= GLIBC 2.10 */
++#endif
+
+ #endif // LIBITM_X86_TLS_H
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 8 May 2015 08:30:40 +0000 (+0000)
+Subject: [PATCH 0/13] Add musl support to GCC
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b8385d763b93772d73d6bf80a9739e
+
+[PATCH 0/13] Add musl support to GCC
+
+2015-05-08 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/glibc-stdint.h (OPTION_MUSL): Define.
+ (INT_FAST16_TYPE, INT_FAST32_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE):
+ Change the definition based on OPTION_MUSL for 64 bit targets.
+ * config/linux.h (OPTION_MUSL): Redefine.
+ * config/alpha/linux.h (OPTION_MUSL): Redefine.
+ * config/rs6000/linux.h (OPTION_MUSL): Redefine.
+ * config/rs6000/linux64.h (OPTION_MUSL): Redefine.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/gcc/config/alpha/linux.h
++++ b/gcc/config/alpha/linux.h
+@@ -61,10 +61,14 @@ along with GCC; see the file COPYING3.
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#undef OPTION_MUSL
++#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)
++#undef OPTION_MUSL
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ /* Determine what functions are present at the runtime;
+--- a/gcc/config/glibc-stdint.h
++++ b/gcc/config/glibc-stdint.h
+@@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Except
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
++/* Systems using musl libc should use this header and make sure
++ OPTION_MUSL is defined correctly before using the TYPE macros. */
++#ifndef OPTION_MUSL
++#define OPTION_MUSL 0
++#endif
++
+ #define SIG_ATOMIC_TYPE "int"
+
+ #define INT8_TYPE "signed char"
+@@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTI
+ #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
+
+ #define INT_FAST8_TYPE "signed char"
+-#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
+-#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
++#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
++#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int")
+ #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int")
+ #define UINT_FAST8_TYPE "unsigned char"
+-#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
+-#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int")
++#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
++#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int")
+ #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int")
+
+ #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int")
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -32,11 +32,13 @@ 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)
++#undef OPTION_MUSL
+ #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)
++#undef OPTION_MUSL
+ #define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -30,10 +30,14 @@
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#undef OPTION_MUSL
++#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)
++#undef OPTION_MUSL
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ /* Determine what functions are present at the runtime;
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -299,10 +299,14 @@ extern int dot_symbols;
+ #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC)
+ #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
+ #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
++#undef OPTION_MUSL
++#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)
++#undef OPTION_MUSL
++#define OPTION_MUSL (linux_libc == LIBC_MUSL)
+ #endif
+
+ /* Determine what functions are present at the runtime;
--- /dev/null
+From: ktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 22 Apr 2015 14:20:01 +0000 (+0000)
+Subject: unwind fix for musl
+X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a2e31d0681d8a47389b8a3552622fbd9827bcef4
+
+unwind fix for musl
+
+On behalf of szabolcs.nagy@arm.com
+
+2015-04-22 Gregor Richards <gregor.richards@uwaterloo.ca>
+ Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on
+ Linux if target provides dl_iterate_phdr.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+
+--- a/libgcc/unwind-dw2-fde-dip.c
++++ b/libgcc/unwind-dw2-fde-dip.c
+@@ -59,6 +59,12 @@
+
+ #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
+ && defined(TARGET_DL_ITERATE_PHDR) \
++ && defined(__linux__)
++# define USE_PT_GNU_EH_FRAME
++#endif
++
++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
++ && defined(TARGET_DL_ITERATE_PHDR) \
+ && (defined(__DragonFly__) || defined(__FreeBSD__))
+ # define ElfW __ElfN
+ # define USE_PT_GNU_EH_FRAME
--- /dev/null
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -369,8 +369,8 @@ extern int dot_symbols;
+ #endif
+ #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" MUSL_DYNAMIC_LINKER_E ".so.1"
+-#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+--- a/gcc/config/rs6000/sysv4.h
++++ b/gcc/config/rs6000/sysv4.h
+@@ -765,7 +765,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF
+
+ #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" MUSL_DYNAMIC_LINKER_E ".so.1"
++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
+ #elif DEFAULT_LIBC == LIBC_MUSL
--- /dev/null
+Use the proper rtx cost model for the selected CPU, even when optimizing
+for size. This generates better code.
+
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -17483,7 +17483,7 @@ mips_option_override (void)
+ flag_pcc_struct_return = 0;
+
+ /* Decide which rtx_costs structure to use. */
+- if (optimize_size)
++ if (0 && optimize_size)
+ mips_cost = &mips_rtx_cost_optimize_size;
+ else
+ mips_cost = &mips_rtx_cost_data[mips_tune];
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
-@@ -271,7 +271,7 @@ extern void (*arm_lang_output_object_att
+@@ -285,7 +285,7 @@ extern void (*arm_lang_output_object_att
/* Thumb-1 only. */
#define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm)
+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \
&& !TARGET_THUMB1)
- /* The following two macros concern the ability to execute coprocessor
+ #define TARGET_CRC32 (arm_arch_crc)
# difference.
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
-@@ -55,8 +55,6 @@
+@@ -60,8 +60,6 @@
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
-@@ -865,11 +865,12 @@ $(libgcov-objects): %$(objext): $(srcdir
+@@ -887,11 +887,12 @@ $(libgcov-driver-objects): %$(objext): $
# Static libraries.
libgcc.a: $(libgcc-objects)
-rm -f $@
objects="$(objects)"; \
-@@ -891,7 +892,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E
+@@ -913,7 +914,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E
endif
ifeq ($(enable_shared),yes)
ifneq ($(LIBUNWIND),)
all: libunwind$(SHLIB_EXT)
endif
-@@ -1058,6 +1059,10 @@ install-shared:
+@@ -1108,6 +1109,10 @@ install-shared:
chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
$(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
--- 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"
+@@ -94,10 +94,15 @@
+ #define MUSL_DYNAMIC_LINKER \
+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
+/* For armv4 we pass --fix-v4bx to linker to support EABI */
+#undef TARGET_FIX_V4BX_SPEC
/* 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 \
+-#define LINK_SPEC EABI_LINK_SPEC \
++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \
LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
--- a/gcc/config/arm/linux-eabi.h
+++ b/gcc/config/arm/linux-eabi.h
-@@ -114,10 +114,6 @@
+@@ -131,10 +131,6 @@
#define ENDFILE_SPEC \
LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
is used. */
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
-@@ -51,6 +51,10 @@ see the files COPYING3 and COPYING.RUNTI
+@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI
builtin_assert ("system=posix"); \
} while (0)
+#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. */
+ uClibc or Bionic or musl is the default C library and whether
+ -muclibc or -mglibc or -mbionic or -mmusl has been passed to change
--- a/libgcc/mkmap-symver.awk
+++ b/libgcc/mkmap-symver.awk
@@ -132,5 +132,5 @@ function output(lib) {
}
--- 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)"
+@@ -60,6 +60,9 @@
+ #undef CPP_OS_DEFAULT_SPEC
+ #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)"
+#undef LIBGCC_SPEC
+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc"
--- /dev/null
+--- a/libgcc/config/t-libunwind
++++ b/libgcc/config/t-libunwind
+@@ -2,8 +2,7 @@
+
+ HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER
+
+-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \
+- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c
++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+
+ # Override the default value from t-slibgcc-elf-ver and mention -lunwind
+++ /dev/null
---- a/libgcc/crtstuff.c
-+++ b/libgcc/crtstuff.c
-@@ -100,15 +100,20 @@ call_ ## FUNC (void) \
- #if defined(OBJECT_FORMAT_ELF) \
- && !defined(OBJECT_FORMAT_FLAT) \
- && defined(HAVE_LD_EH_FRAME_HDR) \
-- && !defined(inhibit_libc) && !defined(CRTSTUFFT_O) \
-- && defined(__GLIBC__) && __GLIBC__ >= 2
-+ && !defined(inhibit_libc) && !defined(CRTSTUFFT_O)
- #include <link.h>
- /* uClibc pretends to be glibc 2.2 and DT_CONFIG is defined in its link.h.
- But it doesn't use PT_GNU_EH_FRAME ELF segment currently. */
--# if !defined(__UCLIBC__) \
-- && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-- || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
--# define USE_PT_GNU_EH_FRAME
-+# if defined(__UCLIBC__)
-+# if (__UCLIBC_MAJOR__ > 0 || __UCLIBC_MINOR__ > 9 || \
-+ (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ >= 33))
-+# define USE_PT_GNU_EH_FRAME
-+# endif
-+# elif defined(__GLIBC__)
-+# if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
-+ || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
-+# define USE_PT_GNU_EH_FRAME
-+# endif
- # endif
- #endif
-
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
-@@ -17653,7 +17653,7 @@ rs6000_savres_strategy (rs6000_stack_t *
+@@ -21500,7 +21500,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)
{
to be able to use -Werror in "make" but prevent
GNU autoconf generated configure scripts from
freaking out.
- * Make -fno-strict-aliasing and -fno-delete-null-pointer-checks
- the default for -O2/-Os, because they trigger gcc bugs
- and can delete code with security implications.
This patch was authored by Thorsten Glaser <tg at mirbsd.de>
with copyright assignment to the FSF in effect.
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
-@@ -104,6 +104,9 @@ static size_t include_cursor;
+@@ -122,6 +122,9 @@ static int class_dump_flags;
/* Whether any standard preincluded header has been preincluded. */
static bool done_preinclude;
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
+@@ -449,6 +452,12 @@ c_common_handle_option (size_t scode, co
flag_no_builtin = !value;
break;
case OPT_fconstant_string_class_:
constant_string_class_name = arg;
break;
-@@ -1027,6 +1039,47 @@ c_common_init (void)
+@@ -1034,6 +1043,47 @@ c_common_init (void)
return false;
}
--- 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
+@@ -431,6 +431,10 @@ Wfloat-conversion
+ C ObjC C++ ObjC++ Var(warn_float_conversion) LangEnabledBy(C ObjC C++ ObjC++,Wconversion)
+ Warn for implicit type conversions that cause loss of floating point precision
+Werror-maybe-reset
+C ObjC C++ ObjC++
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
+@@ -1161,6 +1165,9 @@ C++ ObjC++ Optimization Alias(fexception
fhonor-std
C++ ObjC++ Ignore Warn(switch %qs is no longer supported)
Assume normal C execution environment
--- a/gcc/common.opt
+++ b/gcc/common.opt
-@@ -541,6 +541,10 @@ Werror=
+@@ -561,6 +561,10 @@ Werror=
Common Joined
Treat specified warning as error
Wextra
Common Var(extra_warnings) Warning
Print extra (possibly unwanted) warnings
-@@ -1242,6 +1246,9 @@ fguess-branch-probability
+@@ -1360,6 +1364,9 @@ fguess-branch-probability
Common Report Var(flag_guess_branch_prob) Optimization
Enable guessing of branch probabilities
; 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
+@@ -1699,6 +1699,17 @@ common_handle_option (struct gcc_options
opts, opts_set, loc, dc);
break;
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
+@@ -251,7 +251,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Wdisabled-optimization @gol
+ -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @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
+ -Wformat-security -Wformat-signedness -Wformat-y2k @gol
+@@ -5382,6 +5382,22 @@ This option is only supported for C and
@option{-Wall} and by @option{-Wpedantic}, which can be disabled with
@option{-Wno-pointer-sign}.
@item -Wstack-protector
@opindex Wstack-protector
@opindex Wno-stack-protector
-@@ -6919,7 +6935,7 @@ so, the first branch is redirected to ei
+@@ -7860,7 +7876,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.
@opindex fsplit-wide-types
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
-@@ -626,6 +626,7 @@ lang_specific_pre_link (void)
+@@ -629,6 +629,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));
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
-@@ -8003,7 +8003,10 @@ getenv_spec_function (int argc, const ch
+@@ -8807,8 +8807,10 @@ getenv_spec_function (int argc, const ch
value = getenv (argv[0]);
if (!value)
-- fatal_error ("environment variable %qs not defined", argv[0]);
+- fatal_error (input_location,
+- "environment variable %qs not defined", argv[0]);
+ {
-+ warning (0, "environment variable %qs not defined", argv[0]);
++ warning (input_location, "environment variable %qs not defined", argv[0]);
+ value = "";
+ }
--- /dev/null
+From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001
+From: Andrew McDonnell <bugs@andrewmcdonnell.net>
+Date: Fri, 3 Oct 2014 19:09:00 +0930
+Subject: Add .note.GNU-stack section
+
+See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html
+Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html
+
+Re: [Patch, MIPS] Add .note.GNU-stack section
+
+ From: Steve Ellcey <sellcey at mips dot com>
+
+On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote:
+>
+>
+> On Wed, Sep 10, 2014 at 9:27 AM, <pinskia@gmail.com> wrote:
+
+> This works except you did not update the assembly files in
+> libgcc or glibc. We (Cavium) have the same patch in our tree
+> for a few released versions.
+
+> Mind just checking yours in then Andrew?
+
+> Thanks!
+> -eric
+
+I talked to Andrew about what files he changed in GCC and created and
+tested this new patch. Andrew also mentioned changing some assembly
+files in glibc but I don't see any use of '.section .note.GNU-stack' in
+any assembly files in glibc (for any platform) so I wasn't planning on
+creating a glibc to add them to mips glibc assembly language files.
+
+OK to check in this patch?
+
+Steve Ellcey
+sellcey@mips.com
+
+
+
+2014-09-26 Steve Ellcey <sellcey@mips.com>
+---
+ gcc/config/mips/mips.c | 3 +++
+ libgcc/config/mips/crti.S | 4 ++++
+ libgcc/config/mips/crtn.S | 3 +++
+ libgcc/config/mips/mips16.S | 4 ++++
+ libgcc/config/mips/vr4120-div.S | 4 ++++
+ 5 files changed, 18 insertions(+)
+
+--- a/gcc/config/mips/mips.c
++++ b/gcc/config/mips/mips.c
+@@ -19629,6 +19629,9 @@ mips_lra_p (void)
+ #undef TARGET_LRA_P
+ #define TARGET_LRA_P mips_lra_p
+
++#undef TARGET_ASM_FILE_END
++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack
++
+ struct gcc_target targetm = TARGET_INITIALIZER;
+ \f
+ #include "gt-mips.h"
+--- a/libgcc/config/mips/crti.S
++++ b/libgcc/config/mips/crti.S
+@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
++
++/* An executable stack is *not* required for these functions. */
++ .section .note.GNU-stack,"",%progbits
++
+ /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
+ Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
+
+--- a/libgcc/config/mips/crtn.S
++++ b/libgcc/config/mips/crtn.S
+@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except
+ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ <http://www.gnu.org/licenses/>. */
+
++/* An executable stack is *not* required for these functions. */
++ .section .note.GNU-stack,"",%progbits
++
+ /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack.
+ Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */
+
+--- a/libgcc/config/mips/mips16.S
++++ b/libgcc/config/mips/mips16.S
+@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI
+ values using the soft-float calling convention, but do the actual
+ operation using the hard floating point instructions. */
+
++/* An executable stack is *not* required for these functions. */
++ .section .note.GNU-stack,"",%progbits
++ .previous
++
+ #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64)
+
+ /* This file contains 32-bit assembly code. */
+--- a/libgcc/config/mips/vr4120-div.S
++++ b/libgcc/config/mips/vr4120-div.S
+@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI
+ -mfix-vr4120. div and ddiv do not give the correct result when one
+ of the operands is negative. */
+
++/* An executable stack is *not* required for these functions. */
++ .section .note.GNU-stack,"",%progbits
++ .previous
++
+ .set nomips16
+
+ #define DIV \
--- /dev/null
+--- a/libstdc++-v3/config/os/gnu-linux/os_defines.h 2015-01-05 06:33:28.000000000 -0600
++++ b/libstdc++-v3/config/os/gnu-linux/os_defines.h 2016-04-15 12:32:49.374356001 -0500
+@@ -41,8 +41,8 @@
+ // Provide a declaration for the possibly deprecated gets function, as
+ // glibc 2.15 and later does not declare gets for ISO C11 when
+ // __GNU_SOURCE is defined.
+-#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
++//#if __GLIBC_PREREQ(2,15) && defined(_GNU_SOURCE)
+ # undef _GLIBCXX_HAVE_GETS
+-#endif
++//#endif
+
+ #endif
--- /dev/null
+--- a/libstdc++-v3/include/Makefile.in
++++ b/libstdc++-v3/include/Makefile.in
+@@ -1421,7 +1421,7 @@ stamp-bits: ${bits_headers}
+ @$(STAMP) stamp-bits
+
+ stamp-bits-sup: stamp-bits ${bits_sup_headers}
+- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null
++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null
+ @$(STAMP) stamp-bits-sup
+
+ stamp-c_base: ${c_base_headers}
--- /dev/null
+Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047
+
+--- a/gcc/c-family/c-opts.c
++++ b/gcc/c-family/c-opts.c
+@@ -581,6 +581,10 @@ c_common_handle_option (size_t scode, co
+ add_path (xstrdup (arg), SYSTEM, 0, true);
+ break;
+
++ case OPT_iremap:
++ add_cpp_remap_path (arg);
++ break;
++
+ case OPT_iwithprefix:
+ add_prefixed_path (arg, SYSTEM);
+ break;
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1528,6 +1528,10 @@ iquote
+ C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs)
+ -iquote <dir> Add <dir> to the end of the quote include path
+
++iremap
++C ObjC C++ ObjC++ Joined Separate
++-iremap <src:dst> Convert <src> to <dst> if it occurs as prefix in __FILE__.
++
+ iwithprefix
+ C ObjC C++ ObjC++ Joined Separate
+ -iwithprefix <dir> Add <dir> to the end of the system include path
+--- a/gcc/doc/cpp.texi
++++ b/gcc/doc/cpp.texi
+@@ -4441,6 +4441,7 @@ without notice.
+ @c man begin SYNOPSIS
+ cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}]
+ [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}]
++ [@option{-iremap}@var{src}:@var{dst}]
+ [@option{-W}@var{warn}@dots{}]
+ [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}]
+ [@option{-MP}] [@option{-MQ} @var{target}@dots{}]
+--- a/gcc/doc/cppopts.texi
++++ b/gcc/doc/cppopts.texi
+@@ -532,6 +532,12 @@ Search @var{dir} only for header files r
+ If @var{dir} begins with @code{=}, then the @code{=} will be replaced
+ by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
+
++@item -iremap @var{src}:@var{dst}
++@opindex iremap
++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time.
++This option can be specified more than once. Processing stops at the first
++match.
++
+ @item -fdirectives-only
+ @opindex fdirectives-only
+ When preprocessing, handle directives, but do not expand macros.
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -494,8 +494,8 @@ Objective-C and Objective-C++ Dialects}.
+ @item Directory Options
+ @xref{Directory Options,,Options for Directory Search}.
+ @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
+--iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol
+---sysroot=@var{dir} --no-sysroot-suffix}
++-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -specs=@var{file} @gol
++-I- --sysroot=@var{dir} --no-sysroot-suffix}
+
+ @item Machine Dependent Options
+ @xref{Submodel Options,,Hardware Models and Configurations}.
+@@ -11479,6 +11479,12 @@ be searched for header files only for th
+ "@var{file}"}; they are not searched for @code{#include <@var{file}>},
+ otherwise just like @option{-I}.
+
++@item -iremap @var{src}:@var{dst}
++@opindex iremap
++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time.
++This option can be specified more than once. Processing stops at the first
++match.
++
+ @item -L@var{dir}
+ @opindex L
+ Add directory @var{dir} to the list of directories to be searched
+--- a/libcpp/include/cpplib.h
++++ b/libcpp/include/cpplib.h
+@@ -751,6 +751,9 @@ extern void cpp_set_lang (cpp_reader *,
+ /* Set the include paths. */
+ extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int);
+
++/* Provide src:dst pair for __FILE__ remapping. */
++extern void add_cpp_remap_path (const char *);
++
+ /* Call these to get pointers to the options, callback, and deps
+ structures for a given reader. These pointers are good until you
+ call cpp_finish on that reader. You can either edit the callbacks
+--- a/libcpp/macro.c
++++ b/libcpp/macro.c
+@@ -224,6 +224,64 @@ static const char * const monthnames[] =
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+
++static size_t remap_pairs;
++static char **remap_src;
++static char **remap_dst;
++
++void
++add_cpp_remap_path (const char *arg)
++{
++ const char *arg_dst;
++ size_t len;
++
++ arg_dst = strchr(arg, ':');
++ if (arg_dst == NULL)
++ {
++ fprintf(stderr, "Invalid argument for -iremap\n");
++ exit(1);
++ }
++
++ len = arg_dst - arg;
++ ++arg_dst;
++
++ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1));
++ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1));
++
++ remap_src[remap_pairs] = (char *) xmalloc(len + 1);
++ memcpy(remap_src[remap_pairs], arg, len);
++ remap_src[remap_pairs][len] = '\0';
++ remap_dst[remap_pairs] = xstrdup(arg_dst);
++ ++remap_pairs;
++}
++
++static const char *
++cpp_remap_file (const char *arg, char **tmp_name)
++{
++ char *result;
++ size_t i, len;
++
++ for (i = 0; i < remap_pairs; ++i)
++ {
++ len = strlen (remap_src[i]);
++ if (strncmp (remap_src[i], arg, len))
++ continue;
++ if (arg[len] == '\0')
++ return xstrdup (remap_dst[i]);
++ if (arg[len] != '/')
++ continue;
++ arg += len;
++ len = strlen (remap_dst[i]);
++ result = (char *) xmalloc (len + strlen (arg) + 1);
++ memcpy(result, remap_dst[i], len);
++ strcpy(result + len, arg);
++ *tmp_name = result;
++
++ return result;
++ }
++
++ return arg;
++}
++
+ /* Helper function for builtin_macro. Returns the text generated by
+ a builtin macro. */
+ const uchar *
+@@ -286,6 +344,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi
+ {
+ unsigned int len;
+ const char *name;
++ char *tmp_name = NULL;
+ uchar *buf;
+
+ if (node->value.builtin == BT_FILE)
+@@ -297,6 +356,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi
+ if (!name)
+ abort ();
+ }
++ name = cpp_remap_file (name, &tmp_name);
+ len = strlen (name);
+ buf = _cpp_unaligned_alloc (pfile, len * 2 + 3);
+ result = buf;
+@@ -304,6 +364,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi
+ buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len);
+ *buf++ = '"';
+ *buf = '\0';
++ free (tmp_name);
+ }
+ break;
+
--- /dev/null
+--- a/gcc/go/Make-lang.in
++++ b/gcc/go/Make-lang.in
+@@ -74,7 +74,7 @@ go_OBJS = $(GO_OBJS) go/gospec.o
+
+ go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS)
+ +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
+- $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
++ $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) -lm
+
+ # Documentation.
+
--- /dev/null
+--- a/libgo/runtime/mprof.goc
++++ b/libgo/runtime/mprof.goc
+@@ -403,7 +403,7 @@ func ThreadCreateProfile(p Slice) (n int
+
+ func Stack(b Slice, all bool) (n int) {
+ byte *pc, *sp;
+- bool enablegc;
++ bool enablegc = false; /* workaround GCC bug #36550 */
+
+ sp = runtime_getcallersp(&b);
+ pc = (byte*)(uintptr)runtime_getcallerpc(&b);
PKG_NAME:=libtool
PKG_VERSION:=2.4.6
-PKG_RELEASE:=1
+PKG_RELEASE:=2
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/libtool
-PKG_MD5SUM:=addf44b646ddb4e3919805aa88fa7c5e
+PKG_MD5SUM:=1bfb9b923f2c1339b4d2ce1807064aa5
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-2.0+
PKG_BUILD_DIR = $(BUILD_DIR)/libtool-bin/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
+CONFIGURE_VARS += GREP=grep SED=sed
+
define Package/libtool-bin
SECTION:=devel
CATEGORY:=Development
define Package/libtool-bin/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/libtoolize $(1)/usr/bin/
- $(SED) 's|$(STAGING_DIR_HOST)||g' $(1)/usr/bin/libtoolize
$(INSTALL_DIR) $(1)/usr/share/aclocal/
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
$(1)/usr/share/aclocal/
PKG_NAME:=m4
PKG_VERSION:=1.4.17
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=@GNU/m4
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=a5e9954b1dae036762f7b13673a2cf76
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_MD5SUM:=12a3c829301a4fd6586a57d3fcf196dc
PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
PKG_LICENSE:=GPL-3.0+
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=exfat-nofuse
-PKG_VERSION:=git-20151121
+PKG_VERSION=2016-09-26-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/dorimanx/exfat-nofuse.git
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=42635ed1c682a0d85c12f73d08489d1a3a7a94e3
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=051167ceccbe75d9d77fc4f5356f5a39a01779e8
PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
PKG_LICENSE:=GPL-2.0
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=chardet
+PKG_VERSION:=2.3.0
+PKG_RELEASE:=1
+PKG_LICENSE:=LGPL-2.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/c/chardet/
+PKG_MD5SUM:=25274d664ccb5130adae08047416e1a8
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/chardet
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Universal encoding detector for Python 2 and 3
+ URL:=https://github.com/chardet/chardet
+ DEPENDS:=+python
+endef
+
+define Package/chardet/description
+ Universal encoding detector for Python 2 and 3
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/chardet/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chardetect \
+ $(1)/usr/bin
+ # fix python exec path in scripts
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/chardetect
+endef
+
+$(eval $(call BuildPackage,chardet))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-appconf
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/34/b9/d07195652ab494b026f7cb0341dd6e5f2e6e39be177abe05e2cec8bd46e4/
+PKG_MD5SUM:=cc11511a47088bc56531df67cd5d6261
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-appconf
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A helper class for handling configuration defaults of packaged apps gracefully.
+ URL:=http://django-appconf.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-appconf/description
+ A helper class for handling configuration defaults of packaged apps gracefully.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-appconf/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-appconf))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-compressor
+PKG_VERSION:=2.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=django_compressor-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/23/46/2c7d582255969ad5259937f5f9e14aec1f3349d0fc0651129330918d1c6d/
+PKG_BUILD_DIR:=$(BUILD_DIR)/django_compressor-$(PKG_VERSION)/
+PKG_MD5SUM:=21ecfe4e8615eae64f7068a5599df9af
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-compressor
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Compresses linked and inline JavaScript or CSS into single cached files.
+ URL:=http://django-compressor.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-compressor/description
+ Compresses linked and inline JavaScript or CSS into single cached files.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-compressor/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-compressor))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-constance
+PKG_VERSION:=1.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/ff/1c1caae2b7be9c26f2aee0703236998e22cf5557fa56726347b5afa149d1/
+PKG_MD5SUM:=f9f8e527df50b0a1533149d9be0b814b
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-constance
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Django live settings with pluggable backends, including Redis.
+ URL:=https://github.com/jazzband/django-constance
+ DEPENDS:=+python +django
+endef
+
+define Package/django-constance/description
+ Django live settings with pluggable backends, including Redis.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-constance/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-constance))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-jsonfield
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/e4/b2/a079f0a2218e0eb7892edbf404e0bbfbb281a6bbf06966b775f5142ed159/
+PKG_MD5SUM:=2e5e737a3f93f3b5d7ae6026b1340167
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-jsonfield
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=JSONField for django models
+ URL:=https://github.com/bradjasper/django-jsonfield
+ DEPENDS:=+python +django
+endef
+
+define Package/django-jsonfield/description
+ JSONField for django models
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-jsonfield/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-jsonfield))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-picklefield
+PKG_VERSION:=0.3.2
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/django-picklefield/
+PKG_MD5SUM:=b2c17ca9e03704ce33890e6aefc7b2e5
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-picklefield
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Pickled object field for Django
+ URL:=http://github.com/gintas/django-picklefield/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-picklefield/description
+ Pickled object field for Django
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-picklefield/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-picklefield))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-postoffice
+PKG_VERSION:=2.0.8
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=django-post_office-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/52/25/cc0cfe923f183d7c19b162cac3bf8430ddaed7bad28202b8f93a97d248a4/
+PKG_BUILD_DIR:=$(BUILD_DIR)/django-post_office-$(PKG_VERSION)/
+PKG_MD5SUM:=437bf62cef06381d346ae2bc087c0e3c
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-postoffice
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A Django app to monitor and send mail asynchronously, complete with template support.
+ URL:=https://github.com/ui/django-postoffice
+ DEPENDS:=+python +django +django-jsonfield
+endef
+
+define Package/django-postoffice/description
+ A Django app to monitor and send mail asynchronously, complete with template support.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-postoffice/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-postoffice))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-restframework
+PKG_VERSION:=3.3.3
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=djangorestframework-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/d/djangorestframework/
+PKG_BUILD_DIR:=$(BUILD_DIR)/djangorestframework-$(PKG_VERSION)
+PKG_MD5SUM:=6f5ee9646e7fa87dad4385d3c7e7678d
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-restframework
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Web APIs for Django, made easy.
+ URL:=http://www.django-rest-framework.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-restframework/description
+ Web APIs for Django, made easy.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-restframework/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-restframework))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django-statici18n
+PKG_VERSION:=1.2.1
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/72/76/6ee13019e1691bff6b759136068ee77fcc2982b700135caa134030937b28/
+PKG_MD5SUM:=67cac19909dd3272ae1fc73ad8d1dca3
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django-statici18n
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A Django app that provides helper for generating JavaScript catalog to static files.
+ URL:=http://django-statici18n.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/django-statici18n/description
+ A Django app that provides helper for generating JavaScript catalog to static files.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/django-statici18n/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,django-statici18n))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=django
+PKG_VERSION:=1.8.12
+PKG_RELEASE=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/django/django.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=c168aeba175dbb92c615460a360cb1ea978de5d3
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/django
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=The web framework for perfectionists with deadlines.
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=https://www.djangoproject.com/
+ DEPENDS:=+python
+endef
+
+define Package/django/description
+ The web framework for perfectionists with deadlines.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
+ $(1)/usr/bin
+endef
+
+define Package/django/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/django-admin.py \
+ $(1)/usr/bin
+ # fix python exec path
+ sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/django-admin.py
+endef
+
+$(eval $(call BuildPackage,django))
PKG_NAME:=erlang
PKG_VERSION:=17.5
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= http://www.erlang.org/download/ \
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_BUILD_DEPENDS:=erlang/host openssl
+PKG_USE_MIPS16:=0
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION)
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=et_xmlfile
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/e/et_xmlfile/
+PKG_MD5SUM:=f47940fd9d556375420b2e276476cfaf
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/et_xmlfile
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=An implementation of lxml.xmlfile for the standard library
+ URL:=https://bitbucket.org/openpyxl/et_xmlfile
+ DEPENDS:=+python
+endef
+
+define Package/et_xmlfile/description
+ An implementation of lxml.xmlfile for the standard library
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/et_xmlfile/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,et_xmlfile))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=flup
+PKG_VERSION:=1.0.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/f/flup/
+PKG_MD5SUM:=24dad7edc5ada31dddd49456ee8d5254
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/flup
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Random assortment of WSGI servers
+ URL:=http://www.saddi.com/software/flup/
+ DEPENDS:=+python
+endef
+
+define Package/flup/description
+ Random assortment of WSGI servers
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/flup/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,flup))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gunicorn
+PKG_VERSION:=19.6.0
+PKG_RELEASE=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/84/ce/7ea5396efad1cef682bbc4068e72a0276341d9d9d0f501da609fab9fcb80/
+PKG_MD5SUM:=338e5e8a83ea0f0625f768dba4597530
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/gunicorn
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=WSGI HTTP Server for UNIX
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=http://gunicorn.org/
+ DEPENDS:=+python +python-setuptools
+endef
+
+define Package/gunicorn/description
+ WSGI HTTP Server for UNIX
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/gunicorn/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gunicorn* \
+ $(1)/usr/bin
+ # fix python exec path in scripts
+ $(SED) 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/bin/gunicorn*
+endef
+
+$(eval $(call BuildPackage,gunicorn))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=jdcal
+PKG_VERSION:=1.2
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-3-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/j/jdcal/
+PKG_MD5SUM:=ab8d5ba300fd1eb01514f363d19b1eb9
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/jdcal
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Julian dates from proleptic Gregorian and Julian calendars.
+ URL:=http://github.com/phn/jdcal
+ DEPENDS:=+python
+endef
+
+define Package/jdcal/description
+ Julian dates from proleptic Gregorian and Julian calendars.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/jdcal/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,jdcal))
--- /dev/null
+#
+# Copyright (C) 2016 Amnon Paz <pazamnon@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lua-openssl
+PKG_VERSION:=0.6.0
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Amnon Paz <pazamnon@gmail.com>
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/zhaozg/lua-openssl.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=1b950e6ff8617205cda1a1b612637ef21b9daf96
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+ SUBMENU:=Lua
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Lua openSSL binding
+ URL:=http://github.com/zhaozg/lua-openssl
+ DEPENDS:=+lua +libopenssl +librt
+endef
+
+define Package/lua-openssl/description
+ A free, MIT-licensed OpenSSL binding for Lua.
+endef
+
+define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/lib/lua
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/openssl.so $(1)/usr/lib/lua/
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+diff --git a/Makefile b/Makefile
+index 6cb1176..6605879 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,85 +1,45 @@
+-T=openssl\r
+-\r
+-PREFIX ?=/usr/local\r
+-LIB_OPTION ?= -shared \r
+-\r
+-#Lua auto detect\r
+-LUA_VERSION ?= $(shell pkg-config luajit --print-provides)\r
+-ifeq ($(LUA_VERSION),) ############ Not use luajit\r
+-LUAV ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)")\r
+-LUA_CFLAGS ?= -I$(PREFIX)/include/lua$(LUAV)\r
+-LUA_LIBS ?= -L$(PREFIX)/lib \r
+-LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUAV)\r
+-else\r
+-LUAV ?= $(shell lua -e "_,_,v=string.find(_VERSION,'Lua (.+)');print(v)")\r
+-LUA_CFLAGS ?= $(shell pkg-config luajit --cflags)\r
+-LUA_LIBS ?= $(shell pkg-config luajit --libs)\r
+-LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUAV)\r
+-endif\r
+-\r
+-#OS auto detect\r
+-SYS := $(shell gcc -dumpmachine)\r
+-\r
+-ifneq (, $(findstring linux, $(SYS)))\r
+-# Do linux things\r
+-LDFLAGS = -fPIC -lrt -ldl\r
+-OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) \r
+-OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags)\r
+-CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS) \r
+-endif\r
+-ifneq (, $(findstring apple, $(SYS)))\r
+-# Do darwin things\r
+-LDFLAGS = -fPIC -lrt -ldl\r
+-OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) \r
+-OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags)\r
+-CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
+-endif\r
+-ifneq (, $(findstring mingw, $(SYS)))\r
+-# Do mingw things\r
+-V = $(shell lua -e "v=string.gsub('$(LUAV)','%.','');print(v)")\r
+-LDFLAGS = -mwindows -lcrypt32 -lssl -lcrypto -lws2_32 $(PREFIX)/bin/lua$(V).dll \r
+-LUA_CFLAGS = -DLUA_LIB -DLUA_BUILD_AS_DLL -I$(PREFIX)/include/\r
+-CFLAGS = $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
+-endif\r
+-ifneq (, $(findstring cygwin, $(SYS)))\r
+-# Do cygwin things\r
+-OPENSSL_LIBS ?= $(shell pkg-config openssl --libs) \r
+-OPENSSL_CFLAGS ?= $(shell pkg-config openssl --cflags)\r
+-CFLAGS = -fPIC $(OPENSSL_CFLAGS) $(LUA_CFLAGS)\r
+-endif\r
+-#custome config\r
+-ifeq (.config, $(wildcard .config))\r
+-include .config\r
+-endif\r
+-\r
+-LIBNAME= $T.so.$V\r
+-\r
+-#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X\r
+-\r
+-# Compilation directives\r
+-WARN_MOST = -Wall -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic\r
+-WARN = -Wall -Wno-unused-value\r
+-WARN_MIN = \r
+-CFLAGS += $(WARN_MIN) -DPTHREADS \r
+-CC= gcc -g $(CFLAGS) -Ideps\r
+-\r
+-\r
+-OBJS=src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o \\r
+-src/ec.o src/engine.o src/hmac.o src/lbn.o src/lhash.o src/misc.o src/ocsp.o src/openssl.o src/ots.o src/pkcs12.o src/pkcs7.o \\r
+-src/pkey.o src/rsa.o src/ssl.o src/th-lock.o src/util.o src/x509.o src/xattrs.o src/xexts.o src/xname.o src/xstore.o src/xalgor.o src/callback.o \r
+-\r
+-.c.o:\r
+- $(CC) -c -o $@ $?\r
+-\r
+-all: $T.so\r
+- echo $(SYS)\r
+-\r
+-$T.so: $(OBJS)\r
+- MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o $T.so $(OBJS) $(OPENSSL_LIBS) $(LUA_LIBS) $(LDFLAGS)\r
+-\r
+-install: all\r
+- mkdir -p $(LUA_LIBDIR)\r
+- cp $T.so $(LUA_LIBDIR)\r
+-\r
+-clean:\r
+- rm -f $T.so $(OBJS) \r
++.PHONY: install clean
++
++PKGC ?= pkg-config
++
++LIBNAME = openssl.so
++LIB_OPTION = -shared
++
++# lua's package config can be under various names
++LUAPKGC := $(shell for pc in lua lua5.1 lua5.2 lua5.3; do \
++ $(PKGC) --exists $$pc && echo $$pc && break; \
++ done)
++
++BUILD_DIR = $(shell pwd)
++
++# LUA include/libraries build flags
++LUA_LIBDIR := $(shell $(PKGC) --variable=libdir $(LUAPKGC))
++LUA_CFLAGS := $(shell $(PKGC) --cflags $(LUAPKGC))
++LUA_LIBS := $(shell $(PKGC) --libs-only-L $(LUAPKGC))
++
++# openssl include/libraries build flags
++OPENSSL_LIBS = $(shell $(PKGC) openssl --libs)
++OPENSSL_CFLAGS = $(shell $(PKGC) openssl --cflags)
++
++# openssl include/libraries build flags
++LOCAL_INCLUDE = -I$(BUILD_DIR)/deps
++
++CFLAGS += -fPIC -DPTHREADS -g $(LOCAL_INCLUDE) $(OPENSSL_CFLAGS) $(LUA_CFLAGS)
++LDFLAGS += -lrt -ldl $(OPENSSL_LIBS) $(LUA_LIBS)
++
++OBJS = src/asn1.o src/auxiliar.o src/bio.o src/cipher.o src/cms.o src/compat.o src/crl.o src/csr.o src/dh.o src/digest.o src/dsa.o src/ec.o src/engine.o src/hmac.o src/lbn.o src/lhash.o src/misc.o src/ocsp.o src/openssl.o src/ots.o src/pkcs12.o src/pkcs7.o src/pkey.o src/rsa.o src/ssl.o src/th-lock.o src/util.o src/x509.o src/xattrs.o src/xexts.o src/xname.o src/xstore.o src/xalgor.o src/callback.o
++
++all: clean $(LIBNAME)
++
++$(LIBNAME): $(OBJS)
++ $(CC) $(LDFLAGS) $(LIB_OPTION) $(OBJS) -o $@
++
++%.o: %.c
++ $(CC) $(CFLAGS) -c $< -o $@
++
++install: all
++ mkdir -p $(LUA_LIBDIR)
++ cp $(LIBNAME) $(LUA_LIBDIR)
++
++clean:
++ rm -f $(LIBNAME) $(OBJS)
--- /dev/null
+diff --git a/deps/lua-compat/c-api/compat-5.3.c b/deps/lua-compat/c-api/compat-5.3.c
+index 4395bbc..4a8877c 100644
+--- a/deps/lua-compat/c-api/compat-5.3.c
++++ b/deps/lua-compat/c-api/compat-5.3.c
+@@ -491,17 +491,6 @@ COMPAT53_API int lua_geti (lua_State *L, int index, lua_Integer i) {
+ }
+
+
+-COMPAT53_API int lua_isinteger (lua_State *L, int index) {
+- if (lua_type(L, index) == LUA_TNUMBER) {
+- lua_Number n = lua_tonumber(L, index);
+- lua_Integer i = lua_tointeger(L, index);
+- if (i == n)
+- return 1;
+- }
+- return 0;
+-}
+-
+-
+ static void compat53_reverse (lua_State *L, int a, int b) {
+ for (; a < b; ++a, --b) {
+ lua_pushvalue(L, a);
+diff --git a/deps/lua-compat/c-api/compat-5.3.h b/deps/lua-compat/c-api/compat-5.3.h
+index 2309294..8e67bae 100644
+--- a/deps/lua-compat/c-api/compat-5.3.h
++++ b/deps/lua-compat/c-api/compat-5.3.h
+@@ -244,9 +244,6 @@ typedef int (*lua_KFunction)(lua_State *L, int status, lua_KContext ctx);
+ #define lua_geti COMPAT53_CONCAT(COMPAT53_PREFIX, _geti)
+ COMPAT53_API int lua_geti (lua_State *L, int index, lua_Integer i);
+
+-#define lua_isinteger COMPAT53_CONCAT(COMPAT53_PREFIX, _isinteger)
+-COMPAT53_API int lua_isinteger (lua_State *L, int index);
+-
+ #define lua_numbertointeger(n, p) \
+ ((*(p) = (lua_Integer)(n)), 1)
+
--- /dev/null
+--- lua-openssl-0.6.0.old/src/ssl.c 2016-09-19 08:30:43.735075695 +0200
++++ lua-openssl-0.6.0/src/ssl.c 2016-09-19 09:02:45.733813437 +0200
+@@ -24,12 +24,17 @@
+ SSL_METHOD* method = NULL;
+ const char* ciphers;
+ SSL_CTX* ctx;
+- if (strcmp(meth, "SSLv3") == 0)
++ if (0);
++
++#ifndef OPENSSL_NO_SSL3
++ else if (strcmp(meth, "SSLv3") == 0)
+ method = SSLv3_method(); /* SSLv3 */
+ else if (strcmp(meth, "SSLv3_server") == 0)
+ method = SSLv3_server_method(); /* SSLv3 */
+ else if (strcmp(meth, "SSLv3_client") == 0)
+ method = SSLv3_client_method(); /* SSLv3 */
++#endif
++
+ else if (strcmp(meth, "SSLv23") == 0)
+ method = SSLv23_method(); /* SSLv3 but can rollback to v2 */
+ else if (strcmp(meth, "SSLv23_server") == 0)
+@@ -79,15 +84,15 @@
+ #endif
+ else
+ luaL_error(L, "#1:%s not supported\n"
+- "Maybe SSLv3 SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
+- "default is SSLv3",
++ "Maybe [SSLv3] SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
++ "default is TLSv1",
+ meth);
+ ciphers = luaL_optstring(L, 2, SSL_DEFAULT_CIPHER_LIST);
+ ctx = SSL_CTX_new(method);
+ if (!ctx)
+ luaL_error(L, "#1:%s not supported\n"
+- "Maybe SSLv3 SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
+- "default is SSLv3",
++ "Maybe [SSLv3] SSLv23 TLSv1 TLSv1_1 TLSv1_2 DTLSv1 [SSLv2], option followed by _client or _server\n",
++ "default is TLSv1",
+ meth);
+ openssl_newvalue(L, ctx);
+ SSL_CTX_set_cipher_list(ctx, ciphers);
--- /dev/null
+--- lua-openssl-0.6.0.old/src/ssl.c 2016-09-19 08:30:43.735075695 +0200
++++ lua-openssl-0.6.0/src/ssl.c 2016-09-19 08:48:37.393737125 +0200
+@@ -1245,7 +1250,7 @@
+ lua_pushinteger(L, st);
+ return 2;
+ }
+-#ifndef LIBRESSL_VERSION_NUMBER
++#if !defined(OPENSSL_NO_COMP) && !defined(LIBRESSL_VERSION_NUMBER)
+ static int openssl_ssl_current_compression(lua_State *L)
+ {
+ SSL* s = CHECK_OBJECT(1, SSL, "openssl.ssl");
+@@ -1803,7 +1808,7 @@
+ {"getfd", openssl_ssl_getfd},
+
+ {"current_cipher", openssl_ssl_current_cipher},
+-#ifndef LIBRESSL_VERSION_NUMBER
++#if !defined(OPENSSL_NO_COMP) && !defined(LIBRESSL_VERSION_NUMBER)
+ {"current_compression", openssl_ssl_current_compression},
+ #endif
+ {"getpeerverification", openssl_ssl_getpeerverification},
PKG_NAME:=lua-penlight
PKG_VERSION:=1.3.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_BUILD_DIR:=$(BUILD_DIR)/Penlight-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/stevedonovan/Penlight/archive/
PKG_MD5SUM:=0315a39834bb6fab07741ec04ede1bf4
PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=LICENSE.md
+PKG_LICENSE_FILES:=LICENSE.md
include $(INCLUDE_DIR)/package.mk
SECTION:=lang
CATEGORY:=Languages
TITLE:=Lua-Rings
- URL:=http://www.inf.puc-rio.br/~roberto/lua-rings/
+ URL:=http://keplerproject.github.io/rings/
DEPENDS:=+lua
endef
SECTION:=lang
CATEGORY:=Languages
TITLE:=Lua WSAPI
- URL:=http://www.keplerproject.org/wsapi
+ URL:=https://keplerproject.github.io/wsapi/
DEPENDS:= +lua
endef
SECTION:=lang
CATEGORY:=Languages
TITLE:=Xavante Web Server
- URL:=http://www.keplerproject.org/xavante
+ URL:=http://keplerproject.github.io/xavante/
DEPENDS:= +lua
endef
SECTION:=lang
CATEGORY:=Languages
TITLE:=LuaExpat
- URL:=http://www.keplerproject.org/luaexpat/
+ URL:=http://matthewwild.co.uk/projects/luaexpat/
MAINTAINER:=W. Michael Petullo <mike@flyn.org>
DEPENDS:=+lua +libexpat
endef
#
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=luai2c
PKG_VERSION:=1.0.0
-PKG_RELEASE:=2
-PKG_MAINTAINER:=Frank Edelhaeuser <fedel@users.sourceforge.net>
-
-PKG_SOURCE_NAME:=i2c-lua
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
-
-PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/$(PKG_SOURCE_NAME)
-PKG_MD5SUM:=7098577f101410b201cd43a7467e408d
+PKG_RELEASE:=3
+PKG_MAINTAINER:=Frank Edelhaeuser <mrpace2@gmail.com>
+PKG_LICENSE:=MIT
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/mrpace2/i2c-lua.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
define Package/luai2c
- SUBMENU:=Lua
- SECTION:=lang
- CATEGORY:=Languages
- TITLE:=Lua I2C binding
- URL:=http://sourceforge.net/projects/i2c-lua/
- DEPENDS:=+liblua +kmod-i2c-core
- MAINTAINER:=Frank Edelhaeuser <fedel@users.sourceforge.net>
+ SUBMENU:=Lua
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Lua I2C binding
+ URL:=https://github.com/mrpace2/i2c-lua/
+ DEPENDS:=+liblua +kmod-i2c-core
+ MAINTAINER:=Frank Edelhaeuser <mrpace2@gmail.com>
endef
define Package/luai2c/description
include $(TOPDIR)/rules.mk
PKG_NAME:=luasec
-PKG_VERSION:=0.5.1
+PKG_VERSION:=0.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/brunoos/luasec/archive/
-PKG_MD5SUM:=e34e274a57e9045641191eb7398cce2a
+PKG_MD5SUM:=14e1aef6d2aae96bbf98afc6b6634af2
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION)
MAINTAINER:=W. Michael Petullo <mike@flyn.org>
MAKE_FLAGS += \
INCDIR="$(TARGET_CPPFLAGS) -I." \
LIBDIR="$(TARGET_LDFLAGS) -L./luasocket" \
- LUACPATH="/usr/lib/lua" \
- LUAPATH="/usr/lib/lua"
+ LUACPATH="$(PKG_INSTALL_DIR)/usr/lib/lua" \
+ LUAPATH="$(PKG_INSTALL_DIR)/usr/lib/lua"
define Build/Compile
$(call Build/Compile/Default,linux)
+++ /dev/null
---- luasec-luasec-0.5-old/src/luasocket/Makefile 2014-01-29 21:43:33.000000000 +0100
-+++ luasec-luasec-0.5/src/luasocket/Makefile 2014-11-30 13:07:44.850051000 +0100
-@@ -6,7 +6,7 @@
-
- CC ?= cc
- CFLAGS += $(MYCFLAGS) -DLUASOCKET_DEBUG
--AR := ar rcu
-+AR ?= ar
- RANLIB ?= ranlib
-
- .PHONY: all clean
-@@ -14,7 +14,7 @@
- all: libluasocket.a
-
- libluasocket.a: $(OBJS)
-- $(AR) $@ $(OBJS)
-+ $(AR) rcu $@ $(OBJS)
- $(RANLIB) $@
-
- clean:
SECTION:=lang
CATEGORY:=Languages
TITLE:=Lua SQL binding
- URL:=http://www.keplerproject.org/luasql/
+ URL:=http://keplerproject.github.io/luasql/
DEPENDS:= +lua
endef
PKG_NPM_NAME:=arduino-firmata
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.3.3
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/shokai/node-arduino-firmata.git
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=LICENSE.txt
+PKG_LICENSE_FILES:=LICENSE.txt
include $(INCLUDE_DIR)/package.mk
npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
PREFIX="$(PKG_INSTALL_DIR)/usr/" \
- $(STAGING_DIR)/host/bin/npm install -g $(PKG_BUILD_DIR)
+ npm install -g $(PKG_BUILD_DIR)
endef
define Package/node-arduino-firmata/install
PKG_NPM_NAME:=cylon
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.22.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/hybridgroup/cylon-firmata.git
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
PREFIX="$(PKG_INSTALL_DIR)/usr/" \
- $(STAGING_DIR)/host/bin/npm install -g $(PKG_BUILD_DIR)
+ npm install -g $(PKG_BUILD_DIR)
endef
define Package/node-cylon/install
PKG_NPM_NAME:=hid
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=0.5.1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/node-hid/node-hid.git
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=Custom
-PKG_LICENSE_FILE:=
+PKG_LICENSE_FILES:=
include $(INCLUDE_DIR)/package.mk
npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
PREFIX="$(PKG_INSTALL_DIR)/usr/" \
- $(STAGING_DIR)/host/bin/npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
+ npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
endef
define Package/node-hid/install
PKG_NPM_NAME:=serialport
PKG_NAME:=node-$(PKG_NPM_NAME)
PKG_VERSION:=3.0.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NPM_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://registry.npmjs.org/$(PKG_NPM_NAME)/-/
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=Custom
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
npm_config_nodedir=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/ \
npm_config_cache=$(BUILD_DIR)/node-v$(PKG_NODE_VERSION)/npm-cache \
PREFIX="$(PKG_INSTALL_DIR)/usr/" \
- $(STAGING_DIR)/host/bin/npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
+ npm install --build-from-source --target_arch=$(CPU) -g $(PKG_BUILD_DIR)
endef
define Package/node-serialport/install
--shared-openssl \
--prefix=/usr
+ifneq ($(findstring arm,$(ARCH)),)
+CONFIGURE_ARGS+= \
+ $(if $(CONFIG_SOFT_FLOAT),--with-arm-float-abi=soft,--with-arm-float-abi=hard)
+endif
+
+ifneq ($(findstring mips,$(ARCH)),)
+CONFIGURE_ARGS+= \
+ $(if $(CONFIG_SOFT_FLOAT),--with-mips-float-abi=soft,--with-mips-float-abi=hard)
+endif
+
HOST_CONFIGURE_VARS:=
+
HOST_CONFIGURE_ARGS:= \
--dest-os=linux \
--without-snapshot \
- --prefix=$(STAGING_DIR)/host/
+ --prefix=$(HOST_BUILD_PREFIX)
HOST_CONFIGURE_CMD:=python ./configure
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openpyxl
+PKG_VERSION:=2.4.0
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/7e/75/9bb309f80e4f75d139ecc55e9edf65c5844336b5a84966a609267255f961/
+PKG_MD5SUM:=e3376d1fce0681fd0b4047ab89218af4
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/openpyxl
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=A Python library to read/write Excel 2010 xlsx/xlsm files
+ URL:=https://openpyxl.readthedocs.org/
+ DEPENDS:=+python +django
+endef
+
+define Package/openpyxl/description
+ A Python library to read/write Excel 2010 xlsx/xlsm files
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/openpyxl/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,openpyxl))
+++ /dev/null
-#
-# Copyright (C) 2012-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PECL_NAME:=dio
-PECL_LONGNAME:=Direct I/O functions
-
-PKG_VERSION:=0.0.7
-PKG_RELEASE:=1
-PKG_MD5SUM:=a1a4df428a17dbe1ab4277b492dfa052
-
-PKG_NAME:=php5-pecl-$(PECL_NAME)
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
-
-PKG_LICENSE:=PHPv3.01
-PKG_LICENSE_FILES:=
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)))
+++ /dev/null
---- a/dio.c
-+++ b/dio.c
-@@ -442,6 +442,26 @@ PHP_FUNCTION(dio_tcsetattr)
-
- /* assign to correct values... */
- switch (Baud_Rate) {
-+#ifdef B460800
-+ case 460800:
-+ BAUD = B460800;
-+ break;
-+#endif
-+#ifdef B230400
-+ case 230400:
-+ BAUD = B230400;
-+ break;
-+#endif
-+#ifdef B115200
-+ case 115200:
-+ BAUD = B115200;
-+ break;
-+#endif
-+#ifdef B57600
-+ case 57600:
-+ BAUD = B57600;
-+ break;
-+#endif
- case 38400:
- BAUD = B38400;
- break;
+++ /dev/null
-#
-# Copyright (C) 2012-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PECL_NAME:=libevent
-PECL_LONGNAME:=Libevent - event notification
-
-PKG_VERSION:=0.1.0
-PKG_RELEASE:=2
-PKG_MD5SUM:=e091371a9e714098a4c04a6e3daeb56a
-
-PKG_NAME:=php5-pecl-$(PECL_NAME)
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
-
-PKG_LICENSE:=PHPv3.01
-PKG_LICENSE_FILES:=
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-CONFIGURE_ARGS+= --with-libevent=shared,"$(STAGING_DIR)/usr"
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libevent2 +php5-mod-sockets))
-$(eval $(call BuildPackage,$(PKG_NAME)))
+++ /dev/null
---- a/libevent.c
-+++ b/libevent.c
-@@ -42,10 +42,12 @@
- (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type))
- #endif
-
--#ifdef PHP_WIN32
-+//#ifdef PHP_WIN32
- /* XXX compiling with 2.x on Windows. Luckily the ext code works thanks to the
- compat exports from the libevent. However it might need to be adapted to the
- never version, so this ifdefs would go away. */
-+#if 1
-+/* force use of libevent2 on OpenWrt and by-pass compat event.h */
- # include <event2/event.h>
- # include <event2/event_compat.h>
- # include <event2/event_struct.h>
+++ /dev/null
-#
-# 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
-
-PECL_NAME:=propro
-PECL_LONGNAME:=Property proxy
-
-PKG_VERSION:=1.0.0
-PKG_RELEASE:=1
-PKG_MD5SUM:=9c775035fd17c65f0162b7eb1b4f8564
-
-PKG_NAME:=php5-pecl-propro
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-CONFIGURE_ARGS+= \
- --enable-propro
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)))
+++ /dev/null
-#
-# 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
-
-PECL_NAME:=raphf
-PECL_LONGNAME:=Resource and persistent handles factory
-
-PKG_VERSION:=1.1.0
-PKG_RELEASE:=1
-PKG_MD5SUM:=4d95c44dc28be089ce59bceb647b8db2
-
-PKG_NAME:=php5-pecl-raphf
-PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=http://pecl.php.net/get/
-
-PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
-
-PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PECL_NAME)-$(PKG_VERSION)
-PKG_BUILD_PARALLEL:=1
-
-PKG_FIXUP:=autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-include ../php5/pecl.mk
-
-CONFIGURE_ARGS+= \
- --enable-raphf
-
-$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
-$(eval $(call BuildPackage,$(PKG_NAME)))
+++ /dev/null
-#
-# Copyright (C) 2006-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=php
-PKG_VERSION:=5.6.23
-PKG_RELEASE:=1
-
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>, Michael Heimpold <mhei@heimpold.de>
-
-PKG_LICENSE:=PHPv3.01
-PKG_LICENSE_FILES:=LICENSE
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=c2d2155e50bcbaa0ee7a63845862c894
-
-PKG_FIXUP:=libtool autoreconf
-PKG_BUILD_PARALLEL:=1
-PKG_USE_MIPS16:=0
-
-PHP5_MODULES = \
- calendar ctype curl \
- fileinfo \
- dom \
- exif \
- ftp \
- gettext gd gmp \
- hash \
- iconv intl \
- json \
- ldap \
- mbstring mcrypt mysql mysqli \
- opcache openssl \
- pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql \
- session shmop simplexml soap sockets sqlite3 sysvmsg sysvsem sysvshm \
- tokenizer \
- xml xmlreader xmlwriter zip \
-
-PKG_CONFIG_DEPENDS:= \
- $(patsubst %,CONFIG_PACKAGE_php5-mod-%,$(PHP5_MODULES)) \
- CONFIG_PHP5_FILTER CONFIG_PHP5_LIBXML CONFIG_PHP5_SYSTEMTZDATA
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/php5/Default
- SUBMENU:=PHP
- SECTION:=lang
- CATEGORY:=Languages
- TITLE:=PHP5 Hypertext preprocessor
- URL:=http://www.php.net/
- DEPENDS:=php5
-endef
-
-define Package/php5/Default/description
- PHP is a widely-used general-purpose scripting language that is especially
- suited for Web development and can be embedded into HTML.
-endef
-
-define Package/php5/config
- config PHP5_FILTER
- bool "PHP5 Filter support"
- depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
-
- config PHP5_LIBXML
- bool "PHP5 LIBXML support"
- depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
-
- config PHP5_SYSTEMTZDATA
- bool "Use system timezone data instead of php's built-in database"
- depends on PACKAGE_php5-cli || PACKAGE_php5-cgi
- select PACKAGE_zoneinfo-core
- default y
- help
- Enabling this feature automatically selects the zoneinfo-core package
- which contains data for UTC timezone. To use other timezones you have
- to install the corresponding zoneinfo-... package(s).
-endef
-
-define Package/php5
- $(call Package/php5/Default)
-
- DEPENDS:=+libpcre +zlib \
- +PHP5_LIBXML:libxml2
-endef
-
-define Package/php5/description
- $(call Package/php5/Default/description)
- This package contains only the PHP config file. You must actually choose
- your PHP flavour (cli, cgi or fastcgi).
-endef
-
-define Package/php5-cli
- $(call Package/php5/Default)
- DEPENDS+= +PACKAGE_php5-mod-intl:libstdcpp
- TITLE+= (CLI)
-endef
-
-define Package/php5-cli/description
- $(call Package/php5/Default/description)
- This package contains the CLI version of the PHP5 interpreter.
-endef
-
-define Package/php5-cgi
- $(call Package/php5/Default)
- DEPENDS+= +PACKAGE_php5-mod-intl:libstdcpp
- TITLE+= (CGI & FastCGI)
-endef
-
-define Package/php5-cgi/description
- $(call Package/php5/Default/description)
- This package contains the CGI version of the PHP5 interpreter.
-endef
-
-define Package/php5-fastcgi
- $(call Package/php5/Default)
- DEPENDS+= +php5-cgi
- TITLE:=FastCGI startup script
-endef
-
-define Package/php5-fastcgi/description
- As FastCGI support is now a core feature the php5-fastcgi package now depends
- on the php5-cgi package, containing just the startup script.
-endef
-
-define Package/php5-fpm
- $(call Package/php5/Default)
- DEPENDS+= +php5-cgi
- TITLE+= (FPM)
-endef
-
-define Package/php5-fpm/description
- $(call Package/php5/Default/description)
- This package contains the FastCGI Process Manager of the PHP5 interpreter.
-endef
-
-CONFIGURE_ARGS+= \
- --enable-cli \
- --enable-cgi \
- --enable-fpm \
- --enable-shared \
- --disable-static \
- --disable-rpath \
- --disable-debug \
- --without-pear \
- \
- --with-config-file-path=/etc \
- --with-config-file-scan-dir=/etc/php5 \
- --disable-short-tags \
- \
- --with-zlib="$(STAGING_DIR)/usr" \
- --with-zlib-dir="$(STAGING_DIR)/usr" \
- --with-pcre-regex="$(STAGING_DIR)/usr" \
- --disable-phar
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-calendar),)
- CONFIGURE_ARGS+= --enable-calendar=shared
-else
- CONFIGURE_ARGS+= --disable-calendar
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-ctype),)
- CONFIGURE_ARGS+= --enable-ctype=shared
-else
- CONFIGURE_ARGS+= --disable-ctype
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-curl),)
- CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-curl
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-fileinfo),)
- CONFIGURE_ARGS+= --enable-fileinfo=shared
-else
- CONFIGURE_ARGS+= --disable-fileinfo
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-gettext),)
- CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
-else
- CONFIGURE_ARGS+= --without-gettext
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-dom),)
- CONFIGURE_ARGS+= --enable-dom=shared
-else
- CONFIGURE_ARGS+= --disable-dom
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-exif),)
- CONFIGURE_ARGS+= --enable-exif=shared
-else
- CONFIGURE_ARGS+= --disable-exif
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-ftp),)
- CONFIGURE_ARGS+= --enable-ftp=shared
-else
- CONFIGURE_ARGS+= --disable-ftp
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-gd),)
- CONFIGURE_ARGS+= \
- --with-gd=shared \
- --without-freetype-dir \
- --with-jpeg-dir="$(STAGING_DIR)/usr" \
- --with-png-dir="$(STAGING_DIR)/usr" \
- --without-xpm-dir \
- --without-t1lib \
- --enable-gd-native-ttf \
- --disable-gd-jis-conv
-else
- CONFIGURE_ARGS+= --without-gd
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-gmp),)
- CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-gmp
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-hash),)
- CONFIGURE_ARGS+= --enable-hash=shared
-else
- CONFIGURE_ARGS+= --disable-hash
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-iconv),)
- CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
-else
- CONFIGURE_ARGS+= --without-iconv
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-intl),)
- CONFIGURE_ARGS+= --enable-intl=shared
-else
- CONFIGURE_ARGS+= --disable-intl
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-json),)
- CONFIGURE_ARGS+= --enable-json=shared
-else
- CONFIGURE_ARGS+= --disable-json
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-ldap),)
- CONFIGURE_ARGS+= \
- --with-ldap=shared,"$(STAGING_DIR)/usr" \
- --with-ldap-sasl="$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-ldap
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mbstring),)
- CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex
-else
- CONFIGURE_ARGS+= --disable-mbstring
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mcrypt),)
- CONFIGURE_ARGS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-mcrypt
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mysql),)
- CONFIGURE_ARGS+= --with-mysql=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-mysql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-mysqli),)
- CONFIGURE_ARGS+= --with-mysqli=shared,"$(STAGING_DIR)/usr/bin/mysql_config"
-else
- CONFIGURE_ARGS+= --without-mysqli
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-opcache),)
- CONFIGURE_ARGS+= --enable-opcache=shared
-else
- CONFIGURE_ARGS+= --disable-opcache
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-openssl),)
- CONFIGURE_ARGS+= \
- --with-openssl=shared,"$(STAGING_DIR)/usr" \
- --with-kerberos=no \
- --with-openssl-dir="$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-openssl
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pcntl),)
- CONFIGURE_ARGS+= --enable-pcntl=shared
-else
- CONFIGURE_ARGS+= --disable-pcntl
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo),)
- CONFIGURE_ARGS+= --enable-pdo=shared
- ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo-mysql),)
- CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
- else
- CONFIGURE_ARGS+= --without-pdo-mysql
- endif
- ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo-pgsql),)
- CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
- else
- CONFIGURE_ARGS+= --without-pdo-pgsql
- endif
- ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pdo-sqlite),)
- CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
- else
- CONFIGURE_ARGS+= --without-pdo-sqlite
- endif
-else
- CONFIGURE_ARGS+= --disable-pdo
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-pgsql),)
- CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-pgsql
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-session),)
- CONFIGURE_ARGS+= --enable-session=shared
-else
- CONFIGURE_ARGS+= --disable-session
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-shmop),)
- CONFIGURE_ARGS+= --enable-shmop=shared
-else
- CONFIGURE_ARGS+= --disable-shmop
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-simplexml),)
- CONFIGURE_ARGS+= --enable-simplexml=shared
-else
- CONFIGURE_ARGS+= --disable-simplexml
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-soap),)
- CONFIGURE_ARGS+= --enable-soap=shared
-else
- CONFIGURE_ARGS+= --disable-soap
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sockets),)
- CONFIGURE_ARGS+= --enable-sockets=shared
-else
- CONFIGURE_ARGS+= --disable-sockets
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sqlite3),)
- CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --without-sqlite3
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sysvmsg),)
- CONFIGURE_ARGS+= --enable-sysvmsg=shared
-else
- CONFIGURE_ARGS+= --disable-sysvmsg
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sysvsem),)
- CONFIGURE_ARGS+= --enable-sysvsem=shared
-else
- CONFIGURE_ARGS+= --disable-sysvsem
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-sysvshm),)
- CONFIGURE_ARGS+= --enable-sysvshm=shared
-else
- CONFIGURE_ARGS+= --disable-sysvshm
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-tokenizer),)
- CONFIGURE_ARGS+= --enable-tokenizer=shared
-else
- CONFIGURE_ARGS+= --disable-tokenizer
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-xml),)
- CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
- ifneq ($(CONFIG_PHP5_LIBXML),)
- CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
- else
- CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
- endif
-else
- CONFIGURE_ARGS+= --disable-xml
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-xmlreader),)
- CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --disable-xmlreader
-endif
-
-ifneq ($(SDK)$(CONFIG_PACKAGE_php5-mod-xmlwriter),)
- CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
-else
- CONFIGURE_ARGS+= --disable-xmlwriter
-endif
-
-ifneq ($(CONFIG_PACKAGE_php5-mod-zip),)
- CONFIGURE_ARGS+= --enable-zip=shared
-else
- CONFIGURE_ARGS+= --disable-zip
-endif
-
-ifneq ($(SDK)$(CONFIG_PHP5_FILTER),)
- CONFIGURE_ARGS+= --enable-filter
-else
- CONFIGURE_ARGS+= --disable-filter
-endif
-
-ifneq ($(SDK)$(CONFIG_PHP5_LIBXML),)
- CONFIGURE_ARGS+= --enable-libxml
- CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
-else
- CONFIGURE_ARGS+= --disable-libxml
-endif
-
-ifneq ($(CONFIG_PHP5_SYSTEMTZDATA),)
- CONFIGURE_ARGS+= --with-system-tzdata
-else
- CONFIGURE_ARGS+= --without-system-tzdata
-endif
-
-CONFIGURE_VARS+= \
- ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
- php_cv_cc_rpath="no" \
- iconv_impl_name="gnu_libiconv" \
- ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
-
-define Package/php5/conffiles
-/etc/php.ini
-endef
-
-define Package/php5/install
- $(INSTALL_DIR) $(1)/etc
- $(INSTALL_DATA) ./files/php.ini $(1)/etc/
-endef
-
-define Package/php5-cli/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
-endef
-
-define Package/php5-cgi/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
- ln -sf php-cgi $(1)/usr/bin/php-fcgi
-endef
-
-define Package/php5-fastcgi/install
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/php5-fastcgi.config $(1)/etc/config/php5-fastcgi
-
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/php5-fastcgi.init $(1)/etc/init.d/php5-fastcgi
-endef
-
-define Package/php5-fpm/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm
-
- $(INSTALL_DIR) $(1)/etc
- $(INSTALL_DATA) ./files/php5-fpm.conf $(1)/etc/php5-fpm.conf
-
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_DATA) ./files/php5-fpm.config $(1)/etc/config/php5-fpm
-
- $(INSTALL_DIR) $(1)/etc/php5-fpm.d
- $(INSTALL_DATA) ./files/php5-fpm-www.conf $(1)/etc/php5-fpm.d/www.conf
-
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/php5-fpm.init $(1)/etc/init.d/php5-fpm
-endef
-
-define Build/Prepare
- $(call Build/Prepare/Default)
- ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
-endef
-
-define Build/InstallDev
- mkdir -p $(PKG_BUILD_DIR)/staging/usr/bin
- make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
- rm -f $(PKG_BUILD_DIR)/staging/usr/bin/php
- $(CP) $(PKG_BUILD_DIR)/staging/* $(STAGING_DIR)/host
- sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/host/usr'#" $(STAGING_DIR)/host/usr/bin/phpize
- sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/host/usr'#" $(STAGING_DIR)/host/usr/bin/phpize
- sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/host/usr\"#" $(STAGING_DIR)/host/usr/bin/php-config
-endef
-
-define BuildModule
-
- define Package/php5-mod-$(1)
- $(call Package/php5/Default)
-
- ifneq ($(3),)
- DEPENDS+=$(3)
- endif
-
- TITLE:=$(2) shared module
- endef
-
- define Package/php5-mod-$(1)/install
- $(INSTALL_DIR) $$(1)/usr/lib/php
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
- $(INSTALL_DIR) $$(1)/etc/php5
- ifeq ($(4),zend)
- echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini
- else
- echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini
- endif
- endef
-
- $$(eval $$(call BuildPackage,php5-mod-$(1)))
-
-endef
-
-$(eval $(call BuildPackage,php5))
-$(eval $(call BuildPackage,php5-cgi))
-$(eval $(call BuildPackage,php5-cli))
-$(eval $(call BuildPackage,php5-fastcgi))
-$(eval $(call BuildPackage,php5-fpm))
-
-#$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
-$(eval $(call BuildModule,calendar,Calendar))
-$(eval $(call BuildModule,ctype,Ctype))
-$(eval $(call BuildModule,curl,cURL,+PACKAGE_php5-mod-curl:libcurl))
-$(eval $(call BuildModule,dom,DOM,+@PHP5_LIBXML +PACKAGE_php5-mod-dom:libxml2))
-$(eval $(call BuildModule,exif,EXIF))
-$(eval $(call BuildModule,fileinfo,Fileinfo))
-$(eval $(call BuildModule,ftp,FTP,+PACKAGE_php5-mod-ftp:libopenssl))
-$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php5-mod-gd:libjpeg +PACKAGE_php5-mod-gd:libpng))
-$(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php5-mod-gettext:libintl-full))
-$(eval $(call BuildModule,gmp,GMP,+PACKAGE_php5-mod-gmp:libgmp))
-$(eval $(call BuildModule,hash,Hash))
-$(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
-$(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php5-mod-intl:icu))
-$(eval $(call BuildModule,json,JSON))
-$(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php5-mod-ldap:libopenldap +PACKAGE_php5-mod-ldap:libsasl2))
-$(eval $(call BuildModule,mbstring,MBString))
-$(eval $(call BuildModule,mcrypt,Mcrypt,+PACKAGE_php5-mod-mcrypt:libmcrypt +PACKAGE_php5-mod-mcrypt:libltdl))
-$(eval $(call BuildModule,mysql,MySQL,+PACKAGE_php5-mod-mysql:libmysqlclient))
-$(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php5-mod-mysqli:libmysqlclient))
-$(eval $(call BuildModule,opcache,OPcache,,zend))
-$(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php5-mod-openssl:libopenssl))
-$(eval $(call BuildModule,pcntl,PCNTL))
-$(eval $(call BuildModule,pdo,PHP Data Objects))
-$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php5-mod-pdo +PACKAGE_php5-mod-pdo-mysql:libmysqlclient))
-$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php5-mod-pdo +PACKAGE_php5-mod-pdo-pgsql:libpq))
-$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php5-mod-pdo +PACKAGE_php5-mod-pdo-sqlite:libsqlite3 +PACKAGE_php5-mod-pdo-sqlite:librt))
-$(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php5-mod-pgsql:libpq))
-$(eval $(call BuildModule,session,Session))
-$(eval $(call BuildModule,shmop,Shared Memory))
-$(eval $(call BuildModule,simplexml,SimpleXML,+@PHP5_LIBXML +PACKAGE_php5-mod-simplexml:libxml2))
-$(eval $(call BuildModule,soap,SOAP,+@PHP5_LIBXML +PACKAGE_php5-mod-soap:libxml2))
-$(eval $(call BuildModule,sockets,Sockets))
-$(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php5-mod-sqlite3:libsqlite3))
-$(eval $(call BuildModule,sysvmsg,System V messages))
-$(eval $(call BuildModule,sysvsem,System V shared memory))
-$(eval $(call BuildModule,sysvshm,System V semaphore))
-$(eval $(call BuildModule,tokenizer,Tokenizer))
-$(eval $(call BuildModule,xml,XML,+PHP5_LIBXML:libxml2 +!PHP5_LIBXML:libexpat))
-$(eval $(call BuildModule,xmlreader,XMLReader,+@PHP5_LIBXML +PACKAGE_php5-mod-xmlreader:libxml2))
-$(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP5_LIBXML +PACKAGE_php5-mod-xmlwriter:libxml2))
-$(eval $(call BuildModule,zip,ZIP,+PACKAGE_php5-mod-zip:zlib))
+++ /dev/null
-[PHP]
-
-zend.ze1_compatibility_mode = Off
-
-; Language Options
-
-engine = On
-;short_open_tag = Off
-precision = 12
-y2k_compliance = On
-output_buffering = Off
-;output_handler =
-zlib.output_compression = Off
-;zlib.output_compression_level = -1
-;zlib.output_handler =
-implicit_flush = Off
-unserialize_callback_func =
-serialize_precision = 100
-
-;open_basedir =
-disable_functions =
-disable_classes =
-
-; Colors for Syntax Highlighting mode. Anything that's acceptable in
-; <span style="color: ???????"> would work.
-;highlight.string = #DD0000
-;highlight.comment = #FF9900
-;highlight.keyword = #007700
-;highlight.bg = #FFFFFF
-;highlight.default = #0000BB
-;highlight.html = #000000
-
-;ignore_user_abort = On
-;realpath_cache_size = 16k
-;realpath_cache_ttl = 120
-
-; Miscellaneous
-
-expose_php = On
-
-; Resource Limits
-
-max_execution_time = 30 ; Maximum execution time of each script, in seconds.
-max_input_time = 60 ; Maximum amount of time each script may spend parsing request data.
-;max_input_nesting_level = 64
-memory_limit = 8M ; Maximum amount of memory a script may consume.
-
-; Error handling and logging
-
-; Error Level Constants:
-; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
-; E_ERROR - fatal run-time errors
-; E_RECOVERABLE_ERROR - almost fatal run-time errors
-; E_WARNING - run-time warnings (non-fatal errors)
-; E_PARSE - compile-time parse errors
-; E_NOTICE - run-time notices (these are warnings which often result
-; from a bug in your code, but it's possible that it was
-; intentional (e.g., using an uninitialized variable and
-; relying on the fact it's automatically initialized to an
-; empty string)
-; E_STRICT - run-time notices, enable to have PHP suggest changes
-; to your code which will ensure the best interoperability
-; and forward compatibility of your code
-; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
-; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
-; initial startup
-; E_COMPILE_ERROR - fatal compile-time errors
-; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
-; E_USER_ERROR - user-generated error message
-; E_USER_WARNING - user-generated warning message
-; E_USER_NOTICE - user-generated notice message
-; E_DEPRECATED - warn about code that will not work in future versions
-; of PHP
-; E_USER_DEPRECATED - user-generated deprecation warnings
-;
-; Common Values:
-; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
-; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
-; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
-; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
-; Default Value: E_ALL & ~E_NOTICE
-error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
-
-display_errors = On
-display_startup_errors = Off
-log_errors = Off
-log_errors_max_len = 1024
-ignore_repeated_errors = Off
-ignore_repeated_source = Off
-report_memleaks = On
-;report_zend_debug = 0
-track_errors = Off
-;html_errors = Off
-;docref_root = "/phpmanual/"
-;docref_ext = .html
-;error_prepend_string = "<font color=#ff0000>"
-;error_append_string = "</font>"
-; Log errors to specified file.
-;error_log = /var/log/php_errors.log
-; Log errors to syslog.
-;error_log = syslog
-
-; Data Handling
-
-;arg_separator.output = "&"
-;arg_separator.input = ";&"
-variables_order = "EGPCS"
-request_order = "GP"
-register_globals = Off
-register_long_arrays = Off
-register_argc_argv = On
-auto_globals_jit = On
-post_max_size = 8M
-;magic_quotes_gpc = Off
-magic_quotes_runtime = Off
-magic_quotes_sybase = Off
-auto_prepend_file =
-auto_append_file =
-default_mimetype = "text/html"
-;default_charset = "iso-8859-1"
-;always_populate_raw_post_data = On
-
-; Paths and Directories
-
-; UNIX: "/path1:/path2"
-;include_path = ".:/php/includes"
-doc_root = "/www"
-user_dir =
-extension_dir = "/usr/lib/php"
-enable_dl = On
-;cgi.force_redirect = 1
-;cgi.nph = 1
-;cgi.redirect_status_env = ;
-cgi.fix_pathinfo=1
-;fastcgi.impersonate = 1;
-;fastcgi.logging = 0
-;cgi.rfc2616_headers = 0
-
-; File Uploads
-
-file_uploads = On
-upload_tmp_dir = "/tmp"
-upload_max_filesize = 2M
-max_file_uploads = 20
-
-; Fopen wrappers
-
-allow_url_fopen = On
-allow_url_include = Off
-;from="john@doe.com"
-;user_agent="PHP"
-default_socket_timeout = 60
-;auto_detect_line_endings = Off
-
-; Dynamic Extensions
-
-;extension=ctype.so
-;extension=curl.so
-;extension=dom.so
-;extension=exif.so
-;extension=ftp.so
-;extension=gd.so
-;extension=gmp.so
-;extension=hash.so
-;extension=iconv.so
-;extension=json.so
-;extension=ldap.so
-;extension=mbstring.so
-;extension=mcrypt.so
-;extension=mysql.so
-;extension=openssl.so
-;extension=pcre.so
-;extension=pdo.so
-;extension=pdo-mysql.so
-;extension=pdo-pgsql.so
-;extension=pdo_sqlite.so
-;extension=pgsql.so
-;extension=session.so
-;extension=soap.so
-;extension=sockets.so
-;extension=sqlite.so
-;extension=sqlite3.so
-;extension=tokenizer.so
-;extension=xml.so
-;extension=xmlreader.so
-;extension=xmlwriter.so
-
-; Module Settings
-
-[APC]
-apc.enabled = 1
-apc.shm_segments = 1 ;The number of shared memory segments to allocate for the compiler cache.
-apc.shm_size = 4M ;The size of each shared memory segment.
-
-[Date]
-;date.timezone =
-;date.default_latitude = 31.7667
-;date.default_longitude = 35.2333
-;date.sunrise_zenith = 90.583333
-;date.sunset_zenith = 90.583333
-
-[filter]
-;filter.default = unsafe_raw
-;filter.default_flags =
-
-[iconv]
-;iconv.input_encoding = ISO-8859-1
-;iconv.internal_encoding = ISO-8859-1
-;iconv.output_encoding = ISO-8859-1
-
-[sqlite]
-;sqlite.assoc_case = 0
-
-[sqlite3]
-;sqlite3.extension_dir =
-
-[Pdo_mysql]
-pdo_mysql.cache_size = 2000
-pdo_mysql.default_socket=
-
-[MySQL]
-mysql.allow_local_infile = On
-mysql.allow_persistent = On
-mysql.cache_size = 2000
-mysql.max_persistent = -1
-mysql.max_links = -1
-mysql.default_port =
-mysql.default_socket =
-mysql.default_host =
-mysql.default_user =
-mysql.default_password =
-mysql.connect_timeout = 60
-mysql.trace_mode = Off
-
-[PostgresSQL]
-pgsql.allow_persistent = On
-pgsql.auto_reset_persistent = Off
-pgsql.max_persistent = -1
-pgsql.max_links = -1
-pgsql.ignore_notice = 0
-pgsql.log_notice = 0
-
-[Session]
-session.save_handler = files
-session.save_path = "/tmp"
-session.use_cookies = 1
-;session.cookie_secure =
-session.use_only_cookies = 1
-session.name = PHPSESSID
-session.auto_start = 0
-session.cookie_lifetime = 0
-session.cookie_path = /
-session.cookie_domain =
-session.cookie_httponly =
-session.serialize_handler = php
-session.gc_probability = 1
-session.gc_divisor = 100
-session.gc_maxlifetime = 1440
-session.bug_compat_42 = On
-session.bug_compat_warn = On
-session.referer_check =
-session.entropy_length = 0
-;session.entropy_file = /dev/urandom
-session.entropy_file =
-;session.entropy_length = 16
-session.cache_limiter = nocache
-session.cache_expire = 180
-session.use_trans_sid = 0
-session.hash_function = 0
-session.hash_bits_per_character = 4
-url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldset="
-
-[mbstring]
-;mbstring.language = Japanese
-;mbstring.internal_encoding = EUC-JP
-;mbstring.http_input = auto
-;mbstring.http_output = SJIS
-;mbstring.encoding_translation = Off
-;mbstring.detect_order = auto
-;mbstring.substitute_character = none;
-;mbstring.func_overload = 0
-;mbstring.strict_detection = Off
-;mbstring.http_output_conv_mimetype=
-;mbstring.script_encoding=
-
-[gd]
-;gd.jpeg_ignore_warning = 0
-
-[exif]
-;exif.encode_unicode = ISO-8859-15
-;exif.decode_unicode_motorola = UCS-2BE
-;exif.decode_unicode_intel = UCS-2LE
-;exif.encode_jis =
-;exif.decode_jis_motorola = JIS
-;exif.decode_jis_intel = JIS
-
-[soap]
-soap.wsdl_cache_enabled=1
-soap.wsdl_cache_dir="/tmp"
-soap.wsdl_cache_ttl=86400
-soap.wsdl_cache_limit = 5
-
-[sysvshm]
-;sysvshm.init_mem = 10000
-
-[ldap]
-ldap.max_links = -1
-
-[mcrypt]
-;mcrypt.algorithms_dir=
-;mcrypt.modes_dir=
-
-[opcache]
-;opcache.memory_consumption=8 ; 8M is the allowed minimum
-;opcache.interned_strings_buffer=1
-opcache.max_accelerated_files=200 ; 200 is the allowed minimum
-;opcache.revalidate_freq=60
-;opcache.fast_shutdown=1
-opcache.enable_cli=1
-opcache.enable=1
-;opcache.log_verbosity_level=4
+++ /dev/null
-config php5-fastcgi
- option enabled 1
- option port '1026'
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2010-2011 OpenWrt.org
-
-START=50
-
-SERVICE_DAEMONIZE=1
-SERVICE_WRITE_PID=1
-
-start_instance() {
- local section="$1"
- local enabled
- local port
-
- config_get_bool enabled "$section" 'enabled' 0
- config_get port "$section" 'port' 1026
-
- [ $enabled -gt 0 ] || return 1
-
- PHP_FCGI_CHILDREN='' \
- service_start /usr/bin/php-fcgi -b $port
-}
-
-start() {
- config_load 'php5-fastcgi'
- config_foreach start_instance 'php5-fastcgi'
-}
-
-stop() {
- service_stop /usr/bin/php-fcgi
-}
+++ /dev/null
-; Start a new pool named 'www'.
-; the variable $pool can we used in any directive and will be replaced by the
-; pool name ('www' here)
-[www]
-
-; Per pool prefix
-; It only applies on the following directives:
-; - 'slowlog'
-; - 'listen' (unixsocket)
-; - 'chroot'
-; - 'chdir'
-; - 'php_values'
-; - 'php_admin_values'
-; When not set, the global prefix (or /usr) applies instead.
-; Note: This directive can also be relative to the global prefix.
-; Default Value: none
-;prefix = /path/to/pools/$pool
-
-; Unix user/group of processes
-; Note: The user is mandatory. If the group is not set, the default user's group
-; will be used.
-user = nobody
-;group =
-
-; The address on which to accept FastCGI requests.
-; Valid syntaxes are:
-; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
-; a specific port;
-; 'port' - to listen on a TCP socket to all addresses on a
-; specific port;
-; '/path/to/unix/socket' - to listen on a unix socket.
-; Note: This value is mandatory.
-listen = /var/run/php5-fpm.sock
-
-; Set listen(2) backlog.
-; Default Value: 128 (-1 on FreeBSD and OpenBSD)
-;listen.backlog = 128
-
-; Set permissions for unix socket, if one is used. In Linux, read/write
-; permissions must be set in order to allow connections from a web server. Many
-; BSD-derived systems allow connections regardless of permissions.
-; Default Values: user and group are set as the running user
-; mode is set to 0666
-;listen.owner = www-data
-;listen.group = www-data
-;listen.mode = 0666
-
-; List of ipv4 addresses of FastCGI clients which are allowed to connect.
-; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
-; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
-; must be separated by a comma. If this value is left blank, connections will be
-; accepted from any ip address.
-; Default Value: any
-;listen.allowed_clients = 127.0.0.1
-
-; Specify the nice(2) priority to apply to the pool processes (only if set)
-; The value can vary from -19 (highest priority) to 20 (lower priority)
-; Note: - It will only work if the FPM master process is launched as root
-; - The pool processes will inherit the master process priority
-; unless it specified otherwise
-; Default Value: no set
-; priority = -19
-
-; Choose how the process manager will control the number of child processes.
-; Possible Values:
-; static - a fixed number (pm.max_children) of child processes;
-; dynamic - the number of child processes are set dynamically based on the
-; following directives. With this process management, there will be
-; always at least 1 children.
-; pm.max_children - the maximum number of children that can
-; be alive at the same time.
-; pm.start_servers - the number of children created on startup.
-; pm.min_spare_servers - the minimum number of children in 'idle'
-; state (waiting to process). If the number
-; of 'idle' processes is less than this
-; number then some children will be created.
-; pm.max_spare_servers - the maximum number of children in 'idle'
-; state (waiting to process). If the number
-; of 'idle' processes is greater than this
-; number then some children will be killed.
-; ondemand - no children are created at startup. Children will be forked when
-; new requests will connect. The following parameter are used:
-; pm.max_children - the maximum number of children that
-; can be alive at the same time.
-; pm.process_idle_timeout - The number of seconds after which
-; an idle process will be killed.
-; Note: This value is mandatory.
-pm = dynamic
-
-; The number of child processes to be created when pm is set to 'static' and the
-; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
-; This value sets the limit on the number of simultaneous requests that will be
-; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
-; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
-; CGI. The below defaults are based on a server without much resources. Don't
-; forget to tweak pm.* to fit your needs.
-; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
-; Note: This value is mandatory.
-pm.max_children = 5
-
-; The number of child processes created on startup.
-; Note: Used only when pm is set to 'dynamic'
-; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
-pm.start_servers = 2
-
-; The desired minimum number of idle server processes.
-; Note: Used only when pm is set to 'dynamic'
-; Note: Mandatory when pm is set to 'dynamic'
-pm.min_spare_servers = 1
-
-; The desired maximum number of idle server processes.
-; Note: Used only when pm is set to 'dynamic'
-; Note: Mandatory when pm is set to 'dynamic'
-pm.max_spare_servers = 3
-
-; The number of seconds after which an idle process will be killed.
-; Note: Used only when pm is set to 'ondemand'
-; Default Value: 10s
-;pm.process_idle_timeout = 10s;
-
-; The number of requests each child process should execute before respawning.
-; This can be useful to work around memory leaks in 3rd party libraries. For
-; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
-; Default Value: 0
-;pm.max_requests = 500
-
-; The URI to view the FPM status page. If this value is not set, no URI will be
-; recognized as a status page. It shows the following informations:
-; pool - the name of the pool;
-; process manager - static, dynamic or ondemand;
-; start time - the date and time FPM has started;
-; start since - number of seconds since FPM has started;
-; accepted conn - the number of request accepted by the pool;
-; listen queue - the number of request in the queue of pending
-; connections (see backlog in listen(2));
-; max listen queue - the maximum number of requests in the queue
-; of pending connections since FPM has started;
-; listen queue len - the size of the socket queue of pending connections;
-; idle processes - the number of idle processes;
-; active processes - the number of active processes;
-; total processes - the number of idle + active processes;
-; max active processes - the maximum number of active processes since FPM
-; has started;
-; max children reached - number of times, the process limit has been reached,
-; when pm tries to start more children (works only for
-; pm 'dynamic' and 'ondemand');
-; Value are updated in real time.
-; Example output:
-; pool: www
-; process manager: static
-; start time: 01/Jul/2011:17:53:49 +0200
-; start since: 62636
-; accepted conn: 190460
-; listen queue: 0
-; max listen queue: 1
-; listen queue len: 42
-; idle processes: 4
-; active processes: 11
-; total processes: 15
-; max active processes: 12
-; max children reached: 0
-;
-; By default the status page output is formatted as text/plain. Passing either
-; 'html', 'xml' or 'json' in the query string will return the corresponding
-; output syntax. Example:
-; http://www.foo.bar/status
-; http://www.foo.bar/status?json
-; http://www.foo.bar/status?html
-; http://www.foo.bar/status?xml
-;
-; By default the status page only outputs short status. Passing 'full' in the
-; query string will also return status for each pool process.
-; Example:
-; http://www.foo.bar/status?full
-; http://www.foo.bar/status?json&full
-; http://www.foo.bar/status?html&full
-; http://www.foo.bar/status?xml&full
-; The Full status returns for each process:
-; pid - the PID of the process;
-; state - the state of the process (Idle, Running, ...);
-; start time - the date and time the process has started;
-; start since - the number of seconds since the process has started;
-; requests - the number of requests the process has served;
-; request duration - the duration in µs of the requests;
-; request method - the request method (GET, POST, ...);
-; request URI - the request URI with the query string;
-; content length - the content length of the request (only with POST);
-; user - the user (PHP_AUTH_USER) (or '-' if not set);
-; script - the main script called (or '-' if not set);
-; last request cpu - the %cpu the last request consumed
-; it's always 0 if the process is not in Idle state
-; because CPU calculation is done when the request
-; processing has terminated;
-; last request memory - the max amount of memory the last request consumed
-; it's always 0 if the process is not in Idle state
-; because memory calculation is done when the request
-; processing has terminated;
-; If the process is in Idle state, then informations are related to the
-; last request the process has served. Otherwise informations are related to
-; the current request being served.
-; Example output:
-; ************************
-; pid: 31330
-; state: Running
-; start time: 01/Jul/2011:17:53:49 +0200
-; start since: 63087
-; requests: 12808
-; request duration: 1250261
-; request method: GET
-; request URI: /test_mem.php?N=10000
-; content length: 0
-; user: -
-; script: /home/fat/web/docs/php/test_mem.php
-; last request cpu: 0.00
-; last request memory: 0
-;
-; Note: There is a real-time FPM status monitoring sample web page available
-; It's available in: ${prefix}/share/fpm/status.html
-;
-; Note: The value must start with a leading slash (/). The value can be
-; anything, but it may not be a good idea to use the .php extension or it
-; may conflict with a real PHP file.
-; Default Value: not set
-;pm.status_path = /status
-
-; The ping URI to call the monitoring page of FPM. If this value is not set, no
-; URI will be recognized as a ping page. This could be used to test from outside
-; that FPM is alive and responding, or to
-; - create a graph of FPM availability (rrd or such);
-; - remove a server from a group if it is not responding (load balancing);
-; - trigger alerts for the operating team (24/7).
-; Note: The value must start with a leading slash (/). The value can be
-; anything, but it may not be a good idea to use the .php extension or it
-; may conflict with a real PHP file.
-; Default Value: not set
-;ping.path = /ping
-
-; This directive may be used to customize the response of a ping request. The
-; response is formatted as text/plain with a 200 response code.
-; Default Value: pong
-;ping.response = pong
-
-; The access log file
-; Default: not set
-;access.log = log/$pool.access.log
-
-; The access log format.
-; The following syntax is allowed
-; %%: the '%' character
-; %C: %CPU used by the request
-; it can accept the following format:
-; - %{user}C for user CPU only
-; - %{system}C for system CPU only
-; - %{total}C for user + system CPU (default)
-; %d: time taken to serve the request
-; it can accept the following format:
-; - %{seconds}d (default)
-; - %{miliseconds}d
-; - %{mili}d
-; - %{microseconds}d
-; - %{micro}d
-; %e: an environment variable (same as $_ENV or $_SERVER)
-; it must be associated with embraces to specify the name of the env
-; variable. Some exemples:
-; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
-; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
-; %f: script filename
-; %l: content-length of the request (for POST request only)
-; %m: request method
-; %M: peak of memory allocated by PHP
-; it can accept the following format:
-; - %{bytes}M (default)
-; - %{kilobytes}M
-; - %{kilo}M
-; - %{megabytes}M
-; - %{mega}M
-; %n: pool name
-; %o: ouput header
-; it must be associated with embraces to specify the name of the header:
-; - %{Content-Type}o
-; - %{X-Powered-By}o
-; - %{Transfert-Encoding}o
-; - ....
-; %p: PID of the child that serviced the request
-; %P: PID of the parent of the child that serviced the request
-; %q: the query string
-; %Q: the '?' character if query string exists
-; %r: the request URI (without the query string, see %q and %Q)
-; %R: remote IP address
-; %s: status (response code)
-; %t: server time the request was received
-; it can accept a strftime(3) format:
-; %d/%b/%Y:%H:%M:%S %z (default)
-; %T: time the log has been written (the request has finished)
-; it can accept a strftime(3) format:
-; %d/%b/%Y:%H:%M:%S %z (default)
-; %u: remote user
-;
-; Default: "%R - %u %t \"%m %r\" %s"
-;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
-
-; The log file for slow requests
-; Default Value: not set
-; Note: slowlog is mandatory if request_slowlog_timeout is set
-;slowlog = log/$pool.log.slow
-
-; The timeout for serving a single request after which a PHP backtrace will be
-; dumped to the 'slowlog' file. A value of '0s' means 'off'.
-; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
-; Default Value: 0
-;request_slowlog_timeout = 0
-
-; The timeout for serving a single request after which the worker process will
-; be killed. This option should be used when the 'max_execution_time' ini option
-; does not stop script execution for some reason. A value of '0' means 'off'.
-; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
-; Default Value: 0
-;request_terminate_timeout = 0
-
-; Set open file descriptor rlimit.
-; Default Value: system defined value
-;rlimit_files = 1024
-
-; Set max core size rlimit.
-; Possible Values: 'unlimited' or an integer greater or equal to 0
-; Default Value: system defined value
-;rlimit_core = 0
-
-; Chroot to this directory at the start. This value must be defined as an
-; absolute path. When this value is not set, chroot is not used.
-; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
-; of its subdirectories. If the pool prefix is not set, the global prefix
-; will be used instead.
-; Note: chrooting is a great security feature and should be used whenever
-; possible. However, all PHP paths will be relative to the chroot
-; (error_log, sessions.save_path, ...).
-; Default Value: not set
-;chroot =
-
-; Chdir to this directory at the start.
-; Note: relative path can be used.
-; Default Value: current directory or / when chroot
-chdir = /
-
-; Redirect worker stdout and stderr into main error log. If not set, stdout and
-; stderr will be redirected to /dev/null according to FastCGI specs.
-; Note: on highloaded environement, this can cause some delay in the page
-; process time (several ms).
-; Default Value: no
-;catch_workers_output = yes
-
-; Limits the extensions of the main script FPM will allow to parse. This can
-; prevent configuration mistakes on the web server side. You should only limit
-; FPM to .php extensions to prevent malicious users to use other extensions to
-; exectute php code.
-; Note: set an empty value to allow all extensions.
-; Default Value: .php
-;security.limit_extensions = .php .php3 .php4 .php5
-
-; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
-; the current environment.
-; Default Value: clean env
-;env[HOSTNAME] = $HOSTNAME
-;env[PATH] = /usr/local/bin:/usr/bin:/bin
-;env[TMP] = /tmp
-;env[TMPDIR] = /tmp
-;env[TEMP] = /tmp
-
-; Additional php.ini defines, specific to this pool of workers. These settings
-; overwrite the values previously defined in the php.ini. The directives are the
-; same as the PHP SAPI:
-; php_value/php_flag - you can set classic ini defines which can
-; be overwritten from PHP call 'ini_set'.
-; php_admin_value/php_admin_flag - these directives won't be overwritten by
-; PHP call 'ini_set'
-; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
-
-; Defining 'extension' will load the corresponding shared extension from
-; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
-; overwrite previously defined php.ini values, but will append the new value
-; instead.
-
-; Note: path INI options can be relative and will be expanded with the prefix
-; (pool, global or /usr)
-
-; Default Value: nothing is defined by default except the values in php.ini and
-; specified at startup with the -d argument
-;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
-;php_flag[display_errors] = off
-;php_admin_value[error_log] = /var/log/fpm-php.www.log
-;php_admin_flag[log_errors] = on
-;php_admin_value[memory_limit] = 32M
+++ /dev/null
-;;;;;;;;;;;;;;;;;;;;;
-; FPM Configuration ;
-;;;;;;;;;;;;;;;;;;;;;
-
-; All relative paths in this configuration file are relative to PHP's install
-; prefix (/usr). This prefix can be dynamically changed by using the
-; '-p' argument from the command line.
-
-; Include one or more files. If glob(3) exists, it is used to include a bunch of
-; files from a glob(3) pattern. This directive can be used everywhere in the
-; file.
-; Relative path can also be used. They will be prefixed by:
-; - the global prefix if it's been set (-p argument)
-; - /usr otherwise
-;include=/etc/php5/fpm/*.conf
-
-;;;;;;;;;;;;;;;;;;
-; Global Options ;
-;;;;;;;;;;;;;;;;;;
-
-[global]
-; Pid file
-; Note: the default prefix is /var
-; Default Value: none
-pid = /var/run/php5-fpm.pid
-
-; Error log file
-; If it's set to "syslog", log is sent to syslogd instead of being written
-; in a local file.
-; Note: the default prefix is /var
-; Default Value: log/php-fpm.log
-error_log = /var/log/php5-fpm.log
-
-; syslog_facility is used to specify what type of program is logging the
-; message. This lets syslogd specify that messages from different facilities
-; will be handled differently.
-; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
-; Default Value: daemon
-;syslog.facility = daemon
-
-; syslog_ident is prepended to every message. If you have multiple FPM
-; instances running on the same server, you can change the default value
-; which must suit common needs.
-; Default Value: php-fpm
-;syslog.ident = php-fpm
-
-; Log level
-; Possible Values: alert, error, warning, notice, debug
-; Default Value: notice
-;log_level = notice
-
-; If this number of child processes exit with SIGSEGV or SIGBUS within the time
-; interval set by emergency_restart_interval then FPM will restart. A value
-; of '0' means 'Off'.
-; Default Value: 0
-;emergency_restart_threshold = 0
-
-; Interval of time used by emergency_restart_interval to determine when
-; a graceful restart will be initiated. This can be useful to work around
-; accidental corruptions in an accelerator's shared memory.
-; Available Units: s(econds), m(inutes), h(ours), or d(ays)
-; Default Unit: seconds
-; Default Value: 0
-;emergency_restart_interval = 0
-
-; Time limit for child processes to wait for a reaction on signals from master.
-; Available units: s(econds), m(inutes), h(ours), or d(ays)
-; Default Unit: seconds
-; Default Value: 0
-;process_control_timeout = 0
-
-; The maximum number of processes FPM will fork. This has been design to control
-; the global number of processes when using dynamic PM within a lot of pools.
-; Use it with caution.
-; Note: A value of 0 indicates no limit
-; Default Value: 0
-; process.max = 128
-
-; Specify the nice(2) priority to apply to the master process (only if set)
-; The value can vary from -19 (highest priority) to 20 (lower priority)
-; Note: - It will only work if the FPM master process is launched as root
-; - The pool process will inherit the master process priority
-; unless it specified otherwise
-; Default Value: no set
-; process.priority = -19
-
-; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
-; Default Value: yes
-;daemonize = yes
-
-; Set open file descriptor rlimit for the master process.
-; Default Value: system defined value
-;rlimit_files = 1024
-
-; Set max core size rlimit for the master process.
-; Possible Values: 'unlimited' or an integer greater or equal to 0
-; Default Value: system defined value
-;rlimit_core = 0
-
-; Specify the event mechanism FPM will use. The following is available:
-; - select (any POSIX os)
-; - poll (any POSIX os)
-; - epoll (linux >= 2.5.44)
-; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
-; - /dev/poll (Solaris >= 7)
-; - port (Solaris >= 10)
-; Default Value: not set (auto detection)
-; events.mechanism = epoll
-
-;;;;;;;;;;;;;;;;;;;;
-; Pool Definitions ;
-;;;;;;;;;;;;;;;;;;;;
-
-; Multiple pools of child processes may be started with different listening
-; ports and different management options. The name of the pool will be
-; used in logs and stats. There is no limitation on the number of pools which
-; FPM can handle. Your system will tell you anyway :)
-
-; To configure the pools it is recommended to have one .conf file per
-; pool in the following directory:
-include=/etc/php5-fpm.d/*.conf
+++ /dev/null
-config php5-fpm
- option enabled 1
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
-
-START=50
-
-PROG=/usr/bin/php-fpm
-CONFIG=/etc/php5-fpm.conf
-
-SERVICE_PID_FILE=/var/run/php5-fpm.pid
-
-start_instance() {
- local section="$1"
- local enabled
-
- config_get_bool enabled "$section" 'enabled' 0
-
- [ $enabled -gt 0 ] || return 1
-
- service_start $PROG -y $CONFIG -g $SERVICE_PID_FILE
-}
-
-start() {
- config_load 'php5-fpm'
- config_foreach start_instance 'php5-fpm'
-}
-
-stop() {
- service_stop $PROG
-}
+++ /dev/null
---- a/ext/standard/php_crypt_r.c
-+++ b/ext/standard/php_crypt_r.c
-@@ -96,6 +96,8 @@ void _crypt_extended_init_r(void)
- InterlockedIncrement(&initialized);
- #elif defined(HAVE_SYNC_FETCH_AND_ADD)
- __sync_fetch_and_add(&initialized, 1);
-+#elif (defined(__GNUC__) && (__GNUC__ == 3))
-+ initialized = 1;
- #elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
- membar_producer();
- atomic_add_int(&initialized, 1);
+++ /dev/null
-Add support for use of the system timezone database, rather
-than embedding a copy. Discussed upstream but was not desired.
-
-History:
-r11: adopted to php 5.6.9
-r10: make timezone case insensitive
-r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
-r8: fix compile error without --with-system-tzdata configured
-r7: improve check for valid timezone id to exclude directories
-r6: fix fd leak in r5, fix country code/BC flag use in.
- timezone_identifiers_list() using system db,
- fix use of PECL timezonedb to override system db,
-r5: reverts addition of "System/Localtime" fake tzname.
- updated for 5.3.0, parses zone.tab to pick up mapping between
- timezone name, country code and long/lat coords
-r4: added "System/Localtime" tzname which uses /etc/localtime
-r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
-r2: add filesystem trawl to set up name alias index
-r1: initial revision
-
---- a/ext/date/lib/parse_tz.c
-+++ b/ext/date/lib/parse_tz.c
-@@ -18,8 +18,22 @@
-
- /* $Id$ */
-
-+#ifndef PATH_MAX
-+#define PATH_MAX 4096
-+#endif
-+
- #include "timelib.h"
-
-+#ifdef HAVE_SYSTEM_TZDATA
-+#include <sys/mman.h>
-+#include <sys/stat.h>
-+#include <limits.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include "php_scandir.h"
-+#endif
-+
- #include <stdio.h>
-
- #ifdef HAVE_LOCALE_H
-@@ -32,8 +46,12 @@
- #include <strings.h>
- #endif
-
-+#ifndef HAVE_SYSTEM_TZDATA
- #define TIMELIB_SUPPORTS_V2DATA
- #include "timezonedb.h"
-+#endif
-+
-+#include <ctype.h>
-
- #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
- # if defined(__LITTLE_ENDIAN__)
-@@ -55,6 +73,11 @@ static int read_preamble(const unsigned
- {
- uint32_t version;
-
-+ if (memcmp(tzf, "TZif", 4) == 0) {
-+ *tzf += 20;
-+ return -1;
-+ }
-+
- /* read ID */
- version = (*tzf)[3] - '0';
- *tzf += 4;
-@@ -298,7 +321,406 @@ void timelib_dump_tzinfo(timelib_tzinfo
- }
- }
-
--static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
-+#ifdef HAVE_SYSTEM_TZDATA
-+
-+#ifdef HAVE_SYSTEM_TZDATA_PREFIX
-+#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
-+#else
-+#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
-+#endif
-+
-+/* System timezone database pointer. */
-+static const timelib_tzdb *timezonedb_system;
-+
-+/* Hash table entry for the cache of the zone.tab mapping table. */
-+struct location_info {
-+ char code[2];
-+ double latitude, longitude;
-+ char name[64];
-+ char *comment;
-+ struct location_info *next;
-+};
-+
-+/* Cache of zone.tab. */
-+static struct location_info **system_location_table;
-+
-+/* Size of the zone.tab hash table; a random-ish prime big enough to
-+ * prevent too many collisions. */
-+#define LOCINFO_HASH_SIZE (1021)
-+
-+/* Compute a case insensitive hash of str */
-+static uint32_t tz_hash(const char *str)
-+{
-+ const unsigned char *p = (const unsigned char *)str;
-+ uint32_t hash = 5381;
-+ int c;
-+
-+ while ((c = tolower(*p++)) != '\0') {
-+ hash = (hash << 5) ^ hash ^ c;
-+ }
-+
-+ return hash % LOCINFO_HASH_SIZE;
-+}
-+
-+/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
-+ * parsed string on success, or NULL on parse error. On success,
-+ * writes the parsed number to *result. */
-+static char *parse_iso6709(char *p, double *result)
-+{
-+ double v, sign;
-+ char *pend;
-+ size_t len;
-+
-+ if (*p == '+')
-+ sign = 1.0;
-+ else if (*p == '-')
-+ sign = -1.0;
-+ else
-+ return NULL;
-+
-+ p++;
-+ for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
-+ ;;
-+
-+ /* Annoying encoding used by zone.tab has no decimal point, so use
-+ * the length to determine the format:
-+ *
-+ * 4 = DDMM
-+ * 5 = DDDMM
-+ * 6 = DDMMSS
-+ * 7 = DDDMMSS
-+ */
-+ len = pend - p;
-+ if (len < 4 || len > 7) {
-+ return NULL;
-+ }
-+
-+ /* p => [D]DD */
-+ v = (p[0] - '0') * 10.0 + (p[1] - '0');
-+ p += 2;
-+ if (len == 5 || len == 7)
-+ v = v * 10.0 + (*p++ - '0');
-+ /* p => MM[SS] */
-+ v += (10.0 * (p[0] - '0')
-+ + p[1] - '0') / 60.0;
-+ p += 2;
-+ /* p => [SS] */
-+ if (len > 5) {
-+ v += (10.0 * (p[0] - '0')
-+ + p[1] - '0') / 3600.0;
-+ p += 2;
-+ }
-+
-+ /* Round to five decimal place, not because it's a good idea,
-+ * but, because the builtin data uses rounded data, so, match
-+ * that. */
-+ *result = round(v * sign * 100000.0) / 100000.0;
-+
-+ return p;
-+}
-+
-+/* This function parses the zone.tab file to build up the mapping of
-+ * timezone to country code and geographic location, and returns a
-+ * hash table. The hash table is indexed by the function:
-+ *
-+ * tz_hash(timezone-name)
-+ */
-+static struct location_info **create_location_table(void)
-+{
-+ struct location_info **li, *i;
-+ char zone_tab[PATH_MAX];
-+ char line[512];
-+ FILE *fp;
-+
-+ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
-+
-+ fp = fopen(zone_tab, "r");
-+ if (!fp) {
-+ return NULL;
-+ }
-+
-+ li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
-+
-+ while (fgets(line, sizeof line, fp)) {
-+ char *p = line, *code, *name, *comment;
-+ uint32_t hash;
-+ double latitude, longitude;
-+
-+ while (isspace(*p))
-+ p++;
-+
-+ if (*p == '#' || *p == '\0' || *p == '\n')
-+ continue;
-+
-+ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
-+ continue;
-+
-+ /* code => AA */
-+ code = p;
-+ p[2] = 0;
-+ p += 3;
-+
-+ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
-+ p = parse_iso6709(p, &latitude);
-+ if (!p) {
-+ continue;
-+ }
-+ p = parse_iso6709(p, &longitude);
-+ if (!p) {
-+ continue;
-+ }
-+
-+ if (!p || *p != '\t') {
-+ continue;
-+ }
-+
-+ /* name = string */
-+ name = ++p;
-+ while (*p != '\t' && *p && *p != '\n')
-+ p++;
-+
-+ *p++ = '\0';
-+
-+ /* comment = string */
-+ comment = p;
-+ while (*p != '\t' && *p && *p != '\n')
-+ p++;
-+
-+ if (*p == '\n' || *p == '\t')
-+ *p = '\0';
-+
-+ hash = tz_hash(name);
-+ i = malloc(sizeof *i);
-+ memcpy(i->code, code, 2);
-+ strncpy(i->name, name, sizeof i->name);
-+ i->comment = strdup(comment);
-+ i->longitude = longitude;
-+ i->latitude = latitude;
-+ i->next = li[hash];
-+ li[hash] = i;
-+ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
-+ }
-+
-+ fclose(fp);
-+
-+ return li;
-+}
-+
-+/* Return location info from hash table, using given timezone name.
-+ * Returns NULL if the name could not be found. */
-+const struct location_info *find_zone_info(struct location_info **li,
-+ const char *name)
-+{
-+ uint32_t hash = tz_hash(name);
-+ const struct location_info *l;
-+
-+ if (!li) {
-+ return NULL;
-+ }
-+
-+ for (l = li[hash]; l; l = l->next) {
-+ if (strcasecmp(l->name, name) == 0)
-+ return l;
-+ }
-+
-+ return NULL;
-+}
-+
-+/* Filter out some non-tzdata files and the posix/right databases, if
-+ * present. */
-+static int index_filter(const struct dirent *ent)
-+{
-+ return strcmp(ent->d_name, ".") != 0
-+ && strcmp(ent->d_name, "..") != 0
-+ && strcmp(ent->d_name, "posix") != 0
-+ && strcmp(ent->d_name, "posixrules") != 0
-+ && strcmp(ent->d_name, "right") != 0
-+ && strstr(ent->d_name, ".tab") == NULL;
-+}
-+
-+static int sysdbcmp(const void *first, const void *second)
-+{
-+ const timelib_tzdb_index_entry *alpha = first, *beta = second;
-+
-+ return strcmp(alpha->id, beta->id);
-+}
-+
-+
-+/* Create the zone identifier index by trawling the filesystem. */
-+static void create_zone_index(timelib_tzdb *db)
-+{
-+ size_t dirstack_size, dirstack_top;
-+ size_t index_size, index_next;
-+ timelib_tzdb_index_entry *db_index;
-+ char **dirstack;
-+
-+ /* LIFO stack to hold directory entries to scan; each slot is a
-+ * directory name relative to the zoneinfo prefix. */
-+ dirstack_size = 32;
-+ dirstack = malloc(dirstack_size * sizeof *dirstack);
-+ dirstack_top = 1;
-+ dirstack[0] = strdup("");
-+
-+ /* Index array. */
-+ index_size = 64;
-+ db_index = malloc(index_size * sizeof *db_index);
-+ index_next = 0;
-+
-+ do {
-+ struct dirent **ents;
-+ char name[PATH_MAX], *top;
-+ int count;
-+
-+ /* Pop the top stack entry, and iterate through its contents. */
-+ top = dirstack[--dirstack_top];
-+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
-+
-+ count = php_scandir(name, &ents, index_filter, php_alphasort);
-+
-+ while (count > 0) {
-+ struct stat st;
-+ const char *leaf = ents[count - 1]->d_name;
-+
-+ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s",
-+ top, leaf);
-+
-+ if (strlen(name) && stat(name, &st) == 0) {
-+ /* Name, relative to the zoneinfo prefix. */
-+ const char *root = top;
-+
-+ if (root[0] == '/') root++;
-+
-+ snprintf(name, sizeof name, "%s%s%s", root,
-+ *root ? "/": "", leaf);
-+
-+ if (S_ISDIR(st.st_mode)) {
-+ if (dirstack_top == dirstack_size) {
-+ dirstack_size *= 2;
-+ dirstack = realloc(dirstack,
-+ dirstack_size * sizeof *dirstack);
-+ }
-+ dirstack[dirstack_top++] = strdup(name);
-+ }
-+ else {
-+ if (index_next == index_size) {
-+ index_size *= 2;
-+ db_index = realloc(db_index,
-+ index_size * sizeof *db_index);
-+ }
-+
-+ db_index[index_next++].id = strdup(name);
-+ }
-+ }
-+
-+ free(ents[--count]);
-+ }
-+
-+ if (count != -1) free(ents);
-+ free(top);
-+ } while (dirstack_top);
-+
-+ qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
-+
-+ db->index = db_index;
-+ db->index_size = index_next;
-+
-+ free(dirstack);
-+}
-+
-+#define FAKE_HEADER "1234\0??\1??"
-+#define FAKE_UTC_POS (7 - 4)
-+
-+/* Create a fake data segment for database 'sysdb'. */
-+static void fake_data_segment(timelib_tzdb *sysdb,
-+ struct location_info **info)
-+{
-+ size_t n;
-+ char *data, *p;
-+
-+ data = malloc(3 * sysdb->index_size + 7);
-+
-+ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
-+
-+ for (n = 0; n < sysdb->index_size; n++) {
-+ const struct location_info *li;
-+ timelib_tzdb_index_entry *ent;
-+
-+ ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
-+
-+ /* Lookup the timezone name in the hash table. */
-+ if (strcmp(ent->id, "UTC") == 0) {
-+ ent->pos = FAKE_UTC_POS;
-+ continue;
-+ }
-+
-+ li = find_zone_info(info, ent->id);
-+ if (li) {
-+ /* If found, append the BC byte and the
-+ * country code; set the position for this
-+ * section of timezone data. */
-+ ent->pos = (p - data) - 4;
-+ *p++ = '\1';
-+ *p++ = li->code[0];
-+ *p++ = li->code[1];
-+ }
-+ else {
-+ /* If not found, the timezone data can
-+ * point at the header. */
-+ ent->pos = 0;
-+ }
-+ }
-+
-+ sysdb->data = (unsigned char *)data;
-+}
-+
-+/* Returns true if the passed-in stat structure describes a
-+ * probably-valid timezone file. */
-+static int is_valid_tzfile(const struct stat *st)
-+{
-+ return S_ISREG(st->st_mode) && st->st_size > 20;
-+}
-+
-+/* Return the mmap()ed tzfile if found, else NULL. On success, the
-+ * length of the mapped data is placed in *length. */
-+static char *map_tzfile(const char *timezone, size_t *length)
-+{
-+ char fname[PATH_MAX];
-+ struct stat st;
-+ char *p;
-+ int fd;
-+
-+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
-+ return NULL;
-+ }
-+
-+ if (system_location_table) {
-+ const struct location_info *li;
-+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
-+ /* Use the stored name to avoid case issue */
-+ timezone = li->name;
-+ }
-+ }
-+
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
-+
-+ fd = open(fname, O_RDONLY);
-+ if (fd == -1) {
-+ return NULL;
-+ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
-+ close(fd);
-+ return NULL;
-+ }
-+
-+ *length = st.st_size;
-+ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
-+ close(fd);
-+
-+ return p != MAP_FAILED ? p : NULL;
-+}
-+
-+#endif
-+
-+static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
- {
- int left = 0, right = tzdb->index_size - 1;
- #ifdef HAVE_SETLOCALE
-@@ -337,21 +759,90 @@ static int seek_to_tz_position(const uns
- return 0;
- }
-
-+static int seek_to_tz_position(const unsigned char **tzf, char *timezone,
-+ char **map, size_t *maplen,
-+ const timelib_tzdb *tzdb)
-+{
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (tzdb == timezonedb_system) {
-+ char *orig;
-+
-+ orig = map_tzfile(timezone, maplen);
-+ if (orig == NULL) {
-+ return 0;
-+ }
-+
-+ (*tzf) = (unsigned char *)orig;
-+ *map = orig;
-+
-+ return 1;
-+ }
-+ else
-+#endif
-+ {
-+ return inmem_seek_to_tz_position(tzf, timezone, tzdb);
-+ }
-+}
-+
- const timelib_tzdb *timelib_builtin_db(void)
- {
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (timezonedb_system == NULL) {
-+ timelib_tzdb *tmp = malloc(sizeof *tmp);
-+
-+ tmp->version = "0.system";
-+ tmp->data = NULL;
-+ create_zone_index(tmp);
-+ system_location_table = create_location_table();
-+ fake_data_segment(tmp, system_location_table);
-+ timezonedb_system = tmp;
-+ }
-+
-+
-+ return timezonedb_system;
-+#else
- return &timezonedb_builtin;
-+#endif
- }
-
- const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
- {
-+#ifdef HAVE_SYSTEM_TZDATA
-+ *count = timezonedb_system->index_size;
-+ return timezonedb_system->index;
-+#else
- *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
- return timezonedb_idx_builtin;
-+#endif
- }
-
- int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
- {
- const unsigned char *tzf;
-- return (seek_to_tz_position(&tzf, timezone, tzdb));
-+
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (tzdb == timezonedb_system) {
-+ char fname[PATH_MAX];
-+ struct stat st;
-+
-+ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
-+ return 0;
-+ }
-+
-+ if (system_location_table) {
-+ if (find_zone_info(system_location_table, timezone) != NULL) {
-+ /* found in cache */
-+ return 1;
-+ }
-+ }
-+
-+ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", timezone);
-+
-+ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
-+ }
-+#endif
-+
-+ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
- }
-
- static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -376,10 +867,12 @@ static void read_64bit_header(const unsi
- timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
- {
- const unsigned char *tzf;
-+ char *memmap = NULL;
-+ size_t maplen;
- timelib_tzinfo *tmp;
- int version;
-
-- if (seek_to_tz_position(&tzf, timezone, tzdb)) {
-+ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
- tmp = timelib_tzinfo_ctor(timezone);
-
- version = read_preamble(&tzf, tmp);
-@@ -393,7 +886,34 @@ timelib_tzinfo *timelib_parse_tzfile(cha
- skip_64bit_types(&tzf, tmp);
- skip_posix_string(&tzf, tmp);
- }
-- read_location(&tzf, tmp);
-+
-+#ifdef HAVE_SYSTEM_TZDATA
-+ if (memmap) {
-+ const struct location_info *li;
-+
-+ /* TZif-style - grok the location info from the system database,
-+ * if possible. */
-+
-+ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
-+ tmp->location.comments = strdup(li->comment);
-+ strncpy(tmp->location.country_code, li->code, 2);
-+ tmp->location.longitude = li->longitude;
-+ tmp->location.latitude = li->latitude;
-+ tmp->bc = 1;
-+ } else {
-+ strcpy(tmp->location.country_code, "??");
-+ tmp->bc = 0;
-+ tmp->location.comments = strdup("");
-+ }
-+
-+ /* Now done with the mmap segment - discard it. */
-+ munmap(memmap, maplen);
-+ } else
-+#endif
-+ {
-+ /* PHP-style - use the embedded info. */
-+ read_location(&tzf, tmp);
-+ }
- } else {
- tmp = NULL;
- }
---- a/ext/date/lib/timelib.m4
-+++ b/ext/date/lib/timelib.m4
-@@ -78,3 +78,17 @@ stdlib.h
-
- dnl Check for strtoll, atoll
- AC_CHECK_FUNCS(strtoll atoll strftime)
-+
-+PHP_ARG_WITH(system-tzdata, for use of system timezone data,
-+[ --with-system-tzdata[=DIR] to specify use of system timezone data],
-+no, no)
-+
-+if test "$PHP_SYSTEM_TZDATA" != "no"; then
-+ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
-+
-+ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
-+ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
-+ [Define for location of system timezone data])
-+ fi
-+fi
-+
+++ /dev/null
-Author: Sean Finney <seanius@debian.org>
-Forwarded: no (upstream doesn't want it)
-Description: Silence warnings about using the default system timezone info
- In vanilla upstream php, this is considered an error (i.e. the user must
- set the timezone explicitly), though with our use of the system timezonedb
- patch, we actually feel quite comfortable using the default timezone info.
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571762
---- a/ext/date/tests/date_default_timezone_set-1.phpt
-+++ b/ext/date/tests/date_default_timezone_set-1.phpt
-@@ -22,9 +22,6 @@ date.timezone=
- echo date(DATE_ISO8601, $date4), "\n";
- ?>
- --EXPECTF--
--Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in %sdate_default_timezone_set-1.php on line 3
--
--Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in %sdate_default_timezone_set-1.php on line 4
- America/Indiana/Knox
- 2005-01-12T03:00:00-0500
- 2005-07-12T03:00:00-0500
+++ /dev/null
-From dc8bb6a53bfdfe42d9ae81d4e78c6155ad4bfd6e Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <mhei@heimpold.de>
-Date: Sun, 17 May 2015 16:50:50 +0200
-Subject: [PATCH] ext/opcache: fix detection of shm/mmap
-
-The detection of sysvipc and mmap doesn't work well when cross-compiling,
-so I decided to only check for the availability of the functions involved.
-This is not a clean solution, but works for now(tm) :-)
-
-It should be discussed with upstream to find a better solution.
-
-This solves the issue reported at
-https://github.com/openwrt/packages/issues/1010
-and makes opcache usable on OpenWrt.
-
-Signed-off-by: Michael Heimpold <mhei@heimpold.de>
----
- ext/opcache/config.m4 | 122 ++-----------------------------------------------
- 1 file changed, 4 insertions(+), 118 deletions(-)
-
-diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
-index b7e4835..7b6c0aa 100644
---- a/ext/opcache/config.m4
-+++ b/ext/opcache/config.m4
-@@ -11,127 +11,13 @@ if test "$PHP_OPCACHE" != "no"; then
- AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function])
- ])
-
-- AC_MSG_CHECKING(for sysvipc shared memory support)
-- AC_TRY_RUN([
--#include <sys/types.h>
--#include <sys/wait.h>
--#include <sys/ipc.h>
--#include <sys/shm.h>
--#include <unistd.h>
--#include <string.h>
--
--int main() {
-- pid_t pid;
-- int status;
-- int ipc_id;
-- char *shm;
-- struct shmid_ds shmbuf;
--
-- ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W));
-- if (ipc_id == -1) {
-- return 1;
-- }
--
-- shm = shmat(ipc_id, NULL, 0);
-- if (shm == (void *)-1) {
-- shmctl(ipc_id, IPC_RMID, NULL);
-- return 2;
-- }
--
-- if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) {
-- shmdt(shm);
-- shmctl(ipc_id, IPC_RMID, NULL);
-- return 3;
-- }
--
-- shmbuf.shm_perm.uid = getuid();
-- shmbuf.shm_perm.gid = getgid();
-- shmbuf.shm_perm.mode = 0600;
--
-- if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) {
-- shmdt(shm);
-- shmctl(ipc_id, IPC_RMID, NULL);
-- return 4;
-- }
--
-- shmctl(ipc_id, IPC_RMID, NULL);
--
-- strcpy(shm, "hello");
--
-- pid = fork();
-- if (pid < 0) {
-- return 5;
-- } else if (pid == 0) {
-- strcpy(shm, "bye");
-- return 6;
-- }
-- if (wait(&status) != pid) {
-- return 7;
-- }
-- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
-- return 8;
-- }
-- if (strcmp(shm, "bye") != 0) {
-- return 9;
-- }
-- return 0;
--}
--],dnl
-+ AC_CHECK_FUNC(shmget,[
- AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
-- msg=yes,msg=no,msg=no)
-- AC_MSG_RESULT([$msg])
--
-- AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
-- AC_TRY_RUN([
--#include <sys/types.h>
--#include <sys/wait.h>
--#include <sys/mman.h>
--#include <unistd.h>
--#include <string.h>
--
--#ifndef MAP_ANON
--# ifdef MAP_ANONYMOUS
--# define MAP_ANON MAP_ANONYMOUS
--# endif
--#endif
--#ifndef MAP_FAILED
--# define MAP_FAILED ((void*)-1)
--#endif
--
--int main() {
-- pid_t pid;
-- int status;
-- char *shm;
--
-- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
-- if (shm == MAP_FAILED) {
-- return 1;
-- }
--
-- strcpy(shm, "hello");
-+ ])
-
-- pid = fork();
-- if (pid < 0) {
-- return 5;
-- } else if (pid == 0) {
-- strcpy(shm, "bye");
-- return 6;
-- }
-- if (wait(&status) != pid) {
-- return 7;
-- }
-- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
-- return 8;
-- }
-- if (strcmp(shm, "bye") != 0) {
-- return 9;
-- }
-- return 0;
--}
--],dnl
-+ AC_CHECK_FUNC(mmap,[
- AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
-- msg=yes,msg=no,msg=no)
-- AC_MSG_RESULT([$msg])
-+ ])
-
- AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)
- AC_TRY_RUN([
---
-1.7.10.4
-
+++ /dev/null
---- a/ext/gd/libgd/gdkanji.c
-+++ b/ext/gd/libgd/gdkanji.c
-@@ -9,6 +9,11 @@
- #include "gdhelpers.h"
-
- #include <stdarg.h>
-+
-+/* force usage of internal conversation routine */
-+#undef HAVE_ICONV_H
-+#undef HAVE_ICONV
-+
- #if defined(HAVE_ICONV_H) || defined(HAVE_ICONV)
- #include <iconv.h>
- #ifdef HAVE_ERRNO_H
+++ /dev/null
---- a/configure.in
-+++ b/configure.in
-@@ -453,7 +453,10 @@ PHP_CHECK_FUNC(gethostname, nsl)
- PHP_CHECK_FUNC(gethostbyaddr, nsl)
- PHP_CHECK_FUNC(yp_get_default_domain, nsl)
-
--PHP_CHECK_FUNC(dlopen, dl)
-+PHP_ADD_LIBRARY(dl)
-+PHP_DEF_HAVE(dlopen)
-+PHP_DEF_HAVE(libdl)
-+ac_cv_func_dlopen=yes
- if test "$ac_cv_func_dlopen" = "yes"; then
- AC_DEFINE(HAVE_LIBDL, 1, [ ])
- fi
---- a/ext/fileinfo/config.m4
-+++ b/ext/fileinfo/config.m4
-@@ -46,6 +46,10 @@ int main(void)
- AC_MSG_RESULT(no)
- AC_MSG_NOTICE(using libmagic strcasestr implementation)
- libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
-+ ],[
-+ dnl cross-compiling; assume not present
-+ AC_MSG_NOTICE(using libmagic strcasestr implementation)
-+ libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
- ])
-
- PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
---- a/ext/opcache/config.m4
-+++ b/ext/opcache/config.m4
-@@ -227,7 +227,14 @@ AC_TRY_RUN([
- flock_type=linux
- AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
- AC_MSG_RESULT("yes")
--], AC_MSG_RESULT("no") )
-+], [
-+ AC_MSG_RESULT("no")
-+], [
-+ dnl cross-compiling; assume Linux
-+ flock_type=linux
-+ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
-+ AC_MSG_RESULT("yes")
-+])
-
- AC_MSG_CHECKING("whether flock struct is BSD ordered")
- AC_TRY_RUN([
-@@ -243,7 +250,12 @@ AC_TRY_RUN([
- flock_type=bsd
- AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
- AC_MSG_RESULT("yes")
--], AC_MSG_RESULT("no") )
-+], [
-+ AC_MSG_RESULT("no")
-+], [
-+ dnl cross-compiling; assume Linux
-+ AC_MSG_RESULT("no")
-+])
-
- if test "$flock_type" == "unknown"; then
- AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
+++ /dev/null
-#
-# Copyright (C) 2011-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Package/php5-pecl/Default
- SUBMENU:=PHP
- SECTION:=lang
- CATEGORY:=Languages
- URL:=http://pecl.php.net/
- DEPENDS:=php5
-endef
-
-define Build/Prepare
- $(Build/Prepare/Default)
- ( cd $(PKG_BUILD_DIR); $(STAGING_DIR)/host/usr/bin/phpize )
-endef
-
-CONFIGURE_ARGS+= \
- --with-php-config=$(STAGING_DIR)/host/usr/bin/php-config
-
-define PECLPackage
-
- define Package/php5-pecl-$(1)
- $(call Package/php5-pecl/Default)
- TITLE:=$(2)
-
- ifneq ($(3),)
- DEPENDS+=$(3)
- endif
- endef
-
- define Package/php5-pecl-$(1)/install
- $(INSTALL_DIR) $$(1)/usr/lib/php
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
- $(INSTALL_DIR) $$(1)/etc/php5
- ifeq ($(4),zend)
- echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini
- else
- echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php5/$(subst -,_,$(1)).ini
- endif
- endef
-
-endef
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=dio
+PECL_LONGNAME:=Direct I/O functions
+
+PKG_VERSION:=0.0.7
+PKG_RELEASE:=2
+PKG_MD5SUM:=a1a4df428a17dbe1ab4277b492dfa052
+
+PKG_NAME:=php7-pecl-$(PECL_NAME)
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=PHPv3.01
+PKG_LICENSE_FILES:=
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+--- a/dio_posix.c
++++ b/dio_posix.c
+@@ -1,659 +1,659 @@
+-/*\r
+- +----------------------------------------------------------------------+\r
+- | PHP Version 5 |\r
+- +----------------------------------------------------------------------+\r
+- | Copyright (c) 2009 Melanie Rhianna Lewis |\r
+- +----------------------------------------------------------------------+\r
+- | This source file is subject to version 3.0 of the PHP license, |\r
+- | that is bundled with this package in the file LICENSE, and is |\r
+- | available through the world-wide-web at the following url: |\r
+- | http://www.php.net/license/3_0.txt. |\r
+- | If you did not receive a copy of the PHP license and are unable to |\r
+- | obtain it through the world-wide-web, please send a note to |\r
+- | license@php.net so we can mail you a copy immediately. |\r
+- +----------------------------------------------------------------------+\r
+- | Author: Melanie Rhianna Lewis <cyberspice@php.net> |\r
+- +----------------------------------------------------------------------+\r
+- */\r
+-\r
+-#ifdef HAVE_CONFIG_H\r
+-#include "config.h"\r
+-#endif\r
+-\r
+-#include "php.h"\r
+-\r
+-#include "php_dio_common.h"\r
+-\r
+-/* {{{ dio_stream_mode_to_flags\r
+- * Convert an fopen() mode string to open() flags\r
+- */\r
+-static int dio_stream_mode_to_flags(const char *mode) {\r
+- int flags = 0, ch = 0, bin = 1;\r
+-\r
+- switch(mode[ch++]) {\r
+- case 'r':\r
+- flags = 0;\r
+- break;\r
+- case 'w':\r
+- flags = O_TRUNC | O_CREAT;\r
+- break;\r
+- case 'a':\r
+- flags = O_APPEND | O_CREAT;\r
+- break;\r
+- case 'x':\r
+- flags = O_EXCL | O_CREAT;\r
+- break;\r
+- }\r
+-\r
+- if (mode[ch] != '+') {\r
+- bin = (mode[ch++] == 'b');\r
+- }\r
+-\r
+- if (mode[ch] == '+') {\r
+- flags |= O_RDWR;\r
+- } else if (flags) {\r
+- flags |= O_WRONLY;\r
+- } else {\r
+- flags |= O_RDONLY;\r
+- }\r
+-\r
+-#if defined(_O_TEXT) && defined(O_BINARY)\r
+- if (bin) {\r
+- flags |= O_BINARY;\r
+- } else {\r
+- flags |= _O_TEXT;\r
+- }\r
+-#endif\r
+-\r
+- return flags;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_data_rate_to_define\r
+- * Converts a numeric data rate to a termios define\r
+- */\r
+-static int dio_data_rate_to_define(long rate, speed_t *def) {\r
+- speed_t val;\r
+-\r
+- switch (rate) {\r
+- case 0:\r
+- val = 0;\r
+- break;\r
+- case 50:\r
+- val = B50;\r
+- break;\r
+- case 75:\r
+- val = B75;\r
+- break;\r
+- case 110:\r
+- val = B110;\r
+- break;\r
+- case 134:\r
+- val = B134;\r
+- break;\r
+- case 150:\r
+- val = B150;\r
+- break;\r
+- case 200:\r
+- val = B200;\r
+- break;\r
+- case 300:\r
+- val = B300;\r
+- break;\r
+- case 600:\r
+- val = B600;\r
+- break;\r
+- case 1200:\r
+- val = B1200;\r
+- break;\r
+- case 1800:\r
+- val = B1800;\r
+- break;\r
+- case 2400:\r
+- val = B2400;\r
+- break;\r
+- case 4800:\r
+- val = B4800;\r
+- break;\r
+- case 9600:\r
+- val = B9600;\r
+- break;\r
+- case 19200:\r
+- val = B19200;\r
+- break;\r
+- case 38400:\r
+- val = B38400;\r
+- break;\r
+-#ifdef B57600\r
+- case 57600:\r
+- val = B57600;\r
+- break;\r
+-#endif\r
+-#ifdef B115200\r
+- case 115200:\r
+- val = B115200;\r
+- break;\r
+-#endif\r
+-#ifdef B230400\r
+- case 230400:\r
+- val = B230400;\r
+- break;\r
+-#endif\r
+-#ifdef B460800\r
+- case 460800:\r
+- val = B460800;\r
+- break;\r
+-#endif\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = val;\r
+- return 1;\r
+-}\r
+-\r
+-/* {{{ dio_data_bits_to_define\r
+- * Converts a number of data bits to a termios define\r
+- */\r
+-static int dio_data_bits_to_define(int data_bits, int *def) {\r
+- int val;\r
+-\r
+- switch (data_bits) {\r
+- case 8:\r
+- val = CS8;\r
+- break;\r
+- case 7:\r
+- val = CS7;\r
+- break;\r
+- case 6:\r
+- val = CS6;\r
+- break;\r
+- case 5:\r
+- val = CS5;\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = val;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_stop_bits_to_define\r
+- * Converts a number of stop bits to a termios define\r
+- */\r
+-static int dio_stop_bits_to_define(int stop_bits, int *def) {\r
+- int val;\r
+-\r
+- switch (stop_bits) {\r
+- case 1:\r
+- val = 0;\r
+- break;\r
+- case 2:\r
+- val = CSTOPB;\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = val;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_parity_to_define\r
+- * Converts a parity type to a termios define\r
+- */\r
+-static int dio_parity_to_define(int parity, int *def) {\r
+- int val;\r
+-\r
+- switch (parity) {\r
+- case 0:\r
+- val = 0;\r
+- break;\r
+- case 1:\r
+- val = PARENB | PARODD;\r
+- break;\r
+- case 2:\r
+- val = PARENB;\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = val;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_create_stream_data\r
+- * Creates an initialised stream data structure. Free with efree().\r
+- */\r
+-php_dio_stream_data * dio_create_stream_data(void) {\r
+- php_dio_posix_stream_data * data = emalloc(sizeof(php_dio_posix_stream_data));\r
+- dio_init_stream_data(&(data->common));\r
+- data->fd = -1;\r
+- data->flags = 0;\r
+-\r
+- return (php_dio_stream_data *)data;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_common_write\r
+- * Writes count chars from the buffer to the stream described by the stream data.\r
+- */\r
+-size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {\r
+- size_t ret;\r
+-\r
+- /* Blocking writes can be interrupted by signals etc. If\r
+- * interrupted try again. Not sure about non-blocking\r
+- * writes but it doesn't hurt to check. */\r
+- do {\r
+- ret = write(((php_dio_posix_stream_data*)data)->fd, buf, count);\r
+- if (ret > 0) {\r
+- return ret;\r
+- }\r
+- } while (errno == EINTR);\r
+- return 0;\r
+-}\r
+-/* }}} */\r
+-\r
+-#ifdef DIO_NONBLOCK\r
+-/* {{{ dio_timeval_subtract\r
+- * Calculates the difference between two timevals returning the result in the\r
+- * structure pointed to by diffptr. Returns -1 as error if late time is\r
+- * earlier than early time.\r
+- */\r
+-static int dio_timeval_subtract(struct timeval *late, struct timeval *early, struct timeval *diff) {\r
+- struct timeval *tmp;\r
+-\r
+- /* Handle negatives */\r
+- if (late->tv_sec < early->tv_sec) {\r
+- return 0;\r
+- }\r
+-\r
+- if ((late->tv_sec == early->tv_sec) && (late->tv_usec < early->tv_usec)) {\r
+- return 0;\r
+- }\r
+-\r
+- /* Handle any carry. If later usec is smaller than earlier usec simple\r
+- * subtraction will result in negative value. Since usec has a maximum\r
+- * of one second by adding another second before the subtraction the\r
+- * result will always be positive. */\r
+- if (late->tv_usec < early->tv_usec) {\r
+- late->tv_usec += 1000000;\r
+- late->tv_sec--;\r
+- }\r
+-\r
+- /* Once adjusted can just subtract values. */\r
+- diff->tv_sec = late->tv_sec - early->tv_sec;\r
+- diff->tv_usec = late->tv_usec - early->tv_usec;\r
+-\r
+- return 1;\r
+-}\r
+-#endif\r
+-\r
+-/* {{{ dio_common_read\r
+- * Reads count chars to the buffer to the stream described by the stream data.\r
+- */\r
+-size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {\r
+- int fd = ((php_dio_posix_stream_data*)data)->fd;\r
+- size_t ret, total = 0;\r
+- char *ptr = (char*)buf;\r
+-\r
+- struct timeval timeout, timeouttmp, before, after, diff;\r
+- fd_set rfds;\r
+-\r
+- if (!data->has_timeout) {\r
+- /* Blocking reads can be interrupted by signals etc. If\r
+- * interrupted try again. Not sure about non-blocking\r
+- * reads but it doesn't hurt to check. */\r
+- do {\r
+- ret = read(fd, (char*)ptr, count);\r
+- if (ret > 0) {\r
+- return ret;\r
+- } else if (!ret) {\r
+- data->end_of_file = 1;\r
+- }\r
+- } while ((errno == EINTR) && !data->end_of_file);\r
+- return 0;\r
+- }\r
+-#ifdef DIO_NONBLOCK\r
+- else {\r
+- /* Clear timed out flag */\r
+- data->timed_out = 0;\r
+-\r
+- /* The initial timeout value */\r
+- timeout.tv_sec = data->timeout_sec;\r
+- timeout.tv_usec = data->timeout_usec;\r
+-\r
+- do {\r
+- /* The semantics of select() are that you cannot guarantee\r
+- * that the timeval structure passed in has not been changed by\r
+- * the select call. So you keep a copy. */\r
+- timeouttmp = timeout;\r
+-\r
+- /* The time before we wait for data. */\r
+- (void) gettimeofday(&before, NULL);\r
+-\r
+- /* Wait for an event on our file descriptor. */\r
+- FD_ZERO(&rfds);\r
+- FD_SET(fd, &rfds);\r
+-\r
+- ret = select(fd + 1, &rfds, NULL, NULL, &timeouttmp);\r
+- /* An error. */\r
+- if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {\r
+- return 0;\r
+- }\r
+-\r
+- /* We have data to read. */\r
+- if ((ret > 0) && FD_ISSET(fd, &rfds)) {\r
+- ret = read(fd, ptr, count);\r
+- /* Another error */\r
+- if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {\r
+- return 0;\r
+- }\r
+-\r
+- if (ret > 0) {\r
+- /* Got data, add it to the buffer. */\r
+- ptr += ret;\r
+- total += ret;\r
+- count -= ret;\r
+- } else if (!ret) {\r
+- /* This should never happen since how can we have\r
+- * data to read at an end of file, but still\r
+- * just in case! */\r
+- data->end_of_file = 1;\r
+- break;\r
+- }\r
+- }\r
+-\r
+- /* If not timed out and not end of file and not all data read\r
+- * calculate how long it took us and loop if we still have time\r
+- * out time left. */\r
+- if (count) {\r
+- (void) gettimeofday(&after, NULL);\r
+-\r
+- /* Diff the timevals */\r
+- (void) dio_timeval_subtract(&after, &before, &diff);\r
+-\r
+- /* Now adjust the timeout. */\r
+- if (!dio_timeval_subtract(&timeout, &diff, &timeout)) {\r
+- /* If it errors we've run out of time. */\r
+- data->timed_out = 1;\r
+- break;\r
+- } else if (!timeout.tv_sec && !(timeout.tv_usec / 1000)) {\r
+- /* Check for rounding issues (millisecond accuracy) */\r
+- data->timed_out = 1;\r
+- break;\r
+- }\r
+- }\r
+- } while (count); /* Until time out or end of file or all data read. */\r
+-\r
+- return total;\r
+- }\r
+-#endif\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ php_dio_stream_data\r
+- * Closes the php_stream.\r
+- */\r
+-int dio_common_close(php_dio_stream_data *data) {\r
+- if (close(((php_dio_posix_stream_data*)data)->fd) < 0) {\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_common_set_option\r
+- * Sets/gets stream options\r
+- */\r
+-int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {\r
+- int fd = ((php_dio_posix_stream_data*)data)->fd;\r
+- int old_is_blocking;\r
+- int flags;\r
+-\r
+- switch (option) {\r
+-#ifdef DIO_NONBLOCK\r
+- case PHP_STREAM_OPTION_READ_TIMEOUT:\r
+- if (ptrparam) {\r
+- struct timeval *tv = (struct timeval*)ptrparam;\r
+-\r
+- flags = fcntl(fd, F_GETFL, 0);\r
+-\r
+- /* A timeout of zero seconds and zero microseconds disables\r
+- any existing timeout. */\r
+- if (tv->tv_sec || tv->tv_usec) {\r
+- data->timeout_sec = tv->tv_sec;\r
+- data->timeout_usec = tv->tv_usec;\r
+- data->has_timeout = -1;\r
+- (void) fcntl(fd, F_SETFL, flags & ~DIO_NONBLOCK);\r
+- } else {\r
+- data->timeout_sec = 0;\r
+- data->timeout_usec = 0;\r
+- data->has_timeout = 0;\r
+- data->timed_out = 0;\r
+- (void) fcntl(fd, F_SETFL, flags | DIO_NONBLOCK);\r
+- }\r
+-\r
+- return PHP_STREAM_OPTION_RETURN_OK;\r
+- } else {\r
+- return PHP_STREAM_OPTION_RETURN_ERR;\r
+- }\r
+-\r
+- case PHP_STREAM_OPTION_BLOCKING:\r
+- flags = fcntl(fd, F_GETFL, 0);\r
+- if (value) {\r
+- flags &= ~DIO_NONBLOCK;\r
+- } else {\r
+- flags |= DIO_NONBLOCK;\r
+- }\r
+- (void) fcntl(fd, F_SETFL, flags);\r
+-\r
+- old_is_blocking = data->is_blocking;\r
+- data->is_blocking = value;\r
+- return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;\r
+-#endif /* O_NONBLOCK */\r
+-\r
+- default:\r
+- break;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_raw_open_stream\r
+- * Opens the underlying stream.\r
+- */\r
+-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
+- php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
+- pdata->flags = dio_stream_mode_to_flags(mode);\r
+-\r
+-#ifdef DIO_NONBLOCK\r
+- if (!data->is_blocking || data->has_timeout) {\r
+- pdata->flags |= DIO_NONBLOCK;\r
+- }\r
+-#endif\r
+-\r
+- /* Open the file and handle any errors. */\r
+-#ifdef DIO_HAS_FILEPERMS\r
+- if (data->has_perms) {\r
+- pdata->fd = open(filename, pdata->flags, (mode_t)data->perms);\r
+- } else {\r
+- pdata->fd = open(filename, pdata->flags);\r
+- }\r
+-#else\r
+- pdata->fd = open(filename, pdata->flags);\r
+-#endif\r
+-\r
+- if (pdata->fd < 0) {\r
+- switch (errno) {\r
+- case EEXIST:\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");\r
+- return 0;\r
+- default:\r
+- return 0;\r
+- }\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_init\r
+- * Initialises the serial settings storing the original settings before hand.\r
+- */\r
+-static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {\r
+- php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
+- int ret = 0, data_bits_def, stop_bits_def, parity_def;\r
+- struct termios tio;\r
+- speed_t rate_def;\r
+-\r
+- if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_parity_to_define(data->parity, &parity_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);\r
+- return 0;\r
+- }\r
+-\r
+- ret = tcgetattr(pdata->fd, &(pdata->oldtio));\r
+- if (ret < 0) {\r
+- if ((errno == ENOTTY) || (errno == ENODEV)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a serial port or terminal!");\r
+- }\r
+- return 0;\r
+- }\r
+-\r
+- ret = tcgetattr(pdata->fd, &tio);\r
+- if (ret < 0) {\r
+- return 0;\r
+- }\r
+-\r
+- if (data->canonical) {\r
+- tio.c_iflag = IGNPAR | ICRNL;\r
+- tio.c_oflag = 0;\r
+- tio.c_lflag = ICANON;\r
+- } else {\r
+- cfmakeraw(&tio);\r
+- }\r
+-\r
+- cfsetispeed(&tio, rate_def);\r
+- cfsetospeed(&tio, rate_def);\r
+-\r
+- tio.c_cflag &= ~CSIZE;\r
+- tio.c_cflag |= data_bits_def;\r
+- tio.c_cflag &= ~CSTOPB;\r
+- tio.c_cflag |= stop_bits_def;\r
+- tio.c_cflag &= ~(PARENB|PARODD);\r
+- tio.c_cflag |= parity_def;\r
+-\r
+-#ifdef CRTSCTS\r
+- tio.c_cflag &= ~(CLOCAL | CRTSCTS);\r
+-#else\r
+- tio.c_cflag &= ~CLOCAL;\r
+-#endif\r
+- if (!data->flow_control) {\r
+- tio.c_cflag |= CLOCAL;\r
+-#ifdef CRTSCTS\r
+- } else {\r
+- tio.c_cflag |= CRTSCTS;\r
+-#endif\r
+- }\r
+-\r
+- ret = tcsetattr(pdata->fd, TCSANOW, &tio);\r
+- if (ret < 0) {\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_uninit\r
+- * Restores the serial settings back to their original state.\r
+- */\r
+-int dio_serial_uninit(php_dio_stream_data *data) {\r
+- php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
+- int ret;\r
+-\r
+- do {\r
+- ret = tcsetattr(pdata->fd, TCSANOW, &(pdata->oldtio));\r
+- } while ((ret < 0) && (errno == EINTR));\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_flush\r
+- * Purges the serial buffers of data.\r
+- */\r
+-int dio_serial_purge(php_dio_stream_data *data) {\r
+- php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
+- int ret;\r
+-\r
+- if ((pdata->flags & O_RDWR) == O_RDWR) {\r
+- ret = tcflush(pdata->fd, TCIOFLUSH);\r
+- } else if ((pdata->flags & O_WRONLY) == O_WRONLY) {\r
+- ret = tcflush(pdata->fd, TCOFLUSH);\r
+- } else if ((pdata->flags & O_RDONLY) == O_RDONLY) {\r
+- ret = tcflush(pdata->fd, TCIFLUSH);\r
+- }\r
+-\r
+- if (ret < 0) {\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_open_stream\r
+- * Opens the underlying stream.\r
+- */\r
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
+- php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;\r
+-\r
+-#ifdef O_NOCTTY\r
+- /* We don't want a controlling TTY */\r
+- pdata->flags |= O_NOCTTY;\r
+-#endif\r
+-\r
+- if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_serial_init(data TSRMLS_CC)) {\r
+- close(pdata->fd);\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/*\r
+- * Local variables:\r
+- * c-basic-offset: 4\r
+- * tab-width: 4\r
+- * End:\r
+- * vim600: fdm=marker\r
+- * vim: sw=4 ts=4 noet\r
+- */\r
++/*
++ +----------------------------------------------------------------------+
++ | PHP Version 5 |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2009 Melanie Rhianna Lewis |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.0 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_0.txt. |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Author: Melanie Rhianna Lewis <cyberspice@php.net> |
++ +----------------------------------------------------------------------+
++ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include "php.h"
++
++#include "php_dio_common.h"
++
++/* {{{ dio_stream_mode_to_flags
++ * Convert an fopen() mode string to open() flags
++ */
++static int dio_stream_mode_to_flags(const char *mode) {
++ int flags = 0, ch = 0, bin = 1;
++
++ switch(mode[ch++]) {
++ case 'r':
++ flags = 0;
++ break;
++ case 'w':
++ flags = O_TRUNC | O_CREAT;
++ break;
++ case 'a':
++ flags = O_APPEND | O_CREAT;
++ break;
++ case 'x':
++ flags = O_EXCL | O_CREAT;
++ break;
++ }
++
++ if (mode[ch] != '+') {
++ bin = (mode[ch++] == 'b');
++ }
++
++ if (mode[ch] == '+') {
++ flags |= O_RDWR;
++ } else if (flags) {
++ flags |= O_WRONLY;
++ } else {
++ flags |= O_RDONLY;
++ }
++
++#if defined(_O_TEXT) && defined(O_BINARY)
++ if (bin) {
++ flags |= O_BINARY;
++ } else {
++ flags |= _O_TEXT;
++ }
++#endif
++
++ return flags;
++}
++/* }}} */
++
++/* {{{ dio_data_rate_to_define
++ * Converts a numeric data rate to a termios define
++ */
++static int dio_data_rate_to_define(long rate, speed_t *def) {
++ speed_t val;
++
++ switch (rate) {
++ case 0:
++ val = 0;
++ break;
++ case 50:
++ val = B50;
++ break;
++ case 75:
++ val = B75;
++ break;
++ case 110:
++ val = B110;
++ break;
++ case 134:
++ val = B134;
++ break;
++ case 150:
++ val = B150;
++ break;
++ case 200:
++ val = B200;
++ break;
++ case 300:
++ val = B300;
++ break;
++ case 600:
++ val = B600;
++ break;
++ case 1200:
++ val = B1200;
++ break;
++ case 1800:
++ val = B1800;
++ break;
++ case 2400:
++ val = B2400;
++ break;
++ case 4800:
++ val = B4800;
++ break;
++ case 9600:
++ val = B9600;
++ break;
++ case 19200:
++ val = B19200;
++ break;
++ case 38400:
++ val = B38400;
++ break;
++#ifdef B57600
++ case 57600:
++ val = B57600;
++ break;
++#endif
++#ifdef B115200
++ case 115200:
++ val = B115200;
++ break;
++#endif
++#ifdef B230400
++ case 230400:
++ val = B230400;
++ break;
++#endif
++#ifdef B460800
++ case 460800:
++ val = B460800;
++ break;
++#endif
++ default:
++ return 0;
++ }
++
++ *def = val;
++ return 1;
++}
++
++/* {{{ dio_data_bits_to_define
++ * Converts a number of data bits to a termios define
++ */
++static int dio_data_bits_to_define(int data_bits, int *def) {
++ int val;
++
++ switch (data_bits) {
++ case 8:
++ val = CS8;
++ break;
++ case 7:
++ val = CS7;
++ break;
++ case 6:
++ val = CS6;
++ break;
++ case 5:
++ val = CS5;
++ break;
++ default:
++ return 0;
++ }
++
++ *def = val;
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_stop_bits_to_define
++ * Converts a number of stop bits to a termios define
++ */
++static int dio_stop_bits_to_define(int stop_bits, int *def) {
++ int val;
++
++ switch (stop_bits) {
++ case 1:
++ val = 0;
++ break;
++ case 2:
++ val = CSTOPB;
++ break;
++ default:
++ return 0;
++ }
++
++ *def = val;
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_parity_to_define
++ * Converts a parity type to a termios define
++ */
++static int dio_parity_to_define(int parity, int *def) {
++ int val;
++
++ switch (parity) {
++ case 0:
++ val = 0;
++ break;
++ case 1:
++ val = PARENB | PARODD;
++ break;
++ case 2:
++ val = PARENB;
++ break;
++ default:
++ return 0;
++ }
++
++ *def = val;
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_create_stream_data
++ * Creates an initialised stream data structure. Free with efree().
++ */
++php_dio_stream_data * dio_create_stream_data(void) {
++ php_dio_posix_stream_data * data = emalloc(sizeof(php_dio_posix_stream_data));
++ dio_init_stream_data(&(data->common));
++ data->fd = -1;
++ data->flags = 0;
++
++ return (php_dio_stream_data *)data;
++}
++/* }}} */
++
++/* {{{ dio_common_write
++ * Writes count chars from the buffer to the stream described by the stream data.
++ */
++size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {
++ size_t ret;
++
++ /* Blocking writes can be interrupted by signals etc. If
++ * interrupted try again. Not sure about non-blocking
++ * writes but it doesn't hurt to check. */
++ do {
++ ret = write(((php_dio_posix_stream_data*)data)->fd, buf, count);
++ if (ret > 0) {
++ return ret;
++ }
++ } while (errno == EINTR);
++ return 0;
++}
++/* }}} */
++
++#ifdef DIO_NONBLOCK
++/* {{{ dio_timeval_subtract
++ * Calculates the difference between two timevals returning the result in the
++ * structure pointed to by diffptr. Returns -1 as error if late time is
++ * earlier than early time.
++ */
++static int dio_timeval_subtract(struct timeval *late, struct timeval *early, struct timeval *diff) {
++ struct timeval *tmp;
++
++ /* Handle negatives */
++ if (late->tv_sec < early->tv_sec) {
++ return 0;
++ }
++
++ if ((late->tv_sec == early->tv_sec) && (late->tv_usec < early->tv_usec)) {
++ return 0;
++ }
++
++ /* Handle any carry. If later usec is smaller than earlier usec simple
++ * subtraction will result in negative value. Since usec has a maximum
++ * of one second by adding another second before the subtraction the
++ * result will always be positive. */
++ if (late->tv_usec < early->tv_usec) {
++ late->tv_usec += 1000000;
++ late->tv_sec--;
++ }
++
++ /* Once adjusted can just subtract values. */
++ diff->tv_sec = late->tv_sec - early->tv_sec;
++ diff->tv_usec = late->tv_usec - early->tv_usec;
++
++ return 1;
++}
++#endif
++
++/* {{{ dio_common_read
++ * Reads count chars to the buffer to the stream described by the stream data.
++ */
++size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {
++ int fd = ((php_dio_posix_stream_data*)data)->fd;
++ size_t ret, total = 0;
++ char *ptr = (char*)buf;
++
++ struct timeval timeout, timeouttmp, before, after, diff;
++ fd_set rfds;
++
++ if (!data->has_timeout) {
++ /* Blocking reads can be interrupted by signals etc. If
++ * interrupted try again. Not sure about non-blocking
++ * reads but it doesn't hurt to check. */
++ do {
++ ret = read(fd, (char*)ptr, count);
++ if (ret > 0) {
++ return ret;
++ } else if (!ret) {
++ data->end_of_file = 1;
++ }
++ } while ((errno == EINTR) && !data->end_of_file);
++ return 0;
++ }
++#ifdef DIO_NONBLOCK
++ else {
++ /* Clear timed out flag */
++ data->timed_out = 0;
++
++ /* The initial timeout value */
++ timeout.tv_sec = data->timeout_sec;
++ timeout.tv_usec = data->timeout_usec;
++
++ do {
++ /* The semantics of select() are that you cannot guarantee
++ * that the timeval structure passed in has not been changed by
++ * the select call. So you keep a copy. */
++ timeouttmp = timeout;
++
++ /* The time before we wait for data. */
++ (void) gettimeofday(&before, NULL);
++
++ /* Wait for an event on our file descriptor. */
++ FD_ZERO(&rfds);
++ FD_SET(fd, &rfds);
++
++ ret = select(fd + 1, &rfds, NULL, NULL, &timeouttmp);
++ /* An error. */
++ if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {
++ return 0;
++ }
++
++ /* We have data to read. */
++ if ((ret > 0) && FD_ISSET(fd, &rfds)) {
++ ret = read(fd, ptr, count);
++ /* Another error */
++ if ((ret < 0) && (errno != EINTR) && (errno != EAGAIN)) {
++ return 0;
++ }
++
++ if (ret > 0) {
++ /* Got data, add it to the buffer. */
++ ptr += ret;
++ total += ret;
++ count -= ret;
++ } else if (!ret) {
++ /* This should never happen since how can we have
++ * data to read at an end of file, but still
++ * just in case! */
++ data->end_of_file = 1;
++ break;
++ }
++ }
++
++ /* If not timed out and not end of file and not all data read
++ * calculate how long it took us and loop if we still have time
++ * out time left. */
++ if (count) {
++ (void) gettimeofday(&after, NULL);
++
++ /* Diff the timevals */
++ (void) dio_timeval_subtract(&after, &before, &diff);
++
++ /* Now adjust the timeout. */
++ if (!dio_timeval_subtract(&timeout, &diff, &timeout)) {
++ /* If it errors we've run out of time. */
++ data->timed_out = 1;
++ break;
++ } else if (!timeout.tv_sec && !(timeout.tv_usec / 1000)) {
++ /* Check for rounding issues (millisecond accuracy) */
++ data->timed_out = 1;
++ break;
++ }
++ }
++ } while (count); /* Until time out or end of file or all data read. */
++
++ return total;
++ }
++#endif
++}
++/* }}} */
++
++/* {{{ php_dio_stream_data
++ * Closes the php_stream.
++ */
++int dio_common_close(php_dio_stream_data *data) {
++ if (close(((php_dio_posix_stream_data*)data)->fd) < 0) {
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_common_set_option
++ * Sets/gets stream options
++ */
++int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {
++ int fd = ((php_dio_posix_stream_data*)data)->fd;
++ int old_is_blocking;
++ int flags;
++
++ switch (option) {
++#ifdef DIO_NONBLOCK
++ case PHP_STREAM_OPTION_READ_TIMEOUT:
++ if (ptrparam) {
++ struct timeval *tv = (struct timeval*)ptrparam;
++
++ flags = fcntl(fd, F_GETFL, 0);
++
++ /* A timeout of zero seconds and zero microseconds disables
++ any existing timeout. */
++ if (tv->tv_sec || tv->tv_usec) {
++ data->timeout_sec = tv->tv_sec;
++ data->timeout_usec = tv->tv_usec;
++ data->has_timeout = -1;
++ (void) fcntl(fd, F_SETFL, flags & ~DIO_NONBLOCK);
++ } else {
++ data->timeout_sec = 0;
++ data->timeout_usec = 0;
++ data->has_timeout = 0;
++ data->timed_out = 0;
++ (void) fcntl(fd, F_SETFL, flags | DIO_NONBLOCK);
++ }
++
++ return PHP_STREAM_OPTION_RETURN_OK;
++ } else {
++ return PHP_STREAM_OPTION_RETURN_ERR;
++ }
++
++ case PHP_STREAM_OPTION_BLOCKING:
++ flags = fcntl(fd, F_GETFL, 0);
++ if (value) {
++ flags &= ~DIO_NONBLOCK;
++ } else {
++ flags |= DIO_NONBLOCK;
++ }
++ (void) fcntl(fd, F_SETFL, flags);
++
++ old_is_blocking = data->is_blocking;
++ data->is_blocking = value;
++ return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
++#endif /* O_NONBLOCK */
++
++ default:
++ break;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_raw_open_stream
++ * Opens the underlying stream.
++ */
++int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
++ pdata->flags = dio_stream_mode_to_flags(mode);
++
++#ifdef DIO_NONBLOCK
++ if (!data->is_blocking || data->has_timeout) {
++ pdata->flags |= DIO_NONBLOCK;
++ }
++#endif
++
++ /* Open the file and handle any errors. */
++#ifdef DIO_HAS_FILEPERMS
++ if (data->has_perms) {
++ pdata->fd = open(filename, pdata->flags, (mode_t)data->perms);
++ } else {
++ pdata->fd = open(filename, pdata->flags);
++ }
++#else
++ pdata->fd = open(filename, pdata->flags);
++#endif
++
++ if (pdata->fd < 0) {
++ switch (errno) {
++ case EEXIST:
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
++ return 0;
++ default:
++ return 0;
++ }
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_serial_init
++ * Initialises the serial settings storing the original settings before hand.
++ */
++static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
++ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
++ int ret = 0, data_bits_def, stop_bits_def, parity_def;
++ struct termios tio;
++ speed_t rate_def;
++
++ if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);
++ return 0;
++ }
++
++ if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
++ return 0;
++ }
++
++ if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
++ return 0;
++ }
++
++ if (!dio_parity_to_define(data->parity, &parity_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
++ return 0;
++ }
++
++ ret = tcgetattr(pdata->fd, &(pdata->oldtio));
++ if (ret < 0) {
++ if ((errno == ENOTTY) || (errno == ENODEV)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a serial port or terminal!");
++ }
++ return 0;
++ }
++
++ ret = tcgetattr(pdata->fd, &tio);
++ if (ret < 0) {
++ return 0;
++ }
++
++ if (data->canonical) {
++ tio.c_iflag = IGNPAR | ICRNL;
++ tio.c_oflag = 0;
++ tio.c_lflag = ICANON;
++ } else {
++ cfmakeraw(&tio);
++ }
++
++ cfsetispeed(&tio, rate_def);
++ cfsetospeed(&tio, rate_def);
++
++ tio.c_cflag &= ~CSIZE;
++ tio.c_cflag |= data_bits_def;
++ tio.c_cflag &= ~CSTOPB;
++ tio.c_cflag |= stop_bits_def;
++ tio.c_cflag &= ~(PARENB|PARODD);
++ tio.c_cflag |= parity_def;
++
++#ifdef CRTSCTS
++ tio.c_cflag &= ~(CLOCAL | CRTSCTS);
++#else
++ tio.c_cflag &= ~CLOCAL;
++#endif
++ if (!data->flow_control) {
++ tio.c_cflag |= CLOCAL;
++#ifdef CRTSCTS
++ } else {
++ tio.c_cflag |= CRTSCTS;
++#endif
++ }
++
++ ret = tcsetattr(pdata->fd, TCSANOW, &tio);
++ if (ret < 0) {
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_serial_uninit
++ * Restores the serial settings back to their original state.
++ */
++int dio_serial_uninit(php_dio_stream_data *data) {
++ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
++ int ret;
++
++ do {
++ ret = tcsetattr(pdata->fd, TCSANOW, &(pdata->oldtio));
++ } while ((ret < 0) && (errno == EINTR));
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_serial_flush
++ * Purges the serial buffers of data.
++ */
++int dio_serial_purge(php_dio_stream_data *data) {
++ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
++ int ret;
++
++ if ((pdata->flags & O_RDWR) == O_RDWR) {
++ ret = tcflush(pdata->fd, TCIOFLUSH);
++ } else if ((pdata->flags & O_WRONLY) == O_WRONLY) {
++ ret = tcflush(pdata->fd, TCOFLUSH);
++ } else if ((pdata->flags & O_RDONLY) == O_RDONLY) {
++ ret = tcflush(pdata->fd, TCIFLUSH);
++ }
++
++ if (ret < 0) {
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_serial_open_stream
++ * Opens the underlying stream.
++ */
++int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
++
++#ifdef O_NOCTTY
++ /* We don't want a controlling TTY */
++ pdata->flags |= O_NOCTTY;
++#endif
++
++ if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
++ return 0;
++ }
++
++ if (!dio_serial_init(data TSRMLS_CC)) {
++ close(pdata->fd);
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/*
++ * Local variables:
++ * c-basic-offset: 4
++ * tab-width: 4
++ * End:
++ * vim600: fdm=marker
++ * vim: sw=4 ts=4 noet
++ */
+--- a/dio_win32.c
++++ b/dio_win32.c
+@@ -1,759 +1,759 @@
+-/*\r
+- +----------------------------------------------------------------------+\r
+- | PHP Version 5 |\r
+- +----------------------------------------------------------------------+\r
+- | Copyright (c) 2009 Melanie Rhianna Lewis |\r
+- +----------------------------------------------------------------------+\r
+- | This source file is subject to version 3.0 of the PHP license, |\r
+- | that is bundled with this package in the file LICENSE, and is |\r
+- | available through the world-wide-web at the following url: |\r
+- | http://www.php.net/license/3_0.txt. |\r
+- | If you did not receive a copy of the PHP license and are unable to |\r
+- | obtain it through the world-wide-web, please send a note to |\r
+- | license@php.net so we can mail you a copy immediately. |\r
+- +----------------------------------------------------------------------+\r
+- | Author: Melanie Rhianna Lewis <cyberspice@php.net> |\r
+- +----------------------------------------------------------------------+\r
+- */\r
+-\r
+-#ifdef HAVE_CONFIG_H\r
+-#include "config.h"\r
+-#endif\r
+-\r
+-#include "php.h"\r
+-#include "php_dio_common.h"\r
+-\r
+-#ifndef ZEND_WIN32\r
+-#error ZEND_WIN32 not defined!\r
+-#endif\r
+-\r
+-/* {{{ dio_last_error_php_error\r
+- * Generates a PHP error message based upon the last Windows error.\r
+- */\r
+-static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {\r
+- LPVOID msgbuf;\r
+- DWORD msgbuflen;\r
+- char * errmsg;\r
+- DWORD err;\r
+-\r
+-#ifdef UNICODE\r
+- DWORD errmsglen;\r
+-#endif\r
+-\r
+- err = GetLastError();\r
+- msgbuflen = FormatMessage(\r
+- FORMAT_MESSAGE_ALLOCATE_BUFFER|\r
+- FORMAT_MESSAGE_FROM_SYSTEM|\r
+- FORMAT_MESSAGE_IGNORE_INSERTS,\r
+- NULL,\r
+- err,\r
+- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),\r
+- (LPTSTR)&msgbuf,\r
+- 0,\r
+- NULL);\r
+-\r
+-#ifdef UNICODE\r
+-\r
+- /* Get the length of the converted message */\r
+- errmsglen = WideCharToMultibyte(\r
+- CP_ACP,\r
+- 0\r
+- (LPCWSTR)msgbuf,\r
+- -1,\r
+- (LPSTR)errmsg,\r
+- 0,\r
+- NULL,\r
+- NULL);\r
+-\r
+- /* Allocate a buffer */\r
+- errmsg = emalloc(errmsglen);\r
+- if (!errmsg) {\r
+- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Out of memory in dio_last_error_php_error()!");\r
+- LocalFree(msgbuf);\r
+- return;\r
+- }\r
+-\r
+- /* Convert the message */\r
+- errmsglen = WideCharToMultibyte(\r
+- CP_ACP,\r
+- 0\r
+- (LPCWSTR)msgbuf,\r
+- -1,\r
+- (LPSTR)errmsg,\r
+- errmsglen,\r
+- NULL,\r
+- NULL);\r
+-\r
+-#else\r
+- errmsg = (char *)msgbuf;\r
+-#endif\r
+-\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);\r
+-\r
+- LocalFree(msgbuf);\r
+-#ifdef UNICODE\r
+- efree(errmsg);\r
+-#endif\r
+-}\r
+-\r
+-/* {{{ dio_data_rate_to_define\r
+- * Converts a numeric data rate to a termios define\r
+- */\r
+-static int dio_data_rate_to_define(long rate, DWORD *def) {\r
+- switch (rate) {\r
+- case 75:\r
+- case 110:\r
+- case 134:\r
+- case 150:\r
+- case 300:\r
+- case 600:\r
+- case 1200:\r
+- case 1800:\r
+- case 2400:\r
+- case 4800:\r
+- case 7200:\r
+- case 9600:\r
+- case 14400:\r
+- case 19200:\r
+- case 38400:\r
+- case 57600:\r
+- case 115200:\r
+- case 56000:\r
+- case 128000:\r
+- case 256000:\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = (DWORD)rate;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-\r
+-/* {{{ dio_data_bits_to_define\r
+- * Converts a number of data bits to a termios define\r
+- */\r
+-static int dio_data_bits_to_define(int data_bits, DWORD *def) {\r
+- switch (data_bits) {\r
+- case 8:\r
+- case 7:\r
+- case 6:\r
+- case 5:\r
+- case 4:\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = (DWORD)data_bits;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_stop_bits_to_define\r
+- * Converts a number of stop bits to a termios define\r
+- */\r
+-static int dio_stop_bits_to_define(int stop_bits, DWORD *def) {\r
+- DWORD val;\r
+-\r
+- switch (stop_bits) {\r
+- case 1:\r
+- val = ONESTOPBIT;\r
+- break;\r
+- case 2:\r
+- val = TWOSTOPBITS;\r
+- break;\r
+- case 3:\r
+- val = ONE5STOPBITS;\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = val;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_parity_to_define\r
+- * Converts a parity type to a termios define\r
+- */\r
+-static int dio_parity_to_define(int parity, DWORD *def) {\r
+- DWORD val;\r
+-\r
+- switch (parity) {\r
+- case 0:\r
+- val = NOPARITY;\r
+- break;\r
+- case 1:\r
+- val = ODDPARITY;\r
+- break;\r
+- case 2:\r
+- val = EVENPARITY;\r
+- break;\r
+- default:\r
+- return 0;\r
+- }\r
+-\r
+- *def = val;\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_create_stream_data\r
+- * Creates an initialised stream data structure. Free with efree().\r
+- */\r
+-php_dio_stream_data * dio_create_stream_data(void) {\r
+- php_dio_win32_stream_data * data = emalloc(sizeof(php_dio_win32_stream_data));\r
+- memset(data, 0, sizeof(php_dio_win32_stream_data));\r
+- dio_init_stream_data(&(data->common));\r
+- data->handle = INVALID_HANDLE_VALUE;\r
+- data->desired_access = 0;\r
+- data->creation_disposition = 0;\r
+- data->olddcb.DCBlength = sizeof(DCB);\r
+-\r
+- return (php_dio_stream_data *)data;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_common_write\r
+- * Writes count chars from the buffer to the stream described by the stream data.\r
+- */\r
+-size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+- DWORD total = 0;\r
+-\r
+- if (WriteFile(wdata->handle, buf, (DWORD)count, &total, NULL)) {\r
+- return (size_t)total;\r
+- }\r
+-\r
+- return 0;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_buffer_read\r
+- * Reads any available chars from the canonical buffer.\r
+- */\r
+-static size_t dio_buffer_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {\r
+- php_dio_win32_canon_data *canon_data = wdata->canon_data;\r
+- size_t total = 0;\r
+-\r
+- /* Read always follows write. I.e. if read ptr > write ptr buffer has\r
+- wrapped and so we need to copy two blocks of data. */\r
+- if (canon_data->read_pos > canon_data->write_pos) {\r
+-\r
+- /* Check we actually need to copy both blocks */\r
+- if ((canon_data->size - canon_data->read_pos) > count) {\r
+-\r
+- /* No we don't. Just copy as much as we were asked for. */\r
+- memcpy((char*)buf, \r
+- &(canon_data->buf[canon_data->read_pos]), \r
+- count);\r
+- /* Update the read pointer. */\r
+- canon_data->read_pos += count;\r
+-\r
+- /* Return the amount read. */\r
+- return count;\r
+- } else {\r
+-\r
+- /* We need to copy both blocks so copy data up to the end of \r
+- the buffer. */\r
+- total = canon_data->size - canon_data->read_pos;\r
+- memcpy((char*)buf, \r
+- &(canon_data->buf[canon_data->read_pos]), \r
+- total);\r
+- canon_data->read_pos = 0;\r
+- count -= total;\r
+-\r
+- /* Now copy the data from the start of the buffer either up\r
+- count or the number of bytes in the buffer. */\r
+-\r
+- if (canon_data->write_pos > count) {\r
+- memcpy((char*)buf, canon_data->buf, count);\r
+- canon_data->read_pos = count;\r
+- total += count;\r
+-\r
+- return total;\r
+- } else {\r
+- memcpy((char*)buf, canon_data->buf, canon_data->write_pos);\r
+- canon_data->read_pos = canon_data->write_pos;\r
+- total += canon_data->write_pos;\r
+-\r
+- return total;\r
+- }\r
+- }\r
+-\r
+- /* Else if write follows read. This is a simpler case. We just copy \r
+- either all the data buffered or count, which ever is smaller. */\r
+- } else if (canon_data->write_pos > canon_data->read_pos) {\r
+- if ((canon_data->write_pos - canon_data->read_pos) > count) {\r
+- memcpy((char*)buf, \r
+- &(canon_data->buf[canon_data->read_pos]), \r
+- count);\r
+- canon_data->read_pos += count;\r
+-\r
+- return count;\r
+- } else {\r
+- total = canon_data->write_pos - canon_data->read_pos;\r
+- memcpy((char*)buf, \r
+- &(canon_data->buf[canon_data->read_pos]), \r
+- total);\r
+- canon_data->read_pos += total;\r
+-\r
+- return total;\r
+- }\r
+- }\r
+-\r
+- /* Else we need to read more data from the data port. */\r
+- return 0;\r
+-}\r
+-\r
+-/* {{{ dio_com_read\r
+- * Read chars from the data port.\r
+- */\r
+-static size_t dio_com_read(php_dio_stream_data *data, const char *buf, size_t count) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+- DWORD err, total = 0;\r
+-\r
+- if (ReadFile(wdata->handle, (void*)buf, (DWORD)count, &total, NULL)) {\r
+-\r
+- if (total) {\r
+- return (size_t)total;\r
+- }\r
+-\r
+- data->end_of_file = 1;\r
+- }\r
+-\r
+- if (!data->end_of_file) {\r
+- err = GetLastError();\r
+-\r
+- if (ERROR_HANDLE_EOF == err) {\r
+- data->end_of_file = 1;\r
+- }\r
+- }\r
+-\r
+- return 0;\r
+-}\r
+-\r
+-/* {{{ dio_canonical_read\r
+- * Reads chars from the input stream until the internal buffer is full or a new\r
+- * line is reached.\r
+- */\r
+-static size_t dio_canonical_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {\r
+- php_dio_win32_canon_data *canon_data = wdata->canon_data;\r
+- size_t total = 0;\r
+- char ch;\r
+-\r
+- /* See if there's any buffered data and copy it. */\r
+- total = dio_buffer_read(wdata, buf, count);\r
+- if (total) {\r
+- return total;\r
+- }\r
+-\r
+- /* Need to read more data from the data port. Buffer should be empty(er)\r
+- by now. */\r
+- do {\r
+- /* Is the buffer full? */\r
+- if (((canon_data->write_pos + 1) % canon_data->size) == \r
+- canon_data->read_pos) {\r
+- break;\r
+- }\r
+-\r
+- /* Read a byte from the input checking for EOF. */\r
+- if (!dio_com_read((php_dio_stream_data*)wdata, &ch, 1)) {\r
+- break;\r
+- }\r
+-\r
+- /* Translate CR to newlines (same as ICRNL in POSIX) */\r
+- ch = (ch != '\r') ? ch : '\n';\r
+-\r
+- /* We read a character! So buffer it. */\r
+- canon_data->buf[canon_data->write_pos++] = ch;\r
+- if (canon_data->write_pos >= canon_data->size) {\r
+- canon_data->write_pos = 0;\r
+- }\r
+-\r
+- /* End of line/input (^D)? */\r
+- } while ((ch != '\n') && (ch != 0x04));\r
+-\r
+- return dio_buffer_read(wdata, buf, count);\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_common_read\r
+- * Reads count chars to the buffer to the stream described by the stream data.\r
+- */\r
+-size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {\r
+-\r
+- /* You ask for no bytes you'll get none :-) */\r
+- if (!count) {\r
+- return 0;\r
+- }\r
+-\r
+- if (data->canonical) {\r
+- return dio_canonical_read((php_dio_win32_stream_data*)data, buf, count);\r
+- } else {\r
+- return dio_com_read(data, buf, count);\r
+- }\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ php_dio_stream_data\r
+- * Closes the php_stream.\r
+- */\r
+-int dio_common_close(php_dio_stream_data *data) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+-\r
+- if (data->canonical) {\r
+- efree(wdata->canon_data);\r
+- }\r
+-\r
+- if (!CloseHandle(wdata->handle)) {\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_common_set_option\r
+- * Sets/gets stream options\r
+- */\r
+-int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {\r
+- COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };\r
+- int old_is_blocking = 0;\r
+-\r
+- /* Can't do timeouts or non blocking with raw windows streams :-( */\r
+- if (DIO_STREAM_TYPE_SERIAL == data->stream_type) {\r
+- switch (option) {\r
+- case PHP_STREAM_OPTION_BLOCKING:\r
+- old_is_blocking = data->is_blocking;\r
+- data->is_blocking = value ? 1 : 0;\r
+-\r
+- /* Only change values if we need to change them. */\r
+- if (data->is_blocking != old_is_blocking) {\r
+- /* If we're not blocking but don't have a timeout\r
+- set to return immediately */\r
+- if (!data->is_blocking && !data->has_timeout) {\r
+- cto.ReadIntervalTimeout = MAXDWORD;\r
+- }\r
+-\r
+- /* If we have a timeout ignore the blocking and set\r
+- the total time in which to read the data */\r
+- if (data->has_timeout) {\r
+- cto.ReadIntervalTimeout = MAXDWORD;\r
+- cto.ReadTotalTimeoutMultiplier = MAXDWORD;\r
+- cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +\r
+- (data->timeout_sec * 1000);\r
+- }\r
+-\r
+- if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {\r
+- return PHP_STREAM_OPTION_RETURN_ERR;\r
+- }\r
+- }\r
+- return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;\r
+-\r
+- case PHP_STREAM_OPTION_READ_TIMEOUT:\r
+- if (ptrparam) {\r
+- /* struct timeval is supported with PHP_WIN32 defined. */\r
+- struct timeval *tv = (struct timeval*)ptrparam;\r
+-\r
+- /* A timeout of zero seconds and zero microseconds disables\r
+- any existing timeout. */\r
+- if (tv->tv_sec || tv->tv_usec) {\r
+- data->timeout_sec = tv->tv_sec;\r
+- data->timeout_usec = tv->tv_usec;\r
+- data->has_timeout = -1;\r
+-\r
+- cto.ReadIntervalTimeout = MAXDWORD;\r
+- cto.ReadTotalTimeoutMultiplier = MAXDWORD;\r
+- cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +\r
+- (data->timeout_sec * 1000);\r
+- } else {\r
+- data->timeout_sec = 0;\r
+- data->timeout_usec = 0;\r
+- data->has_timeout = 0;\r
+- data->timed_out = 0;\r
+-\r
+- /* If we're not blocking but don't have a timeout\r
+- set to return immediately */\r
+- if (!data->is_blocking) {\r
+- cto.ReadIntervalTimeout = MAXDWORD;\r
+- }\r
+- }\r
+-\r
+- if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {\r
+- return PHP_STREAM_OPTION_RETURN_ERR;\r
+- } else {\r
+- return PHP_STREAM_OPTION_RETURN_OK;\r
+- }\r
+- } else {\r
+- return PHP_STREAM_OPTION_RETURN_ERR;\r
+- }\r
+-\r
+- default:\r
+- break;\r
+- }\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_raw_open_stream\r
+- * Opens the underlying stream.\r
+- */\r
+-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+- DWORD err;\r
+-\r
+- switch(*mode) {\r
+- case 'r':\r
+- wdata->creation_disposition = OPEN_EXISTING;\r
+- break;\r
+- case 'w':\r
+- wdata->creation_disposition = TRUNCATE_EXISTING;\r
+- break;\r
+- case 'a':\r
+- wdata->creation_disposition = OPEN_ALWAYS;\r
+- break;\r
+- case 'x':\r
+- wdata->creation_disposition = CREATE_NEW;\r
+- break;\r
+- }\r
+- mode ++;\r
+-\r
+- if (*mode && (*mode != '+')) {\r
+- mode++;\r
+- }\r
+-\r
+- if (*mode && (*mode == '+')) {\r
+- wdata->desired_access = GENERIC_READ | GENERIC_WRITE;\r
+- } else if (OPEN_EXISTING == wdata->creation_disposition) {\r
+- wdata->desired_access = GENERIC_READ;\r
+- } else {\r
+- wdata->desired_access = GENERIC_WRITE;\r
+- }\r
+-\r
+- wdata->handle = CreateFile(filename, wdata->desired_access, 0,\r
+- NULL, wdata->creation_disposition, FILE_ATTRIBUTE_NORMAL, NULL);\r
+- if (INVALID_HANDLE_VALUE == wdata->handle) {\r
+- err = GetLastError();\r
+- switch (err) {\r
+- case ERROR_FILE_EXISTS:\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");\r
+- return 0;\r
+-\r
+- case ERROR_FILE_NOT_FOUND:\r
+- /* ERROR_FILE_NOT_FOUND with TRUNCATE_EXISTING means that\r
+- * the file doesn't exist so now try to create it. */\r
+- if (TRUNCATE_EXISTING == wdata->creation_disposition) {\r
+- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "File does not exist, creating new file!");\r
+-\r
+- wdata->handle = CreateFile(filename, wdata->desired_access, 0,\r
+- NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);\r
+- if (INVALID_HANDLE_VALUE == wdata->handle) {\r
+- dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);\r
+- return 0;\r
+- }\r
+- } else {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File not found!");\r
+- return 0;\r
+- }\r
+- break;\r
+-\r
+- default:\r
+- dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);\r
+- return 0;\r
+- }\r
+- }\r
+-\r
+- /* If canonical allocate the canonical buffer. */\r
+- if (data->canonical) {\r
+- wdata->canon_data = emalloc(sizeof(php_dio_win32_canon_data));\r
+- memset(wdata->canon_data, 0, sizeof(php_dio_win32_canon_data));\r
+- wdata->canon_data->size = DIO_WIN32_CANON_BUF_SIZE;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_init\r
+- * Initialises the serial port\r
+- */\r
+-static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+- DWORD rate_def, data_bits_def, stop_bits_def, parity_def;\r
+- DCB dcb;\r
+-\r
+- if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%d)", data->data_rate);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_parity_to_define(data->parity, &parity_def)) {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);\r
+- return 0;\r
+- }\r
+-\r
+- if (!GetCommState(wdata->handle, &(wdata->olddcb))) {\r
+- dio_last_error_php_error(E_WARNING, "GetCommState() failed:" TSRMLS_CC);\r
+- return 0;\r
+- }\r
+-\r
+- /* Init the DCB structure */\r
+- memset(&dcb, 0, sizeof(DCB));\r
+- dcb.DCBlength = sizeof(DCB);\r
+-\r
+- /* Set the communication parameters */\r
+- dcb.fBinary = 1;\r
+- dcb.BaudRate = rate_def;\r
+- dcb.ByteSize = (BYTE)data_bits_def;\r
+- dcb.StopBits = (BYTE)stop_bits_def;\r
+- dcb.Parity = (BYTE)parity_def;\r
+-\r
+- /* Set the control line parameters */\r
+- dcb.fDtrControl = DTR_CONTROL_DISABLE;\r
+- dcb.fDsrSensitivity = FALSE;\r
+- dcb.fOutxDsrFlow = FALSE;\r
+- dcb.fTXContinueOnXoff = FALSE;\r
+- dcb.fOutX = FALSE;\r
+- dcb.fInX = FALSE;\r
+- dcb.fErrorChar = FALSE;\r
+- dcb.fNull = FALSE;\r
+- dcb.fAbortOnError = FALSE;\r
+-\r
+- /* Hardware flow control */\r
+- if (data->flow_control) {\r
+- dcb.fOutxCtsFlow = TRUE;\r
+- dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;\r
+- } else {\r
+- dcb.fOutxCtsFlow = FALSE;\r
+- dcb.fRtsControl = RTS_CONTROL_DISABLE;\r
+- }\r
+-\r
+- if (!SetCommState(wdata->handle, &dcb)) {\r
+- dio_last_error_php_error(E_WARNING, "SetCommState() failed:" TSRMLS_CC);\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-\r
+-/* {{{ dio_serial_uninit\r
+- * Restores the serial settings back to their original state.\r
+- */\r
+-int dio_serial_uninit(php_dio_stream_data *data) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+-\r
+- if (!SetCommState(wdata->handle, &(wdata->olddcb))) {\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_flush\r
+- * Purges the serial buffers of data.\r
+- */\r
+-int dio_serial_purge(php_dio_stream_data *data) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+- BOOL ret;\r
+-\r
+- /* Purge the canonical buffer if required */\r
+- if (data->canonical && ((wdata->desired_access & GENERIC_READ) == GENERIC_READ)) {\r
+- wdata->canon_data->read_pos = 0;\r
+- wdata->canon_data->write_pos = 0;\r
+- }\r
+-\r
+- /* Purge the com port */\r
+- if ((wdata->desired_access & (GENERIC_READ|GENERIC_WRITE)) == (GENERIC_READ|GENERIC_WRITE)) {\r
+- ret = PurgeComm(wdata->handle, PURGE_RXCLEAR|PURGE_TXCLEAR);\r
+- } else if ((wdata->desired_access & GENERIC_WRITE) == GENERIC_WRITE) {\r
+- ret = PurgeComm(wdata->handle, PURGE_TXCLEAR);\r
+- } else if ((wdata->desired_access & GENERIC_READ) == GENERIC_READ) {\r
+- ret = PurgeComm(wdata->handle, PURGE_RXCLEAR);\r
+- }\r
+-\r
+- return ret;\r
+-}\r
+-/* }}} */\r
+-\r
+-/* {{{ dio_serial_open_stream\r
+- * Opens the underlying stream.\r
+- */\r
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {\r
+- php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;\r
+- COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };\r
+-\r
+- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);\r
+-\r
+- if (*mode != 'r') {\r
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must open serial ports in read or read/write mode!");\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {\r
+- return 0;\r
+- }\r
+-\r
+- if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) {\r
+- dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):" TSRMLS_CC);\r
+- CloseHandle(wdata->handle);\r
+- return 0;\r
+- }\r
+-\r
+- /* If we're not blocking but don't have a timeout\r
+- set to return immediately */\r
+- if (!data->is_blocking && !data->has_timeout) {\r
+- cto.ReadIntervalTimeout = MAXDWORD;\r
+- }\r
+- \r
+- /* If we have a timeout ignore the blocking and set\r
+- the total time in which to read the data */\r
+- if (data->has_timeout) {\r
+- cto.ReadIntervalTimeout = MAXDWORD;\r
+- cto.ReadTotalTimeoutMultiplier = MAXDWORD;\r
+- cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) + \r
+- (data->timeout_sec * 1000);\r
+- }\r
+-\r
+- if (!SetCommTimeouts(wdata->handle, &cto)) {\r
+- dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:" TSRMLS_CC);\r
+- CloseHandle(wdata->handle);\r
+- return 0;\r
+- }\r
+-\r
+- if (!dio_serial_init(data TSRMLS_CC)) {\r
+- CloseHandle(wdata->handle);\r
+- return 0;\r
+- }\r
+-\r
+- return 1;\r
+-}\r
+-/* }}} */\r
+-\r
+-/*\r
+- * Local variables:\r
+- * c-basic-offset: 4\r
+- * tab-width: 4\r
+- * End:\r
+- * vim600: fdm=marker\r
+- * vim: sw=4 ts=4 noet\r
+- */\r
++/*
++ +----------------------------------------------------------------------+
++ | PHP Version 5 |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2009 Melanie Rhianna Lewis |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.0 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_0.txt. |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Author: Melanie Rhianna Lewis <cyberspice@php.net> |
++ +----------------------------------------------------------------------+
++ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include "php.h"
++#include "php_dio_common.h"
++
++#ifndef ZEND_WIN32
++#error ZEND_WIN32 not defined!
++#endif
++
++/* {{{ dio_last_error_php_error
++ * Generates a PHP error message based upon the last Windows error.
++ */
++static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
++ LPVOID msgbuf;
++ DWORD msgbuflen;
++ char * errmsg;
++ DWORD err;
++
++#ifdef UNICODE
++ DWORD errmsglen;
++#endif
++
++ err = GetLastError();
++ msgbuflen = FormatMessage(
++ FORMAT_MESSAGE_ALLOCATE_BUFFER|
++ FORMAT_MESSAGE_FROM_SYSTEM|
++ FORMAT_MESSAGE_IGNORE_INSERTS,
++ NULL,
++ err,
++ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
++ (LPTSTR)&msgbuf,
++ 0,
++ NULL);
++
++#ifdef UNICODE
++
++ /* Get the length of the converted message */
++ errmsglen = WideCharToMultibyte(
++ CP_ACP,
++ 0
++ (LPCWSTR)msgbuf,
++ -1,
++ (LPSTR)errmsg,
++ 0,
++ NULL,
++ NULL);
++
++ /* Allocate a buffer */
++ errmsg = emalloc(errmsglen);
++ if (!errmsg) {
++ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Out of memory in dio_last_error_php_error()!");
++ LocalFree(msgbuf);
++ return;
++ }
++
++ /* Convert the message */
++ errmsglen = WideCharToMultibyte(
++ CP_ACP,
++ 0
++ (LPCWSTR)msgbuf,
++ -1,
++ (LPSTR)errmsg,
++ errmsglen,
++ NULL,
++ NULL);
++
++#else
++ errmsg = (char *)msgbuf;
++#endif
++
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);
++
++ LocalFree(msgbuf);
++#ifdef UNICODE
++ efree(errmsg);
++#endif
++}
++
++/* {{{ dio_data_rate_to_define
++ * Converts a numeric data rate to a termios define
++ */
++static int dio_data_rate_to_define(long rate, DWORD *def) {
++ switch (rate) {
++ case 75:
++ case 110:
++ case 134:
++ case 150:
++ case 300:
++ case 600:
++ case 1200:
++ case 1800:
++ case 2400:
++ case 4800:
++ case 7200:
++ case 9600:
++ case 14400:
++ case 19200:
++ case 38400:
++ case 57600:
++ case 115200:
++ case 56000:
++ case 128000:
++ case 256000:
++ break;
++ default:
++ return 0;
++ }
++
++ *def = (DWORD)rate;
++ return 1;
++}
++/* }}} */
++
++
++/* {{{ dio_data_bits_to_define
++ * Converts a number of data bits to a termios define
++ */
++static int dio_data_bits_to_define(int data_bits, DWORD *def) {
++ switch (data_bits) {
++ case 8:
++ case 7:
++ case 6:
++ case 5:
++ case 4:
++ break;
++ default:
++ return 0;
++ }
++
++ *def = (DWORD)data_bits;
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_stop_bits_to_define
++ * Converts a number of stop bits to a termios define
++ */
++static int dio_stop_bits_to_define(int stop_bits, DWORD *def) {
++ DWORD val;
++
++ switch (stop_bits) {
++ case 1:
++ val = ONESTOPBIT;
++ break;
++ case 2:
++ val = TWOSTOPBITS;
++ break;
++ case 3:
++ val = ONE5STOPBITS;
++ break;
++ default:
++ return 0;
++ }
++
++ *def = val;
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_parity_to_define
++ * Converts a parity type to a termios define
++ */
++static int dio_parity_to_define(int parity, DWORD *def) {
++ DWORD val;
++
++ switch (parity) {
++ case 0:
++ val = NOPARITY;
++ break;
++ case 1:
++ val = ODDPARITY;
++ break;
++ case 2:
++ val = EVENPARITY;
++ break;
++ default:
++ return 0;
++ }
++
++ *def = val;
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_create_stream_data
++ * Creates an initialised stream data structure. Free with efree().
++ */
++php_dio_stream_data * dio_create_stream_data(void) {
++ php_dio_win32_stream_data * data = emalloc(sizeof(php_dio_win32_stream_data));
++ memset(data, 0, sizeof(php_dio_win32_stream_data));
++ dio_init_stream_data(&(data->common));
++ data->handle = INVALID_HANDLE_VALUE;
++ data->desired_access = 0;
++ data->creation_disposition = 0;
++ data->olddcb.DCBlength = sizeof(DCB);
++
++ return (php_dio_stream_data *)data;
++}
++/* }}} */
++
++/* {{{ dio_common_write
++ * Writes count chars from the buffer to the stream described by the stream data.
++ */
++size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++ DWORD total = 0;
++
++ if (WriteFile(wdata->handle, buf, (DWORD)count, &total, NULL)) {
++ return (size_t)total;
++ }
++
++ return 0;
++}
++/* }}} */
++
++/* {{{ dio_buffer_read
++ * Reads any available chars from the canonical buffer.
++ */
++static size_t dio_buffer_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {
++ php_dio_win32_canon_data *canon_data = wdata->canon_data;
++ size_t total = 0;
++
++ /* Read always follows write. I.e. if read ptr > write ptr buffer has
++ wrapped and so we need to copy two blocks of data. */
++ if (canon_data->read_pos > canon_data->write_pos) {
++
++ /* Check we actually need to copy both blocks */
++ if ((canon_data->size - canon_data->read_pos) > count) {
++
++ /* No we don't. Just copy as much as we were asked for. */
++ memcpy((char*)buf,
++ &(canon_data->buf[canon_data->read_pos]),
++ count);
++ /* Update the read pointer. */
++ canon_data->read_pos += count;
++
++ /* Return the amount read. */
++ return count;
++ } else {
++
++ /* We need to copy both blocks so copy data up to the end of
++ the buffer. */
++ total = canon_data->size - canon_data->read_pos;
++ memcpy((char*)buf,
++ &(canon_data->buf[canon_data->read_pos]),
++ total);
++ canon_data->read_pos = 0;
++ count -= total;
++
++ /* Now copy the data from the start of the buffer either up
++ count or the number of bytes in the buffer. */
++
++ if (canon_data->write_pos > count) {
++ memcpy((char*)buf, canon_data->buf, count);
++ canon_data->read_pos = count;
++ total += count;
++
++ return total;
++ } else {
++ memcpy((char*)buf, canon_data->buf, canon_data->write_pos);
++ canon_data->read_pos = canon_data->write_pos;
++ total += canon_data->write_pos;
++
++ return total;
++ }
++ }
++
++ /* Else if write follows read. This is a simpler case. We just copy
++ either all the data buffered or count, which ever is smaller. */
++ } else if (canon_data->write_pos > canon_data->read_pos) {
++ if ((canon_data->write_pos - canon_data->read_pos) > count) {
++ memcpy((char*)buf,
++ &(canon_data->buf[canon_data->read_pos]),
++ count);
++ canon_data->read_pos += count;
++
++ return count;
++ } else {
++ total = canon_data->write_pos - canon_data->read_pos;
++ memcpy((char*)buf,
++ &(canon_data->buf[canon_data->read_pos]),
++ total);
++ canon_data->read_pos += total;
++
++ return total;
++ }
++ }
++
++ /* Else we need to read more data from the data port. */
++ return 0;
++}
++
++/* {{{ dio_com_read
++ * Read chars from the data port.
++ */
++static size_t dio_com_read(php_dio_stream_data *data, const char *buf, size_t count) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++ DWORD err, total = 0;
++
++ if (ReadFile(wdata->handle, (void*)buf, (DWORD)count, &total, NULL)) {
++
++ if (total) {
++ return (size_t)total;
++ }
++
++ data->end_of_file = 1;
++ }
++
++ if (!data->end_of_file) {
++ err = GetLastError();
++
++ if (ERROR_HANDLE_EOF == err) {
++ data->end_of_file = 1;
++ }
++ }
++
++ return 0;
++}
++
++/* {{{ dio_canonical_read
++ * Reads chars from the input stream until the internal buffer is full or a new
++ * line is reached.
++ */
++static size_t dio_canonical_read(php_dio_win32_stream_data *wdata, const char *buf, size_t count) {
++ php_dio_win32_canon_data *canon_data = wdata->canon_data;
++ size_t total = 0;
++ char ch;
++
++ /* See if there's any buffered data and copy it. */
++ total = dio_buffer_read(wdata, buf, count);
++ if (total) {
++ return total;
++ }
++
++ /* Need to read more data from the data port. Buffer should be empty(er)
++ by now. */
++ do {
++ /* Is the buffer full? */
++ if (((canon_data->write_pos + 1) % canon_data->size) ==
++ canon_data->read_pos) {
++ break;
++ }
++
++ /* Read a byte from the input checking for EOF. */
++ if (!dio_com_read((php_dio_stream_data*)wdata, &ch, 1)) {
++ break;
++ }
++
++ /* Translate CR to newlines (same as ICRNL in POSIX) */
++ ch = (ch != '\r') ? ch : '\n';
++
++ /* We read a character! So buffer it. */
++ canon_data->buf[canon_data->write_pos++] = ch;
++ if (canon_data->write_pos >= canon_data->size) {
++ canon_data->write_pos = 0;
++ }
++
++ /* End of line/input (^D)? */
++ } while ((ch != '\n') && (ch != 0x04));
++
++ return dio_buffer_read(wdata, buf, count);
++}
++/* }}} */
++
++/* {{{ dio_common_read
++ * Reads count chars to the buffer to the stream described by the stream data.
++ */
++size_t dio_common_read(php_dio_stream_data *data, const char *buf, size_t count) {
++
++ /* You ask for no bytes you'll get none :-) */
++ if (!count) {
++ return 0;
++ }
++
++ if (data->canonical) {
++ return dio_canonical_read((php_dio_win32_stream_data*)data, buf, count);
++ } else {
++ return dio_com_read(data, buf, count);
++ }
++}
++/* }}} */
++
++/* {{{ php_dio_stream_data
++ * Closes the php_stream.
++ */
++int dio_common_close(php_dio_stream_data *data) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++
++ if (data->canonical) {
++ efree(wdata->canon_data);
++ }
++
++ if (!CloseHandle(wdata->handle)) {
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_common_set_option
++ * Sets/gets stream options
++ */
++int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam) {
++ COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
++ int old_is_blocking = 0;
++
++ /* Can't do timeouts or non blocking with raw windows streams :-( */
++ if (DIO_STREAM_TYPE_SERIAL == data->stream_type) {
++ switch (option) {
++ case PHP_STREAM_OPTION_BLOCKING:
++ old_is_blocking = data->is_blocking;
++ data->is_blocking = value ? 1 : 0;
++
++ /* Only change values if we need to change them. */
++ if (data->is_blocking != old_is_blocking) {
++ /* If we're not blocking but don't have a timeout
++ set to return immediately */
++ if (!data->is_blocking && !data->has_timeout) {
++ cto.ReadIntervalTimeout = MAXDWORD;
++ }
++
++ /* If we have a timeout ignore the blocking and set
++ the total time in which to read the data */
++ if (data->has_timeout) {
++ cto.ReadIntervalTimeout = MAXDWORD;
++ cto.ReadTotalTimeoutMultiplier = MAXDWORD;
++ cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +
++ (data->timeout_sec * 1000);
++ }
++
++ if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {
++ return PHP_STREAM_OPTION_RETURN_ERR;
++ }
++ }
++ return old_is_blocking ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR;
++
++ case PHP_STREAM_OPTION_READ_TIMEOUT:
++ if (ptrparam) {
++ /* struct timeval is supported with PHP_WIN32 defined. */
++ struct timeval *tv = (struct timeval*)ptrparam;
++
++ /* A timeout of zero seconds and zero microseconds disables
++ any existing timeout. */
++ if (tv->tv_sec || tv->tv_usec) {
++ data->timeout_sec = tv->tv_sec;
++ data->timeout_usec = tv->tv_usec;
++ data->has_timeout = -1;
++
++ cto.ReadIntervalTimeout = MAXDWORD;
++ cto.ReadTotalTimeoutMultiplier = MAXDWORD;
++ cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +
++ (data->timeout_sec * 1000);
++ } else {
++ data->timeout_sec = 0;
++ data->timeout_usec = 0;
++ data->has_timeout = 0;
++ data->timed_out = 0;
++
++ /* If we're not blocking but don't have a timeout
++ set to return immediately */
++ if (!data->is_blocking) {
++ cto.ReadIntervalTimeout = MAXDWORD;
++ }
++ }
++
++ if (!SetCommTimeouts(((php_dio_win32_stream_data*)data)->handle, &cto)) {
++ return PHP_STREAM_OPTION_RETURN_ERR;
++ } else {
++ return PHP_STREAM_OPTION_RETURN_OK;
++ }
++ } else {
++ return PHP_STREAM_OPTION_RETURN_ERR;
++ }
++
++ default:
++ break;
++ }
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_raw_open_stream
++ * Opens the underlying stream.
++ */
++int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++ DWORD err;
++
++ switch(*mode) {
++ case 'r':
++ wdata->creation_disposition = OPEN_EXISTING;
++ break;
++ case 'w':
++ wdata->creation_disposition = TRUNCATE_EXISTING;
++ break;
++ case 'a':
++ wdata->creation_disposition = OPEN_ALWAYS;
++ break;
++ case 'x':
++ wdata->creation_disposition = CREATE_NEW;
++ break;
++ }
++ mode ++;
++
++ if (*mode && (*mode != '+')) {
++ mode++;
++ }
++
++ if (*mode && (*mode == '+')) {
++ wdata->desired_access = GENERIC_READ | GENERIC_WRITE;
++ } else if (OPEN_EXISTING == wdata->creation_disposition) {
++ wdata->desired_access = GENERIC_READ;
++ } else {
++ wdata->desired_access = GENERIC_WRITE;
++ }
++
++ wdata->handle = CreateFile(filename, wdata->desired_access, 0,
++ NULL, wdata->creation_disposition, FILE_ATTRIBUTE_NORMAL, NULL);
++ if (INVALID_HANDLE_VALUE == wdata->handle) {
++ err = GetLastError();
++ switch (err) {
++ case ERROR_FILE_EXISTS:
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
++ return 0;
++
++ case ERROR_FILE_NOT_FOUND:
++ /* ERROR_FILE_NOT_FOUND with TRUNCATE_EXISTING means that
++ * the file doesn't exist so now try to create it. */
++ if (TRUNCATE_EXISTING == wdata->creation_disposition) {
++ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "File does not exist, creating new file!");
++
++ wdata->handle = CreateFile(filename, wdata->desired_access, 0,
++ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
++ if (INVALID_HANDLE_VALUE == wdata->handle) {
++ dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
++ return 0;
++ }
++ } else {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "File not found!");
++ return 0;
++ }
++ break;
++
++ default:
++ dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
++ return 0;
++ }
++ }
++
++ /* If canonical allocate the canonical buffer. */
++ if (data->canonical) {
++ wdata->canon_data = emalloc(sizeof(php_dio_win32_canon_data));
++ memset(wdata->canon_data, 0, sizeof(php_dio_win32_canon_data));
++ wdata->canon_data->size = DIO_WIN32_CANON_BUF_SIZE;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_serial_init
++ * Initialises the serial port
++ */
++static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++ DWORD rate_def, data_bits_def, stop_bits_def, parity_def;
++ DCB dcb;
++
++ if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%d)", data->data_rate);
++ return 0;
++ }
++
++ if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
++ return 0;
++ }
++
++ if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
++ return 0;
++ }
++
++ if (!dio_parity_to_define(data->parity, &parity_def)) {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
++ return 0;
++ }
++
++ if (!GetCommState(wdata->handle, &(wdata->olddcb))) {
++ dio_last_error_php_error(E_WARNING, "GetCommState() failed:" TSRMLS_CC);
++ return 0;
++ }
++
++ /* Init the DCB structure */
++ memset(&dcb, 0, sizeof(DCB));
++ dcb.DCBlength = sizeof(DCB);
++
++ /* Set the communication parameters */
++ dcb.fBinary = 1;
++ dcb.BaudRate = rate_def;
++ dcb.ByteSize = (BYTE)data_bits_def;
++ dcb.StopBits = (BYTE)stop_bits_def;
++ dcb.Parity = (BYTE)parity_def;
++
++ /* Set the control line parameters */
++ dcb.fDtrControl = DTR_CONTROL_DISABLE;
++ dcb.fDsrSensitivity = FALSE;
++ dcb.fOutxDsrFlow = FALSE;
++ dcb.fTXContinueOnXoff = FALSE;
++ dcb.fOutX = FALSE;
++ dcb.fInX = FALSE;
++ dcb.fErrorChar = FALSE;
++ dcb.fNull = FALSE;
++ dcb.fAbortOnError = FALSE;
++
++ /* Hardware flow control */
++ if (data->flow_control) {
++ dcb.fOutxCtsFlow = TRUE;
++ dcb.fRtsControl = RTS_CONTROL_HANDSHAKE;
++ } else {
++ dcb.fOutxCtsFlow = FALSE;
++ dcb.fRtsControl = RTS_CONTROL_DISABLE;
++ }
++
++ if (!SetCommState(wdata->handle, &dcb)) {
++ dio_last_error_php_error(E_WARNING, "SetCommState() failed:" TSRMLS_CC);
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++
++/* {{{ dio_serial_uninit
++ * Restores the serial settings back to their original state.
++ */
++int dio_serial_uninit(php_dio_stream_data *data) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++
++ if (!SetCommState(wdata->handle, &(wdata->olddcb))) {
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/* {{{ dio_serial_flush
++ * Purges the serial buffers of data.
++ */
++int dio_serial_purge(php_dio_stream_data *data) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++ BOOL ret;
++
++ /* Purge the canonical buffer if required */
++ if (data->canonical && ((wdata->desired_access & GENERIC_READ) == GENERIC_READ)) {
++ wdata->canon_data->read_pos = 0;
++ wdata->canon_data->write_pos = 0;
++ }
++
++ /* Purge the com port */
++ if ((wdata->desired_access & (GENERIC_READ|GENERIC_WRITE)) == (GENERIC_READ|GENERIC_WRITE)) {
++ ret = PurgeComm(wdata->handle, PURGE_RXCLEAR|PURGE_TXCLEAR);
++ } else if ((wdata->desired_access & GENERIC_WRITE) == GENERIC_WRITE) {
++ ret = PurgeComm(wdata->handle, PURGE_TXCLEAR);
++ } else if ((wdata->desired_access & GENERIC_READ) == GENERIC_READ) {
++ ret = PurgeComm(wdata->handle, PURGE_RXCLEAR);
++ }
++
++ return ret;
++}
++/* }}} */
++
++/* {{{ dio_serial_open_stream
++ * Opens the underlying stream.
++ */
++int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
++ COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
++
++ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);
++
++ if (*mode != 'r') {
++ php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must open serial ports in read or read/write mode!");
++ return 0;
++ }
++
++ if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
++ return 0;
++ }
++
++ if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) {
++ dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):" TSRMLS_CC);
++ CloseHandle(wdata->handle);
++ return 0;
++ }
++
++ /* If we're not blocking but don't have a timeout
++ set to return immediately */
++ if (!data->is_blocking && !data->has_timeout) {
++ cto.ReadIntervalTimeout = MAXDWORD;
++ }
++
++ /* If we have a timeout ignore the blocking and set
++ the total time in which to read the data */
++ if (data->has_timeout) {
++ cto.ReadIntervalTimeout = MAXDWORD;
++ cto.ReadTotalTimeoutMultiplier = MAXDWORD;
++ cto.ReadTotalTimeoutConstant = (data->timeout_usec / 1000) +
++ (data->timeout_sec * 1000);
++ }
++
++ if (!SetCommTimeouts(wdata->handle, &cto)) {
++ dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:" TSRMLS_CC);
++ CloseHandle(wdata->handle);
++ return 0;
++ }
++
++ if (!dio_serial_init(data TSRMLS_CC)) {
++ CloseHandle(wdata->handle);
++ return 0;
++ }
++
++ return 1;
++}
++/* }}} */
++
++/*
++ * Local variables:
++ * c-basic-offset: 4
++ * tab-width: 4
++ * End:
++ * vim600: fdm=marker
++ * vim: sw=4 ts=4 noet
++ */
+--- a/php_dio_posix.h
++++ b/php_dio_posix.h
+@@ -1,70 +1,70 @@
+-/*\r
+- +----------------------------------------------------------------------+\r
+- | PHP Version 5 |\r
+- +----------------------------------------------------------------------+\r
+- | Copyright (c) 2009 Melanie Rhianna Lewis |\r
+- +----------------------------------------------------------------------+\r
+- | This source file is subject to version 3.0 of the PHP license, |\r
+- | that is bundled with this package in the file LICENSE, and is |\r
+- | available through the world-wide-web at the following url: |\r
+- | http://www.php.net/license/3_0.txt. |\r
+- | If you did not receive a copy of the PHP license and are unable to |\r
+- | obtain it through the world-wide-web, please send a note to |\r
+- | license@php.net so we can mail you a copy immediately. |\r
+- +----------------------------------------------------------------------+\r
+- | Author: Melanie Rhianna Lewis <cyberspice@php.net> |\r
+- +----------------------------------------------------------------------+\r
+- */\r
+-\r
+-#ifndef PHP_DIO_POSIX_H_\r
+-#define PHP_DIO_POSIX_H_\r
+-\r
+-#include <sys/stat.h>\r
+-#include <sys/types.h>\r
+-#include <sys/select.h>\r
+-#include <sys/time.h>\r
+-\r
+-#ifdef HAVE_UNISTD_H\r
+-#include <unistd.h>\r
+-#endif\r
+-\r
+-#include <fcntl.h>\r
+-#include <termios.h>\r
+-\r
+-\r
+-/**\r
++/*
++ +----------------------------------------------------------------------+
++ | PHP Version 5 |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2009 Melanie Rhianna Lewis |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.0 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_0.txt. |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Author: Melanie Rhianna Lewis <cyberspice@php.net> |
++ +----------------------------------------------------------------------+
++ */
++
++#ifndef PHP_DIO_POSIX_H_
++#define PHP_DIO_POSIX_H_
++
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <sys/select.h>
++#include <sys/time.h>
++
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
++
++#include <fcntl.h>
++#include <termios.h>
++
++
++/**
+ * Detect if we can support non blocking IO.
+- */\r
+-#ifdef O_NONBLOCK\r
+-#define DIO_NONBLOCK O_NONBLOCK\r
+-#else\r
+-#ifdef O_NDELAY\r
+-#define DIO_NONBLOCK O_NDELAY\r
+-#endif\r
+-#endif\r
+-\r
+-/**\r
++ */
++#ifdef O_NONBLOCK
++#define DIO_NONBLOCK O_NONBLOCK
++#else
++#ifdef O_NDELAY
++#define DIO_NONBLOCK O_NDELAY
++#endif
++#endif
++
++/**
+ * POSIXy platforms have file permissions
+- */\r
+-#define DIO_HAS_FILEPERMS\r
+-\r
+-#include "php_dio_common_data.h"\r
+-\r
+-typedef struct _php_dio_posix_stream_data {\r
+- php_dio_stream_data common;\r
+- int fd;\r
+- int flags;\r
+- /* Serial options */\r
+- struct termios oldtio;\r
+-} php_dio_posix_stream_data ;\r
+-\r
+-#endif /* PHP_DIO_POSIX_H_ */\r
+-\r
+-/*\r
+- * Local variables:\r
+- * c-basic-offset: 4\r
+- * tab-width: 4\r
+- * End:\r
+- * vim600: fdm=marker\r
+- * vim: sw=4 ts=4 noet\r
+- */\r
++ */
++#define DIO_HAS_FILEPERMS
++
++#include "php_dio_common_data.h"
++
++typedef struct _php_dio_posix_stream_data {
++ php_dio_stream_data common;
++ int fd;
++ int flags;
++ /* Serial options */
++ struct termios oldtio;
++} php_dio_posix_stream_data ;
++
++#endif /* PHP_DIO_POSIX_H_ */
++
++/*
++ * Local variables:
++ * c-basic-offset: 4
++ * tab-width: 4
++ * End:
++ * vim600: fdm=marker
++ * vim: sw=4 ts=4 noet
++ */
+--- a/php_dio_win32.h
++++ b/php_dio_win32.h
+@@ -1,62 +1,62 @@
+-/*\r
+- +----------------------------------------------------------------------+\r
+- | PHP Version 5 |\r
+- +----------------------------------------------------------------------+\r
+- | Copyright (c) 2009 Melanie Rhianna Lewis |\r
+- +----------------------------------------------------------------------+\r
+- | This source file is subject to version 3.0 of the PHP license, |\r
+- | that is bundled with this package in the file LICENSE, and is |\r
+- | available through the world-wide-web at the following url: |\r
+- | http://www.php.net/license/3_0.txt. |\r
+- | If you did not receive a copy of the PHP license and are unable to |\r
+- | obtain it through the world-wide-web, please send a note to |\r
+- | license@php.net so we can mail you a copy immediately. |\r
+- +----------------------------------------------------------------------+\r
+- | Author: Melanie Rhianna Lewis <cyberspice@php.net> |\r
+- +----------------------------------------------------------------------+\r
+- */\r
+-\r
+-#ifndef PHP_DIO_WIN32_H_\r
+-#define PHP_DIO_WIN32_H_\r
+-\r
+-#include <windows.h>\r
+-\r
+-/* Windows platform can do non blocking. */\r
+-#define DIO_NONBLOCK\r
+-\r
+-#include "php_dio_common_data.h"\r
+-\r
+-#define DIO_WIN32_CANON_BUF_SIZE 8192\r
+-\r
+-/* This is the buffer information when reading in canonical mode. Data is \r
+- read right up to either buffer being full or a newline being read. Excess\r
+- data will be retained in the buffer until the next read. */\r
+-typedef struct _php_dio_win32_canon_data {\r
+- size_t size;\r
+- size_t read_pos;\r
+- size_t write_pos;\r
+- char buf[DIO_WIN32_CANON_BUF_SIZE];\r
+-\r
+-} php_dio_win32_canon_data;\r
+-\r
+-typedef struct _php_dio_win32_stream_data {\r
+- php_dio_stream_data common;\r
+- HANDLE handle;\r
+- DWORD desired_access;\r
+- DWORD creation_disposition;\r
+- DCB olddcb;\r
+- COMMTIMEOUTS oldcto;\r
+- php_dio_win32_canon_data *canon_data;\r
+-\r
+-} php_dio_win32_stream_data ;\r
+-\r
+-#endif /* PHP_DIO_WIN32_H_ */\r
+-\r
+-/*\r
+- * Local variables:\r
+- * c-basic-offset: 4\r
+- * tab-width: 4\r
+- * End:\r
+- * vim600: fdm=marker\r
+- * vim: sw=4 ts=4 noet\r
+- */\r
++/*
++ +----------------------------------------------------------------------+
++ | PHP Version 5 |
++ +----------------------------------------------------------------------+
++ | Copyright (c) 2009 Melanie Rhianna Lewis |
++ +----------------------------------------------------------------------+
++ | This source file is subject to version 3.0 of the PHP license, |
++ | that is bundled with this package in the file LICENSE, and is |
++ | available through the world-wide-web at the following url: |
++ | http://www.php.net/license/3_0.txt. |
++ | If you did not receive a copy of the PHP license and are unable to |
++ | obtain it through the world-wide-web, please send a note to |
++ | license@php.net so we can mail you a copy immediately. |
++ +----------------------------------------------------------------------+
++ | Author: Melanie Rhianna Lewis <cyberspice@php.net> |
++ +----------------------------------------------------------------------+
++ */
++
++#ifndef PHP_DIO_WIN32_H_
++#define PHP_DIO_WIN32_H_
++
++#include <windows.h>
++
++/* Windows platform can do non blocking. */
++#define DIO_NONBLOCK
++
++#include "php_dio_common_data.h"
++
++#define DIO_WIN32_CANON_BUF_SIZE 8192
++
++/* This is the buffer information when reading in canonical mode. Data is
++ read right up to either buffer being full or a newline being read. Excess
++ data will be retained in the buffer until the next read. */
++typedef struct _php_dio_win32_canon_data {
++ size_t size;
++ size_t read_pos;
++ size_t write_pos;
++ char buf[DIO_WIN32_CANON_BUF_SIZE];
++
++} php_dio_win32_canon_data;
++
++typedef struct _php_dio_win32_stream_data {
++ php_dio_stream_data common;
++ HANDLE handle;
++ DWORD desired_access;
++ DWORD creation_disposition;
++ DCB olddcb;
++ COMMTIMEOUTS oldcto;
++ php_dio_win32_canon_data *canon_data;
++
++} php_dio_win32_stream_data ;
++
++#endif /* PHP_DIO_WIN32_H_ */
++
++/*
++ * Local variables:
++ * c-basic-offset: 4
++ * tab-width: 4
++ * End:
++ * vim600: fdm=marker
++ * vim: sw=4 ts=4 noet
++ */
--- /dev/null
+From 46d3a1ff2c6e316cf0928a9fd403cb5284bfe863 Mon Sep 17 00:00:00 2001
+From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
+Date: Wed, 9 Oct 2013 12:04:16 +0000
+Subject: [PATCH 01/16] fix svn prop
+
+git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331748 c90b9560-bf6c-de11-be94-00142212c4b1
+---
+ dio_posix.c | 0
+ dio_win32.c | 0
+ php_dio_posix.h | 0
+ php_dio_win32.h | 0
+ 4 files changed, 0 insertions(+), 0 deletions(-)
+ mode change 100755 => 100644 dio_posix.c
+ mode change 100755 => 100644 dio_win32.c
+ mode change 100755 => 100644 php_dio_posix.h
+ mode change 100755 => 100644 php_dio_win32.h
+
+diff --git a/dio_posix.c b/dio_posix.c
+old mode 100755
+new mode 100644
+diff --git a/dio_win32.c b/dio_win32.c
+old mode 100755
+new mode 100644
+diff --git a/php_dio_posix.h b/php_dio_posix.h
+old mode 100755
+new mode 100644
+diff --git a/php_dio_win32.h b/php_dio_win32.h
+old mode 100755
+new mode 100644
+--
+2.5.0
+
--- /dev/null
+From e9261081d447492e7eff3a22601b1de4f1ae550f Mon Sep 17 00:00:00 2001
+From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
+Date: Wed, 9 Oct 2013 12:15:51 +0000
+Subject: [PATCH 02/16] fix [-Wunused-variable]
+
+git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331749 c90b9560-bf6c-de11-be94-00142212c4b1
+---
+ dio.c | 2 +-
+ dio_posix.c | 1 -
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/dio.c b/dio.c
+index e400cf0..408a171 100644
+--- a/dio.c
++++ b/dio.c
+@@ -775,7 +775,7 @@ ZEND_BEGIN_ARG_INFO_EX(dio_serial_args, 0, 0, 2)
+ ZEND_ARG_INFO(0, options)
+ ZEND_END_ARG_INFO()
+
+-static zend_object_handlers dio_raw_object_handlers;
++// not used static zend_object_handlers dio_raw_object_handlers;
+
+ static zend_function_entry dio_functions[] = {
+ /* Class functions. */
+diff --git a/dio_posix.c b/dio_posix.c
+index 16fb3d6..01e1109 100644
+--- a/dio_posix.c
++++ b/dio_posix.c
+@@ -266,7 +266,6 @@ size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count
+ * earlier than early time.
+ */
+ static int dio_timeval_subtract(struct timeval *late, struct timeval *early, struct timeval *diff) {
+- struct timeval *tmp;
+
+ /* Handle negatives */
+ if (late->tv_sec < early->tv_sec) {
+--
+2.5.0
+
--- /dev/null
+From 6cbc1651b6b6f865f9aae1e9adff73743298666f Mon Sep 17 00:00:00 2001
+From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
+Date: Wed, 9 Oct 2013 12:18:34 +0000
+Subject: [PATCH 03/16] Fix [-Wmaybe-uninitialized]
+
+git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331750 c90b9560-bf6c-de11-be94-00142212c4b1
+---
+ dio_stream_wrappers.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
+index 844b006..811bc07 100644
+--- a/dio_stream_wrappers.c
++++ b/dio_stream_wrappers.c
+@@ -228,9 +228,8 @@ PHP_FUNCTION(dio_raw) {
+ efree(data);
+ RETURN_FALSE;
+ }
++ php_stream_to_zval(stream, return_value);
+ }
+-
+- php_stream_to_zval(stream, return_value);
+ }
+ /* }}} */
+
+@@ -390,9 +389,8 @@ PHP_FUNCTION(dio_serial) {
+ efree(data);
+ RETURN_FALSE;
+ }
++ php_stream_to_zval(stream, return_value);
+ }
+-
+- php_stream_to_zval(stream, return_value);
+ }
+ /* }}} */
+
+--
+2.5.0
+
--- /dev/null
+From 1e6f98d9fb65b9c052e6d555eab573d7e5073dae Mon Sep 17 00:00:00 2001
+From: remi <remi@c90b9560-bf6c-de11-be94-00142212c4b1>
+Date: Wed, 9 Oct 2013 12:24:28 +0000
+Subject: [PATCH 04/16] Fix last build warning [-Wunused-but-set-variable]
+ (sorry for legibility...)
+
+git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331751 c90b9560-bf6c-de11-be94-00142212c4b1
+---
+ dio_posix.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/dio_posix.c b/dio_posix.c
+index 01e1109..6ed8630 100644
+--- a/dio_posix.c
++++ b/dio_posix.c
+@@ -28,7 +28,10 @@
+ * Convert an fopen() mode string to open() flags
+ */
+ static int dio_stream_mode_to_flags(const char *mode) {
+- int flags = 0, ch = 0, bin = 1;
++ int flags = 0, ch = 0;
++#if defined(_O_TEXT) && defined(O_BINARY)
++ int bin = 1;
++#endif
+
+ switch(mode[ch++]) {
+ case 'r':
+@@ -45,9 +48,11 @@ static int dio_stream_mode_to_flags(const char *mode) {
+ break;
+ }
+
++#if defined(_O_TEXT) && defined(O_BINARY)
+ if (mode[ch] != '+') {
+ bin = (mode[ch++] == 'b');
+ }
++#endif
+
+ if (mode[ch] == '+') {
+ flags |= O_RDWR;
+--
+2.5.0
+
--- /dev/null
+From 7c85a44880d9d748e7554f8fe7448505fa86aa28 Mon Sep 17 00:00:00 2001
+From: cyberspice <cyberspice@c90b9560-bf6c-de11-be94-00142212c4b1>
+Date: Sat, 12 Oct 2013 22:20:19 +0000
+Subject: [PATCH 05/16] Added LICENCE file as requested in Request #65869
+
+Files added:
+ LICENCE
+
+git-svn-id: http://svn.php.net/repository/pecl/dio/trunk@331788 c90b9560-bf6c-de11-be94-00142212c4b1
+---
+ LICENSE | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 68 insertions(+)
+ create mode 100644 LICENSE
+
+diff --git a/LICENSE b/LICENSE
+new file mode 100644
+index 0000000..d376afe
+--- /dev/null
++++ b/LICENSE
+@@ -0,0 +1,68 @@
++--------------------------------------------------------------------
++ The PHP License, version 3.01
++Copyright (c) 2008 - 2013 The PHP Group. All rights reserved.
++--------------------------------------------------------------------
++
++Redistribution and use in source and binary forms, with or without
++modification, is permitted provided that the following conditions
++are met:
++
++ 1. Redistributions of source code must retain the above copyright
++ notice, this list of conditions and the following disclaimer.
++
++ 2. Redistributions in binary form must reproduce the above copyright
++ notice, this list of conditions and the following disclaimer in
++ the documentation and/or other materials provided with the
++ distribution.
++
++ 3. The name "PHP" must not be used to endorse or promote products
++ derived from this software without prior written permission. For
++ written permission, please contact group@php.net.
++
++ 4. Products derived from this software may not be called "PHP", nor
++ may "PHP" appear in their name, without prior written permission
++ from group@php.net. You may indicate that your software works in
++ conjunction with PHP by saying "Foo for PHP" instead of calling
++ it "PHP Foo" or "phpfoo"
++
++ 5. The PHP Group may publish revised and/or new versions of the
++ license from time to time. Each version will be given a
++ distinguishing version number.
++ Once covered code has been published under a particular version
++ of the license, you may always continue to use it under the terms
++ of that version. You may also choose to use such covered code
++ under the terms of any subsequent version of the license
++ published by the PHP Group. No one other than the PHP Group has
++ the right to modify the terms applicable to covered code created
++ under this License.
++
++ 6. Redistributions of any form whatsoever must retain the following
++ acknowledgment:
++ "This product includes PHP software, freely available from
++ <http://www.php.net/software/>".
++
++THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND
++ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
++THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
++PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP
++DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
++INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
++SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
++STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
++OF THE POSSIBILITY OF SUCH DAMAGE.
++
++--------------------------------------------------------------------
++
++This software consists of voluntary contributions made by many
++individuals on behalf of the PHP Group.
++
++The PHP Group can be contacted via Email at group@php.net.
++
++For more information on the PHP Group and the PHP project,
++please see <http://www.php.net>.
++
++PHP includes the Zend Engine, freely available at
++<http://www.zend.com>.
+--
+2.5.0
+
--- /dev/null
+From b69e1067f70ef293587b72979193e68b01d90902 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Wed, 13 Jul 2016 00:23:29 +0200
+Subject: [PATCH 06/16] Replace ZEND_FETCH_RESOURCE macro with
+ zend_fetch_resource
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 36 +++++++++++++++++++++++++++---------
+ 1 file changed, 27 insertions(+), 9 deletions(-)
+
+diff --git a/dio.c b/dio.c
+index 408a171..6b687ac 100644
+--- a/dio.c
++++ b/dio.c
+@@ -161,7 +161,9 @@ PHP_FUNCTION(dio_dup)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ dfd = dup(f->fd);
+ if (dfd == -1) {
+@@ -192,7 +194,9 @@ PHP_FUNCTION(dio_read)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ if (bytes <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
+@@ -233,7 +237,9 @@ PHP_FUNCTION(dio_write)
+ RETURN_FALSE;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ res = write(f->fd, data, trunc_len ? trunc_len : data_len);
+ if (res == -1) {
+@@ -258,7 +264,9 @@ PHP_FUNCTION(dio_truncate)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ if (ftruncate(f->fd, offset) == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
+@@ -284,7 +292,9 @@ PHP_FUNCTION(dio_stat)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ if (fstat(f->fd, &s) == -1) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
+@@ -323,7 +333,9 @@ PHP_FUNCTION(dio_seek)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ RETURN_LONG(lseek(f->fd, offset, whence));
+ }
+@@ -344,7 +356,9 @@ PHP_FUNCTION(dio_fcntl)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ switch (cmd) {
+ case F_SETLK:
+@@ -454,7 +468,9 @@ PHP_FUNCTION(dio_tcsetattr)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ if (Z_TYPE_P(arg) != IS_ARRAY) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,"tcsetattr, third argument should be an associative array");
+@@ -639,7 +655,9 @@ PHP_FUNCTION(dio_close)
+ return;
+ }
+
+- ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
++ if ((f = (php_fd_t *)zend_fetch_resource(Z_RES_P(r_fd), le_fd_name, le_fd)) == NULL) {
++ RETURN_FALSE;
++ }
+
+ zend_list_delete(Z_LVAL_P(r_fd));
+ }
+--
+2.5.0
+
--- /dev/null
+From dbf03eb09bf1a41bcd140c4edba351121ac24729 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Wed, 13 Jul 2016 00:36:46 +0200
+Subject: [PATCH 07/16] Replace ZEND_REGISTER_RESOURCE with
+ zend_register_resource
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/dio.c b/dio.c
+index 6b687ac..6f2d58c 100644
+--- a/dio.c
++++ b/dio.c
+@@ -72,9 +72,9 @@ static int new_php_fd(php_fd_t **f, int fd)
+ return 1;
+ }
+
+-static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC)
++static void _dio_close_fd(zend_resource *res)
+ {
+- php_fd_t *f = (php_fd_t *) rsrc->ptr;
++ php_fd_t *f = (php_fd_t *)zend_fetch_resource(res, NULL, le_fd);
+ if (f) {
+ close(f->fd);
+ free(f);
+@@ -115,7 +115,7 @@ PHP_FUNCTION(dio_open)
+ RETURN_FALSE;
+ }
+
+- ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
++ RETVAL_RES(zend_register_resource(f, le_fd));
+ }
+ /* }}} */
+
+@@ -144,7 +144,7 @@ PHP_FUNCTION(dio_fdopen)
+ RETURN_FALSE;
+ }
+
+- ZEND_REGISTER_RESOURCE(return_value, f, le_fd);
++ RETVAL_RES(zend_register_resource(f, le_fd));
+ }
+ /* }}} */
+
+@@ -175,7 +175,7 @@ PHP_FUNCTION(dio_dup)
+ RETURN_FALSE;
+ }
+
+- ZEND_REGISTER_RESOURCE(return_value, df, le_fd);
++ RETVAL_RES(zend_register_resource(f, le_fd));
+ }
+ /* }}} */
+ #endif
+@@ -434,7 +434,7 @@ PHP_FUNCTION(dio_fcntl)
+ if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) {
+ RETURN_FALSE;
+ }
+- ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd);
++ RETVAL_RES(zend_register_resource(new_f, le_fd));
+ break;
+ }
+ default:
+--
+2.5.0
+
--- /dev/null
+From 47422cf01f0a352c3f5f015585a28c99dba79862 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Wed, 13 Jul 2016 00:40:08 +0200
+Subject: [PATCH 08/16] RETURN_STRINGL takes only 2 arguments
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/dio.c b/dio.c
+index 6f2d58c..e8660f8 100644
+--- a/dio.c
++++ b/dio.c
+@@ -24,6 +24,7 @@
+ #include "php.h"
+ #include "php_ini.h"
+ #include "ext/standard/info.h"
++#include "ext/standard/php_string.h"
+
+ #include "php_dio.h"
+ #include "php_dio_stream_wrappers.h"
+@@ -213,7 +214,7 @@ PHP_FUNCTION(dio_read)
+ data = erealloc(data, res + 1);
+ data[res] = 0;
+
+- RETURN_STRINGL(data, res, 0);
++ RETURN_STRINGL(data, res);
+ }
+ /* }}} */
+
+--
+2.5.0
+
--- /dev/null
+From 7533f64b19006262fae7c6a4769392c67078166b Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Wed, 13 Jul 2016 01:07:22 +0200
+Subject: [PATCH 09/16] Replace zend_hash_find with zend_hash_str_find
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 44 ++++++++++++++++++++++----------------------
+ 1 file changed, 22 insertions(+), 22 deletions(-)
+
+diff --git a/dio.c b/dio.c
+index e8660f8..b489747 100644
+--- a/dio.c
++++ b/dio.c
+@@ -364,7 +364,7 @@ PHP_FUNCTION(dio_fcntl)
+ switch (cmd) {
+ case F_SETLK:
+ case F_SETLKW: {
+- zval **element;
++ zval *element;
+ struct flock lk = {0};
+ HashTable *fh;
+
+@@ -374,28 +374,28 @@ PHP_FUNCTION(dio_fcntl)
+ }
+ if (Z_TYPE_P(arg) == IS_ARRAY) {
+ fh = HASH_OF(arg);
+- if (zend_hash_find(fh, "start", sizeof("start"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "start", sizeof("start"))) == NULL) {
+ lk.l_start = 0;
+ } else {
+- lk.l_start = Z_LVAL_PP(element);
++ lk.l_start = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "length", sizeof("length"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "length", sizeof("length"))) == NULL) {
+ lk.l_len = 0;
+ } else {
+- lk.l_len = Z_LVAL_PP(element);
++ lk.l_len = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "whence", sizeof("whence"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "whence", sizeof("whence"))) == NULL) {
+ lk.l_whence = 0;
+ } else {
+- lk.l_whence = Z_LVAL_PP(element);
++ lk.l_whence = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "type", sizeof("type"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "type", sizeof("type"))) == NULL) {
+ lk.l_type = 0;
+ } else {
+- lk.l_type = Z_LVAL_PP(element);
++ lk.l_type = Z_LVAL_P(element);
+ }
+ } else if (Z_TYPE_P(arg) == IS_LONG) {
+ lk.l_start = 0;
+@@ -463,7 +463,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ int Baud_Rate, Data_Bits=8, Stop_Bits=1, Parity=0, Flow_Control=1, Is_Canonical=1;
+ long BAUD,DATABITS,STOPBITS,PARITYON,PARITY;
+ HashTable *fh;
+- zval **element;
++ zval *element;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
+ return;
+@@ -480,40 +480,40 @@ PHP_FUNCTION(dio_tcsetattr)
+
+ fh = HASH_OF(arg);
+
+- if (zend_hash_find(fh, "baud", sizeof("baud"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "baud", sizeof("baud"))) == NULL) {
+ Baud_Rate = 9600;
+ } else {
+- Baud_Rate = Z_LVAL_PP(element);
++ Baud_Rate = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "bits", sizeof("bits"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "bits", sizeof("bits"))) == NULL) {
+ Data_Bits = 8;
+ } else {
+- Data_Bits = Z_LVAL_PP(element);
++ Data_Bits = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "stop", sizeof("stop"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "stop", sizeof("stop"))) == NULL) {
+ Stop_Bits = 1;
+ } else {
+- Stop_Bits = Z_LVAL_PP(element);
++ Stop_Bits = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "parity", sizeof("parity"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "parity", sizeof("parity"))) == NULL) {
+ Parity = 0;
+ } else {
+- Parity = Z_LVAL_PP(element);
++ Parity = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "flow_control", sizeof("flow_control"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "flow_control", sizeof("flow_control"))) == NULL) {
+ Flow_Control = 1;
+ } else {
+- Flow_Control = Z_LVAL_PP(element);
++ Flow_Control = Z_LVAL_P(element);
+ }
+
+- if (zend_hash_find(fh, "is_canonical", sizeof("is_canonical"), (void **) &element) == FAILURE) {
++ if ((element = zend_hash_str_find(fh, "is_canonical", sizeof("is_canonical"))) == NULL) {
+ Is_Canonical = 0;
+ } else {
+- Is_Canonical = Z_LVAL_PP(element);
++ Is_Canonical = Z_LVAL_P(element);
+ }
+
+ /* assign to correct values... */
+--
+2.5.0
+
--- /dev/null
+From fb31b1cf4da2bfd0830d0a83754f5ecb125d1c4a Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Thu, 14 Jul 2016 00:38:52 +0200
+Subject: [PATCH 10/16] Replace dio_convert_to_long
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio_common.c | 106 +++++++++++++++++++++++--------------------------------
+ php_dio_common.h | 2 --
+ 2 files changed, 44 insertions(+), 64 deletions(-)
+
+diff --git a/dio_common.c b/dio_common.c
+index c50f56d..a5f4c63 100644
+--- a/dio_common.c
++++ b/dio_common.c
+@@ -52,29 +52,12 @@ void dio_init_stream_data(php_dio_stream_data *data) {
+ }
+ /* }}} */
+
+-/* {{{ dio_convert_to_long
+- * Returns as a long, the value of the zval regardless of its type.
+- */
+-long dio_convert_to_long(zval *val) {
+- zval *copyval;
+- long longval;
+-
+- ALLOC_INIT_ZVAL(copyval);
+- *copyval = *val;
+- convert_to_long(copyval);
+- longval = Z_LVAL_P(copyval);
+- zval_ptr_dtor(©val);
+-
+- return longval;
+-}
+-/* }}} */
+-
+ /* {{{ dio_assoc_array_get_basic_options
+ * Retrieves the basic open option values from an associative array
+ */
+ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
+ #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
+- zval **tmpzval;
++ zval *tmpzval;
+ HashTable *opthash;
+
+ opthash = HASH_OF(options);
+@@ -82,8 +65,8 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
+
+ #ifdef DIO_HAS_FILEPERMS
+ /* This is the file mode flags used by open(). */
+- if (zend_hash_find(opthash, "perms", sizeof("perms"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->perms = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "perms", sizeof("perms"))) != NULL) {
++ data->perms = (int)zval_get_long(tmpzval);
+ data->has_perms = 1;
+ }
+ #endif
+@@ -91,20 +74,20 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
+ #ifdef DIO_NONBLOCK
+ /* This sets the underlying stream to be blocking/non
+ block (i.e. O_NONBLOCK) */
+- if (zend_hash_find(opthash, "is_blocking", sizeof("is_blocking"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->is_blocking = dio_convert_to_long(*tmpzval) ? 1 : 0;
++ if ((tmpzval = zend_hash_str_find(opthash, "is_blocking", sizeof("is_blocking"))) != NULL) {
++ data->is_blocking = zval_get_long(tmpzval) ? 1 : 0;
+ }
+
+ /* This is the timeout value for reads in seconds. Only one of
+ timeout_secs or timeout_usecs need be defined to define a timeout. */
+- if (zend_hash_find(opthash, "timeout_secs", sizeof("timeout_secs"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->timeout_sec = dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "timeout_secs", sizeof("timeout_secs"))) != NULL) {
++ data->timeout_sec = zval_get_long(tmpzval);
+ }
+
+ /* This is the timeout value for reads in microseconds. Only one of
+ timeout_secs or timeout_usecs need be defined to define a timeout. */
+- if (zend_hash_find(opthash, "timeout_usecs", sizeof("timeout_usecs"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->timeout_usec = dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "timeout_usecs", sizeof("timeout_usecs"))) != NULL) {
++ data->timeout_usec = zval_get_long(tmpzval);
+ }
+
+ data->has_timeout = (data->timeout_sec | data->timeout_usec) ? 1 : 0;
+@@ -116,33 +99,33 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
+ * Retrieves the serial open option values from an associative array
+ */
+ void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
+- zval **tmpzval;
++ zval *tmpzval;
+ HashTable *opthash;
+
+ opthash = HASH_OF(options);
+
+- if (zend_hash_find(opthash, "data_rate", sizeof("data_rate"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->data_rate = dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "data_rate", sizeof("data_rate"))) != NULL) {
++ data->data_rate = zval_get_long(tmpzval);
+ }
+
+- if (zend_hash_find(opthash, "data_bits", sizeof("data_bits"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->data_bits = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "data_bits", sizeof("data_bits"))) != NULL) {
++ data->data_bits = (int)zval_get_long(tmpzval);
+ }
+
+- if (zend_hash_find(opthash, "stop_bits", sizeof("stop_bits"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->stop_bits = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "stop_bits", sizeof("stop_bits"))) != NULL) {
++ data->stop_bits = (int)zval_get_long(tmpzval);
+ }
+
+- if (zend_hash_find(opthash, "parity", sizeof("parity"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->parity = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = zend_hash_str_find(opthash, "parity", sizeof("parity"))) != NULL) {
++ data->parity = (int)zval_get_long(tmpzval);
+ }
+
+- if (zend_hash_find(opthash, "flow_control", sizeof("flow_control"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->flow_control = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
++ if ((tmpzval = zend_hash_str_find(opthash, "flow_control", sizeof("flow_control"))) != NULL) {
++ data->flow_control = zval_get_long(tmpzval) ? 1 : 0;
+ }
+
+- if (zend_hash_find(opthash, "is_canonical", sizeof("is_canonical"), (void **)&tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->canonical = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
++ if ((tmpzval = zend_hash_str_find(opthash, "is_canonical", sizeof("is_canonical"))) != NULL) {
++ data->canonical = zval_get_long(tmpzval) ? 1 : 0;
+ }
+ }
+ /* }}} */
+@@ -152,13 +135,13 @@ void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data
+ */
+ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
+ #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
+- zval **tmpzval;
++ zval *tmpzval;
+ #endif
+
+ #ifdef DIO_HAS_FILEPERMS
+ /* This is the file mode flags used by open(). */
+- if (php_stream_context_get_option(context, "dio", "perms", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->perms = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "perms")) != NULL) {
++ data->perms = (int)zval_get_long(tmpzval);
+ data->has_perms = 1;
+ }
+ #endif
+@@ -166,20 +149,20 @@ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_s
+ #ifdef DIO_NONBLOCK
+ /* This sets the underlying stream to be blocking/non
+ block (i.e. O_NONBLOCK) */
+- if (php_stream_context_get_option(context, "dio", "is_blocking", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->is_blocking = dio_convert_to_long(*tmpzval) ? 1 : 0;
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "is_blocking")) != NULL) {
++ data->is_blocking = zval_get_long(tmpzval) ? 1 : 0;
+ }
+
+ /* This is the timeout value for reads in seconds. Only one of
+ timeout_secs or timeout_usecs need be defined to define a timeout. */
+- if (php_stream_context_get_option(context, "dio", "timeout_secs", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->timeout_sec = dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "timeout_secs")) != NULL) {
++ data->timeout_sec = zval_get_long(tmpzval);
+ }
+
+ /* This is the timeout value for reads in microseconds. Only one of
+ timeout_secs or timeout_usecs need be defined to define a timeout. */
+- if (php_stream_context_get_option(context, "dio", "timeout_usecs", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->timeout_usec = dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "timeout_usecs")) != NULL) {
++ data->timeout_usec = zval_get_long(tmpzval);
+ }
+
+ data->has_timeout = (data->timeout_sec | data->timeout_usec) ? 1 : 0;
+@@ -191,30 +174,30 @@ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_s
+ * Extracts the option values for dio.serial mode from a context
+ */
+ void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
+- zval **tmpzval;
++ zval *tmpzval;
+
+- if (php_stream_context_get_option(context, "dio", "data_rate", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->data_rate = dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "data_rate")) != NULL) {
++ data->data_rate = zval_get_long(tmpzval);
+ }
+
+- if (php_stream_context_get_option(context, "dio", "data_bits", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->data_bits = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "data_bits")) != NULL) {
++ data->data_bits = (int)zval_get_long(tmpzval);
+ }
+
+- if (php_stream_context_get_option(context, "dio", "stop_bits", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->stop_bits = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "stop_bits")) != NULL) {
++ data->stop_bits = (int)zval_get_long(tmpzval);
+ }
+
+- if (php_stream_context_get_option(context, "dio", "parity", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->parity = (int)dio_convert_to_long(*tmpzval);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "parity")) != NULL) {
++ data->parity = (int)zval_get_long(tmpzval);
+ }
+
+- if (php_stream_context_get_option(context, "dio", "flow_control", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->flow_control = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "flow_control")) != NULL) {
++ data->flow_control = zval_get_long(tmpzval) ? 1 : 0;
+ }
+
+- if (php_stream_context_get_option(context, "dio", "is_canonical", &tmpzval) == SUCCESS && tmpzval && *tmpzval) {
+- data->canonical = (int)(dio_convert_to_long(*tmpzval) ? 1 : 0);
++ if ((tmpzval = php_stream_context_get_option(context, "dio", "is_canonical")) != NULL) {
++ data->canonical = zval_get_long(tmpzval) ? 1 : 0;
+ }
+ }
+ /* }}} */
+@@ -227,4 +210,3 @@ void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_
+ * vim600: fdm=marker
+ * vim: sw=4 ts=4 noet
+ */
+-
+diff --git a/php_dio_common.h b/php_dio_common.h
+index f6e4d98..6b14040 100644
+--- a/php_dio_common.h
++++ b/php_dio_common.h
+@@ -35,8 +35,6 @@
+ #define DIO_STREAM_TYPE_RAW 1
+ #define DIO_STREAM_TYPE_SERIAL 2
+
+-long dio_convert_to_long(zval *val);
+-
+ php_dio_stream_data * dio_create_stream_data(void);
+
+ void dio_init_stream_data(php_dio_stream_data *data);
+--
+2.5.0
+
--- /dev/null
+From 3d71063ada4f1a4ef90611d263aa8e1d4f275359 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Thu, 14 Jul 2016 00:50:12 +0200
+Subject: [PATCH 11/16] Adopt to changed stream API interface
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio_posix.c | 2 +-
+ dio_stream_wrappers.c | 14 +++++++-------
+ dio_win32.c | 2 +-
+ php_dio_common.h | 2 +-
+ 4 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/dio_posix.c b/dio_posix.c
+index 6ed8630..527d683 100644
+--- a/dio_posix.c
++++ b/dio_posix.c
+@@ -474,7 +474,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
+ /* {{{ dio_raw_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
+ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
+ pdata->flags = dio_stream_mode_to_flags(mode);
+
+diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
+index 811bc07..817b0d1 100644
+--- a/dio_stream_wrappers.c
++++ b/dio_stream_wrappers.c
+@@ -126,12 +126,12 @@ php_stream_ops dio_raw_stream_ops = {
+ * fopen for the dio.raw stream.
+ */
+ static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
+- char *path, char *mode,
+- int options, char **opened_path,
+- php_stream_context *context STREAMS_DC TSRMLS_DC) {
++ const char *path, const char *mode, int options,
++ zend_string **opened_path, php_stream_context *context STREAMS_DC)
++{
+ php_dio_stream_data *data;
+ php_stream *stream;
+- char *filename;
++ const char *filename;
+
+ /* Check it was actually for us (not a corrupted function pointer
+ somewhere!). */
+@@ -287,9 +287,9 @@ php_stream_ops dio_serial_stream_ops = {
+ * fopen for the dio.raw stream.
+ */
+ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
+- char *path, char *mode,
+- int options, char **opened_path,
+- php_stream_context *context STREAMS_DC TSRMLS_DC) {
++ const char *path, const char *mode, int options,
++ zend_string **opened_path, php_stream_context *context STREAMS_DC)
++{
+ php_dio_stream_data *data;
+ php_stream *stream;
+ char *filename;
+diff --git a/dio_win32.c b/dio_win32.c
+index e7ccedd..1023d36 100644
+--- a/dio_win32.c
++++ b/dio_win32.c
+@@ -505,7 +505,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
+ /* {{{ dio_raw_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
+ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
+ DWORD err;
+
+diff --git a/php_dio_common.h b/php_dio_common.h
+index 6b14040..7a75370 100644
+--- a/php_dio_common.h
++++ b/php_dio_common.h
+@@ -55,7 +55,7 @@ int dio_common_close(php_dio_stream_data *data);
+
+ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam);
+
+-int dio_raw_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
++int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
+
+ int dio_serial_uninit(php_dio_stream_data *data);
+
+--
+2.5.0
+
--- /dev/null
+From 760ec7072cbba2cbbb6e4e17b0c54ee3c7b661a8 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Thu, 14 Jul 2016 00:59:42 +0200
+Subject: [PATCH 12/16] Remove ancient macros TSRMLS_CC and TSRMLS_DC
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 70 +++++++++++++++++++++++++--------------------------
+ dio_common.c | 8 +++---
+ dio_posix.c | 22 ++++++++--------
+ dio_stream_wrappers.c | 48 +++++++++++++++++------------------
+ dio_win32.c | 46 ++++++++++++++++-----------------
+ php_dio_common.h | 12 ++++-----
+ 6 files changed, 103 insertions(+), 103 deletions(-)
+
+diff --git a/dio.c b/dio.c
+index b489747..7bad575 100644
+--- a/dio.c
++++ b/dio.c
+@@ -93,11 +93,11 @@ PHP_FUNCTION(dio_open)
+ long mode = 0;
+ int fd;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) {
+ return;
+ }
+
+- if (php_check_open_basedir(file_name TSRMLS_CC) || DIO_SAFE_MODE_CHECK(file_name, "wb+")) {
++ if (php_check_open_basedir(file_name) || DIO_SAFE_MODE_CHECK(file_name, "wb+")) {
+ RETURN_FALSE;
+ }
+
+@@ -108,7 +108,7 @@ PHP_FUNCTION(dio_open)
+ }
+
+ if (fd == -1) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
++ php_error_docref(NULL, E_WARNING, "cannot open file %s with flags %ld and permissions %ld: %s", file_name, flags, mode, strerror(errno));
+ RETURN_FALSE;
+ }
+
+@@ -130,14 +130,14 @@ PHP_FUNCTION(dio_fdopen)
+ long lfd;
+ int fd;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &lfd) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &lfd) == FAILURE) {
+ return;
+ }
+
+ fd = (int)lfd;
+
+ if ((fcntl(fd, F_GETFL, 0) == -1) && (errno == EBADF)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad file descriptor %d", fd);
++ php_error_docref(NULL, E_WARNING, "Bad file descriptor %d", fd);
+ RETURN_FALSE;
+ }
+
+@@ -158,7 +158,7 @@ PHP_FUNCTION(dio_dup)
+ php_fd_t *f, *df;
+ int dfd;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &r_fd) == FAILURE) {
+ return;
+ }
+
+@@ -168,7 +168,7 @@ PHP_FUNCTION(dio_dup)
+
+ dfd = dup(f->fd);
+ if (dfd == -1) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot duplication file descriptor %d: %s", f->fd, strerror(errno));
++ php_error_docref(NULL, E_WARNING, "cannot duplication file descriptor %d: %s", f->fd, strerror(errno));
+ RETURN_FALSE;
+ }
+
+@@ -191,7 +191,7 @@ PHP_FUNCTION(dio_read)
+ long bytes = 1024;
+ ssize_t res;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &r_fd, &bytes) == FAILURE) {
+ return;
+ }
+
+@@ -200,7 +200,7 @@ PHP_FUNCTION(dio_read)
+ }
+
+ if (bytes <= 0) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0.");
++ php_error_docref(NULL, E_WARNING, "Length parameter must be greater than 0.");
+ RETURN_FALSE;
+ }
+
+@@ -229,12 +229,12 @@ PHP_FUNCTION(dio_write)
+ long trunc_len = 0;
+ ssize_t res;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) {
+ return;
+ }
+
+ if (trunc_len < 0 || trunc_len > data_len) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
++ php_error_docref(NULL, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string.");
+ RETURN_FALSE;
+ }
+
+@@ -244,7 +244,7 @@ PHP_FUNCTION(dio_write)
+
+ res = write(f->fd, data, trunc_len ? trunc_len : data_len);
+ if (res == -1) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write data to file descriptor %d: %s", f->fd, strerror(errno));
++ php_error_docref(NULL, E_WARNING, "cannot write data to file descriptor %d: %s", f->fd, strerror(errno));
+ }
+
+ RETURN_LONG(res);
+@@ -261,7 +261,7 @@ PHP_FUNCTION(dio_truncate)
+ php_fd_t *f;
+ long offset;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &r_fd, &offset) == FAILURE) {
+ return;
+ }
+
+@@ -270,7 +270,7 @@ PHP_FUNCTION(dio_truncate)
+ }
+
+ if (ftruncate(f->fd, offset) == -1) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
++ php_error_docref(NULL, E_WARNING, "couldn't truncate %d to %ld bytes: %s", f->fd, offset, strerror(errno));
+ RETURN_FALSE;
+ }
+
+@@ -289,7 +289,7 @@ PHP_FUNCTION(dio_stat)
+ php_fd_t *f;
+ struct stat s;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &r_fd) == FAILURE) {
+ return;
+ }
+
+@@ -298,7 +298,7 @@ PHP_FUNCTION(dio_stat)
+ }
+
+ if (fstat(f->fd, &s) == -1) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
++ php_error_docref(NULL, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
+ RETURN_FALSE;
+ }
+
+@@ -330,7 +330,7 @@ PHP_FUNCTION(dio_seek)
+ long offset;
+ long whence = SEEK_SET;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|l", &r_fd, &offset, &whence) == FAILURE) {
+ return;
+ }
+
+@@ -353,7 +353,7 @@ PHP_FUNCTION(dio_fcntl)
+ php_fd_t *f;
+ long cmd;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl|z", &r_fd, &cmd, &arg) == FAILURE) {
+ return;
+ }
+
+@@ -369,7 +369,7 @@ PHP_FUNCTION(dio_fcntl)
+ HashTable *fh;
+
+ if (!arg) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, none given");
++ php_error_docref(NULL, E_WARNING, "expects argument 3 to be array or int, none given");
+ RETURN_FALSE;
+ }
+ if (Z_TYPE_P(arg) == IS_ARRAY) {
+@@ -403,7 +403,7 @@ PHP_FUNCTION(dio_fcntl)
+ lk.l_whence = SEEK_SET;
+ lk.l_type = Z_LVAL_P(arg);
+ } else {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, %s given", zend_zval_type_name(arg));
++ php_error_docref(NULL, E_WARNING, "expects argument 3 to be array or int, %s given", zend_zval_type_name(arg));
+ RETURN_FALSE;
+ }
+
+@@ -428,7 +428,7 @@ PHP_FUNCTION(dio_fcntl)
+ php_fd_t *new_f;
+
+ if (!arg || Z_TYPE_P(arg) != IS_LONG) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
++ php_error_docref(NULL, E_WARNING, "expects argument 3 to be int");
+ RETURN_FALSE;
+ }
+
+@@ -440,7 +440,7 @@ PHP_FUNCTION(dio_fcntl)
+ }
+ default:
+ if (!arg || Z_TYPE_P(arg) != IS_LONG) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
++ php_error_docref(NULL, E_WARNING, "expects argument 3 to be int");
+ RETURN_FALSE;
+ }
+
+@@ -465,7 +465,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ HashTable *fh;
+ zval *element;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "rz", &r_fd, &arg) == FAILURE) {
+ return;
+ }
+
+@@ -474,7 +474,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ }
+
+ if (Z_TYPE_P(arg) != IS_ARRAY) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING,"tcsetattr, third argument should be an associative array");
++ php_error_docref(NULL, E_WARNING,"tcsetattr, third argument should be an associative array");
+ return;
+ }
+
+@@ -564,7 +564,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ BAUD = B50;
+ break;
+ default:
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid baud rate %d", Baud_Rate);
++ php_error_docref(NULL, E_WARNING, "invalid baud rate %d", Baud_Rate);
+ RETURN_FALSE;
+ }
+ switch (Data_Bits) {
+@@ -581,7 +581,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ DATABITS = CS5;
+ break;
+ default:
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data bits %d", Data_Bits);
++ php_error_docref(NULL, E_WARNING, "invalid data bits %d", Data_Bits);
+ RETURN_FALSE;
+ }
+ switch (Stop_Bits) {
+@@ -592,7 +592,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ STOPBITS = CSTOPB;
+ break;
+ default:
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop bits %d", Stop_Bits);
++ php_error_docref(NULL, E_WARNING, "invalid stop bits %d", Stop_Bits);
+ RETURN_FALSE;
+ }
+
+@@ -610,7 +610,7 @@ PHP_FUNCTION(dio_tcsetattr)
+ PARITY = 0;
+ break;
+ default:
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity %d", Parity);
++ php_error_docref(NULL, E_WARNING, "invalid parity %d", Parity);
+ RETURN_FALSE;
+ }
+
+@@ -652,7 +652,7 @@ PHP_FUNCTION(dio_close)
+ zval *r_fd;
+ php_fd_t *f;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &r_fd) == FAILURE) {
+ return;
+ }
+
+@@ -669,7 +669,7 @@ PHP_FUNCTION(dio_close)
+ /* {{{ dio_init_legacy_defines
+ * Initialises the legacy PHP defines
+ */
+-static void dio_init_legacy_defines(int module_number TSRMLS_DC) {
++static void dio_init_legacy_defines(int module_number) {
+ RDIOC(O_RDONLY);
+ RDIOC(O_WRONLY);
+ RDIOC(O_RDWR);
+@@ -852,11 +852,11 @@ PHP_MINIT_FUNCTION(dio)
+ /* Legacy resource destructor. */
+ le_fd = zend_register_list_destructors_ex(_dio_close_fd, NULL, le_fd_name, module_number);
+
+- dio_init_legacy_defines(module_number TSRMLS_CC);
++ dio_init_legacy_defines(module_number);
+
+ /* Register the stream wrappers */
+- return (php_register_url_stream_wrapper(DIO_RAW_STREAM_NAME, &php_dio_raw_stream_wrapper TSRMLS_CC) == SUCCESS &&
+- php_register_url_stream_wrapper(DIO_SERIAL_STREAM_NAME, &php_dio_serial_stream_wrapper TSRMLS_CC) == SUCCESS) ? SUCCESS : FAILURE;
++ return (php_register_url_stream_wrapper(DIO_RAW_STREAM_NAME, &php_dio_raw_stream_wrapper) == SUCCESS &&
++ php_register_url_stream_wrapper(DIO_SERIAL_STREAM_NAME, &php_dio_serial_stream_wrapper) == SUCCESS) ? SUCCESS : FAILURE;
+ }
+ /* }}} */
+
+@@ -864,8 +864,8 @@ PHP_MINIT_FUNCTION(dio)
+ */
+ PHP_MSHUTDOWN_FUNCTION(dio)
+ {
+- return (php_unregister_url_stream_wrapper(DIO_RAW_STREAM_NAME TSRMLS_CC) == SUCCESS &&
+- php_unregister_url_stream_wrapper(DIO_SERIAL_STREAM_NAME TSRMLS_CC) == SUCCESS) ? SUCCESS : FAILURE;
++ return (php_unregister_url_stream_wrapper(DIO_RAW_STREAM_NAME) == SUCCESS &&
++ php_unregister_url_stream_wrapper(DIO_SERIAL_STREAM_NAME) == SUCCESS) ? SUCCESS : FAILURE;
+ }
+ /* }}} */
+
+diff --git a/dio_common.c b/dio_common.c
+index a5f4c63..d09c0ec 100644
+--- a/dio_common.c
++++ b/dio_common.c
+@@ -55,7 +55,7 @@ void dio_init_stream_data(php_dio_stream_data *data) {
+ /* {{{ dio_assoc_array_get_basic_options
+ * Retrieves the basic open option values from an associative array
+ */
+-void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
++void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data) {
+ #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
+ zval *tmpzval;
+ HashTable *opthash;
+@@ -98,7 +98,7 @@ void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data
+ /* {{{ dio_assoc_array_get_serial_options
+ * Retrieves the serial open option values from an associative array
+ */
+-void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC) {
++void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data) {
+ zval *tmpzval;
+ HashTable *opthash;
+
+@@ -133,7 +133,7 @@ void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data
+ /* {{{ dio_stream_context_get_raw_options
+ * Extracts the option values for dio.raw mode from a context
+ */
+-void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
++void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data) {
+ #if defined(DIO_HAS_FILEPERMS) || defined(DIO_NONBLOCK)
+ zval *tmpzval;
+ #endif
+@@ -173,7 +173,7 @@ void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_s
+ /* {{{ dio_stream_context_get_serial_options
+ * Extracts the option values for dio.serial mode from a context
+ */
+-void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC) {
++void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data) {
+ zval *tmpzval;
+
+ if ((tmpzval = php_stream_context_get_option(context, "dio", "data_rate")) != NULL) {
+diff --git a/dio_posix.c b/dio_posix.c
+index 527d683..843e234 100644
+--- a/dio_posix.c
++++ b/dio_posix.c
+@@ -474,7 +474,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
+ /* {{{ dio_raw_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++int dio_raw_open_stream(const char *filename, const char *mode, php_dio_stream_data *data) {
+ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
+ pdata->flags = dio_stream_mode_to_flags(mode);
+
+@@ -498,7 +498,7 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
+ if (pdata->fd < 0) {
+ switch (errno) {
+ case EEXIST:
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
++ php_error_docref(NULL, E_WARNING, "File exists!");
+ return 0;
+ default:
+ return 0;
+@@ -512,36 +512,36 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
+ /* {{{ dio_serial_init
+ * Initialises the serial settings storing the original settings before hand.
+ */
+-static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
++static int dio_serial_init(php_dio_stream_data *data) {
+ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
+ int ret = 0, data_bits_def, stop_bits_def, parity_def;
+ struct termios tio;
+ speed_t rate_def;
+
+ if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);
++ php_error_docref(NULL, E_WARNING, "invalid data_rate value (%ld)", data->data_rate);
+ return 0;
+ }
+
+ if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
++ php_error_docref(NULL, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
+ return 0;
+ }
+
+ if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
++ php_error_docref(NULL, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
+ return 0;
+ }
+
+ if (!dio_parity_to_define(data->parity, &parity_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
++ php_error_docref(NULL, E_WARNING, "invalid parity value (%d)", data->parity);
+ return 0;
+ }
+
+ ret = tcgetattr(pdata->fd, &(pdata->oldtio));
+ if (ret < 0) {
+ if ((errno == ENOTTY) || (errno == ENODEV)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a serial port or terminal!");
++ php_error_docref(NULL, E_WARNING, "Not a serial port or terminal!");
+ }
+ return 0;
+ }
+@@ -632,7 +632,7 @@ int dio_serial_purge(php_dio_stream_data *data) {
+ /* {{{ dio_serial_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data) {
+ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
+
+ #ifdef O_NOCTTY
+@@ -640,11 +640,11 @@ int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data
+ pdata->flags |= O_NOCTTY;
+ #endif
+
+- if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
++ if (!dio_raw_open_stream(filename, mode, data)) {
+ return 0;
+ }
+
+- if (!dio_serial_init(data TSRMLS_CC)) {
++ if (!dio_serial_init(data)) {
+ close(pdata->fd);
+ return 0;
+ }
+diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
+index 817b0d1..eb23752 100644
+--- a/dio_stream_wrappers.c
++++ b/dio_stream_wrappers.c
+@@ -36,7 +36,7 @@
+ /* {{{ dio_stream_write
+ * Write to the stream
+ */
+-static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
++static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count)
+ {
+ return dio_common_write((php_dio_stream_data*)stream->abstract, buf, count);
+ }
+@@ -45,7 +45,7 @@ static size_t dio_stream_write(php_stream *stream, const char *buf, size_t count
+ /* {{{ dio_stream_read
+ * Read from the stream
+ */
+-static size_t dio_stream_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
++static size_t dio_stream_read(php_stream *stream, char *buf, size_t count)
+ {
+ php_dio_stream_data* data = (php_dio_stream_data*)stream->abstract;
+ size_t bytes = dio_common_read(data, buf, count);
+@@ -58,7 +58,7 @@ static size_t dio_stream_read(php_stream *stream, char *buf, size_t count TSRMLS
+ /* {{{ dio_stream_flush
+ * Flush the stream. For raw streams this does nothing.
+ */
+-static int dio_stream_flush(php_stream *stream TSRMLS_DC)
++static int dio_stream_flush(php_stream *stream)
+ {
+ return 1;
+ }
+@@ -67,7 +67,7 @@ static int dio_stream_flush(php_stream *stream TSRMLS_DC)
+ /* {{{ dio_stream_close
+ * Close the stream
+ */
+-static int dio_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
++static int dio_stream_close(php_stream *stream, int close_handle)
+ {
+ php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract;
+
+@@ -83,7 +83,7 @@ static int dio_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
+ /* {{{ dio_stream_set_option
+ * Set the stream options.
+ */
+-static int dio_stream_set_option(php_stream *stream, int option, int value, void *ptrparam TSRMLS_DC)
++static int dio_stream_set_option(php_stream *stream, int option, int value, void *ptrparam)
+ {
+ php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract;
+
+@@ -143,7 +143,7 @@ static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
+ filename = path + sizeof(DIO_RAW_STREAM_PROTOCOL) - 1;
+
+ /* Check we can actually access it. */
+- if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
++ if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
+ return NULL;
+ }
+
+@@ -152,11 +152,11 @@ static php_stream *dio_raw_fopen_wrapper(php_stream_wrapper *wrapper,
+
+ /* Parse the context. */
+ if (context) {
+- dio_stream_context_get_basic_options(context, data TSRMLS_CC);
++ dio_stream_context_get_basic_options(context, data);
+ }
+
+ /* Try and open a raw stream. */
+- if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
++ if (!dio_raw_open_stream(filename, mode, data)) {
+ return NULL;
+ }
+
+@@ -199,7 +199,7 @@ PHP_FUNCTION(dio_raw) {
+ char *mode;
+ int mode_len;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+@@ -209,7 +209,7 @@ PHP_FUNCTION(dio_raw) {
+ }
+
+ /* Check we can actually access the file. */
+- if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
++ if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
+ RETURN_FALSE;
+ }
+
+@@ -217,11 +217,11 @@ PHP_FUNCTION(dio_raw) {
+ data->stream_type = DIO_STREAM_TYPE_RAW;
+
+ if (options) {
+- dio_assoc_array_get_basic_options(options, data TSRMLS_CC);
++ dio_assoc_array_get_basic_options(options, data);
+ }
+
+ /* Try and open a raw stream. */
+- if (dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
++ if (dio_raw_open_stream(filename, mode, data)) {
+ stream = php_stream_alloc(&dio_raw_stream_ops, data, 0, mode);
+ if (!stream) {
+ (void) dio_common_close(data);
+@@ -244,7 +244,7 @@ PHP_FUNCTION(dio_raw) {
+ * stream, if it is write only it flushes the write, otherwise it flushes
+ * both.
+ */
+-static int dio_serial_stream_flush(php_stream *stream TSRMLS_DC)
++static int dio_serial_stream_flush(php_stream *stream)
+ {
+ return dio_serial_purge((php_dio_stream_data*)stream->abstract);
+ }
+@@ -254,7 +254,7 @@ static int dio_serial_stream_flush(php_stream *stream TSRMLS_DC)
+ * Close the stream. Restores the serial settings to their value before
+ * the stream was open.
+ */
+-static int dio_serial_stream_close(php_stream *stream, int close_handle TSRMLS_DC)
++static int dio_serial_stream_close(php_stream *stream, int close_handle)
+ {
+ php_dio_stream_data *abstract = (php_dio_stream_data*)stream->abstract;
+
+@@ -304,7 +304,7 @@ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
+ filename = path + sizeof(DIO_SERIAL_STREAM_PROTOCOL) - 1;
+
+ /* Check we can actually access it. */
+- if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
++ if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
+ return NULL;
+ }
+
+@@ -313,12 +313,12 @@ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
+
+ /* Parse the context. */
+ if (context) {
+- dio_stream_context_get_basic_options(context, data TSRMLS_CC);
+- dio_stream_context_get_serial_options(context, data TSRMLS_CC);
++ dio_stream_context_get_basic_options(context, data);
++ dio_stream_context_get_serial_options(context, data);
+ }
+
+ /* Try and open a serial stream. */
+- if (!dio_serial_open_stream(filename, mode, data TSRMLS_CC)) {
++ if (!dio_serial_open_stream(filename, mode, data)) {
+ return NULL;
+ }
+
+@@ -359,18 +359,18 @@ PHP_FUNCTION(dio_serial) {
+ char *mode;
+ int mode_len;
+
+- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
++ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|z", &filename, &filename_len, &mode, &mode_len, &options) == FAILURE) {
+ RETURN_FALSE;
+ }
+
+ /* Check the third argument is an array. */
+ if (options && (Z_TYPE_P(options) != IS_ARRAY)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING,"dio_serial, the third argument should be an array of options");
++ php_error_docref(NULL, E_WARNING,"dio_serial, the third argument should be an array of options");
+ RETURN_FALSE;
+ }
+
+ /* Check we can actually access the file. */
+- if (php_check_open_basedir(filename TSRMLS_CC) || DIO_SAFE_MODE_CHECK(filename, mode)) {
++ if (php_check_open_basedir(filename) || DIO_SAFE_MODE_CHECK(filename, mode)) {
+ RETURN_FALSE;
+ }
+
+@@ -378,12 +378,12 @@ PHP_FUNCTION(dio_serial) {
+ data->stream_type = DIO_STREAM_TYPE_SERIAL;
+
+ if (options) {
+- dio_assoc_array_get_basic_options(options, data TSRMLS_CC);
+- dio_assoc_array_get_serial_options(options, data TSRMLS_CC);
++ dio_assoc_array_get_basic_options(options, data);
++ dio_assoc_array_get_serial_options(options, data);
+ }
+
+ /* Try and open a serial stream. */
+- if (dio_serial_open_stream(filename, mode, data TSRMLS_CC)) {
++ if (dio_serial_open_stream(filename, mode, data)) {
+ stream = php_stream_alloc(&dio_serial_stream_ops, data, 0, mode);
+ if (!stream) {
+ efree(data);
+diff --git a/dio_win32.c b/dio_win32.c
+index 1023d36..25c838a 100644
+--- a/dio_win32.c
++++ b/dio_win32.c
+@@ -30,7 +30,7 @@
+ /* {{{ dio_last_error_php_error
+ * Generates a PHP error message based upon the last Windows error.
+ */
+-static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
++static void dio_last_error_php_error(int level, char * message) {
+ LPVOID msgbuf;
+ DWORD msgbuflen;
+ char * errmsg;
+@@ -68,7 +68,7 @@ static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
+ /* Allocate a buffer */
+ errmsg = emalloc(errmsglen);
+ if (!errmsg) {
+- php_error_docref(NULL TSRMLS_CC, E_ERROR, "Out of memory in dio_last_error_php_error()!");
++ php_error_docref(NULL, E_ERROR, "Out of memory in dio_last_error_php_error()!");
+ LocalFree(msgbuf);
+ return;
+ }
+@@ -88,7 +88,7 @@ static void dio_last_error_php_error(int level, char * message TSRMLS_DC) {
+ errmsg = (char *)msgbuf;
+ #endif
+
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);
++ php_error_docref(NULL, E_WARNING, "%s[ERROR %d] %s", message, err, errmsg);
+
+ LocalFree(msgbuf);
+ #ifdef UNICODE
+@@ -505,7 +505,7 @@ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void
+ /* {{{ dio_raw_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++int dio_raw_open_stream(const char *filename, const char *mode, php_dio_stream_data *data) {
+ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
+ DWORD err;
+
+@@ -543,29 +543,29 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
+ err = GetLastError();
+ switch (err) {
+ case ERROR_FILE_EXISTS:
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File exists!");
++ php_error_docref(NULL, E_WARNING, "File exists!");
+ return 0;
+
+ case ERROR_FILE_NOT_FOUND:
+ /* ERROR_FILE_NOT_FOUND with TRUNCATE_EXISTING means that
+ * the file doesn't exist so now try to create it. */
+ if (TRUNCATE_EXISTING == wdata->creation_disposition) {
+- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "File does not exist, creating new file!");
++ php_error_docref(NULL, E_NOTICE, "File does not exist, creating new file!");
+
+ wdata->handle = CreateFile(filename, wdata->desired_access, 0,
+ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (INVALID_HANDLE_VALUE == wdata->handle) {
+- dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
++ dio_last_error_php_error(E_WARNING, "CreateFile() failed:");
+ return 0;
+ }
+ } else {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "File not found!");
++ php_error_docref(NULL, E_WARNING, "File not found!");
+ return 0;
+ }
+ break;
+
+ default:
+- dio_last_error_php_error(E_WARNING, "CreateFile() failed:" TSRMLS_CC);
++ dio_last_error_php_error(E_WARNING, "CreateFile() failed:");
+ return 0;
+ }
+ }
+@@ -584,33 +584,33 @@ int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *d
+ /* {{{ dio_serial_init
+ * Initialises the serial port
+ */
+-static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
++static int dio_serial_init(php_dio_stream_data *data) {
+ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
+ DWORD rate_def, data_bits_def, stop_bits_def, parity_def;
+ DCB dcb;
+
+ if (!dio_data_rate_to_define(data->data_rate, &rate_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_rate value (%d)", data->data_rate);
++ php_error_docref(NULL, E_WARNING, "invalid data_rate value (%d)", data->data_rate);
+ return 0;
+ }
+
+ if (!dio_data_bits_to_define(data->data_bits, &data_bits_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
++ php_error_docref(NULL, E_WARNING, "invalid data_bits value (%d)", data->data_bits);
+ return 0;
+ }
+
+ if (!dio_stop_bits_to_define(data->stop_bits, &stop_bits_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
++ php_error_docref(NULL, E_WARNING, "invalid stop_bits value (%d)", data->stop_bits);
+ return 0;
+ }
+
+ if (!dio_parity_to_define(data->parity, &parity_def)) {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid parity value (%d)", data->parity);
++ php_error_docref(NULL, E_WARNING, "invalid parity value (%d)", data->parity);
+ return 0;
+ }
+
+ if (!GetCommState(wdata->handle, &(wdata->olddcb))) {
+- dio_last_error_php_error(E_WARNING, "GetCommState() failed:" TSRMLS_CC);
++ dio_last_error_php_error(E_WARNING, "GetCommState() failed:");
+ return 0;
+ }
+
+@@ -646,7 +646,7 @@ static int dio_serial_init(php_dio_stream_data *data TSRMLS_DC) {
+ }
+
+ if (!SetCommState(wdata->handle, &dcb)) {
+- dio_last_error_php_error(E_WARNING, "SetCommState() failed:" TSRMLS_CC);
++ dio_last_error_php_error(E_WARNING, "SetCommState() failed:");
+ return 0;
+ }
+
+@@ -698,23 +698,23 @@ int dio_serial_purge(php_dio_stream_data *data) {
+ /* {{{ dio_serial_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC) {
++int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data) {
+ php_dio_win32_stream_data *wdata = (php_dio_win32_stream_data*)data;
+ COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
+
+- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);
++ php_error_docref(NULL, E_NOTICE, "Opening \"%s\" as a serial port (mode=\"%s\").", filename, mode);
+
+ if (*mode != 'r') {
+- php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must open serial ports in read or read/write mode!");
++ php_error_docref(NULL, E_WARNING, "You must open serial ports in read or read/write mode!");
+ return 0;
+ }
+
+- if (!dio_raw_open_stream(filename, mode, data TSRMLS_CC)) {
++ if (!dio_raw_open_stream(filename, mode, data)) {
+ return 0;
+ }
+
+ if (!GetCommTimeouts(wdata->handle, &(wdata->oldcto))) {
+- dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):" TSRMLS_CC);
++ dio_last_error_php_error(E_WARNING, "GetCommTimeouts() failed (Not a comm port?):");
+ CloseHandle(wdata->handle);
+ return 0;
+ }
+@@ -735,12 +735,12 @@ int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data
+ }
+
+ if (!SetCommTimeouts(wdata->handle, &cto)) {
+- dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:" TSRMLS_CC);
++ dio_last_error_php_error(E_WARNING, "SetCommTimeouts() failed:");
+ CloseHandle(wdata->handle);
+ return 0;
+ }
+
+- if (!dio_serial_init(data TSRMLS_CC)) {
++ if (!dio_serial_init(data)) {
+ CloseHandle(wdata->handle);
+ return 0;
+ }
+diff --git a/php_dio_common.h b/php_dio_common.h
+index 7a75370..6af202f 100644
+--- a/php_dio_common.h
++++ b/php_dio_common.h
+@@ -39,13 +39,13 @@ php_dio_stream_data * dio_create_stream_data(void);
+
+ void dio_init_stream_data(php_dio_stream_data *data);
+
+-void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data TSRMLS_DC);
++void dio_assoc_array_get_basic_options(zval *options, php_dio_stream_data *data);
+
+-void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data TSRMLS_DC);
++void dio_assoc_array_get_serial_options(zval *options, php_dio_stream_data *data);
+
+-void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC);
++void dio_stream_context_get_basic_options(php_stream_context *context, php_dio_stream_data *data);
+
+-void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data TSRMLS_DC);
++void dio_stream_context_get_serial_options(php_stream_context *context, php_dio_stream_data *data);
+
+ size_t dio_common_write(php_dio_stream_data *data, const char *buf, size_t count);
+
+@@ -55,13 +55,13 @@ int dio_common_close(php_dio_stream_data *data);
+
+ int dio_common_set_option(php_dio_stream_data *data, int option, int value, void *ptrparam);
+
+-int dio_raw_open_stream(const char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
++int dio_raw_open_stream(const char *filename, const char *mode, php_dio_stream_data *data);
+
+ int dio_serial_uninit(php_dio_stream_data *data);
+
+ int dio_serial_purge(php_dio_stream_data *data);
+
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data TSRMLS_DC);
++int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data);
+
+ #endif /* PHP_DIO_COMMON_H_ */
+
+--
+2.5.0
+
--- /dev/null
+From 942b77d84417298fb9e99c216029f22fbd1e2d98 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Thu, 14 Jul 2016 01:47:05 +0200
+Subject: [PATCH 13/16] Fix tests for legacy interface
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 16 ++++++++++------
+ 1 file changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/dio.c b/dio.c
+index 7bad575..1a130a2 100644
+--- a/dio.c
++++ b/dio.c
+@@ -73,9 +73,9 @@ static int new_php_fd(php_fd_t **f, int fd)
+ return 1;
+ }
+
+-static void _dio_close_fd(zend_resource *res)
++static void _dio_close_fd(zend_resource *rsrc)
+ {
+- php_fd_t *f = (php_fd_t *)zend_fetch_resource(res, NULL, le_fd);
++ php_fd_t *f = (php_fd_t *)rsrc->ptr;
+ if (f) {
+ close(f->fd);
+ free(f);
+@@ -87,8 +87,8 @@ static void _dio_close_fd(zend_resource *res)
+ PHP_FUNCTION(dio_open)
+ {
+ php_fd_t *f;
+- char *file_name;
+- int file_name_length;
++ char *file_name = NULL;
++ size_t file_name_length = 0;
+ long flags;
+ long mode = 0;
+ int fd;
+@@ -97,6 +97,10 @@ PHP_FUNCTION(dio_open)
+ return;
+ }
+
++ if (!file_name || file_name[0] == '\0') {
++ RETURN_FALSE;
++ }
++
+ if (php_check_open_basedir(file_name) || DIO_SAFE_MODE_CHECK(file_name, "wb+")) {
+ RETURN_FALSE;
+ }
+@@ -176,7 +180,7 @@ PHP_FUNCTION(dio_dup)
+ RETURN_FALSE;
+ }
+
+- RETVAL_RES(zend_register_resource(f, le_fd));
++ RETVAL_RES(zend_register_resource(df, le_fd));
+ }
+ /* }}} */
+ #endif
+@@ -660,7 +664,7 @@ PHP_FUNCTION(dio_close)
+ RETURN_FALSE;
+ }
+
+- zend_list_delete(Z_LVAL_P(r_fd));
++ zend_list_delete(Z_RES_P(r_fd));
+ }
+ /* }}} */
+
+--
+2.5.0
+
--- /dev/null
+From ff469d3a11409e9b043dc10ddfc44792c5359ff1 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Thu, 14 Jul 2016 01:47:05 +0200
+Subject: [PATCH 14/16] Add missing changes from changed stream API interface
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio_posix.c | 2 +-
+ dio_stream_wrappers.c | 2 +-
+ php_dio_common.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dio_posix.c b/dio_posix.c
+index 843e234..b2aa228 100644
+--- a/dio_posix.c
++++ b/dio_posix.c
+@@ -632,7 +632,7 @@ int dio_serial_purge(php_dio_stream_data *data) {
+ /* {{{ dio_serial_open_stream
+ * Opens the underlying stream.
+ */
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data) {
++int dio_serial_open_stream(const char *filename, const char *mode, php_dio_stream_data *data) {
+ php_dio_posix_stream_data *pdata = (php_dio_posix_stream_data*)data;
+
+ #ifdef O_NOCTTY
+diff --git a/dio_stream_wrappers.c b/dio_stream_wrappers.c
+index eb23752..0a00daa 100644
+--- a/dio_stream_wrappers.c
++++ b/dio_stream_wrappers.c
+@@ -292,7 +292,7 @@ static php_stream *dio_serial_fopen_wrapper(php_stream_wrapper *wrapper,
+ {
+ php_dio_stream_data *data;
+ php_stream *stream;
+- char *filename;
++ const char *filename;
+
+ /* Check it was actually for us (not a corrupted function pointer
+ somewhere!). */
+diff --git a/php_dio_common.h b/php_dio_common.h
+index 6af202f..7068ea7 100644
+--- a/php_dio_common.h
++++ b/php_dio_common.h
+@@ -61,7 +61,7 @@ int dio_serial_uninit(php_dio_stream_data *data);
+
+ int dio_serial_purge(php_dio_stream_data *data);
+
+-int dio_serial_open_stream(char *filename, char *mode, php_dio_stream_data *data);
++int dio_serial_open_stream(const char *filename, const char *mode, php_dio_stream_data *data);
+
+ #endif /* PHP_DIO_COMMON_H_ */
+
+--
+2.5.0
+
--- /dev/null
+From def92a2db269d4ea6d2e8b7f8fe9dd473886a6b1 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Sun, 17 Jul 2016 01:08:47 +0200
+Subject: [PATCH 15/16] Add .gitignore
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ .gitignore | 28 ++++++++++++++++++++++++++++
+ 1 file changed, 28 insertions(+)
+ create mode 100644 .gitignore
+
+diff --git a/.gitignore b/.gitignore
+new file mode 100644
+index 0000000..dae52e8
+--- /dev/null
++++ b/.gitignore
+@@ -0,0 +1,28 @@
++.deps
++.libs
++Makefile
++Makefile.fragments
++Makefile.global
++Makefile.objects
++acinclude.m4
++aclocal.m4
++autom4te.cache
++build
++config.guess
++config.h
++config.h.in
++config.log
++config.nice
++config.status
++config.sub
++configure
++configure.in
++*.la
++*.lo
++install-sh
++libtool
++ltmain.sh
++missing
++mkinstalldirs
++modules
++run-tests.php
+--
+2.5.0
+
--- /dev/null
+From 0f8df09a8008eed8a7ac0c6400bce523014ff770 Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Mon, 18 Jul 2016 22:45:04 +0200
+Subject: [PATCH 16/16] Add additional baudrates
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ dio.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/dio.c b/dio.c
+index 1a130a2..a4e8e7d 100644
+--- a/dio.c
++++ b/dio.c
+@@ -522,6 +522,26 @@ PHP_FUNCTION(dio_tcsetattr)
+
+ /* assign to correct values... */
+ switch (Baud_Rate) {
++#ifdef B460800
++ case 460800:
++ BAUD = B460800;
++ break;
++#endif
++#ifdef B230400
++ case 230400:
++ BAUD = B230400;
++ break;
++#endif
++#ifdef B115200
++ case 115200:
++ BAUD = B115200;
++ break;
++#endif
++#ifdef B57600
++ case 57600:
++ BAUD = B57600;
++ break;
++#endif
+ case 38400:
+ BAUD = B38400;
+ break;
+--
+2.5.0
+
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=pecl_http
+PECL_LONGNAME:=Extended HTTP Support
+
+PKG_VERSION:=3.0.1
+PKG_RELEASE:=2
+PKG_MD5SUM:=042c97314c180f6473338f0c5d35fabd
+
+PKG_NAME:=php7-pecl-http
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DEPENDS:=php7 php7-pecl-propro php7-pecl-raphf
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_VARS+= \
+ PHP_PROPRO=yes \
+ PHP_RAPHF=yes \
+
+CONFIGURE_ARGS+= \
+ --with-http \
+ --without-http-shared-deps \
+ --with-http-libcurl-dir="$(STAGING_DIR)/usr" \
+ --with-http-libevent-dir="$(STAGING_DIR)/usr" \
+ --with-http-libidn-dir="$(STAGING_DIR)/usr"
+
+$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+libcurl +librt +libevent2 +libidn +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+--- a/config9.m4 2016-09-08 21:39:18.000000000 +0200
++++ b/config9.m4 2016-09-08 21:42:35.066903251 +0200
+@@ -71,18 +71,7 @@
+ extname=$1
+ haveext=$[PHP_]translit($1,a-z_-,A-Z__)
+ AC_MSG_CHECKING([for ext/$extname support])
+- if test -x "$PHP_EXECUTABLE"; then
+- grepext=`$PHP_EXECUTABLE -m | $EGREP ^$extname\$`
+- if test "$grepext" = "$extname"; then
+- [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
+- AC_MSG_RESULT([yes])
+- $2
+- else
+- [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=
+- AC_MSG_RESULT([no])
+- $3
+- fi
+- elif test "$haveext" != "no" && test "x$haveext" != "x"; then
++ if test "$haveext" != "no" && test "x$haveext" != "x"; then
+ [PHP_HTTP_HAVE_EXT_]translit($1,a-z_-,A-Z__)=1
+ AC_MSG_RESULT([yes])
+ $2
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=libevent
+PECL_LONGNAME:=Libevent - event notification
+
+PKG_NAME:=php7-pecl-$(PECL_NAME)
+PKG_VERSION=2016-08-30-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/expressif/pecl-event-libevent.git
+PKG_SOURCE_VERSION:=9e72744ce6224beafc7b54ce2a3a990f1c552a5a
+PKG_SOURCE_SUBDIR:=$(PECL_NAME)-$(PKG_SOURCE_VERSION)
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=PHPv3.01
+PKG_LICENSE_FILES:=
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_SOURCE_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_ARGS+= --with-libevent=shared,"$(STAGING_DIR)/usr"
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME),+libevent2 +php7-mod-sockets,25))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+--- a/libevent.c
++++ b/libevent.c
+@@ -42,10 +42,12 @@
+ (rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 1, resource_type))
+ #endif
+
+-#ifdef PHP_WIN32
++//#ifdef PHP_WIN32
+ /* XXX compiling with 2.x on Windows. Luckily the ext code works thanks to the
+ compat exports from the libevent. However it might need to be adapted to the
+ never version, so this ifdefs would go away. */
++#if 1
++/* force use of libevent2 on OpenWrt and by-pass compat event.h */
+ # include <event2/event.h>
+ # include <event2/event_compat.h>
+ # include <event2/event_struct.h>
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=propro
+PECL_LONGNAME:=Property proxy
+
+PKG_VERSION:=2.0.1
+PKG_RELEASE:=2
+PKG_MD5SUM:=19f9517210a87e18cc09faed262e1522
+
+PKG_NAME:=php7-pecl-propro
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_ARGS+= \
+ --enable-propro
+
+define Build/InstallDev
+ mkdir -p $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)
+ $(CP) $(PKG_BUILD_DIR)/php_propro.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+ $(CP) $(PKG_BUILD_DIR)/php_propro_api.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+endef
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PECL_NAME:=raphf
+PECL_LONGNAME:=Resource and persistent handles factory
+
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=2
+PKG_MD5SUM:=bc465eb5caa9d0f09cced121a8ac2e8e
+
+PKG_NAME:=php7-pecl-raphf
+PKG_SOURCE:=$(PECL_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://pecl.php.net/get/
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=BSD-2-Clause
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pecl-php7/$(PECL_NAME)-$(PKG_VERSION)
+PKG_BUILD_PARALLEL:=1
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+include ../php7/pecl.mk
+
+CONFIGURE_ARGS+= \
+ --enable-raphf
+
+define Build/InstallDev
+ mkdir -p $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)
+ cp $(PKG_BUILD_DIR)/php_raphf.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+ cp $(PKG_BUILD_DIR)/php_raphf_api.h $(STAGING_DIR)/usr/include/php7/ext/$(PECL_NAME)/
+endef
+
+$(eval $(call PECLPackage,$(PECL_NAME),$(PECL_LONGNAME)))
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=php
+PKG_VERSION:=7.0.12
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
+
+PKG_LICENSE:=PHPv3.01
+PKG_LICENSE_FILES:=LICENSE
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://www.php.net/distributions/
+PKG_MD5SUM:=bdcc4dbdac90c2a39422786653059f70
+
+PKG_FIXUP:=libtool autoreconf
+PKG_BUILD_PARALLEL:=1
+PKG_USE_MIPS16:=0
+
+PHP7_MODULES = \
+ calendar ctype curl \
+ fileinfo \
+ dom \
+ exif \
+ ftp \
+ gettext gd gmp \
+ hash \
+ iconv intl \
+ json \
+ ldap \
+ mbstring mcrypt mysqli \
+ opcache openssl \
+ pcntl pdo pdo-mysql pdo-pgsql pdo-sqlite pgsql phar \
+ session shmop simplexml soap sockets sqlite3 sysvmsg sysvsem sysvshm \
+ tokenizer \
+ xml xmlreader xmlwriter zip \
+
+PKG_CONFIG_DEPENDS:= \
+ $(patsubst %,CONFIG_PACKAGE_php7-mod-%,$(PHP7_MODULES)) \
+ CONFIG_PHP7_FILTER CONFIG_PHP7_LIBXML CONFIG_PHP7_SYSTEMTZDATA
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/php7/Default
+ SUBMENU:=PHP
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=PHP7 Hypertext preprocessor
+ URL:=http://www.php.net/
+ DEPENDS:=php7
+endef
+
+define Package/php7/Default/description
+ PHP is a widely-used general-purpose scripting language that is especially
+ suited for Web development and can be embedded into HTML.
+endef
+
+define Package/php7/config
+ config PHP7_FILTER
+ bool "PHP7 Filter support"
+ depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+
+ config PHP7_LIBXML
+ bool "PHP7 LIBXML support"
+ depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+
+ config PHP7_SYSTEMTZDATA
+ bool "Use system timezone data instead of php's built-in database"
+ depends on PACKAGE_php7-cli || PACKAGE_php7-cgi
+ select PACKAGE_zoneinfo-core
+ default y
+ help
+ Enabling this feature automatically selects the zoneinfo-core package
+ which contains data for UTC timezone. To use other timezones you have
+ to install the corresponding zoneinfo-... package(s).
+endef
+
+define Package/php7
+ $(call Package/php7/Default)
+
+ DEPENDS:=+libpcre +zlib \
+ +PHP7_LIBXML:libxml2
+endef
+
+define Package/php7/description
+ $(call Package/php7/Default/description)
+ This package contains only the PHP config file. You must actually choose
+ your PHP flavour (cli, cgi or fastcgi).
+
+ Please note, that installing php5 and php7 in parallel on the same target
+ is not supported in OpenWrt/LEDE.
+endef
+
+define Package/php7-cli
+ $(call Package/php7/Default)
+ DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
+ TITLE+= (CLI)
+endef
+
+define Package/php7-cli/description
+ $(call Package/php7/Default/description)
+ This package contains the CLI version of the PHP7 interpreter.
+endef
+
+define Package/php7-cgi
+ $(call Package/php7/Default)
+ DEPENDS+= +PACKAGE_php7-mod-intl:libstdcpp
+ TITLE+= (CGI & FastCGI)
+endef
+
+define Package/php7-cgi/description
+ $(call Package/php7/Default/description)
+ This package contains the CGI version of the PHP7 interpreter.
+endef
+
+define Package/php7-fastcgi
+ $(call Package/php7/Default)
+ DEPENDS+= +php7-cgi
+ TITLE:=FastCGI startup script
+endef
+
+define Package/php7-fastcgi/description
+ As FastCGI support is now a core feature the php7-fastcgi package now depends
+ on the php7-cgi package, containing just the startup script.
+endef
+
+define Package/php7-fpm
+ $(call Package/php7/Default)
+ DEPENDS+= +php7-cgi
+ TITLE+= (FPM)
+endef
+
+define Package/php7-fpm/description
+ $(call Package/php7/Default/description)
+ This package contains the FastCGI Process Manager of the PHP7 interpreter.
+endef
+
+CONFIGURE_ARGS+= \
+ --enable-cli \
+ --enable-cgi \
+ --enable-fpm \
+ --enable-shared \
+ --disable-static \
+ --disable-rpath \
+ --disable-debug \
+ --disable-phpdbg \
+ --without-pear \
+ \
+ --with-config-file-path=/etc \
+ --with-config-file-scan-dir=/etc/php7 \
+ --disable-short-tags \
+ \
+ --with-zlib="$(STAGING_DIR)/usr" \
+ --with-zlib-dir="$(STAGING_DIR)/usr"
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-calendar),)
+ CONFIGURE_ARGS+= --enable-calendar=shared
+else
+ CONFIGURE_ARGS+= --disable-calendar
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ctype),)
+ CONFIGURE_ARGS+= --enable-ctype=shared
+else
+ CONFIGURE_ARGS+= --disable-ctype
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-curl),)
+ CONFIGURE_ARGS+= --with-curl=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-curl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-fileinfo),)
+ CONFIGURE_ARGS+= --enable-fileinfo=shared
+else
+ CONFIGURE_ARGS+= --disable-fileinfo
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gettext),)
+ CONFIGURE_ARGS+= --with-gettext=shared,"$(STAGING_DIR)/usr/lib/libintl-full"
+else
+ CONFIGURE_ARGS+= --without-gettext
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-dom),)
+ CONFIGURE_ARGS+= --enable-dom=shared
+else
+ CONFIGURE_ARGS+= --disable-dom
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-exif),)
+ CONFIGURE_ARGS+= --enable-exif=shared
+else
+ CONFIGURE_ARGS+= --disable-exif
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ftp),)
+ CONFIGURE_ARGS+= --enable-ftp=shared
+else
+ CONFIGURE_ARGS+= --disable-ftp
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gd),)
+ CONFIGURE_ARGS+= \
+ --with-gd=shared \
+ --without-freetype-dir \
+ --with-jpeg-dir="$(STAGING_DIR)/usr" \
+ --with-png-dir="$(STAGING_DIR)/usr" \
+ --without-xpm-dir \
+ --without-t1lib \
+ --enable-gd-native-ttf \
+ --disable-gd-jis-conv
+else
+ CONFIGURE_ARGS+= --without-gd
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-gmp),)
+ CONFIGURE_ARGS+= --with-gmp=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-gmp
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-hash),)
+ CONFIGURE_ARGS+= --enable-hash=shared
+else
+ CONFIGURE_ARGS+= --disable-hash
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-iconv),)
+ CONFIGURE_ARGS+= --with-iconv=shared,"$(ICONV_PREFIX)"
+else
+ CONFIGURE_ARGS+= --without-iconv
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-intl),)
+ CONFIGURE_ARGS+= --enable-intl=shared
+else
+ CONFIGURE_ARGS+= --disable-intl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-json),)
+ CONFIGURE_ARGS+= --enable-json=shared
+else
+ CONFIGURE_ARGS+= --disable-json
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-ldap),)
+ CONFIGURE_ARGS+= \
+ --with-ldap=shared,"$(STAGING_DIR)/usr" \
+ --with-ldap-sasl="$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-ldap
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mbstring),)
+ CONFIGURE_ARGS+= --enable-mbstring=shared --enable-mbregex
+else
+ CONFIGURE_ARGS+= --disable-mbstring
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mcrypt),)
+ CONFIGURE_ARGS+= --with-mcrypt=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-mcrypt
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-mysqli),)
+ CONFIGURE_ARGS+= --with-mysqli=shared,"$(STAGING_DIR)/usr/bin/mysql_config"
+else
+ CONFIGURE_ARGS+= --without-mysqli
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-opcache),)
+ CONFIGURE_ARGS+= --enable-opcache=shared
+else
+ CONFIGURE_ARGS+= --disable-opcache
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-openssl),)
+ CONFIGURE_ARGS+= \
+ --with-openssl=shared,"$(STAGING_DIR)/usr" \
+ --with-kerberos=no \
+ --with-openssl-dir="$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-openssl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pcntl),)
+ CONFIGURE_ARGS+= --enable-pcntl=shared
+else
+ CONFIGURE_ARGS+= --disable-pcntl
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo),)
+ CONFIGURE_ARGS+= --enable-pdo=shared
+ ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-mysql),)
+ CONFIGURE_ARGS+= --with-pdo-mysql=shared,"$(STAGING_DIR)/usr"
+ else
+ CONFIGURE_ARGS+= --without-pdo-mysql
+ endif
+ ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-pgsql),)
+ CONFIGURE_ARGS+= --with-pdo-pgsql=shared,"$(STAGING_DIR)/usr"
+ else
+ CONFIGURE_ARGS+= --without-pdo-pgsql
+ endif
+ ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pdo-sqlite),)
+ CONFIGURE_ARGS+= --with-pdo-sqlite=shared,"$(STAGING_DIR)/usr"
+ else
+ CONFIGURE_ARGS+= --without-pdo-sqlite
+ endif
+else
+ CONFIGURE_ARGS+= --disable-pdo
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-pgsql),)
+ CONFIGURE_ARGS+= --with-pgsql=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-pgsql
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-phar),)
+ CONFIGURE_ARGS+= --enable-phar=shared
+else
+ CONFIGURE_ARGS+= --disable-phar
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-session),)
+ CONFIGURE_ARGS+= --enable-session=shared
+else
+ CONFIGURE_ARGS+= --disable-session
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-shmop),)
+ CONFIGURE_ARGS+= --enable-shmop=shared
+else
+ CONFIGURE_ARGS+= --disable-shmop
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-simplexml),)
+ CONFIGURE_ARGS+= --enable-simplexml=shared
+else
+ CONFIGURE_ARGS+= --disable-simplexml
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-soap),)
+ CONFIGURE_ARGS+= --enable-soap=shared
+else
+ CONFIGURE_ARGS+= --disable-soap
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sockets),)
+ CONFIGURE_ARGS+= --enable-sockets=shared
+else
+ CONFIGURE_ARGS+= --disable-sockets
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sqlite3),)
+ CONFIGURE_ARGS+= --with-sqlite3=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --without-sqlite3
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvmsg),)
+ CONFIGURE_ARGS+= --enable-sysvmsg=shared
+else
+ CONFIGURE_ARGS+= --disable-sysvmsg
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvsem),)
+ CONFIGURE_ARGS+= --enable-sysvsem=shared
+else
+ CONFIGURE_ARGS+= --disable-sysvsem
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-sysvshm),)
+ CONFIGURE_ARGS+= --enable-sysvshm=shared
+else
+ CONFIGURE_ARGS+= --disable-sysvshm
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-tokenizer),)
+ CONFIGURE_ARGS+= --enable-tokenizer=shared
+else
+ CONFIGURE_ARGS+= --disable-tokenizer
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xml),)
+ CONFIGURE_ARGS+= --enable-xml=shared,"$(STAGING_DIR)/usr"
+ ifneq ($(CONFIG_PHP7_LIBXML),)
+ CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
+ else
+ CONFIGURE_ARGS+= --with-libexpat-dir="$(STAGING_DIR)/usr"
+ endif
+else
+ CONFIGURE_ARGS+= --disable-xml
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlreader),)
+ CONFIGURE_ARGS+= --enable-xmlreader=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --disable-xmlreader
+endif
+
+ifneq ($(SDK)$(CONFIG_PACKAGE_php7-mod-xmlwriter),)
+ CONFIGURE_ARGS+= --enable-xmlwriter=shared,"$(STAGING_DIR)/usr"
+else
+ CONFIGURE_ARGS+= --disable-xmlwriter
+endif
+
+ifneq ($(CONFIG_PACKAGE_php7-mod-zip),)
+ CONFIGURE_ARGS+= --enable-zip=shared
+else
+ CONFIGURE_ARGS+= --disable-zip
+endif
+
+ifneq ($(SDK)$(CONFIG_PHP7_FILTER),)
+ CONFIGURE_ARGS+= --enable-filter
+else
+ CONFIGURE_ARGS+= --disable-filter
+endif
+
+ifneq ($(SDK)$(CONFIG_PHP7_LIBXML),)
+ CONFIGURE_ARGS+= --enable-libxml
+ CONFIGURE_ARGS+= --with-libxml-dir="$(STAGING_DIR)/usr/include/libxml2"
+else
+ CONFIGURE_ARGS+= --disable-libxml
+endif
+
+#ifneq ($(CONFIG_PHP7_SYSTEMTZDATA),)
+# CONFIGURE_ARGS+= --with-system-tzdata
+#else
+# CONFIGURE_ARGS+= --without-system-tzdata
+#endif
+
+CONFIGURE_VARS+= \
+ ac_cv_c_bigendian_php=$(if $(CONFIG_BIG_ENDIAN),yes,no) \
+ php_cv_cc_rpath="no" \
+ iconv_impl_name="gnu_libiconv" \
+ ac_cv_php_xml2_config_path="$(STAGING_DIR)/host/bin/xml2-config" \
+
+define Package/php7/conffiles
+/etc/php.ini
+endef
+
+define Package/php7/install
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) ./files/php.ini $(1)/etc/
+endef
+
+define Package/php7-cli/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/sapi/cli/php $(1)/usr/bin/php-cli
+endef
+
+define Package/php7-cgi/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/sapi/cgi/php-cgi $(1)/usr/bin/php-cgi
+ ln -sf php-cgi $(1)/usr/bin/php-fcgi
+endef
+
+define Package/php7-fastcgi/install
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/php7-fastcgi.config $(1)/etc/config/php7-fastcgi
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/php7-fastcgi.init $(1)/etc/init.d/php7-fastcgi
+endef
+
+define Package/php7-fpm/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/sapi/fpm/php-fpm $(1)/usr/bin/php-fpm
+
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) ./files/php7-fpm.conf $(1)/etc/php7-fpm.conf
+
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/php7-fpm.config $(1)/etc/config/php7-fpm
+
+ $(INSTALL_DIR) $(1)/etc/php7-fpm.d
+ $(INSTALL_DATA) ./files/php7-fpm-www.conf $(1)/etc/php7-fpm.d/www.conf
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/php7-fpm.init $(1)/etc/init.d/php7-fpm
+endef
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ ( cd $(PKG_BUILD_DIR); touch configure.in; ./buildconf --force )
+endef
+
+define Build/InstallDev
+ rm -rf $(PKG_BUILD_DIR)/staging
+ make -C $(PKG_BUILD_DIR) install INSTALL_ROOT=$(PKG_BUILD_DIR)/staging
+ rm -rf $(PKG_BUILD_DIR)/staging/usr/{share,man,sbin}
+ rm -f $(PKG_BUILD_DIR)/staging/usr/bin/{php,php-cgi,php-cli}
+ mv $(PKG_BUILD_DIR)/staging/usr/bin/phpize $(PKG_BUILD_DIR)/staging/usr/bin/phpize7
+ mv $(PKG_BUILD_DIR)/staging/usr/bin/php-config $(PKG_BUILD_DIR)/staging/usr/bin/php7-config
+ mv $(PKG_BUILD_DIR)/staging/usr/include/php $(PKG_BUILD_DIR)/staging/usr/include/php7
+ mv $(PKG_BUILD_DIR)/staging/usr/lib/php $(PKG_BUILD_DIR)/staging/usr/lib/php7
+
+ $(CP) $(PKG_BUILD_DIR)/staging/usr $(STAGING_DIR)/
+
+ sed -i -e "s#prefix='/usr'#prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
+ sed -i -e "s#exec_prefix=\"\`eval echo /usr\`\"#exec_prefix='$(STAGING_DIR)/usr'#" $(STAGING_DIR)/usr/bin/phpize7
+ sed -i -e "s#/include\`/php\"#/include\`/php7\"#" $(STAGING_DIR)/usr/bin/phpize7
+ sed -i -e "s#/lib/php\`/build\"#/lib/php7\`/build\"#" $(STAGING_DIR)/usr/bin/phpize7
+
+ sed -i -e "s#prefix=\"/usr\"#prefix=\"$(STAGING_DIR)/usr\"#" $(STAGING_DIR)/usr/bin/php7-config
+ sed -i -e "s#/include/php\"#/include/php7\"#" $(STAGING_DIR)/usr/bin/php7-config
+endef
+
+define BuildModule
+
+ define Package/php7-mod-$(1)
+ $(call Package/php7/Default)
+
+ ifneq ($(3),)
+ DEPENDS+=$(3)
+ endif
+
+ TITLE:=$(2) shared module
+ endef
+
+ define Package/php7-mod-$(1)/install
+ $(INSTALL_DIR) $$(1)/usr/lib/php
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
+ $(INSTALL_DIR) $$(1)/etc/php7
+ ifeq ($(5),zend)
+ echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+ else
+ echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+ endif
+ endef
+
+ $$(eval $$(call BuildPackage,php7-mod-$(1)))
+
+endef
+
+$(eval $(call BuildPackage,php7))
+$(eval $(call BuildPackage,php7-cgi))
+$(eval $(call BuildPackage,php7-cli))
+$(eval $(call BuildPackage,php7-fastcgi))
+$(eval $(call BuildPackage,php7-fpm))
+
+#$(eval $(call BuildModule,NAME,TITLE[,PKG DEPENDS]))
+$(eval $(call BuildModule,calendar,Calendar))
+$(eval $(call BuildModule,ctype,Ctype))
+$(eval $(call BuildModule,curl,cURL,+PACKAGE_php7-mod-curl:libcurl))
+$(eval $(call BuildModule,dom,DOM,+@PHP7_LIBXML +PACKAGE_php7-mod-dom:libxml2))
+$(eval $(call BuildModule,exif,EXIF))
+$(eval $(call BuildModule,fileinfo,Fileinfo))
+$(eval $(call BuildModule,ftp,FTP,+PACKAGE_php7-mod-ftp:libopenssl))
+$(eval $(call BuildModule,gd,GD graphics,+PACKAGE_php7-mod-gd:libjpeg +PACKAGE_php7-mod-gd:libpng))
+$(eval $(call BuildModule,gettext,Gettext,+PACKAGE_php7-mod-gettext:libintl-full))
+$(eval $(call BuildModule,gmp,GMP,+PACKAGE_php7-mod-gmp:libgmp))
+$(eval $(call BuildModule,hash,Hash))
+$(eval $(call BuildModule,iconv,iConv,$(ICONV_DEPENDS)))
+$(eval $(call BuildModule,intl,Internationalization Functions,+PACKAGE_php7-mod-intl:icu))
+$(eval $(call BuildModule,json,JSON))
+$(eval $(call BuildModule,ldap,LDAP,+PACKAGE_php7-mod-ldap:libopenldap +PACKAGE_php7-mod-ldap:libsasl2))
+$(eval $(call BuildModule,mbstring,MBString))
+$(eval $(call BuildModule,mcrypt,Mcrypt,+PACKAGE_php7-mod-mcrypt:libmcrypt +PACKAGE_php7-mod-mcrypt:libltdl))
+$(eval $(call BuildModule,mysqli,MySQL Improved Extension,+PACKAGE_php7-mod-mysqli:libmysqlclient))
+$(eval $(call BuildModule,opcache,OPcache,,,zend))
+$(eval $(call BuildModule,openssl,OpenSSL,+PACKAGE_php7-mod-openssl:libopenssl))
+$(eval $(call BuildModule,pcntl,PCNTL))
+$(eval $(call BuildModule,pdo,PHP Data Objects))
+$(eval $(call BuildModule,pdo-mysql,PDO driver for MySQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-mysql:libmysqlclient))
+$(eval $(call BuildModule,pdo-pgsql,PDO driver for PostgreSQL,+php7-mod-pdo +PACKAGE_php7-mod-pdo-pgsql:libpq))
+$(eval $(call BuildModule,pdo-sqlite,PDO driver for SQLite 3.x,+php7-mod-pdo +PACKAGE_php7-mod-pdo-sqlite:libsqlite3 +PACKAGE_php7-mod-pdo-sqlite:librt))
+$(eval $(call BuildModule,pgsql,PostgreSQL,+PACKAGE_php7-mod-pgsql:libpq))
+$(eval $(call BuildModule,phar,Phar Archives,+php7-mod-hash))
+$(eval $(call BuildModule,session,Session))
+$(eval $(call BuildModule,shmop,Shared Memory))
+$(eval $(call BuildModule,simplexml,SimpleXML,+@PHP7_LIBXML +PACKAGE_php7-mod-simplexml:libxml2))
+$(eval $(call BuildModule,soap,SOAP,+@PHP7_LIBXML +PACKAGE_php7-mod-soap:libxml2))
+$(eval $(call BuildModule,sockets,Sockets))
+$(eval $(call BuildModule,sqlite3,SQLite3,+PACKAGE_php7-mod-sqlite3:libsqlite3))
+$(eval $(call BuildModule,sysvmsg,System V messages))
+$(eval $(call BuildModule,sysvsem,System V shared memory))
+$(eval $(call BuildModule,sysvshm,System V semaphore))
+$(eval $(call BuildModule,tokenizer,Tokenizer))
+$(eval $(call BuildModule,xml,XML,+PHP7_LIBXML:libxml2 +!PHP7_LIBXML:libexpat))
+$(eval $(call BuildModule,xmlreader,XMLReader,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlreader:libxml2))
+$(eval $(call BuildModule,xmlwriter,XMLWriter,+@PHP7_LIBXML +PACKAGE_php7-mod-xmlwriter:libxml2))
+$(eval $(call BuildModule,zip,ZIP,+PACKAGE_php7-mod-zip:zlib))
--- /dev/null
+[PHP]
+zend.ze1_compatibility_mode = Off
+
+; Language Options
+
+engine = On
+;short_open_tag = Off
+precision = 12
+y2k_compliance = On
+output_buffering = Off
+;output_handler =
+zlib.output_compression = Off
+;zlib.output_compression_level = -1
+;zlib.output_handler =
+implicit_flush = Off
+unserialize_callback_func =
+serialize_precision = 100
+
+;open_basedir =
+disable_functions =
+disable_classes =
+
+; Colors for Syntax Highlighting mode. Anything that's acceptable in
+; <span style="color: ???????"> would work.
+;highlight.string = #DD0000
+;highlight.comment = #FF9900
+;highlight.keyword = #007700
+;highlight.bg = #FFFFFF
+;highlight.default = #0000BB
+;highlight.html = #000000
+
+;ignore_user_abort = On
+;realpath_cache_size = 16k
+;realpath_cache_ttl = 120
+
+; Miscellaneous
+
+expose_php = On
+
+; Resource Limits
+
+max_execution_time = 30 ; Maximum execution time of each script, in seconds.
+max_input_time = 60 ; Maximum amount of time each script may spend parsing request data.
+;max_input_nesting_level = 64
+memory_limit = 8M ; Maximum amount of memory a script may consume.
+
+; Error handling and logging
+
+; Error Level Constants:
+; E_ALL - All errors and warnings (includes E_STRICT as of PHP 6.0.0)
+; E_ERROR - fatal run-time errors
+; E_RECOVERABLE_ERROR - almost fatal run-time errors
+; E_WARNING - run-time warnings (non-fatal errors)
+; E_PARSE - compile-time parse errors
+; E_NOTICE - run-time notices (these are warnings which often result
+; from a bug in your code, but it's possible that it was
+; intentional (e.g., using an uninitialized variable and
+; relying on the fact it's automatically initialized to an
+; empty string)
+; E_STRICT - run-time notices, enable to have PHP suggest changes
+; to your code which will ensure the best interoperability
+; and forward compatibility of your code
+; E_CORE_ERROR - fatal errors that occur during PHP's initial startup
+; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's
+; initial startup
+; E_COMPILE_ERROR - fatal compile-time errors
+; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
+; E_USER_ERROR - user-generated error message
+; E_USER_WARNING - user-generated warning message
+; E_USER_NOTICE - user-generated notice message
+; E_DEPRECATED - warn about code that will not work in future versions
+; of PHP
+; E_USER_DEPRECATED - user-generated deprecation warnings
+;
+; Common Values:
+; E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
+; E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
+; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
+; E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
+; Default Value: E_ALL & ~E_NOTICE
+error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
+
+display_errors = On
+display_startup_errors = Off
+log_errors = Off
+log_errors_max_len = 1024
+ignore_repeated_errors = Off
+ignore_repeated_source = Off
+report_memleaks = On
+;report_zend_debug = 0
+track_errors = Off
+;html_errors = Off
+;docref_root = "/phpmanual/"
+;docref_ext = .html
+;error_prepend_string = "<font color=#ff0000>"
+;error_append_string = "</font>"
+; Log errors to specified file.
+;error_log = /var/log/php_errors.log
+; Log errors to syslog.
+;error_log = syslog
+
+; Data Handling
+
+;arg_separator.output = "&"
+;arg_separator.input = ";&"
+variables_order = "EGPCS"
+request_order = "GP"
+register_globals = Off
+register_long_arrays = Off
+register_argc_argv = On
+auto_globals_jit = On
+post_max_size = 8M
+;magic_quotes_gpc = Off
+magic_quotes_runtime = Off
+magic_quotes_sybase = Off
+auto_prepend_file =
+auto_append_file =
+default_mimetype = "text/html"
+;default_charset = "iso-8859-1"
+;always_populate_raw_post_data = On
+
+; Paths and Directories
+
+; UNIX: "/path1:/path2"
+;include_path = ".:/php/includes"
+doc_root = "/www"
+user_dir =
+extension_dir = "/usr/lib/php"
+enable_dl = On
+;cgi.force_redirect = 1
+;cgi.nph = 1
+;cgi.redirect_status_env = ;
+cgi.fix_pathinfo=1
+;fastcgi.impersonate = 1;
+;fastcgi.logging = 0
+;cgi.rfc2616_headers = 0
+
+; File Uploads
+
+file_uploads = On
+upload_tmp_dir = "/tmp"
+upload_max_filesize = 2M
+max_file_uploads = 20
+
+; Fopen wrappers
+
+allow_url_fopen = On
+allow_url_include = Off
+;from="john@doe.com"
+;user_agent="PHP"
+default_socket_timeout = 60
+;auto_detect_line_endings = Off
--- /dev/null
+config php7-fastcgi
+ option enabled 1
+ option port '1026'
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=50
+
+SERVICE_DAEMONIZE=1
+SERVICE_WRITE_PID=1
+
+start_instance() {
+ local section="$1"
+ local enabled
+ local port
+
+ config_get_bool enabled "$section" 'enabled' 0
+ config_get port "$section" 'port' 1026
+
+ [ $enabled -gt 0 ] || return 1
+
+ PHP_FCGI_CHILDREN='' \
+ service_start /usr/bin/php-fcgi -b $port
+}
+
+start() {
+ config_load 'php7-fastcgi'
+ config_foreach start_instance 'php7-fastcgi'
+}
+
+stop() {
+ service_stop /usr/bin/php-fcgi
+}
--- /dev/null
+; Start a new pool named 'www'.
+; the variable $pool can we used in any directive and will be replaced by the
+; pool name ('www' here)
+[www]
+
+; Per pool prefix
+; It only applies on the following directives:
+; - 'slowlog'
+; - 'listen' (unixsocket)
+; - 'chroot'
+; - 'chdir'
+; - 'php_values'
+; - 'php_admin_values'
+; When not set, the global prefix (or /usr) applies instead.
+; Note: This directive can also be relative to the global prefix.
+; Default Value: none
+;prefix = /path/to/pools/$pool
+
+; Unix user/group of processes
+; Note: The user is mandatory. If the group is not set, the default user's group
+; will be used.
+user = nobody
+;group =
+
+; The address on which to accept FastCGI requests.
+; Valid syntaxes are:
+; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
+; a specific port;
+; 'port' - to listen on a TCP socket to all addresses on a
+; specific port;
+; '/path/to/unix/socket' - to listen on a unix socket.
+; Note: This value is mandatory.
+listen = /var/run/php7-fpm.sock
+
+; Set listen(2) backlog.
+; Default Value: 128 (-1 on FreeBSD and OpenBSD)
+;listen.backlog = 128
+
+; Set permissions for unix socket, if one is used. In Linux, read/write
+; permissions must be set in order to allow connections from a web server. Many
+; BSD-derived systems allow connections regardless of permissions.
+; Default Values: user and group are set as the running user
+; mode is set to 0666
+;listen.owner = www-data
+;listen.group = www-data
+;listen.mode = 0666
+
+; List of ipv4 addresses of FastCGI clients which are allowed to connect.
+; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
+; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
+; must be separated by a comma. If this value is left blank, connections will be
+; accepted from any ip address.
+; Default Value: any
+;listen.allowed_clients = 127.0.0.1
+
+; Specify the nice(2) priority to apply to the pool processes (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool processes will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; priority = -19
+
+; Choose how the process manager will control the number of child processes.
+; Possible Values:
+; static - a fixed number (pm.max_children) of child processes;
+; dynamic - the number of child processes are set dynamically based on the
+; following directives. With this process management, there will be
+; always at least 1 children.
+; pm.max_children - the maximum number of children that can
+; be alive at the same time.
+; pm.start_servers - the number of children created on startup.
+; pm.min_spare_servers - the minimum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is less than this
+; number then some children will be created.
+; pm.max_spare_servers - the maximum number of children in 'idle'
+; state (waiting to process). If the number
+; of 'idle' processes is greater than this
+; number then some children will be killed.
+; ondemand - no children are created at startup. Children will be forked when
+; new requests will connect. The following parameter are used:
+; pm.max_children - the maximum number of children that
+; can be alive at the same time.
+; pm.process_idle_timeout - The number of seconds after which
+; an idle process will be killed.
+; Note: This value is mandatory.
+pm = dynamic
+
+; The number of child processes to be created when pm is set to 'static' and the
+; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
+; This value sets the limit on the number of simultaneous requests that will be
+; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
+; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
+; CGI. The below defaults are based on a server without much resources. Don't
+; forget to tweak pm.* to fit your needs.
+; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
+; Note: This value is mandatory.
+pm.max_children = 5
+
+; The number of child processes created on startup.
+; Note: Used only when pm is set to 'dynamic'
+; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
+pm.start_servers = 2
+
+; The desired minimum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.min_spare_servers = 1
+
+; The desired maximum number of idle server processes.
+; Note: Used only when pm is set to 'dynamic'
+; Note: Mandatory when pm is set to 'dynamic'
+pm.max_spare_servers = 3
+
+; The number of seconds after which an idle process will be killed.
+; Note: Used only when pm is set to 'ondemand'
+; Default Value: 10s
+;pm.process_idle_timeout = 10s;
+
+; The number of requests each child process should execute before respawning.
+; This can be useful to work around memory leaks in 3rd party libraries. For
+; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
+; Default Value: 0
+;pm.max_requests = 500
+
+; The URI to view the FPM status page. If this value is not set, no URI will be
+; recognized as a status page. It shows the following informations:
+; pool - the name of the pool;
+; process manager - static, dynamic or ondemand;
+; start time - the date and time FPM has started;
+; start since - number of seconds since FPM has started;
+; accepted conn - the number of request accepted by the pool;
+; listen queue - the number of request in the queue of pending
+; connections (see backlog in listen(2));
+; max listen queue - the maximum number of requests in the queue
+; of pending connections since FPM has started;
+; listen queue len - the size of the socket queue of pending connections;
+; idle processes - the number of idle processes;
+; active processes - the number of active processes;
+; total processes - the number of idle + active processes;
+; max active processes - the maximum number of active processes since FPM
+; has started;
+; max children reached - number of times, the process limit has been reached,
+; when pm tries to start more children (works only for
+; pm 'dynamic' and 'ondemand');
+; Value are updated in real time.
+; Example output:
+; pool: www
+; process manager: static
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 62636
+; accepted conn: 190460
+; listen queue: 0
+; max listen queue: 1
+; listen queue len: 42
+; idle processes: 4
+; active processes: 11
+; total processes: 15
+; max active processes: 12
+; max children reached: 0
+;
+; By default the status page output is formatted as text/plain. Passing either
+; 'html', 'xml' or 'json' in the query string will return the corresponding
+; output syntax. Example:
+; http://www.foo.bar/status
+; http://www.foo.bar/status?json
+; http://www.foo.bar/status?html
+; http://www.foo.bar/status?xml
+;
+; By default the status page only outputs short status. Passing 'full' in the
+; query string will also return status for each pool process.
+; Example:
+; http://www.foo.bar/status?full
+; http://www.foo.bar/status?json&full
+; http://www.foo.bar/status?html&full
+; http://www.foo.bar/status?xml&full
+; The Full status returns for each process:
+; pid - the PID of the process;
+; state - the state of the process (Idle, Running, ...);
+; start time - the date and time the process has started;
+; start since - the number of seconds since the process has started;
+; requests - the number of requests the process has served;
+; request duration - the duration in µs of the requests;
+; request method - the request method (GET, POST, ...);
+; request URI - the request URI with the query string;
+; content length - the content length of the request (only with POST);
+; user - the user (PHP_AUTH_USER) (or '-' if not set);
+; script - the main script called (or '-' if not set);
+; last request cpu - the %cpu the last request consumed
+; it's always 0 if the process is not in Idle state
+; because CPU calculation is done when the request
+; processing has terminated;
+; last request memory - the max amount of memory the last request consumed
+; it's always 0 if the process is not in Idle state
+; because memory calculation is done when the request
+; processing has terminated;
+; If the process is in Idle state, then informations are related to the
+; last request the process has served. Otherwise informations are related to
+; the current request being served.
+; Example output:
+; ************************
+; pid: 31330
+; state: Running
+; start time: 01/Jul/2011:17:53:49 +0200
+; start since: 63087
+; requests: 12808
+; request duration: 1250261
+; request method: GET
+; request URI: /test_mem.php?N=10000
+; content length: 0
+; user: -
+; script: /home/fat/web/docs/php/test_mem.php
+; last request cpu: 0.00
+; last request memory: 0
+;
+; Note: There is a real-time FPM status monitoring sample web page available
+; It's available in: ${prefix}/share/fpm/status.html
+;
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;pm.status_path = /status
+
+; The ping URI to call the monitoring page of FPM. If this value is not set, no
+; URI will be recognized as a ping page. This could be used to test from outside
+; that FPM is alive and responding, or to
+; - create a graph of FPM availability (rrd or such);
+; - remove a server from a group if it is not responding (load balancing);
+; - trigger alerts for the operating team (24/7).
+; Note: The value must start with a leading slash (/). The value can be
+; anything, but it may not be a good idea to use the .php extension or it
+; may conflict with a real PHP file.
+; Default Value: not set
+;ping.path = /ping
+
+; This directive may be used to customize the response of a ping request. The
+; response is formatted as text/plain with a 200 response code.
+; Default Value: pong
+;ping.response = pong
+
+; The access log file
+; Default: not set
+;access.log = log/$pool.access.log
+
+; The access log format.
+; The following syntax is allowed
+; %%: the '%' character
+; %C: %CPU used by the request
+; it can accept the following format:
+; - %{user}C for user CPU only
+; - %{system}C for system CPU only
+; - %{total}C for user + system CPU (default)
+; %d: time taken to serve the request
+; it can accept the following format:
+; - %{seconds}d (default)
+; - %{miliseconds}d
+; - %{mili}d
+; - %{microseconds}d
+; - %{micro}d
+; %e: an environment variable (same as $_ENV or $_SERVER)
+; it must be associated with embraces to specify the name of the env
+; variable. Some exemples:
+; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e
+; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e
+; %f: script filename
+; %l: content-length of the request (for POST request only)
+; %m: request method
+; %M: peak of memory allocated by PHP
+; it can accept the following format:
+; - %{bytes}M (default)
+; - %{kilobytes}M
+; - %{kilo}M
+; - %{megabytes}M
+; - %{mega}M
+; %n: pool name
+; %o: ouput header
+; it must be associated with embraces to specify the name of the header:
+; - %{Content-Type}o
+; - %{X-Powered-By}o
+; - %{Transfert-Encoding}o
+; - ....
+; %p: PID of the child that serviced the request
+; %P: PID of the parent of the child that serviced the request
+; %q: the query string
+; %Q: the '?' character if query string exists
+; %r: the request URI (without the query string, see %q and %Q)
+; %R: remote IP address
+; %s: status (response code)
+; %t: server time the request was received
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; %T: time the log has been written (the request has finished)
+; it can accept a strftime(3) format:
+; %d/%b/%Y:%H:%M:%S %z (default)
+; %u: remote user
+;
+; Default: "%R - %u %t \"%m %r\" %s"
+;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
+
+; The log file for slow requests
+; Default Value: not set
+; Note: slowlog is mandatory if request_slowlog_timeout is set
+;slowlog = log/$pool.log.slow
+
+; The timeout for serving a single request after which a PHP backtrace will be
+; dumped to the 'slowlog' file. A value of '0s' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_slowlog_timeout = 0
+
+; The timeout for serving a single request after which the worker process will
+; be killed. This option should be used when the 'max_execution_time' ini option
+; does not stop script execution for some reason. A value of '0' means 'off'.
+; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
+; Default Value: 0
+;request_terminate_timeout = 0
+
+; Set open file descriptor rlimit.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Chroot to this directory at the start. This value must be defined as an
+; absolute path. When this value is not set, chroot is not used.
+; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
+; of its subdirectories. If the pool prefix is not set, the global prefix
+; will be used instead.
+; Note: chrooting is a great security feature and should be used whenever
+; possible. However, all PHP paths will be relative to the chroot
+; (error_log, sessions.save_path, ...).
+; Default Value: not set
+;chroot =
+
+; Chdir to this directory at the start.
+; Note: relative path can be used.
+; Default Value: current directory or / when chroot
+chdir = /
+
+; Redirect worker stdout and stderr into main error log. If not set, stdout and
+; stderr will be redirected to /dev/null according to FastCGI specs.
+; Note: on highloaded environement, this can cause some delay in the page
+; process time (several ms).
+; Default Value: no
+;catch_workers_output = yes
+
+; Limits the extensions of the main script FPM will allow to parse. This can
+; prevent configuration mistakes on the web server side. You should only limit
+; FPM to .php extensions to prevent malicious users to use other extensions to
+; exectute php code.
+; Note: set an empty value to allow all extensions.
+; Default Value: .php
+;security.limit_extensions = .php .php3 .php4 .php5
+
+; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
+; the current environment.
+; Default Value: clean env
+;env[HOSTNAME] = $HOSTNAME
+;env[PATH] = /usr/local/bin:/usr/bin:/bin
+;env[TMP] = /tmp
+;env[TMPDIR] = /tmp
+;env[TEMP] = /tmp
+
+; Additional php.ini defines, specific to this pool of workers. These settings
+; overwrite the values previously defined in the php.ini. The directives are the
+; same as the PHP SAPI:
+; php_value/php_flag - you can set classic ini defines which can
+; be overwritten from PHP call 'ini_set'.
+; php_admin_value/php_admin_flag - these directives won't be overwritten by
+; PHP call 'ini_set'
+; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
+
+; Defining 'extension' will load the corresponding shared extension from
+; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
+; overwrite previously defined php.ini values, but will append the new value
+; instead.
+
+; Note: path INI options can be relative and will be expanded with the prefix
+; (pool, global or /usr)
+
+; Default Value: nothing is defined by default except the values in php.ini and
+; specified at startup with the -d argument
+;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
+;php_flag[display_errors] = off
+;php_admin_value[error_log] = /var/log/fpm-php.www.log
+;php_admin_flag[log_errors] = on
+;php_admin_value[memory_limit] = 32M
--- /dev/null
+;;;;;;;;;;;;;;;;;;;;;
+; FPM Configuration ;
+;;;;;;;;;;;;;;;;;;;;;
+
+; All relative paths in this configuration file are relative to PHP's install
+; prefix (/usr). This prefix can be dynamically changed by using the
+; '-p' argument from the command line.
+
+; Include one or more files. If glob(3) exists, it is used to include a bunch of
+; files from a glob(3) pattern. This directive can be used everywhere in the
+; file.
+; Relative path can also be used. They will be prefixed by:
+; - the global prefix if it's been set (-p argument)
+; - /usr otherwise
+;include=/etc/php7/fpm/*.conf
+
+;;;;;;;;;;;;;;;;;;
+; Global Options ;
+;;;;;;;;;;;;;;;;;;
+
+[global]
+; Pid file
+; Note: the default prefix is /var
+; Default Value: none
+pid = /var/run/php7-fpm.pid
+
+; Error log file
+; If it's set to "syslog", log is sent to syslogd instead of being written
+; in a local file.
+; Note: the default prefix is /var
+; Default Value: log/php-fpm.log
+error_log = /var/log/php7-fpm.log
+
+; syslog_facility is used to specify what type of program is logging the
+; message. This lets syslogd specify that messages from different facilities
+; will be handled differently.
+; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
+; Default Value: daemon
+;syslog.facility = daemon
+
+; syslog_ident is prepended to every message. If you have multiple FPM
+; instances running on the same server, you can change the default value
+; which must suit common needs.
+; Default Value: php-fpm
+;syslog.ident = php-fpm
+
+; Log level
+; Possible Values: alert, error, warning, notice, debug
+; Default Value: notice
+;log_level = notice
+
+; If this number of child processes exit with SIGSEGV or SIGBUS within the time
+; interval set by emergency_restart_interval then FPM will restart. A value
+; of '0' means 'Off'.
+; Default Value: 0
+;emergency_restart_threshold = 0
+
+; Interval of time used by emergency_restart_interval to determine when
+; a graceful restart will be initiated. This can be useful to work around
+; accidental corruptions in an accelerator's shared memory.
+; Available Units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;emergency_restart_interval = 0
+
+; Time limit for child processes to wait for a reaction on signals from master.
+; Available units: s(econds), m(inutes), h(ours), or d(ays)
+; Default Unit: seconds
+; Default Value: 0
+;process_control_timeout = 0
+
+; The maximum number of processes FPM will fork. This has been design to control
+; the global number of processes when using dynamic PM within a lot of pools.
+; Use it with caution.
+; Note: A value of 0 indicates no limit
+; Default Value: 0
+; process.max = 128
+
+; Specify the nice(2) priority to apply to the master process (only if set)
+; The value can vary from -19 (highest priority) to 20 (lower priority)
+; Note: - It will only work if the FPM master process is launched as root
+; - The pool process will inherit the master process priority
+; unless it specified otherwise
+; Default Value: no set
+; process.priority = -19
+
+; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
+; Default Value: yes
+;daemonize = yes
+
+; Set open file descriptor rlimit for the master process.
+; Default Value: system defined value
+;rlimit_files = 1024
+
+; Set max core size rlimit for the master process.
+; Possible Values: 'unlimited' or an integer greater or equal to 0
+; Default Value: system defined value
+;rlimit_core = 0
+
+; Specify the event mechanism FPM will use. The following is available:
+; - select (any POSIX os)
+; - poll (any POSIX os)
+; - epoll (linux >= 2.5.44)
+; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
+; - /dev/poll (Solaris >= 7)
+; - port (Solaris >= 10)
+; Default Value: not set (auto detection)
+; events.mechanism = epoll
+
+;;;;;;;;;;;;;;;;;;;;
+; Pool Definitions ;
+;;;;;;;;;;;;;;;;;;;;
+
+; Multiple pools of child processes may be started with different listening
+; ports and different management options. The name of the pool will be
+; used in logs and stats. There is no limitation on the number of pools which
+; FPM can handle. Your system will tell you anyway :)
+
+; To configure the pools it is recommended to have one .conf file per
+; pool in the following directory:
+include=/etc/php7-fpm.d/*.conf
--- /dev/null
+config php7-fpm
+ option enabled 1
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=50
+
+PROG=/usr/bin/php-fpm
+CONFIG=/etc/php7-fpm.conf
+
+SERVICE_PID_FILE=/var/run/php7-fpm.pid
+
+start_instance() {
+ local section="$1"
+ local enabled
+
+ config_get_bool enabled "$section" 'enabled' 0
+
+ [ $enabled -gt 0 ] || return 1
+
+ service_start $PROG -y $CONFIG -g $SERVICE_PID_FILE
+}
+
+start() {
+ config_load 'php7-fpm'
+ config_foreach start_instance 'php7-fpm'
+}
+
+stop() {
+ service_stop $PROG
+}
--- /dev/null
+From: Joe Orton <jorton@redhat.com>
+Date: Sun, 18 Oct 2015 02:15:17 +0200
+Subject: Add support for use of the system timezone database
+
+Add support for use of the system timezone database, rather
+than embedding a copy. Discussed upstream but was not desired.
+
+History:
+r13: adapt for upstream changes to use PHP allocator
+r12: adapt for upstream changes for new zic
+r11: use canonical names to avoid more case sensitivity issues
+ round lat/long from zone.tab towards zero per builtin db
+r10: make timezone case insensitive
+r9: fix another compile error without --with-system-tzdata configured (Michael Heimpold)
+r8: fix compile error without --with-system-tzdata configured
+r7: improve check for valid timezone id to exclude directories
+r6: fix fd leak in r5, fix country code/BC flag use in
+ timezone_identifiers_list() using system db,
+ fix use of PECL timezonedb to override system db,
+r5: reverts addition of "System/Localtime" fake tzname.
+ updated for 5.3.0, parses zone.tab to pick up mapping between
+ timezone name, country code and long/lat coords
+r4: added "System/Localtime" tzname which uses /etc/localtime
+r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
+r2: add filesystem trawl to set up name alias index
+r1: initial revision
+---
+ ext/date/lib/parse_tz.c | 549 +++++++++++++++++++++++++++++++++++++++++++++++-
+ ext/date/lib/timelib.m4 | 14 ++
+ 2 files changed, 552 insertions(+), 11 deletions(-)
+
+diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
+index 20d7eea..6301dc5 100644
+--- a/ext/date/lib/parse_tz.c
++++ b/ext/date/lib/parse_tz.c
+@@ -24,6 +24,16 @@
+
+ #include "timelib.h"
+
++#ifdef HAVE_SYSTEM_TZDATA
++#include <sys/mman.h>
++#include <sys/stat.h>
++#include <limits.h>
++#include <fcntl.h>
++#include <unistd.h>
++
++#include "php_scandir.h"
++#endif
++
+ #include <stdio.h>
+
+ #ifdef HAVE_LOCALE_H
+@@ -36,8 +46,12 @@
+ #include <strings.h>
+ #endif
+
++#ifndef HAVE_SYSTEM_TZDATA
+ #define TIMELIB_SUPPORTS_V2DATA
+ #include "timezonedb.h"
++#endif
++
++#include <ctype.h>
+
+ #if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
+ # if defined(__LITTLE_ENDIAN__)
+@@ -59,6 +73,11 @@ static int read_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
+ {
+ uint32_t version;
+
++ if (memcmp(*tzf, "TZif", 4) == 0) {
++ *tzf += 20;
++ return 0;
++ }
++
+ /* read ID */
+ version = (*tzf)[3] - '0';
+ *tzf += 4;
+@@ -302,7 +321,418 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
+ }
+ }
+
+-static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
++#ifdef HAVE_SYSTEM_TZDATA
++
++#ifdef HAVE_SYSTEM_TZDATA_PREFIX
++#define ZONEINFO_PREFIX HAVE_SYSTEM_TZDATA_PREFIX
++#else
++#define ZONEINFO_PREFIX "/usr/share/zoneinfo"
++#endif
++
++/* System timezone database pointer. */
++static const timelib_tzdb *timezonedb_system;
++
++/* Hash table entry for the cache of the zone.tab mapping table. */
++struct location_info {
++ char code[2];
++ double latitude, longitude;
++ char name[64];
++ char *comment;
++ struct location_info *next;
++};
++
++/* Cache of zone.tab. */
++static struct location_info **system_location_table;
++
++/* Size of the zone.tab hash table; a random-ish prime big enough to
++ * prevent too many collisions. */
++#define LOCINFO_HASH_SIZE (1021)
++
++/* Compute a case insensitive hash of str */
++static uint32_t tz_hash(const char *str)
++{
++ const unsigned char *p = (const unsigned char *)str;
++ uint32_t hash = 5381;
++ int c;
++
++ while ((c = tolower(*p++)) != '\0') {
++ hash = (hash << 5) ^ hash ^ c;
++ }
++
++ return hash % LOCINFO_HASH_SIZE;
++}
++
++/* Parse an ISO-6709 date as used in zone.tab. Returns end of the
++ * parsed string on success, or NULL on parse error. On success,
++ * writes the parsed number to *result. */
++static char *parse_iso6709(char *p, double *result)
++{
++ double v, sign;
++ char *pend;
++ size_t len;
++
++ if (*p == '+')
++ sign = 1.0;
++ else if (*p == '-')
++ sign = -1.0;
++ else
++ return NULL;
++
++ p++;
++ for (pend = p; *pend >= '0' && *pend <= '9'; pend++)
++ ;;
++
++ /* Annoying encoding used by zone.tab has no decimal point, so use
++ * the length to determine the format:
++ *
++ * 4 = DDMM
++ * 5 = DDDMM
++ * 6 = DDMMSS
++ * 7 = DDDMMSS
++ */
++ len = pend - p;
++ if (len < 4 || len > 7) {
++ return NULL;
++ }
++
++ /* p => [D]DD */
++ v = (p[0] - '0') * 10.0 + (p[1] - '0');
++ p += 2;
++ if (len == 5 || len == 7)
++ v = v * 10.0 + (*p++ - '0');
++ /* p => MM[SS] */
++ v += (10.0 * (p[0] - '0')
++ + p[1] - '0') / 60.0;
++ p += 2;
++ /* p => [SS] */
++ if (len > 5) {
++ v += (10.0 * (p[0] - '0')
++ + p[1] - '0') / 3600.0;
++ p += 2;
++ }
++
++ /* Round to five decimal place, not because it's a good idea,
++ * but, because the builtin data uses rounded data, so, match
++ * that. */
++ *result = trunc(v * sign * 100000.0) / 100000.0;
++
++ return p;
++}
++
++/* This function parses the zone.tab file to build up the mapping of
++ * timezone to country code and geographic location, and returns a
++ * hash table. The hash table is indexed by the function:
++ *
++ * tz_hash(timezone-name)
++ */
++static struct location_info **create_location_table(void)
++{
++ struct location_info **li, *i;
++ char zone_tab[PATH_MAX];
++ char line[512];
++ FILE *fp;
++
++ strncpy(zone_tab, ZONEINFO_PREFIX "/zone.tab", sizeof zone_tab);
++
++ fp = fopen(zone_tab, "r");
++ if (!fp) {
++ return NULL;
++ }
++
++ li = calloc(LOCINFO_HASH_SIZE, sizeof *li);
++
++ while (fgets(line, sizeof line, fp)) {
++ char *p = line, *code, *name, *comment;
++ uint32_t hash;
++ double latitude, longitude;
++
++ while (isspace(*p))
++ p++;
++
++ if (*p == '#' || *p == '\0' || *p == '\n')
++ continue;
++
++ if (!isalpha(p[0]) || !isalpha(p[1]) || p[2] != '\t')
++ continue;
++
++ /* code => AA */
++ code = p;
++ p[2] = 0;
++ p += 3;
++
++ /* coords => [+-][D]DDMM[SS][+-][D]DDMM[SS] */
++ p = parse_iso6709(p, &latitude);
++ if (!p) {
++ continue;
++ }
++ p = parse_iso6709(p, &longitude);
++ if (!p) {
++ continue;
++ }
++
++ if (!p || *p != '\t') {
++ continue;
++ }
++
++ /* name = string */
++ name = ++p;
++ while (*p != '\t' && *p && *p != '\n')
++ p++;
++
++ *p++ = '\0';
++
++ /* comment = string */
++ comment = p;
++ while (*p != '\t' && *p && *p != '\n')
++ p++;
++
++ if (*p == '\n' || *p == '\t')
++ *p = '\0';
++
++ hash = tz_hash(name);
++ i = malloc(sizeof *i);
++ memcpy(i->code, code, 2);
++ strncpy(i->name, name, sizeof i->name);
++ i->comment = strdup(comment);
++ i->longitude = longitude;
++ i->latitude = latitude;
++ i->next = li[hash];
++ li[hash] = i;
++ /* printf("%s [%u, %f, %f]\n", name, hash, latitude, longitude); */
++ }
++
++ fclose(fp);
++
++ return li;
++}
++
++/* Return location info from hash table, using given timezone name.
++ * Returns NULL if the name could not be found. */
++const struct location_info *find_zone_info(struct location_info **li,
++ const char *name)
++{
++ uint32_t hash = tz_hash(name);
++ const struct location_info *l;
++
++ if (!li) {
++ return NULL;
++ }
++
++ for (l = li[hash]; l; l = l->next) {
++ if (strcasecmp(l->name, name) == 0)
++ return l;
++ }
++
++ return NULL;
++}
++
++/* Filter out some non-tzdata files and the posix/right databases, if
++ * present. */
++static int index_filter(const struct dirent *ent)
++{
++ return strcmp(ent->d_name, ".") != 0
++ && strcmp(ent->d_name, "..") != 0
++ && strcmp(ent->d_name, "posix") != 0
++ && strcmp(ent->d_name, "posixrules") != 0
++ && strcmp(ent->d_name, "right") != 0
++ && strstr(ent->d_name, ".tab") == NULL;
++}
++
++static int sysdbcmp(const void *first, const void *second)
++{
++ const timelib_tzdb_index_entry *alpha = first, *beta = second;
++
++ return strcasecmp(alpha->id, beta->id);
++}
++
++
++/* Create the zone identifier index by trawling the filesystem. */
++static void create_zone_index(timelib_tzdb *db)
++{
++ size_t dirstack_size, dirstack_top;
++ size_t index_size, index_next;
++ timelib_tzdb_index_entry *db_index;
++ char **dirstack;
++
++ /* LIFO stack to hold directory entries to scan; each slot is a
++ * directory name relative to the zoneinfo prefix. */
++ dirstack_size = 32;
++ dirstack = malloc(dirstack_size * sizeof *dirstack);
++ dirstack_top = 1;
++ dirstack[0] = strdup("");
++
++ /* Index array. */
++ index_size = 64;
++ db_index = malloc(index_size * sizeof *db_index);
++ index_next = 0;
++
++ do {
++ struct dirent **ents;
++ char name[PATH_MAX], *top;
++ int count;
++
++ /* Pop the top stack entry, and iterate through its contents. */
++ top = dirstack[--dirstack_top];
++ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s", top);
++
++ count = php_scandir(name, &ents, index_filter, php_alphasort);
++
++ while (count > 0) {
++ struct stat st;
++ const char *leaf = ents[count - 1]->d_name;
++
++ snprintf(name, sizeof name, ZONEINFO_PREFIX "/%s/%s",
++ top, leaf);
++
++ if (strlen(name) && stat(name, &st) == 0) {
++ /* Name, relative to the zoneinfo prefix. */
++ const char *root = top;
++
++ if (root[0] == '/') root++;
++
++ snprintf(name, sizeof name, "%s%s%s", root,
++ *root ? "/": "", leaf);
++
++ if (S_ISDIR(st.st_mode)) {
++ if (dirstack_top == dirstack_size) {
++ dirstack_size *= 2;
++ dirstack = realloc(dirstack,
++ dirstack_size * sizeof *dirstack);
++ }
++ dirstack[dirstack_top++] = strdup(name);
++ }
++ else {
++ if (index_next == index_size) {
++ index_size *= 2;
++ db_index = realloc(db_index,
++ index_size * sizeof *db_index);
++ }
++
++ db_index[index_next++].id = strdup(name);
++ }
++ }
++
++ free(ents[--count]);
++ }
++
++ if (count != -1) free(ents);
++ free(top);
++ } while (dirstack_top);
++
++ qsort(db_index, index_next, sizeof *db_index, sysdbcmp);
++
++ db->index = db_index;
++ db->index_size = index_next;
++
++ free(dirstack);
++}
++
++#define FAKE_HEADER "1234\0??\1??"
++#define FAKE_UTC_POS (7 - 4)
++
++/* Create a fake data segment for database 'sysdb'. */
++static void fake_data_segment(timelib_tzdb *sysdb,
++ struct location_info **info)
++{
++ size_t n;
++ char *data, *p;
++
++ data = malloc(3 * sysdb->index_size + 7);
++
++ p = mempcpy(data, FAKE_HEADER, sizeof(FAKE_HEADER) - 1);
++
++ for (n = 0; n < sysdb->index_size; n++) {
++ const struct location_info *li;
++ timelib_tzdb_index_entry *ent;
++
++ ent = (timelib_tzdb_index_entry *)&sysdb->index[n];
++
++ /* Lookup the timezone name in the hash table. */
++ if (strcmp(ent->id, "UTC") == 0) {
++ ent->pos = FAKE_UTC_POS;
++ continue;
++ }
++
++ li = find_zone_info(info, ent->id);
++ if (li) {
++ /* If found, append the BC byte and the
++ * country code; set the position for this
++ * section of timezone data. */
++ ent->pos = (p - data) - 4;
++ *p++ = '\1';
++ *p++ = li->code[0];
++ *p++ = li->code[1];
++ }
++ else {
++ /* If not found, the timezone data can
++ * point at the header. */
++ ent->pos = 0;
++ }
++ }
++
++ sysdb->data = (unsigned char *)data;
++}
++
++/* Returns true if the passed-in stat structure describes a
++ * probably-valid timezone file. */
++static int is_valid_tzfile(const struct stat *st)
++{
++ return S_ISREG(st->st_mode) && st->st_size > 20;
++}
++
++/* To allow timezone names to be used case-insensitively, find the
++ * canonical name for this timezone, if possible. */
++static const char *canonical_tzname(const char *timezone)
++{
++ if (timezonedb_system) {
++ timelib_tzdb_index_entry *ent, lookup;
++
++ lookup.id = (char *)timezone;
++
++ ent = bsearch(&lookup, timezonedb_system->index,
++ timezonedb_system->index_size, sizeof lookup,
++ sysdbcmp);
++ if (ent) {
++ return ent->id;
++ }
++ }
++
++ return timezone;
++}
++
++/* Return the mmap()ed tzfile if found, else NULL. On success, the
++ * length of the mapped data is placed in *length. */
++static char *map_tzfile(const char *timezone, size_t *length)
++{
++ char fname[PATH_MAX];
++ struct stat st;
++ char *p;
++ int fd;
++
++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++ return NULL;
++ }
++
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++ fd = open(fname, O_RDONLY);
++ if (fd == -1) {
++ return NULL;
++ } else if (fstat(fd, &st) != 0 || !is_valid_tzfile(&st)) {
++ close(fd);
++ return NULL;
++ }
++
++ *length = st.st_size;
++ p = mmap(NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
++ close(fd);
++
++ return p != MAP_FAILED ? p : NULL;
++}
++
++#endif
++
++static int inmem_seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb)
+ {
+ int left = 0, right = tzdb->index_size - 1;
+ #ifdef HAVE_SETLOCALE
+@@ -341,21 +771,88 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
+ return 0;
+ }
+
++static int seek_to_tz_position(const unsigned char **tzf, char *timezone,
++ char **map, size_t *maplen,
++ const timelib_tzdb *tzdb)
++{
++#ifdef HAVE_SYSTEM_TZDATA
++ if (tzdb == timezonedb_system) {
++ char *orig;
++
++ orig = map_tzfile(timezone, maplen);
++ if (orig == NULL) {
++ return 0;
++ }
++
++ (*tzf) = (unsigned char *)orig;
++ *map = orig;
++ return 1;
++ }
++ else
++#endif
++ {
++ return inmem_seek_to_tz_position(tzf, timezone, tzdb);
++ }
++}
++
+ const timelib_tzdb *timelib_builtin_db(void)
+ {
++#ifdef HAVE_SYSTEM_TZDATA
++ if (timezonedb_system == NULL) {
++ timelib_tzdb *tmp = malloc(sizeof *tmp);
++
++ tmp->version = "0.system";
++ tmp->data = NULL;
++ create_zone_index(tmp);
++ system_location_table = create_location_table();
++ fake_data_segment(tmp, system_location_table);
++ timezonedb_system = tmp;
++ }
++
++ return timezonedb_system;
++#else
+ return &timezonedb_builtin;
++#endif
+ }
+
+ const timelib_tzdb_index_entry *timelib_timezone_builtin_identifiers_list(int *count)
+ {
++#ifdef HAVE_SYSTEM_TZDATA
++ *count = timezonedb_system->index_size;
++ return timezonedb_system->index;
++#else
+ *count = sizeof(timezonedb_idx_builtin) / sizeof(*timezonedb_idx_builtin);
+ return timezonedb_idx_builtin;
++#endif
+ }
+
+ int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
+ {
+ const unsigned char *tzf;
+- return (seek_to_tz_position(&tzf, timezone, tzdb));
++
++#ifdef HAVE_SYSTEM_TZDATA
++ if (tzdb == timezonedb_system) {
++ char fname[PATH_MAX];
++ struct stat st;
++
++ if (timezone[0] == '\0' || strstr(timezone, "..") != NULL) {
++ return 0;
++ }
++
++ if (system_location_table) {
++ if (find_zone_info(system_location_table, timezone) != NULL) {
++ /* found in cache */
++ return 1;
++ }
++ }
++
++ snprintf(fname, sizeof fname, ZONEINFO_PREFIX "/%s", canonical_tzname(timezone));
++
++ return stat(fname, &st) == 0 && is_valid_tzfile(&st);
++ }
++#endif
++
++ return (inmem_seek_to_tz_position(&tzf, timezone, tzdb));
+ }
+
+ static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
+@@ -380,24 +877,54 @@ static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz)
+ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb)
+ {
+ const unsigned char *tzf;
++ char *memmap = NULL;
++ size_t maplen;
+ timelib_tzinfo *tmp;
+ int version;
+
+- if (seek_to_tz_position(&tzf, timezone, tzdb)) {
++ if (seek_to_tz_position(&tzf, timezone, &memmap, &maplen, tzdb)) {
+ tmp = timelib_tzinfo_ctor(timezone);
+
+ version = read_preamble(&tzf, tmp);
+ read_header(&tzf, tmp);
+ read_transistions(&tzf, tmp);
+ read_types(&tzf, tmp);
+- if (version == 2) {
+- skip_64bit_preamble(&tzf, tmp);
+- read_64bit_header(&tzf, tmp);
+- skip_64bit_transistions(&tzf, tmp);
+- skip_64bit_types(&tzf, tmp);
+- skip_posix_string(&tzf, tmp);
+- }
+- read_location(&tzf, tmp);
++
++#ifdef HAVE_SYSTEM_TZDATA
++ if (memmap) {
++ const struct location_info *li;
++
++ /* TZif-style - grok the location info from the system database,
++ * if possible. */
++
++ if ((li = find_zone_info(system_location_table, timezone)) != NULL) {
++ tmp->location.comments = timelib_strdup(li->comment);
++ strncpy(tmp->location.country_code, li->code, 2);
++ tmp->location.longitude = li->longitude;
++ tmp->location.latitude = li->latitude;
++ tmp->bc = 1;
++ }
++ else {
++ strcpy(tmp->location.country_code, "??");
++ tmp->bc = 0;
++ tmp->location.comments = timelib_strdup("");
++ }
++
++ /* Now done with the mmap segment - discard it. */
++ munmap(memmap, maplen);
++ } else
++#endif
++ {
++ /* PHP-style - use the embedded info. */
++ if (version == 2) {
++ skip_64bit_preamble(&tzf, tmp);
++ read_64bit_header(&tzf, tmp);
++ skip_64bit_transistions(&tzf, tmp);
++ skip_64bit_types(&tzf, tmp);
++ skip_posix_string(&tzf, tmp);
++ }
++ read_location(&tzf, tmp);
++ }
+ } else {
+ tmp = NULL;
+ }
+diff --git a/ext/date/lib/timelib.m4 b/ext/date/lib/timelib.m4
+index c725572..4c837c7 100644
+--- a/ext/date/lib/timelib.m4
++++ b/ext/date/lib/timelib.m4
+@@ -78,3 +78,17 @@ stdlib.h
+
+ dnl Check for strtoll, atoll
+ AC_CHECK_FUNCS(strtoll atoll strftime)
++
++PHP_ARG_WITH(system-tzdata, for use of system timezone data,
++[ --with-system-tzdata[=DIR] to specify use of system timezone data],
++no, no)
++
++if test "$PHP_SYSTEM_TZDATA" != "no"; then
++ AC_DEFINE(HAVE_SYSTEM_TZDATA, 1, [Define if system timezone data is used])
++
++ if test "$PHP_SYSTEM_TZDATA" != "yes"; then
++ AC_DEFINE_UNQUOTED(HAVE_SYSTEM_TZDATA_PREFIX, "$PHP_SYSTEM_TZDATA",
++ [Define for location of system timezone data])
++ fi
++fi
++
--- /dev/null
+From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
+Date: Sat, 2 May 2015 10:26:53 +0200
+Subject: dont-gitclean-in-build
+
+---
+ build/build.mk | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/build/build.mk b/build/build.mk
+index 9452984..b964def 100644
+--- a/build/build.mk
++++ b/build/build.mk
+@@ -63,6 +63,5 @@ gitclean-work:
+ @if (test ! -f '.git/info/exclude' || grep -s "git-ls-files" .git/info/exclude); then \
+ (echo "Rebuild .git/info/exclude" && echo '*.o' > .git/info/exclude && git svn propget svn:ignore | grep -v config.nice >> .git/info/exclude); \
+ fi; \
+- git clean -X -f -d;
+
+ .PHONY: $(ALWAYS) snapshot
--- /dev/null
+From: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
+Date: Sat, 2 May 2015 10:26:56 +0200
+Subject: Use system timezone
+
+Upstream don't want this patch. See
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=730771 for a summary.
+
+This delta is recovered from previous versions of the system timezone patch in
+Debian, and appears to have inadvertently been dropped. Author unknown.
+
+To be used in tandem with use_embedded_timezonedb.patch and use_embedded_timezonedb_fixes.patch.
+---
+ ext/date/php_date.c | 17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+diff --git a/ext/date/php_date.c b/ext/date/php_date.c
+index e780b2e..2b5a528 100644
+--- a/ext/date/php_date.c
++++ b/ext/date/php_date.c
+@@ -992,6 +992,23 @@ static char* guess_timezone(const timelib_tzdb *tzdb)
+ DATEG(timezone_valid) = 1;
+ return DATEG(default_timezone);
+ }
++ /* Try to guess timezone from system information */
++ {
++ struct tm *ta, tmbuf;
++ time_t the_time;
++ char *tzid = NULL;
++
++ the_time = time(NULL);
++ ta = php_localtime_r(&the_time, &tmbuf);
++ if (ta) {
++ tzid = timelib_timezone_id_from_abbr(ta->tm_zone, ta->tm_gmtoff, ta->tm_isdst);
++ }
++ if (! tzid) {
++ tzid = "UTC";
++ }
++
++ return tzid;
++ }
+ /* Fallback to UTC */
+ return "UTC";
+ }
--- /dev/null
+From: Thijs Kinkhorst <thijs@debian.org>
+Date: Wed, 15 Jun 2016 09:18:03 +0200
+Subject: Add patch to remove build timestamps from generated binaries.
+
+---
+ ext/standard/info.c | 1 -
+ sapi/apache2handler/config.m4 | 15 +++------------
+ sapi/cgi/cgi_main.c | 4 ++--
+ sapi/cli/php_cli.c | 4 ++--
+ sapi/fpm/fpm/fpm_main.c | 4 ++--
+ sapi/litespeed/lsapi_main.c | 4 ++--
+ sapi/phpdbg/phpdbg.c | 4 +---
+ 7 files changed, 12 insertions(+), 24 deletions(-)
+
+diff --git a/ext/standard/info.c b/ext/standard/info.c
+index e6eaac3..024e5c9 100644
+--- a/ext/standard/info.c
++++ b/ext/standard/info.c
+@@ -863,7 +863,6 @@ PHPAPI void php_print_info(int flag)
+ php_info_print_box_end();
+ php_info_print_table_start();
+ php_info_print_table_row(2, "System", ZSTR_VAL(php_uname));
+- php_info_print_table_row(2, "Build Date", __DATE__ " " __TIME__);
+ #ifdef COMPILER
+ php_info_print_table_row(2, "Compiler", COMPILER);
+ #endif
+diff --git a/sapi/apache2handler/config.m4 b/sapi/apache2handler/config.m4
+index f286b1a..fba92b8 100644
+--- a/sapi/apache2handler/config.m4
++++ b/sapi/apache2handler/config.m4
+@@ -59,18 +59,9 @@ if test "$PHP_APXS2" != "no"; then
+ APACHE_CFLAGS="$APACHE_CPPFLAGS -I$APXS_INCLUDEDIR $APR_CFLAGS $APU_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
+
+ APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
+- if test -z `$APXS -q SYSCONFDIR`; then
+- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+- -i -n php7"
+- else
+- APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
+- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+- \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
+- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+- -S SYSCONFDIR='$APXS_SYSCONFDIR' \
+- -i -a -n php7"
+- fi
++ INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
++ $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
++ -i -n php7"
+
+ case $host_alias in
+ *aix*)
+diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
+index 8983b53..589e299 100644
+--- a/sapi/cgi/cgi_main.c
++++ b/sapi/cgi/cgi_main.c
+@@ -2216,9 +2216,9 @@ consult the installation file that came with this distribution, or visit \n\
+ SG(request_info).no_headers = 1;
+ }
+ #if ZEND_DEBUG
+- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #else
+- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++ php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #endif
+ php_request_shutdown((void *) 0);
+ fcgi_shutdown();
+diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
+index 978c8b3..3ee61a4 100644
+--- a/sapi/cli/php_cli.c
++++ b/sapi/cli/php_cli.c
+@@ -682,8 +682,8 @@ static int do_cli(int argc, char **argv) /* {{{ */
+ goto out;
+
+ case 'v': /* show php version & quit */
+- php_printf("PHP %s (%s) (built: %s %s) ( %s)\nCopyright (c) 1997-2016 The PHP Group\n%s",
+- PHP_VERSION, cli_sapi_module.name, __DATE__, __TIME__,
++ php_printf("PHP %s (%s) ( %s)\nCopyright (c) 1997-2016 The PHP Group\n%s",
++ PHP_VERSION, cli_sapi_module.name,
+ #if ZTS
+ "ZTS "
+ #else
+diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
+index 5adeb63..5e60255 100644
+--- a/sapi/fpm/fpm/fpm_main.c
++++ b/sapi/fpm/fpm/fpm_main.c
+@@ -1757,9 +1757,9 @@ int main(int argc, char *argv[])
+ SG(request_info).no_headers = 1;
+
+ #if ZEND_DEBUG
+- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #else
+- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++ php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #endif
+ php_request_shutdown((void *) 0);
+ fcgi_shutdown();
+diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
+index b0ea105..4feb8f3 100644
+--- a/sapi/litespeed/lsapi_main.c
++++ b/sapi/litespeed/lsapi_main.c
+@@ -811,9 +811,9 @@ static int cli_main( int argc, char * argv[] )
+ case 'v':
+ if (php_request_startup() != FAILURE) {
+ #if ZEND_DEBUG
+- php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++ php_printf("PHP %s (%s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #else
+- php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version());
++ php_printf("PHP %s (%s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, get_zend_version());
+ #endif
+ #ifdef PHP_OUTPUT_NEWAPI
+ php_output_end_all();
+diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
+index 68a164c..82565d8 100644
+--- a/sapi/phpdbg/phpdbg.c
++++ b/sapi/phpdbg/phpdbg.c
+@@ -1520,10 +1520,8 @@ phpdbg_main:
+ sapi_startup(phpdbg);
+ phpdbg->startup(phpdbg);
+ printf(
+- "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2016 The PHP Group\n%s",
++ "phpdbg %s\nPHP %s, Copyright (c) 1997-2016 The PHP Group\n%s",
+ PHPDBG_VERSION,
+- __DATE__,
+- __TIME__,
+ PHP_VERSION,
+ get_zend_version()
+ );
--- /dev/null
+From: =?utf-8?q?Ond=C5=99ej_Sur=C3=BD?= <ondrej@sury.org>
+Date: Wed, 29 Jul 2015 14:37:55 +0200
+Subject: Remove W3C validation icon to not expose the reader's IP address to
+ potential tracking.
+
+---
+ sapi/fpm/status.html.in | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/sapi/fpm/status.html.in b/sapi/fpm/status.html.in
+index 86492d7..31c31ff 100644
+--- a/sapi/fpm/status.html.in
++++ b/sapi/fpm/status.html.in
+@@ -71,11 +71,6 @@
+ <tr class="h"><th>PID↓</th><th>Start Time</th><th>Start Since</th><th>Requests Served</th><th>Request Duration</th><th>Request method</th><th>Request URI</th><th>Content Length</th><th>User</th><th>Script</th><th>Last Request %CPU</th><th>Last Request Memory</th></tr>
+ </table>
+ </div>
+- <p>
+- <a href="http://validator.w3.org/check?uri=referer">
+- <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Transitional" height="31" width="88" />
+- </a>
+- </p>
+ <script type="text/javascript">
+ <!--
+ var xhr_object = null;
--- /dev/null
+--- a/ext/standard/php_crypt_r.c
++++ b/ext/standard/php_crypt_r.c
+@@ -96,6 +96,8 @@ void _crypt_extended_init_r(void)
+ InterlockedIncrement(&initialized);
+ #elif defined(HAVE_SYNC_FETCH_AND_ADD)
+ __sync_fetch_and_add(&initialized, 1);
++#elif (defined(__GNUC__) && (__GNUC__ == 3))
++ initialized = 1;
+ #elif defined(HAVE_ATOMIC_H) /* Solaris 10 defines atomic API within */
+ membar_producer();
+ atomic_add_int(&initialized, 1);
--- /dev/null
+From dc8bb6a53bfdfe42d9ae81d4e78c6155ad4bfd6e Mon Sep 17 00:00:00 2001
+From: Michael Heimpold <mhei@heimpold.de>
+Date: Sun, 17 May 2015 16:50:50 +0200
+Subject: [PATCH] ext/opcache: fix detection of shm/mmap
+
+The detection of sysvipc and mmap doesn't work well when cross-compiling,
+so I decided to only check for the availability of the functions involved.
+This is not a clean solution, but works for now(tm) :-)
+
+It should be discussed with upstream to find a better solution.
+
+This solves the issue reported at
+https://github.com/openwrt/packages/issues/1010
+and makes opcache usable on OpenWrt.
+
+Signed-off-by: Michael Heimpold <mhei@heimpold.de>
+---
+ ext/opcache/config.m4 | 122 ++-----------------------------------------------
+ 1 file changed, 4 insertions(+), 118 deletions(-)
+
+diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
+index b7e4835..7b6c0aa 100644
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -11,127 +11,13 @@ if test "$PHP_OPCACHE" != "no"; then
+ AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function])
+ ])
+
+- AC_MSG_CHECKING(for sysvipc shared memory support)
+- AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <sys/wait.h>
+-#include <sys/ipc.h>
+-#include <sys/shm.h>
+-#include <unistd.h>
+-#include <string.h>
+-
+-int main() {
+- pid_t pid;
+- int status;
+- int ipc_id;
+- char *shm;
+- struct shmid_ds shmbuf;
+-
+- ipc_id = shmget(IPC_PRIVATE, 4096, (IPC_CREAT | SHM_R | SHM_W));
+- if (ipc_id == -1) {
+- return 1;
+- }
+-
+- shm = shmat(ipc_id, NULL, 0);
+- if (shm == (void *)-1) {
+- shmctl(ipc_id, IPC_RMID, NULL);
+- return 2;
+- }
+-
+- if (shmctl(ipc_id, IPC_STAT, &shmbuf) != 0) {
+- shmdt(shm);
+- shmctl(ipc_id, IPC_RMID, NULL);
+- return 3;
+- }
+-
+- shmbuf.shm_perm.uid = getuid();
+- shmbuf.shm_perm.gid = getgid();
+- shmbuf.shm_perm.mode = 0600;
+-
+- if (shmctl(ipc_id, IPC_SET, &shmbuf) != 0) {
+- shmdt(shm);
+- shmctl(ipc_id, IPC_RMID, NULL);
+- return 4;
+- }
+-
+- shmctl(ipc_id, IPC_RMID, NULL);
+-
+- strcpy(shm, "hello");
+-
+- pid = fork();
+- if (pid < 0) {
+- return 5;
+- } else if (pid == 0) {
+- strcpy(shm, "bye");
+- return 6;
+- }
+- if (wait(&status) != pid) {
+- return 7;
+- }
+- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
+- return 8;
+- }
+- if (strcmp(shm, "bye") != 0) {
+- return 9;
+- }
+- return 0;
+-}
+-],dnl
++ AC_CHECK_FUNC(shmget,[
+ AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
+- msg=yes,msg=no,msg=no)
+- AC_MSG_RESULT([$msg])
+-
+- AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
+- AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <sys/wait.h>
+-#include <sys/mman.h>
+-#include <unistd.h>
+-#include <string.h>
+-
+-#ifndef MAP_ANON
+-# ifdef MAP_ANONYMOUS
+-# define MAP_ANON MAP_ANONYMOUS
+-# endif
+-#endif
+-#ifndef MAP_FAILED
+-# define MAP_FAILED ((void*)-1)
+-#endif
+-
+-int main() {
+- pid_t pid;
+- int status;
+- char *shm;
+-
+- shm = mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
+- if (shm == MAP_FAILED) {
+- return 1;
+- }
+-
+- strcpy(shm, "hello");
++ ])
+
+- pid = fork();
+- if (pid < 0) {
+- return 5;
+- } else if (pid == 0) {
+- strcpy(shm, "bye");
+- return 6;
+- }
+- if (wait(&status) != pid) {
+- return 7;
+- }
+- if (!WIFEXITED(status) || WEXITSTATUS(status) != 6) {
+- return 8;
+- }
+- if (strcmp(shm, "bye") != 0) {
+- return 9;
+- }
+- return 0;
+-}
+-],dnl
++ AC_CHECK_FUNC(mmap,[
+ AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
+- msg=yes,msg=no,msg=no)
+- AC_MSG_RESULT([$msg])
++ ])
+
+ AC_MSG_CHECKING(for mmap() using /dev/zero shared memory support)
+ AC_TRY_RUN([
+--
+1.7.10.4
+
--- /dev/null
+--- a/ext/gd/libgd/gdkanji.c
++++ b/ext/gd/libgd/gdkanji.c
+@@ -9,6 +9,11 @@
+ #include "gdhelpers.h"
+
+ #include <stdarg.h>
++
++/* force usage of internal conversation routine */
++#undef HAVE_ICONV_H
++#undef HAVE_ICONV
++
+ #if defined(HAVE_ICONV_H) || defined(HAVE_ICONV)
+ #include <iconv.h>
+ #ifdef HAVE_ERRNO_H
--- /dev/null
+--- a/configure.in
++++ b/configure.in
+@@ -453,7 +453,10 @@ PHP_CHECK_FUNC(gethostname, nsl)
+ PHP_CHECK_FUNC(gethostbyaddr, nsl)
+ PHP_CHECK_FUNC(yp_get_default_domain, nsl)
+
+-PHP_CHECK_FUNC(dlopen, dl)
++PHP_ADD_LIBRARY(dl)
++PHP_DEF_HAVE(dlopen)
++PHP_DEF_HAVE(libdl)
++ac_cv_func_dlopen=yes
+ if test "$ac_cv_func_dlopen" = "yes"; then
+ AC_DEFINE(HAVE_LIBDL, 1, [ ])
+ fi
+--- a/ext/fileinfo/config.m4
++++ b/ext/fileinfo/config.m4
+@@ -46,6 +46,10 @@ int main(void)
+ AC_MSG_RESULT(no)
+ AC_MSG_NOTICE(using libmagic strcasestr implementation)
+ libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
++ ],[
++ dnl cross-compiling; assume not present
++ AC_MSG_NOTICE(using libmagic strcasestr implementation)
++ libmagic_sources="$libmagic_sources libmagic/strcasestr.c"
+ ])
+
+ PHP_NEW_EXTENSION(fileinfo, fileinfo.c $libmagic_sources, $ext_shared,,-I@ext_srcdir@/libmagic)
+--- a/ext/opcache/config.m4
++++ b/ext/opcache/config.m4
+@@ -227,7 +227,14 @@ AC_TRY_RUN([
+ flock_type=linux
+ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
+ AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
++], [
++ AC_MSG_RESULT("no")
++], [
++ dnl cross-compiling; assume Linux
++ flock_type=linux
++ AC_DEFINE([HAVE_FLOCK_LINUX], [], [Struct flock is Linux-type])
++ AC_MSG_RESULT("yes")
++])
+
+ AC_MSG_CHECKING("whether flock struct is BSD ordered")
+ AC_TRY_RUN([
+@@ -243,7 +250,12 @@ AC_TRY_RUN([
+ flock_type=bsd
+ AC_DEFINE([HAVE_FLOCK_BSD], [], [Struct flock is BSD-type])
+ AC_MSG_RESULT("yes")
+-], AC_MSG_RESULT("no") )
++], [
++ AC_MSG_RESULT("no")
++], [
++ dnl cross-compiling; assume Linux
++ AC_MSG_RESULT("no")
++])
+
+ if test "$flock_type" == "unknown"; then
+ AC_MSG_ERROR([Don't know how to define struct flock on this system[,] set --enable-opcache=no])
--- /dev/null
+--- a/ext/phar/config.m4 2016-08-17 21:50:58.000000000 +0200
++++ b/ext/phar/config.m4 2016-09-20 22:21:28.494934775 +0200
+@@ -26,7 +26,7 @@
+ fi
+ PHP_ADD_EXTENSION_DEP(phar, hash, true)
+ PHP_ADD_EXTENSION_DEP(phar, spl, true)
+- PHP_ADD_MAKEFILE_FRAGMENT
++ #PHP_ADD_MAKEFILE_FRAGMENT
+
+ PHP_INSTALL_HEADERS([ext/phar], [php_phar.h])
+
+--- a/configure.in 2016-09-20 22:26:38.000000000 +0200
++++ b/configure.in 2016-09-20 22:42:30.380101556 +0200
+@@ -1448,13 +1448,13 @@
+ INLINE_CFLAGS="$INLINE_CFLAGS $standard_libtool_flag"
+ CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
+
+-if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
+- pharcmd=pharcmd
+- pharcmd_install=install-pharcmd
+-else
++#if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
++# pharcmd=pharcmd
++# pharcmd_install=install-pharcmd
++#else
+ pharcmd=
+ pharcmd_install=
+-fi;
++#fi;
+
+ all_targets="$lcov_target \$(OVERALL_TARGET) \$(PHP_MODULES) \$(PHP_ZEND_EX) \$(PHP_BINARIES) $pharcmd"
+ install_targets="$install_sapi $install_modules $install_binaries install-build install-headers install-programs $install_pear $pharcmd_install"
--- /dev/null
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Package/php7-pecl/Default
+ SUBMENU:=PHP
+ SECTION:=lang
+ CATEGORY:=Languages
+ URL:=http://pecl.php.net/
+ DEPENDS:=php7
+endef
+
+define Build/Prepare
+ $(Build/Prepare/Default)
+ ( cd $(PKG_BUILD_DIR); $(STAGING_DIR)/usr/bin/phpize7 )
+endef
+
+CONFIGURE_ARGS+= \
+ --with-php-config=$(STAGING_DIR)/usr/bin/php7-config
+
+define PECLPackage
+
+ define Package/php7-pecl-$(1)
+ $(call Package/php7-pecl/Default)
+ TITLE:=$(2)
+
+ ifneq ($(3),)
+ DEPENDS+=$(3)
+ endif
+ endef
+
+ define Package/php7-pecl-$(1)/install
+ $(INSTALL_DIR) $$(1)/usr/lib/php
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/modules/$(subst -,_,$(1)).so $$(1)/usr/lib/php/
+ $(INSTALL_DIR) $$(1)/etc/php7
+ ifeq ($(5),zend)
+ echo "zend_extension=/usr/lib/php/$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+ else
+ echo "extension=$(subst -,_,$(1)).so" > $$(1)/etc/php7/$(if $(4),$(4),20)_$(subst -,_,$(1)).ini
+ endif
+ endef
+
+endef
include $(TOPDIR)/rules.mk
PKG_NAME:=pillow
-PKG_VERSION:=3.2.0
+PKG_VERSION:=3.3.1
PKG_RELEASE=1
PKG_LICENSE:=CUSTOM
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/python-pillow/Pillow.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=344cb709ed0111adcc6ad47cc007507c3f5efeb3
+PKG_SOURCE_VERSION:=aab33141f381d5577cdef9033b7fdff79122a10c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DEPENDS:=python python-setuptools
CATEGORY:=Languages
TITLE:=The friendly PIL fork
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
- URL:=https://www.pillowproject.com/
+ URL:=https://python-pillow.org/
DEPENDS:=+python +libfreetype +libjpeg +zlib +libtiff
endef
-diff -rupN Pillow-3.2.0.orig/setup.py Pillow-3.2.0/setup.py
---- Pillow-3.2.0.orig/setup.py 2016-04-01 14:17:23.000000000 +0200
-+++ Pillow-3.2.0/setup.py 2016-04-28 23:24:08.633969175 +0200
-@@ -90,11 +90,11 @@ except (ImportError, OSError):
+diff -rupN pillow-3.3.1.orig/setup.py pillow-3.3.1/setup.py
+--- pillow-3.3.1.orig/setup.py 2016-08-22 17:45:05.000000000 +0200
++++ pillow-3.3.1/setup.py 2016-08-22 18:09:51.947745155 +0200
+@@ -111,12 +111,12 @@ except (ImportError, OSError):
+
NAME = 'Pillow'
- PILLOW_VERSION = '3.2.0'
- TCL_ROOT = None
+ PILLOW_VERSION = '3.3.1'
-JPEG_ROOT = None
+JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
JPEG2K_ROOT = None
-ZLIB_ROOT = None
++ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+ IMAGEQUANT_ROOT = None
-TIFF_ROOT = None
-FREETYPE_ROOT = None
-+ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
LCMS_ROOT = None
-@@ -187,129 +187,6 @@ class pil_build_ext(build_ext):
- _add_directory(library_dirs, os.path.join(prefix, "lib"))
+@@ -221,161 +221,6 @@ class pil_build_ext(build_ext):
_add_directory(include_dirs, os.path.join(prefix, "include"))
-- #
+ #
- # add platform directories
-
-- if sys.platform == "cygwin":
+- if self.disable_platform_guessing:
+- pass
+-
+- elif sys.platform == "cygwin":
- # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory
- _add_directory(library_dirs,
- os.path.join("/usr/lib", "python%s" %
- _add_directory(include_dirs, "/opt/local/include")
-
- # if Homebrew is installed, use its lib and include directories
-- import subprocess
- try:
- prefix = subprocess.check_output(['brew', '--prefix']).strip(
- ).decode('latin1')
- raise ValueError(
- "Unable to identify Linux platform: `%s`" % platform_)
-
-- # XXX Kludge. Above /\ we brute force support multiarch. Here we
-- # try Barry's more general approach. Afterward, something should
-- # work ;-)
-- self.add_multiarch_paths()
+- # XXX Kludge. Above /\ we brute force support multiarch. Here we
+- # try Barry's more general approach. Afterward, something should
+- # work ;-)
+- self.add_multiarch_paths()
-
- elif sys.platform.startswith("gnu"):
- self.add_multiarch_paths()
-
- # FIXME: check /opt/stuff directories here?
-
- # locate tkinter libraries
-
- if _tkinter:
-@@ -343,21 +220,6 @@ class pil_build_ext(build_ext):
- else:
- TCL_ROOT = None
-
-- # add standard directories
+- # standard locations
+- if not self.disable_platform_guessing:
+- _add_directory(library_dirs, "/usr/local/lib")
+- _add_directory(include_dirs, "/usr/local/include")
-
-- # look for tcl specific subdirectory (e.g debian)
-- if _tkinter:
-- tcl_dir = "/usr/include/tcl" + TCL_VERSION
-- if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
-- _add_directory(include_dirs, tcl_dir)
+- _add_directory(library_dirs, "/usr/lib")
+- _add_directory(include_dirs, "/usr/include")
+- # alpine, at least
+- _add_directory(library_dirs, "/lib")
+-
+- # on Windows, look for the OpenJPEG libraries in the location that
+- # the official installer puts them
+- if sys.platform == "win32":
+- program_files = os.environ.get('ProgramFiles', '')
+- best_version = (0, 0)
+- best_path = None
+- for name in os.listdir(program_files):
+- if name.startswith('OpenJPEG '):
+- version = tuple([int(x) for x in name[9:].strip().split(
+- '.')])
+- if version > best_version:
+- best_version = version
+- best_path = os.path.join(program_files, name)
+-
+- if best_path:
+- _dbg('Adding %s to search list', best_path)
+- _add_directory(library_dirs, os.path.join(best_path, 'lib'))
+- _add_directory(include_dirs,
+- os.path.join(best_path, 'include'))
-
-- # standard locations
-- _add_directory(library_dirs, "/usr/local/lib")
-- _add_directory(include_dirs, "/usr/local/include")
--
-- _add_directory(library_dirs, "/usr/lib")
-- _add_directory(include_dirs, "/usr/include")
--
- # on Windows, look for the OpenJPEG libraries in the location that
- # the official installer puts them
- if sys.platform == "win32":
-@@ -449,7 +311,7 @@ class pil_build_ext(build_ext):
- # look for freetype2 include files
- freetype_version = 0
- for dir in self.compiler.include_dirs:
-- if os.path.isfile(os.path.join(dir, "ft2build.h")):
-+ if os.path.isfile(os.path.join(dir, "freetype2/ft2build.h")):
- freetype_version = 21
- dir = os.path.join(dir, "freetype2")
- break
+- #
+ # insert new dirs *before* default libs, to avoid conflicts
+ # between Python PYD stub libs and real libraries
+
include $(TOPDIR)/rules.mk
PKG_NAME:=attrs
-PKG_VERSION:=16.0.0
+PKG_VERSION:=16.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/89/15/80d388d696c8c8ba14874635207aa698eb30ef1242dbb54d9eccf0e927ff
-PKG_MD5SUM:=5bcdd418f6e83e580434c63067c08a73
+PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/71/1682316894ed80b362b9102e7a10997136d8dc1213c36a9f0515c451373a
+PKG_MD5SUM:=442b73d049af046ced010671b7bfd0e9
PKG_BUILD_DEPENDS:=python python-setuptools
include $(TOPDIR)/rules.mk
PKG_NAME:=cffi
-PKG_VERSION:=1.7.0
+PKG_VERSION:=1.8.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/83/3c/00b553fd05ae32f27b3637f705c413c4ce71290aa9b4c4764df694e906d9
-PKG_MD5SUM:=34122a545060cee58bab88feab57006d
+PKG_SOURCE_URL:=https://pypi.python.org/packages/0a/f3/686af8873b70028fccf67b15c78fd4e4667a3da995007afc71e786d61b0a
+PKG_MD5SUM:=c8e877fe0426a99d0cf5872cf2f95b27
PKG_BUILD_DEPENDS:=python python-setuptools
HOST_BUILD_DEPENDS:=libffi/host python/host python-setuptools/host python-pycparser/host
endef
define Host/Compile
- $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR)/host")
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(HOST_BUILD_PREFIX)")
endef
define Host/Install
include $(TOPDIR)/rules.mk
PKG_NAME:=cryptography
-PKG_VERSION:=1.3.1
+PKG_VERSION:=1.5.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/c/cryptography
-PKG_MD5SUM:=bc8148d2ff2d80fef8ef2d2e856b3a7f
+PKG_SOURCE_URL:=https://pypi.python.org/packages/21/e1/37fc14f9d77924e84ba0dcb88eb8352db914583af229287c6c965d66ba0d
+PKG_MD5SUM:=66a3e01f5f436d2413ef47b7e6bb7729
PKG_BUILD_DEPENDS:=python-cffi/host
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-dateutil
+PKG_VERSION:=2.5.2
+PKG_RELEASE:=2
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://pypi.python.org/packages/source/p/python-dateutil/
+PKG_MD5SUM:=eafe168e8f404bf384514f5116eedbb6
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-dateutil
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=Extensions to the standard Python datetime module
+ URL:=https://dateutil.readthedocs.org/
+ DEPENDS:=+python +python-six
+endef
+
+define Package/python-dateutil/description
+ Extensions to the standard Python datetime module
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-dateutil/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-dateutil))
#
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=enum34
-PKG_VERSION:=1.1.2
-PKG_RELEASE:=1
+PKG_VERSION:=1.1.6
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/e/enum34
-PKG_MD5SUM:=025bb71b3f9d2fad15d0ee53e48dc873
+PKG_SOURCE_URL:=https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876
+PKG_MD5SUM:=5f13a0841a61f7fc295c514490d120d0
+
+PKG_BUILD_DEPENDS:=python python-setuptools
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=enum/LICENSE
define PyPackage/python-enum34/filespec
+|$(PYTHON_PKG_DIR)
--|$(PYTHON_PKG_DIR)/enum/test_enum.py
+-|$(PYTHON_PKG_DIR)/enum/test.py
endef
define Build/Compile
-diff -Nur a/setup.py b/setup.py
---- a/setup.py 2015-11-29 17:31:14.000000000 +0800
-+++ b/setup.py 2015-12-07 18:39:00.863378684 +0800
-@@ -13,15 +13,6 @@
- version='1.1.1',\r
- url='https://pypi.python.org/pypi/enum34',\r
- packages=['enum'],\r
-- package_data={\r
-- 'enum' : [\r
-- 'LICENSE',\r
-- 'README',\r
-- 'doc/enum.rst',\r
-- 'doc/enum.pdf',\r
-- 'test_enum.py',\r
-- ]\r
-- },\r
- license='BSD License',\r
- description='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4',\r
- long_description=long_desc,\r
+diff -r f24487b45cd0 setup.py
+--- a/setup.py Sun May 15 20:28:23 2016 -0700
++++ b/setup.py Wed Jul 27 22:49:13 2016 +0800
+@@ -63,15 +63,6 @@
+ version='1.1.6',\r
+ url='https://bitbucket.org/stoneleaf/enum34',\r
+ packages=['enum'],\r
+- package_data={\r
+- 'enum' : [\r
+- 'LICENSE',\r
+- 'README',\r
+- 'doc/enum.rst',\r
+- 'doc/enum.pdf',\r
+- 'test.py',\r
+- ]\r
+- },\r
+ license='BSD License',\r
+ description='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4',\r
+ long_description=long_desc,\r
#
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gmpy2
-PKG_VERSION:=2.0.7
+PKG_VERSION:=2.0.8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/g/gmpy2
-PKG_MD5SUM:=b5aada3ee5afb316ea94604f45192054
+PKG_SOURCE_URL:=https://pypi.python.org/packages/90/f4/9a2e384b325b69bc5827b9a6510a8fb4a51698c915c06a3f25a86458892a
+PKG_MD5SUM:=56d40bddcf8f22be0a36d60f764f3241
PKG_LICENSE:=LGPL-3.0+
PKG_LICENSE_FILES:=COPYING.LESSER
include $(TOPDIR)/rules.mk
PKG_NAME:=ipaddress
-PKG_VERSION:=1.0.16
+PKG_VERSION:=1.0.17
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/i/ipaddress
-PKG_MD5SUM:=1e27b62aa20f5b6fc200b2bdbf0d0847
+PKG_SOURCE_URL:=https://pypi.python.org/packages/bb/26/3b64955ff73f9e3155079b9ed31812afdfa5333b5c76387454d651ef593a
+PKG_MD5SUM:=8bbf0326719fafb1f453921ef96729fe
PKG_BUILD_DEPENDS:=python python-setuptools
--- /dev/null
+#
+# Copyright (C) 2016 Yousong Zhou <yszhou4tech@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-packages
+PKG_VERSION:=1.0
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
+
+#
+# NOTE: move the host module installation to Host/Compile when
+# HOST_CONFIG_DEPENDS is supported
+#
+# NOTE: PKG_CONFIG_DEPENDS cannot correctly track changes of string type config
+# options, so you may want to do manual cleanup on config change.
+#
+PKG_CONFIG_DEPENDS:= \
+ CONFIG_PACKAGE_python-packages-list-host \
+ CONFIG_PACKAGE_python-packages-list \
+ CONFIG_PACKAGE_python-packages-list-cleanup \
+ CONFIG_PACKAGE_python-packages-envs \
+ CONFIG_PACKAGE_python-packages-extra-deps \
+ CONFIG_PACKAGE_python-packages-index-url \
+ CONFIG_PACKAGE_python-packages-pip-opts \
+
+PKG_BUILD_DEPENDS:=python python-pip/host
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-host.mk)
+$(call include_mk, python-package.mk)
+
+define Package/python-packages
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=A dummy package for packaging python modules with pip
+ DEPENDS:=@DEVEL +python
+endef
+
+define Package/python-packages/config
+if PACKAGE_python-packages
+config PACKAGE_python-packages-list-host
+ string "List of python packages to install on host"
+config PACKAGE_python-packages-list
+ string "List of python packages to install on target"
+config PACKAGE_python-packages-list-cleanup
+ string "List of python packages to cleanup to avoid clash with existing packages"
+config PACKAGE_python-packages-envs
+ string "Extra environment variables to pass on to pip and its children on target build"
+config PACKAGE_python-packages-extra-deps
+ string "List of deps fulfilled but not tracked by the build system"
+config PACKAGE_python-packages-index-url
+ string "Index URL passed to pip with --index-url"
+config PACKAGE_python-packages-pip-opts
+ string "Additional arguments to pip command line"
+endif
+endef
+
+CONFIG_PACKAGE_python-packages-list-host:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-host))
+CONFIG_PACKAGE_python-packages-list:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list))
+CONFIG_PACKAGE_python-packages-list-cleanup:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-list-cleanup))
+CONFIG_PACKAGE_python-packages-envs:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-envs))
+CONFIG_PACKAGE_python-packages-extra-deps:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-extra-deps))
+CONFIG_PACKAGE_python-packages-pip-opts:=$(call qstrip,$(CONFIG_PACKAGE_python-packages-pip-opts))
+
+HOST_PYTHON_PIP:=$(STAGING_DIR)/host/bin/pip$(PYTHON_VERSION)
+
+decr=$(word $(1),0 1 2 3 4 5 6 7 8 9 10)
+recur=$(if $(subst 0,,$(2)),$(call recur,$(1),$(call decr,$(2)),$(call $(1)$(2),$(3))),$(3))
+_req2dir1=$(subst >,gt,$(1))
+_req2dir2=$(subst <,lt,$(1))
+_req2dir3=$(subst >=,geq,$(1))
+_req2dir4=$(subst <=,leq,$(1))
+_req2dir5=$(subst ://,:::,$(1))
+_req2dir6=$(subst *,_,$(1))
+_req2dir7=$(subst ?,_,$(1))
+req2dir=$(call recur,_req2dir,7,$(1))
+
+# --ignore-installed, it may happen that host pip will ignore target install if
+# it was already installed as host module, e.g. cffi deps of cryptograph
+HOST_PYTHON_PIP_INSTALL=$(HOST_PYTHON_PIP) install \
+ --root=$(1) \
+ --prefix=$(2) \
+ --ignore-installed \
+ --no-compile \
+ $(if $(CONFIG_PACKAGE_python-packages-index-url), --index-url $(CONFIG_PACKAGE_python-packages-index-url)) \
+ $(if $(CONFIG_PACKAGE_python-packages-pip-opts), $(CONFIG_PACKAGE_python-packages-pip-opts)) \
+
+HOST_PYTHON_PIP_INSTALL_HOST:=$(call HOST_PYTHON_PIP_INSTALL,$(STAGING_DIR)/host,"")
+HOST_PYTHON_PIP_INSTALL_TARGET=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg)),/usr)
+HOST_PYTHON_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON_PIP_INSTALL,$(PKG_INSTALL_DIR)/_cleanup,/usr)
+
+define Build/Compile
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-host),
+ $(call Build/Compile/HostPyRunHost,,$(HOST_PYTHON_PIP_INSTALL_HOST) $(pkg))
+ )
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
+ $(call Build/Compile/HostPyRunTarget,,$(call HOST_PYTHON_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
+ )
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list-cleanup),
+ $(call Build/Compile/HostPyRunTarget,,$(HOST_PYTHON_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python-packages-envs))
+ )
+endef
+
+define Package/python-packages/install
+ $(foreach pkg,$(CONFIG_PACKAGE_python-packages-list),
+ $(CP) "$(PKG_INSTALL_DIR)/$(call req2dir,$(pkg))"/* $(1)
+ )
+
+ find "$(PKG_INSTALL_DIR)/_cleanup" -mindepth 1 -depth | while read sf; do \
+ tf="$$$${sf#$(PKG_INSTALL_DIR)/_cleanup/}"; \
+ tf="$(1)/$$$$tf"; \
+ if [ -f "$$$$tf" -o -L "$$$$tf" ]; then \
+ rm -vf "$$$$tf"; \
+ elif [ -d "$$$$tf" ]; then \
+ rmdir -v -p "$$$$tf" || true; \
+ fi \
+ done
+endef
+
+define Package/python-packages/extra_provides
+ echo $(CONFIG_PACKAGE_python-packages-extra-deps) | tr ' ' '\n'
+endef
+
+$(eval $(call BuildPackage,python-packages))
--- /dev/null
+This package allows users to package python modules without creating package
+Makefiles for each individual module and their dependencies. It provides a
+way making packaging python packages faster and may also facilitate the process
+of developing Makefiles for new python packages
+
+This is a raw DEVEL only package. Using it may entail a lot of implementation
+details and you may need to resolve target dependencies and package details on
+your own
+
+- Third party python packages may depend on features not included in e.g.
+ python-light
+- Some python modules may require host install of another module to progress,
+ e.g. target cryptography requires host cffi
+- Some python modules have external C library dependencies, e.g. pyOpenSSL
+ requires openssl libs
+- Some packages may have an autoconf configure script whose arguments we
+ cannot control with pip and has to be passed on (hacked) by overriding some
+ environment variables
+
+## How it works
+
+1. Install host modules required for building target modules
+2. Install each target module to separate directories
+3. Install another copy of modules for cleanup purposes to make list of
+ installed files to be removed from target modules installed in step 2
+
+Why should it be so
+
+1. Installing target cryptography requires host installation of cffi module
+2. cryptography requires setuptools and pip will install its own copy with
+ --ignore-installed. When PACKAGE_python-setuptools is also selected, opkg
+ will complain of data file clashes if it was not removed here.
+
+Pip will handle dependency requirements of python modules, but external
+dependencies like c libraries has to be prepared by the build system. The
+issue is that there is currently no way to express such dependencies, thus may
+cause build failure, e.g. pycrypto requires the presence of libgmp to build
+successfully.
+
+## Tips
+
+If something goes wrong, we can add additional arguments to pip command
+line to check the detailed build process. Some useful arguments may be
+
+- -v, for verbose output. Repeat this option if the current level of
+ verbosity is not enough
+- --no-clean, for preserving pip build dir on build failure
+
+## Examples
+
+tornado (python-only module)
+
+ CONFIG_PACKAGE_python-packages=y
+ CONFIG_PACKAGE_python-packages-list="tornado==4.4.2"
+
+cryptography (requires installation of host modules and cleanup on target modules)
+
+ CONFIG_PACKAGE_python-packages=y
+ CONFIG_PACKAGE_python-packages-list-host="cffi"
+ CONFIG_PACKAGE_python-packages-list="cryptography"
+ CONFIG_PACKAGE_python-packages-list-cleanup="setuptools"
+
+pycrypto 2.7a1 (python module with autoconf configure script; depends on
+libgmp; broken wmmintrin.h). 2.6.1 does not work because of a flaw in
+the setup.py hardcoding host include directory
+
+ CONFIG_PACKAGE_libgmp=y
+ CONFIG_PACKAGE_python-packages=y
+ CONFIG_PACKAGE_python-packages-list="https://github.com/dlitz/pycrypto/archive/v2.7a1.tar.gz"
+ CONFIG_PACKAGE_python-packages-envs="ac_cv_header_wmmintrin_h=no build_alias=$(GNU_HOST_NAME) host_alias=$(GNU_TARGET_NAME) target_alias=$(GNU_TARGET_NAME)"
+ CONFIG_PACKAGE_python-packages-extra-deps="libgmp.so.10"
+
PKG_BUILD_DIR:=$(BUILD_DIR)/python-pip-$(PKG_VERSION)
PKG_UNPACK=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/python-pip-$(PKG_VERSION)
+HOST_UNPACK=$(HOST_TAR) -C $(HOST_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)
PKG_USE_MIPS16:=0
+HOST_BUILD_DEPENDS:=python python/host python-setuptools/host
+
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
+$(call include_mk, python-host.mk)
define Package/python-pip
SUBMENU:=Python
$(INSTALL_CONF) ./files/pip.conf $(1)/etc/
endef
+define Host/Compile
+ $(call Build/Compile/HostPyMod,,\
+ install --root="$(STAGING_DIR)/host" --prefix="" \
+ --single-version-externally-managed \
+ )
+endef
+
+define Host/Install
+endef
+
+$(eval $(call HostBuild))
+
$(eval $(call PyPackage,python-pip))
$(eval $(call BuildPackage,python-pip))
-
include $(TOPDIR)/rules.mk
PKG_NAME:=ply
-PKG_VERSION:=3.8
-PKG_RELEASE:=3
+PKG_VERSION:=3.9
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.dabeaz.com/ply
-PKG_MD5SUM:=94726411496c52c87c2b9429b12d5c50
+PKG_MD5SUM:=c5c5767376eff902617fd9874f0c76b7
PKG_BUILD_DEPENDS:=python python-setuptools
HOST_BUILD_DEPENDS:=python/host python-setuptools/host
endef
define Host/Compile
- $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR)/host")
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(HOST_BUILD_PREFIX)")
endef
define Host/Install
endef
define Host/Compile
- $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(STAGING_DIR)/host")
+ $(call Build/Compile/HostPyMod,,install --prefix="" --root="$(HOST_BUILD_PREFIX)")
endef
define Host/Install
include $(TOPDIR)/rules.mk
PKG_NAME:=pyOpenSSL
-PKG_VERSION:=16.0.0
+PKG_VERSION:=16.1.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pyOpenSSL
-PKG_MD5SUM:=9587d813dcf656e9f2760e41a3682dc3
+PKG_SOURCE_URL:=https://pypi.python.org/packages/15/1e/79c75db50e57350a7cefb70b110255757e9abd380a50ebdc0cfd853b7450
+PKG_MD5SUM:=d8100b0c333f0eeadaf05914da8792a6
PKG_BUILD_DEPENDS:=python python-setuptools
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pyserial
-PKG_VERSION:=2.7
+PKG_VERSION:=3.1.1
PKG_RELEASE:=1
PKG_MAINTAINER:=Micke Prag <micke.prag@telldus.se>
PKG_LICENSE:=Python-2.0
PKG_SOURCE:=pyserial-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/p/pyserial/
-PKG_MD5SUM:=794506184df83ef2290de0d18803dd11
+PKG_SOURCE_URL:=http://pypi.python.org/packages/3c/d8/a9fa247ca60b02b3bebbd61766b4f321393b57b13c53b18f6f62cf172c08/
+PKG_MD5SUM:=2f72100de3e410b36d575e12e82e9d27
PKG_BUILD_DIR:=$(BUILD_DIR)/pyserial-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python
endef
define Build/Compile
- $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root="$(PKG_INSTALL_DIR)")
endef
define Package/python-pyserial/install
include $(TOPDIR)/rules.mk
PKG_NAME:=python-setuptools
-PKG_VERSION:=22.0.5
+PKG_VERSION:=27.2.0
PKG_RELEASE:=1
PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/90/7a/b64d5804b6d1aebed1892e4df1c21bcb4f8480095ba8004e48999601119d/
-PKG_MD5SUM:=869f3029dcc66a64ba39875e2a2f044a
+PKG_SOURCE_URL:=https://pypi.python.org/packages/87/ba/54197971d107bc06f5f3fbdc0d728a7ae0b10cafca46acfddba65a0899d8/
+PKG_MD5SUM:=b39715612fdc0372dbfd7b3fcf5d4fe5
HOST_BUILD_DEPENDS:=python python/host
define Host/Compile
$(call Build/Compile/HostPyMod,,\
- install --root="$(STAGING_DIR)/host" --prefix="" \
+ install --root="$(HOST_BUILD_PREFIX)" --prefix="" \
--single-version-externally-managed \
)
endef
diff --git a/setuptools/dist.py b/setuptools/dist.py
-index 7785541..23108c7 100644
+index b004f92..66b9d89 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
-@@ -18,7 +18,6 @@ from setuptools.extern.six.moves import map
+@@ -17,7 +17,6 @@ from setuptools.extern.six.moves import map
from pkg_resources.extern import packaging
from setuptools.depends import Require
-from setuptools import windows_support
+ from setuptools.monkey import get_unpatched
import pkg_resources
-
-@@ -335,7 +334,6 @@ class Distribution(_Distribution):
+@@ -383,7 +382,6 @@ class Distribution(_Distribution):
egg_cache_dir = os.path.join(os.curdir, '.eggs')
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-urllib3
+PKG_VERSION:=1.18.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=urllib3-$(PKG_VERSION).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/urllib3-$(PKG_VERSION)/
+PKG_SOURCE_URL:=https://pypi.python.org/packages/d8/1f/7e5e7e7d36fa82c179085ef06c32abe2a1f8a25067e1724921f7e871da1a/
+PKG_MD5SUM:=30b6f366a691b7b5d2eb67d20932b77f
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-urllib3
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=HTTP library with thread-safe connection pooling, file post, and more.
+ URL:=https://urllib3.readthedocs.io/
+ DEPENDS:=+python
+endef
+
+define Package/python-urllib3/description
+ HTTP library with thread-safe connection pooling, file post, and more.
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/python-urllib3/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,python-urllib3))
PKG_NAME:=python
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
-PKG_RELEASE:=9
+PKG_RELEASE:=2
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=1dbcc848b4cd8399a8199d000f9f823c
+PKG_MD5SUM:=57dffcee9cee8bb2ab5f82af1d8e9a69
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(1)/usr/include/
$(CP) \
- $(STAGING_DIR)/host/lib/python$(PYTHON_VERSION) \
+ $(HOST_BUILD_PREFIX)/lib/python$(PYTHON_VERSION) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
$(1)/usr/lib/
$(CP) \
- $(STAGING_DIR)/host/lib/pkgconfig/python.pc \
- $(STAGING_DIR)/host/lib/pkgconfig/python2.pc \
- $(STAGING_DIR)/host/lib/pkgconfig/python-$(PYTHON_VERSION).pc \
+ $(HOST_BUILD_PREFIX)/lib/pkgconfig/python.pc \
+ $(HOST_BUILD_PREFIX)/lib/pkgconfig/python2.pc \
+ $(HOST_BUILD_PREFIX)/lib/pkgconfig/python-$(PYTHON_VERSION).pc \
$(1)/usr/lib/pkgconfig
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
--without-cxx-main \
--without-pymalloc \
--with-threads \
- --prefix=$(STAGING_DIR)/host \
- --exec-prefix=$(STAGING_DIR)/host \
- --sysconfdir=$(STAGING_DIR_HOST)/host/etc \
- --localstatedir=$(STAGING_DIR)/host/var \
- --sbindir=$(STAGING_DIR)/host/bin \
- --with-system-expat=$(STAGING_DIR)/host \
- --with-system-ffi=$(STAGING_DIR)/host \
- --with-ensurepip=upgrade \
+ --prefix=$(HOST_BUILD_PREFIX) \
+ --exec-prefix=$(HOST_BUILD_PREFIX) \
+ --sysconfdir=$(HOST_BUILD_PREFIX)/etc \
+ --localstatedir=$(HOST_BUILD_PREFIX)/var \
+ --sbindir=$(HOST_BUILD_PREFIX)/bin \
+ --with-system-expat=$(HOST_BUILD_PREFIX) \
+ --with-system-ffi=$(HOST_BUILD_PREFIX) \
CONFIG_SITE= \
CFLAGS="$(HOST_CFLAGS)"
define Host/Install
- $(INSTALL_DIR) $(STAGING_DIR)/host/bin/
$(MAKE) -C $(HOST_BUILD_DIR) install
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR)/host/bin/pgen2
+ $(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_BUILD_PREFIX)/bin/pgen2
endef
$(eval $(call HostBuild))
# See /LICENSE for more information.
#
-HOST_PYTHON_DIR:=$(STAGING_DIR)/host
+# Compatibility fallback for older OpenWrt and LEDE versions
+ifeq ($(STAGING_DIR_HOSTPKG),)
+ $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
+ STAGING_DIR_HOSTPKG := $(STAGING_DIR)/host
+endif
+
+HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
-HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR)/host/$(HOST_PYTHON_PKG_DIR)
+HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOSTPKG)/$(HOST_PYTHON_PKG_DIR)
define HostPython
if [ "$(strip $(3))" == "HOST" ]; then \
$(HOST_PYTHON_BIN) $(2);
endef
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
# $(3) => additional variables
-define Build/Compile/HostPyMod
+define Build/Compile/HostPyRunHost
$(call HostPython, \
- cd $(HOST_BUILD_DIR)/$(strip $(1)); \
+ $(if $(1),$(1);) \
CC="$(HOSTCC)" \
CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
CXX="$(HOSTCXX)" \
LDSHARED="$(HOSTCC) -shared" \
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
- LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR)/host/lib" \
+ LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
_PYTHON_HOST_PLATFORM=linux2 \
$(3) \
, \
- ./setup.py $(2) \
+ $(2) \
, \
HOST \
)
endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/HostPyMod
+ $(call Build/Compile/HostPyRunHost, \
+ cd $(HOST_BUILD_DIR)/$(strip $(1)), \
+ ./setup.py $(2), \
+ $(3))
+endef
+
#
PYTHON_VERSION:=2.7
-PYTHON_VERSION_MICRO:=11
+PYTHON_VERSION_MICRO:=12
PYTHON_DIR:=$(STAGING_DIR)/usr
PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
$(call include_mk, python-host.mk)
-# $(1) => build subdir
-# $(2) => additional arguments to setup.py
+# $(1) => commands to execute before running pythons script
+# $(2) => python script and its arguments
# $(3) => additional variables
-define Build/Compile/PyMod
- $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+define Build/Compile/HostPyRunTarget
$(call HostPython, \
- cd $(PKG_BUILD_DIR)/$(strip $(1)); \
+ $(if $(1),$(1);) \
CC="$(TARGET_CC)" \
CCSHARED="$(TARGET_CC) $(FPIC)" \
CXX="$(TARGET_CXX)" \
__PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
$(3) \
, \
- ./setup.py $(2) \
+ $(2) \
)
+endef
+
+# $(1) => build subdir
+# $(2) => additional arguments to setup.py
+# $(3) => additional variables
+define Build/Compile/PyMod
+ $(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+ $(call Build/Compile/HostPyRunTarget, \
+ cd $(PKG_BUILD_DIR)/$(strip $(1)), \
+ ./setup.py $(2), \
+ $(3))
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" -o -name "*\.exe" | xargs rm -f
endef
#
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=python3-setuptools
-PKG_VERSION:=22.0.5
+PKG_VERSION:=27.2.0
PKG_RELEASE:=1
PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/90/7a/b64d5804b6d1aebed1892e4df1c21bcb4f8480095ba8004e48999601119d/
-PKG_MD5SUM:=869f3029dcc66a64ba39875e2a2f044a
+PKG_SOURCE_URL:=https://pypi.python.org/packages/87/ba/54197971d107bc06f5f3fbdc0d728a7ae0b10cafca46acfddba65a0899d8/
+PKG_MD5SUM:=b39715612fdc0372dbfd7b3fcf5d4fe5
PKG_LICENSE:=PSF
diff --git a/setuptools/dist.py b/setuptools/dist.py
-index 7785541..23108c7 100644
+index b004f92..66b9d89 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
-@@ -18,7 +18,6 @@ from setuptools.extern.six.moves import map
+@@ -17,7 +17,6 @@ from setuptools.extern.six.moves import map
from pkg_resources.extern import packaging
from setuptools.depends import Require
-from setuptools import windows_support
+ from setuptools.monkey import get_unpatched
import pkg_resources
-
-@@ -335,7 +334,6 @@ class Distribution(_Distribution):
+@@ -383,7 +382,6 @@ class Distribution(_Distribution):
egg_cache_dir = os.path.join(os.curdir, '.eggs')
if not os.path.exists(egg_cache_dir):
os.mkdir(egg_cache_dir)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
-PKG_RELEASE:=4
+PKG_RELEASE:=1
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=e9ea6f2623fffcdd871b7b19113fde80
+PKG_MD5SUM:=8906efbacfcdc7c3c9198aeefafd159e
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
MAKE_FLAGS+=\
CROSS_COMPILE=yes \
LD="$(TARGET_CC)" \
- FREEZE_IMPORTLIB=_freeze_importlib \
PGEN=pgen3
ifeq ($(ARCH),i386)
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(1)/usr/include/
$(CP) \
- $(STAGING_DIR)/host/lib/python$(PYTHON_VERSION) \
+ $(HOST_BUILD_PREFIX)/lib/python$(PYTHON_VERSION) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
$(1)/usr/lib/
$(CP) \
--without-cxx-main \
--without-pymalloc \
--with-threads \
- --prefix=$(STAGING_DIR)/host \
- --exec-prefix=$(STAGING_DIR)/host \
- --sysconfdir=$(STAGING_DIR_HOST)/host/etc \
- --localstatedir=$(STAGING_DIR)/host/var \
- --sbindir=$(STAGING_DIR)/host/bin \
- --with-system-expat=$(STAGING_DIR)/host \
- --with-system-ffi=$(STAGING_DIR)/host \
+ --prefix=$(HOST_BUILD_PREFIX) \
+ --exec-prefix=$(HOST_BUILD_PREFIX) \
+ --sysconfdir=$(HOST_BUILD_PREFIX)/etc \
+ --localstatedir=$(HOST_BUILD_PREFIX)/var \
+ --sbindir=$(HOST_BUILD_PREFIX)/bin \
+ --with-system-expat=$(HOST_BUILD_PREFIX) \
+ --with-system-ffi=$(HOST_BUILD_PREFIX) \
--with-ensurepip=upgrade \
CONFIG_SITE= \
CFLAGS="$(HOST_CFLAGS)"
endef
define Host/Install
- $(INSTALL_DIR) $(STAGING_DIR)/host/bin/
$(MAKE) -C $(HOST_BUILD_DIR) install
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR)/host/bin/pgen3
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(STAGING_DIR)/host/bin/_freeze_importlib
+
+ $(INSTALL_DIR) $(HOST_BUILD_PREFIX)/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(HOST_BUILD_PREFIX)/bin/pgen3
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Programs/_freeze_importlib $(HOST_BUILD_PREFIX)/bin/_freeze_importlib
endef
$(eval $(call HostBuild))
# See /LICENSE for more information.
#
+# Compatibility fallback for older OpenWrt and LEDE versions
+ifeq ($(STAGING_DIR_HOSTPKG),)
+ $(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
+ STAGING_DIR_HOSTPKG := $(STAGING_DIR)/host
+endif
+
PYTHON3_VERSION_MAJOR:=3
PYTHON3_VERSION_MINOR:=5
-PYTHON3_VERSION_MICRO:=1
+PYTHON3_VERSION_MICRO:=2
PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
PYTHON3:=python$(PYTHON3_VERSION)
-HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR)/host/lib/python$(PYTHON3_VERSION)
-HOST_PYTHON3_BIN:=$(STAGING_DIR)/host/bin/python3
+HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR_HOSTPKG)/lib/python$(PYTHON3_VERSION)
+HOST_PYTHON3_BIN:=$(STAGING_DIR_HOSTPKG)/bin/python3
PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
define HostPython3
+++ /dev/null
-diff --git a/Makefile.pre.in b/Makefile.pre.in
-index ce2c0aa..7df56bf 100644
---- a/Makefile.pre.in
-+++ b/Makefile.pre.in
-@@ -691,17 +691,19 @@ Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
- ############################################################################
- # Importlib
-
-+FREEZE_IMPORTLIB ?= ./Programs/_freeze_importlib
-+
- Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile
-
- Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
- $(LINKCC) $(PY_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
-
- Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib
-- ./Programs/_freeze_importlib \
-+ $(FREEZE_IMPORTLIB) \
- $(srcdir)/Lib/importlib/_bootstrap_external.py Python/importlib_external.h
-
- Python/importlib.h: $(srcdir)/Lib/importlib/_bootstrap.py Programs/_freeze_importlib
-- ./Programs/_freeze_importlib \
-+ $(FREEZE_IMPORTLIB) \
- $(srcdir)/Lib/importlib/_bootstrap.py Python/importlib.h
-
-
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=pytz
+PKG_VERSION:=2016.6.1
+PKG_RELEASE:=1
+PKG_LICENSE:=MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/5d/8e/6635d8f3f9f48c03bb925fab543383089858271f9cfd1216b83247e8df94/
+PKG_MD5SUM:=b6c28a3b968bc1d8badfb61b93874e03
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/pytz
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ TITLE:=World timezone definitions, modern and historical
+ URL:=https://sourceforge.net/projects/pytz/
+ DEPENDS:=+python
+endef
+
+define Package/pytz/description
+ World timezone definitions, modern and historical
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Package/pytz/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,pytz))
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rcssmin
+PKG_VERSION:=1.0.6
+PKG_RELEASE=1
+PKG_LICENSE:=Apache-2.0
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ndparker/rcssmin.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=4764e3bc47ca8d44be3198892e73c51d8a0a9970
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_BUILD_DEPENDS:=python python-setuptools
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/rcssmin
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Fast CSS minifier for Python
+ MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
+ URL:=http://opensource.perlig.de/rcssmin/
+ DEPENDS:=+python
+endef
+
+define Package/rcssmin/description
+ Fast CSS minifier for Python
+endef
+
+define Build/Compile
+ $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+define Package/rcssmin/install
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(CP) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
+ $(1)$(PYTHON_PKG_DIR)
+endef
+
+$(eval $(call BuildPackage,rcssmin))
#
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=simplejson
-PKG_VERSION:=3.6.5
+PKG_VERSION:=3.10.0
PKG_RELEASE:=1
PKG_LICENSE:=MIT
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pypi.python.org/packages/source/s/simplejson/
-PKG_MD5SUM:=b65dc21c7aaad14c6b4ad0d9179e437d
+PKG_SOURCE_URL:=https://pypi.python.org/packages/40/ad/52c1f3a562df3b210e8f165e1aa243a178c454ead65476a39fa3ce1847b6/
+PKG_MD5SUM:=426a9631d22851a7a970b1a677368b15
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
#
-# Copyright (C) 2006-2016 OpenWrt.org
+# Copyright (C) 2006-2011, 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=twisted
-PKG_VERSION:=16.0.0
+PKG_VERSION:=16.4.1
PKG_RELEASE:=1
PKG_SOURCE:=Twisted-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/T/Twisted \
- http://twistedmatrix.com/Releases/Twisted/16.0
-PKG_MD5SUM:=c6aa35e9a1e40fce6797247f39647d2a
+PKG_SOURCE_URL:=https://pypi.python.org/packages/6b/23/8dbe86fc83215015e221fbd861a545c6ec5c9e9cd7514af114d1f64084ab \
+ http://twistedmatrix.com/Releases/Twisted/16.4
+PKG_MD5SUM:=c6d09bdd681f538369659111f079c29d
PKG_BUILD_DIR:=$(BUILD_DIR)/Twisted-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python python-setuptools USE_MUSL:librpc
define PyPackage/twisted/filespec
+|/usr/bin
--|/usr/bin/manhole
--|/usr/bin/tap2deb
--|/usr/bin/tap2rpm
-|/usr/bin/tkconch
+|$(PYTHON_PKG_DIR)
-|$(PYTHON_PKG_DIR)/twisted/conch/scripts/tkconch.py
--|$(PYTHON_PKG_DIR)/twisted/scripts/manhole.py
--|$(PYTHON_PKG_DIR)/twisted/scripts/tap2deb.py
--|$(PYTHON_PKG_DIR)/twisted/scripts/tap2rpm.py
endef
define Build/Compile
-diff -Nur a/twisted/python/twisted-completion.zsh b/twisted/python/twisted-completion.zsh
---- a/twisted/python/twisted-completion.zsh 2015-11-29 11:30:47.000000000 +0800
-+++ b/twisted/python/twisted-completion.zsh 2015-11-30 20:05:59.755695237 +0800
+diff --git a/twisted/python/twisted-completion.zsh b/twisted/python/twisted-completion.zsh
+index 4d97aa5..9a8d4d8 100644
+--- a/twisted/python/twisted-completion.zsh
++++ b/twisted/python/twisted-completion.zsh
@@ -1,4 +1,4 @@
--#compdef twistd trial conch cftp ckeygen pyhtmlizer tap2deb tkconch manhole tap2rpm
+-#compdef twistd trial conch cftp ckeygen pyhtmlizer tkconch
+#compdef twistd trial conch cftp ckeygen pyhtmlizer
#
# This is the ZSH completion file for Twisted commands. It calls the current
-diff -Nur a/setup.py b/setup.py
---- a/setup.py 2015-11-29 11:30:46.000000000 +0800
-+++ b/setup.py 2015-12-02 18:22:10.251268303 +0800
-@@ -49,11 +49,11 @@
- scripts = getScripts()
+diff --git a/setup.py b/setup.py
+index e21ef70..a4d9ee8 100755
+--- a/setup.py
++++ b/setup.py
+@@ -55,13 +55,14 @@ def main(args):
+ setup_args = STATIC_PACKAGE_METADATA.copy()
setup_args.update(dict(
-- packages=getPackages('twisted'),
-+ packages=getPackages('twisted', ignore=['test']),
+- packages=setuptools.find_packages(),
++ packages=setuptools.find_packages(exclude=["*.test", "*.test.*"]),
+ install_requires=requirements,
conditionalExtensions=getExtensions(),
- scripts=scripts,
+ entry_points={
+ 'console_scripts': getConsoleScripts()
+ },
+ include_package_data=True,
++ exclude_package_data={'':['test/*']},
+ zip_safe=False,
extras_require=_EXTRAS_REQUIRE,
-- data_files=getDataFiles('twisted'),
-+ data_files=getDataFiles('twisted', ignore=['test']),
- **STATIC_PACKAGE_METADATA))
-
- setup(**setup_args)
-diff -Nur a/twisted/python/dist.py b/twisted/python/dist.py
---- a/twisted/python/dist.py 2015-11-29 11:30:47.000000000 +0800
-+++ b/twisted/python/dist.py 2015-12-02 19:21:20.076370379 +0800
-@@ -268,11 +268,6 @@
+ ))
+diff --git a/twisted/python/dist.py b/twisted/python/dist.py
+index dfff9dc..a05b716 100644
+--- a/twisted/python/dist.py
++++ b/twisted/python/dist.py
+@@ -191,11 +191,11 @@ def getExtensions():
+ Get the C extensions used for Twisted.
"""
extensions = [
- ConditionalExtension(
+- ConditionalExtension(
- "twisted.test.raiser",
- ["twisted/test/raiser.c"],
-- condition=lambda _: _isCPython),
--
-- ConditionalExtension(
+- condition=lambda _: _isCPython
+- ),
++ #ConditionalExtension(
++ # "twisted.test.raiser",
++ # ["twisted/test/raiser.c"],
++ # condition=lambda _: _isCPython
++ #),
+ ConditionalExtension(
"twisted.internet.iocpreactor.iocpsupport",
["twisted/internet/iocpreactor/iocpsupport/iocpsupport.c",
- "twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c"],
include $(TOPDIR)/rules.mk
PKG_NAME:=vala
-PKG_VERSION:=0.32.0
+PKG_VERSION:=0.34.2
PKG_RELEASE:=1
PKG_LICENSE:=LGPL-2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@GNOME/vala/0.32/
-PKG_MD5SUM:=d3ff298424bb80476f7d189e6b614c35
+PKG_SOURCE_URL:=@GNOME/vala/0.34/
+PKG_MD5SUM:=f9b4a0a10b76b56b0b6e914c506a6828
PKG_BUILD_DEPENDS:=glib2 glib2/host vala/host
HOST_BUILD_DEPENDS:=glib2/host
define Build/InstallDev
$(INSTALL_DIR) \
- $(1)/usr/share/vala-0.32/vapi \
+ $(1)/usr/share/vala-0.34/vapi \
$(1)/usr/lib \
- $(1)/usr/share/pkgconfig
+ $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/share/vala-0.32/vapi/* \
- $(1)/usr/share/vala-0.32/vapi
+ $(PKG_INSTALL_DIR)/usr/share/vala-0.34/vapi/* \
+ $(1)/usr/share/vala-0.34/vapi
$(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/lib/libvala-0.32.{so*,la} \
+ $(PKG_INSTALL_DIR)/usr/lib/libvala-0.34.{so*,la} \
$(1)/usr/lib
$(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/share/pkgconfig/*.pc \
- $(1)/usr/share/pkgconfig
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+ $(1)/usr/lib/pkgconfig
endef
define Package/vala/install
$(INSTALL_DIR) \
- $(1)/usr/share/vala-0.32/vapi \
+ $(1)/usr/share/vala-0.34/vapi \
$(1)/usr/lib \
- $(1)/usr/share/pkgconfig \
+ $(1)/usr/lib/pkgconfig \
$(1)/usr/bin
$(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/share/vala-0.32/vapi/* \
- $(1)/usr/share/vala-0.32/vapi
+ $(PKG_INSTALL_DIR)/usr/share/vala-0.34/vapi/* \
+ $(1)/usr/share/vala-0.34/vapi
$(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/lib/libvala-0.32.{so*,la} \
+ $(PKG_INSTALL_DIR)/usr/lib/libvala-0.34.{so*,la} \
$(1)/usr/lib
$(INSTALL_BIN) \
- $(PKG_INSTALL_DIR)/usr/bin/{vala,vala-0.32,valac,valac-0.32,vapicheck,vapicheck-0.32,vapigen,vapigen-0.32,vala-gen-introspect,vala-gen-introspect-0.32} \
+ $(PKG_INSTALL_DIR)/usr/bin/{vala,vala-0.34,valac,valac-0.34,vapicheck,vapicheck-0.34,vapigen,vapigen-0.34,vala-gen-introspect,vala-gen-introspect-0.34} \
$(1)/usr/bin
$(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/share/pkgconfig/*.pc \
- $(1)/usr/share/pkgconfig
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+ $(1)/usr/lib/pkgconfig
endef
$(eval $(call HostBuild))
#
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2011, 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=zope.interface
-PKG_VERSION:=4.1.3
+PKG_VERSION:=4.3.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://pypi.python.org/packages/source/z/zope.interface
-PKG_MD5SUM:=9ae3d24c0c7415deb249dd1a132f0f79
+PKG_SOURCE_URL:=https://pypi.python.org/packages/38/1b/d55c39f2cf442bd9fb2c59760ed058c84b57d25c680819c25f3aff741e1f
+PKG_MD5SUM:=5f7e15a5bcdfa3c6c0e93ffe45caf87c
PKG_BUILD_DEPENDS:=python python-setuptools
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=avahi
-PKG_VERSION:=0.6.31
-PKG_RELEASE:=12
+PKG_VERSION:=0.6.32
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://avahi.org/download/
-PKG_MD5SUM:=2f22745b8f7368ad5a0a3fddac343f2d
+PKG_SOURCE_URL:=https://github.com/lathiat/avahi/releases/download/v$(PKG_VERSION)
+PKG_MD5SUM:=22b5e705d3eabb31d26f2e1e7b074013
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_BUILD_DEPENDS:=libexpat libdaemon libgdbm intltool/host libpthread dbus
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/avahi/avahi-autoipd.action $(1)/etc/avahi/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/avahi-autoipd $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/lib/netifd/proto
+ $(INSTALL_BIN) ./files/netifd-autoip.sh $(1)/lib/netifd/proto/autoip.sh
endef
define Package/avahi-daemon/install
--- /dev/null
+#!/bin/sh
+
+. /lib/functions.sh
+. ../netifd-proto.sh
+init_proto "$@"
+
+proto_autoip_setup() {
+ local config="$1"
+ local iface="$2"
+
+ proto_export "INTERFACE=$config"
+ proto_run_command "$config" avahi-autoipd $iface
+}
+
+proto_autoip_teardown() {
+ local interface="$1"
+ proto_kill_command "$interface"
+}
+
+add_protocol autoip
--- /dev/null
+#
+# avro - Makefile for Apache Avro library
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=avro-c
+PKG_VERSION:=1.8.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@APACHE/avro/avro-$(PKG_VERSION)/c
+PKG_MD5SUM:=b268348536714541e10411823a1b59b0
+
+PKG_MAINTAINER:=John Clark <inindev@gmail.com>
+
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_LICENSE:=Apache-2.0
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/avro-c
+ SECTION:=libs
+ CATEGORY:=Libraries
+ DEPENDS:=+jansson +zlib +liblzma
+ TITLE:=Apache Avro C Library
+ URL:=https://avro.apache.org
+endef
+
+define Package/avro-c/description
+ This package contains the Apache Avro C library.
+endef
+
+CMAKE_OPTIONS += \
+ -DCMAKE_BUILD_TYPE:STRING=MINSIZEREL
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/{lib,include}
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavro.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/avro-c/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavro.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,avro-c))
+
#
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(INCLUDE_DIR)/target.mk
PKG_NAME:=boost
-PKG_VERSION:=1_61_0
+PKG_VERSION:=1.62.0
+PKG_SOURCE_VERSION:=1_62_0
PKG_RELEASE:=1
-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:=874805ba2e2ee415b1877ef3297bf8ad
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_SOURCE_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://sourceforge.net/projects/boost/files/boost/$(PKG_VERSION)
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
+PKG_MD5SUM:=36c96b0f6155c98404091d8ceb48319a28279ca0333fba1ad8611eb90afb2ca0
PKG_LICENSE:=Boost Software License <http://www.boost.org/users/license.html>
PKG_MAINTAINER:=Carlos M. Ferreira <carlosmf.pt@gmail.com>
DEPENDS:=+libstdcpp +libpthread +librt
endef
-define Package/boost/description/Default
- true
-endef
-
define Package/boost/description
-This package provides the Boost v1.61 libraries.
+This package provides the Boost v1.62 libraries.
Boost is a set of free, peer-reviewed, portable C++ source libraries.
+
+-----------------------------------------------------------------------------
+| Warning |
+| In order to build all of the Boost Libraries, it is necessary |
+| to use, at least, GCC version 5 (C++14 support) and, it is necessary to |
+| compile the kernel with Full Language Support. |
+| Without these requirerements, the following libs will not be available: |
+| - Boost.Locale |
+| - Boost.Coroutine2 |
+| - Boost.Fiber |
+-----------------------------------------------------------------------------
+
This package provides the following run-time libraries:
- atomic
- chrono
- container
- context
- - coroutine
- - - coroutine2 (requires GCC v5 and up)
+ - coroutine (Deprecated - use Coroutine2)
+ - - coroutine2 (Requires GCC v5 and up)
- date_time
- exception
- filesystem
+ - fiber (Requires GCC v5 and up) - BROKEN
- graph
- - graph-parallel
- iostreams
- - locale (requires kernel being compiled with full language support)
+ - locale (Requires kernel being compiled with full language support)
- log
- math
- program_options
- thread
- timer
- wave
- There are many more header-only libraries supported by Boost.
- See more at http://www.boost.org/doc/libs/1_61_0/
+
+There are many more header-only libraries supported by Boost.
+See more at http://www.boost.org/doc/libs/1_62_0/
endef
BOOST_LIBS =
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
endef
define Package/boost/config
- menu "Select Boost Options"
- depends on PACKAGE_boost
- comment "Boost compilation options."
-
- choice
- prompt "Compile Boost libraries."
- default boost-static-and-shared-libs
- help
- Choose which version to compile.
- -> Shared:
- - Only Shared libs will be compiled.
- -> Static:
- - Only Static libs will be compiled.
- -> Both:
- - Both Static and Shared libs will be compiled.
-
- config boost-shared-libs
- bool "Shared"
+ menu "Select Boost Options"
+ depends on PACKAGE_boost
+ comment "Boost compilation options."
+
+ choice
+ prompt "Compile Boost libraries."
+ default boost-static-and-shared-libs
+ help
+ Choose which version to compile.
+ -> Shared:
+ - Only Shared libs will be compiled.
+ -> Static:
+ - Only Static libs will be compiled.
+ -> Both:
+ - Both Static and Shared libs will be compiled.
+
+ config boost-shared-libs
+ bool "Shared"
config boost-static-libs
- bool "Static"
+ bool "Static"
config boost-static-and-shared-libs
- bool "Both"
- endchoice
-
- choice
- prompt "Selects Boost Runtime linkage."
- default boost-runtime-shared
- help
- Choose which C and C++ runtimes to use:
- -> Use Shared runtimes.
- -> Use Static runtimes.
- - Not available if Shared libs are to be built.
- -> Use both runtimes.
- - Not available if Shared libs are to be built.
- - Two separate versions of Boost are built, linking each to a different runtime.
- - This option requires "Use tagged names" option to be active.
-
- config boost-runtime-shared
- bool "Shared"
-
- config boost-runtime-static
- depends on @(!boost-shared-libs&&!boost-static-and-shared-libs)
- bool "Static"
-
- config boost-runtime-static-and-shared
- depends on @(boost-use-name-tags&&!boost-shared-libs&&!boost-static-and-shared-libs)
- bool "Both"
- endchoice
-
- choice
- prompt "Select a Variant."
- default boost-variant-release
- help
- Chooses which boost variant should be selected:
- -> Release: Optimizes Boost for release.
- - Optimization: Speed; Debug Symbols: Off; Inlining: Full; Runtime Debugging: Off.
- -> Debug:
- - Optimization: Off; Debug Symbols: On; Inlining: Off; Runtime Debugging: On.
- -> Profile:
- - Profiling: On; Debug Symbols: On.
-
- config boost-variant-release
- bool "Release"
-
- config boost-variant-debug
- bool "Debug"
-
- config boost-variant-profile
- bool "Profile"
- endchoice
-
- config boost-use-name-tags
- bool "Use tagged names."
- help
- Add name tags the lib files, to diferentiate each library version:
- "-mt" for multi-threading.
- "-d" for debugging.
- "-s" for runtime static link".
- Might break compatibility with libraries that expect boost libs with default names.
- default n
-
- config boost-single-thread
- depends on @boost-use-name-tags
- bool "Single thread Support."
- help
- Compile Boost libraries in single-thread mode.
- default n
+ bool "Both"
+ endchoice
+
+ choice
+ prompt "Selects Boost Runtime linkage."
+ default boost-runtime-shared
+ help
+ Choose which C and C++ runtimes to use:
+ -> Use Shared runtimes.
+ -> Use Static runtimes.
+ - Not available if Shared libs are to be built.
+ -> Use both runtimes.
+ - Not available if Shared libs are to be built.
+ - Two separate versions of Boost are built, linking each to a different runtime.
+ - This option requires "Use tagged names" option to be active.
+
+ config boost-runtime-shared
+ bool "Shared"
+
+ config boost-runtime-static
+ depends on @(!boost-shared-libs&&!boost-static-and-shared-libs)
+ bool "Static"
+
+ config boost-runtime-static-and-shared
+ depends on @(boost-use-name-tags&&!boost-shared-libs&&!boost-static-and-shared-libs)
+ bool "Both"
+ endchoice
+
+ choice
+ prompt "Select a Variant."
+ default boost-variant-release
+ help
+ Chooses which boost variant should be selected:
+ -> Release: Optimizes Boost for release.
+ - Optimization: Speed; Debug Symbols: Off; Inlining: Full; Runtime Debugging: Off.
+ -> Debug:
+ - Optimization: Off; Debug Symbols: On; Inlining: Off; Runtime Debugging: On.
+ -> Profile:
+ - Profiling: On; Debug Symbols: On.
+
+ config boost-variant-release
+ bool "Release"
+
+ config boost-variant-debug
+ bool "Debug"
+
+ config boost-variant-profile
+ bool "Profile"
+ endchoice
+
+ config boost-use-name-tags
+ bool "Use tagged names."
+ help
+ Add name tags the lib files, to diferentiate each library version:
+ "-mt" for multi-threading.
+ "-d" for debugging.
+ "-s" for runtime static link".
+ Might break compatibility with libraries that expect boost libs with default names.
+ default n
+
+ config boost-single-thread
+ depends on @boost-use-name-tags
+ bool "Single thread Support."
+ help
+ Compile Boost libraries in single-thread mode.
+ default n
- config boost-build-type-complete
- depends on @boost-use-name-tags
- bool "Complete Boost Build."
- help
- Builds both release and debug libs. It will take much longer to compile.
- default n
- endmenu
-
- menu "Select Boost libraries"
- depends on PACKAGE_boost
+ config boost-build-type-complete
+ depends on @boost-use-name-tags
+ bool "Complete Boost Build."
+ help
+ Builds both release and debug libs. It will take much longer to compile.
+ default n
+ endmenu
+
+ menu "Select Boost libraries"
+ depends on PACKAGE_boost
comment "Libraries"
config boost-libs-all
- bool "Include all Boost libraries."
- select PACKAGE_boost-libs
+ bool "Include all Boost libraries."
+ select PACKAGE_boost-libs
+ select boost-test-pkg
+ select boost-coroutine2
+ select boost-graph-parallel
config boost-test-pkg
- bool "Boost test package."
- select PACKAGE_boost-test
-
+ bool "Boost test package."
+ select PACKAGE_boost-test
+
config boost-coroutine2
- depends on @GCC_VERSION_5
- bool "Boost couroutine2 support."
- select PACKAGE_boost-coroutine
- default n
+ depends on !@GCC_VERSION_4_8
+ bool "Boost couroutine2 support."
+ select PACKAGE_boost-coroutine
+ default n
config boost-graph-parallel
- bool "Boost parallel graph support."
- select PACKAGE_boost-graph
- default n
+ bool "Boost parallel graph support."
+ select PACKAGE_boost-graph
+ default n
$(foreach lib,$(BOOST_LIBS), \
- config PACKAGE_boost-$(lib)
- prompt "Boost $(lib) library."
+ config PACKAGE_boost-$(lib)
+ prompt "Boost $(lib) library."
+ $(if $(findstring locale,$(lib)),depends on @BUILD_NLS,)
+ $(if $(findstring fiber,$(lib)),depends on BROKEN,)
)
- endmenu
+ endmenu
endef
PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_boost-test
define Package/boost-test
- $(call Package/boost/Default)
- TITLE+= (test)
- HIDDEN:=1
- DEPENDS+=+boost-system +boost-timer
+ $(call Package/boost/Default)
+ TITLE+= (test)
+ HIDDEN:=1
+ DEPENDS+=+boost-system +boost-timer
endef
define Build/Configure
endef
define Package/boost-$(1)/description
- $(call Package/boost/description/Default)
- .
This package contains the Boost $(1) library.
endef
endef
$(eval $(call DefineBoostLibrary,coroutine,system chrono context thread,))
$(eval $(call DefineBoostLibrary,date_time,,))
#$(eval $(call DefineBoostLibrary,exception,,))
+$(eval $(call DefineBoostLibrary,fiber,coroutine,))
$(eval $(call DefineBoostLibrary,filesystem,system,))
$(eval $(call DefineBoostLibrary,graph,regex,))
$(eval $(call DefineBoostLibrary,iostreams,,+PACKAGE_boost-iostreams:zlib))
-$(eval $(call DefineBoostLibrary,locale,system,$(ICONV_DEPENDS) @BUILD_NLS))
+$(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,,)) # OpenMPI does no exist in OpenWRT at this time.
$(if $(CONFIG_PACKAGE_boost-test),,--without-test) \
$(foreach lib,$(BOOST_LIBS), \
$(if $(findstring python,$(lib)), \
- $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
- $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
+ $(if $(or $(CONFIG_PACKAGE_boost-python),$(CONFIG_PACKAGE_boost-python3)),,--without-python), \
+ $(if $(CONFIG_PACKAGE_boost-$(lib)),,--without-$(lib))) \
) \
$(if $(CONFIG_PACKAGE_boost-locale),boost.locale.iconv=on -sICONV_PATH=$(ICONV_PREFIX) boost.locale.posix=$(if $(USE_MUSL),on,off), \
boost.locale.iconv=off) \
$(PKG_INSTALL_DIR)/lib/ -name 'libboost_$(2)*.so*' -exec $(CP) {} $(1)/usr/lib/ \;
endef
-define Package/boost-test/install
+define Package/boost-test/install
$(INSTALL_DIR) \
$(1)/usr/lib
define BuildBoostLibrary
define Package/boost-$(1)/install
- $(call Package/boost/Default/install,$$(1),$(1))
+ $(call Package/boost/Default/install,$$(1),$(1))
endef
$$(eval $$(call BuildPackage,boost-$(1)))
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=doc/COPYING
PKG_VERSION:=0.8.17
-PKG_RELEASE:=1
+PKG_RELEASE:=2
# Use this for official releasees
PKG_MD5SUM:=e53efdb9a5e0852c58b21280b1e6c07d
endef
define CONTENT_ELEKTRA_PLUGINS_TEXT
-cachefilter ccode conditionals csvstorage curlget enum filecheck glob
+cachefilter ccode conditionals csvstorage enum filecheck glob
hexcode hidden hosts iconv keytometa line lineendings list mathcheck
network null path profile shell syslog uname validation
endef
This package contains support for encrypting values before storage.
endef
+define Package/libelektra-curlget
+ $(call Package/libelektra/Default)
+ TITLE:=Elektra curlget plugin
+ DEPENDS:=+libelektra-core +libcurl
+endef
+
+define Package/libelektra-curlget/description
+$(call Package/libelektra/Default-description)
+
+This plugin can get configuration data from remote URLs before access.
+endef
+
define Package/libelektra-dbus
$(call Package/libelektra/Default)
TITLE:=Elektra dbus plugin
define Package/libelektra-plugins/install
$(INSTALL_DIR) $(1)/usr/lib/
- $(foreach plugin,$(CONTENT_ELEKTRA_PLUGINS),$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so $(1)/usr/lib/;)
+ $(CP) $(foreach plugin,$(CONTENT_ELEKTRA_PLUGINS),$(PKG_INSTALL_DIR)/usr/lib/libelektra-$(plugin).so) $(1)/usr/lib/
endef
define Package/libelektra-boost/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-crypto_openssl.so $(1)/usr/lib/
endef
+define Package/libelektra-curlget/install
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-curlget.so $(1)/usr/lib/
+endef
+
define Package/libelektra-dbus/install
$(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libelektra-dbus.so $(1)/usr/lib/
$(eval $(call BuildPackage,libelektra-plugins))
$(eval $(call BuildPackage,libelektra-boost))
$(eval $(call BuildPackage,libelektra-cpp))
+$(eval $(call BuildPackage,libelektra-curlget))
$(eval $(call BuildPackage,libelektra-crypto))
$(eval $(call BuildPackage,libelektra-dbus))
$(eval $(call BuildPackage,libelektra-xml))
+++ /dev/null
-#
-# 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:=engine_pkcs11
-PKG_VERSION:=20150429
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-PKG_LICENSE:=LGPL-2.1+
-
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/OpenSC/engine_pkcs11.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=0cc9d88eb291f5c545e5bc91d56866a2e0e95d48
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_FIXUP:=libtool
-
-PKG_CONFIG_DEPENDS:=CONFIG_OPENSSL_ENGINE
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/engine_pkcs11
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE:=PKCS#11 OpenSSL engine
- URL:=https://www.opensc-project.org/opensc/wiki/
- DEPENDS:=+libopenssl +libp11
-endef
-
-define Package/engine_pkcs11/description
- engine_pkcs11 is an implementation of OpenSSL engine interface.
-endef
-
-define Package/engine_pkcs11/install
- $(INSTALL_DIR) $(1)/usr/lib/engines
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/engines/engine_pkcs11.so $(1)/usr/lib/engines/
-endef
-
-$(eval $(call BuildPackage,engine_pkcs11))
include $(TOPDIR)/rules.mk
PKG_NAME:=glib2
-PKG_VERSION:=2.46.2
+PKG_VERSION:=2.49.7
PKG_RELEASE:=1
PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
-PKG_SOURCE_URL:=@GNOME/glib/2.46
-PKG_MD5SUM:=7f815d6e46df68e070cb421ed7f1139e
+PKG_SOURCE_URL:=@GNOME/glib/2.49
+PKG_MD5SUM:=397ead3fcf325cb921d54e2c9e7dfd7a
PKG_BUILD_PARALLEL:=1
HOST_BUILD_PARALLEL:=1
HOST_CONFIGURE_ARGS += \
--disable-selinux \
- --with-libiconv=gnu
+ --with-libiconv=gnu \
+ --with-pcre=internal
CONFIGURE_ARGS += \
--enable-shared \
--enable-debug=no \
--disable-selinux \
--disable-fam \
- --with-libiconv=gnu
+ --with-libiconv=gnu \
+ --with-pcre=internal
CONFIGURE_VARS += \
glib_cv_stack_grows=no \
--- a/gtk-doc.make
+++ b/gtk-doc.make
-@@ -271,7 +271,7 @@ uninstall-local:
+@@ -282,7 +282,7 @@ uninstall-local:
#
# Require gtk-doc when making dist
#
glib/gdate.c | 3 +++
1 file changed, 3 insertions(+)
-diff --git a/glib/gdate.c b/glib/gdate.c
-index 4aece02..cdc735c 100644
--- a/glib/gdate.c
+++ b/glib/gdate.c
-@@ -2494,7 +2494,10 @@ g_date_strftime (gchar *s,
+@@ -2497,7 +2497,10 @@ g_date_strftime (gchar *s,
* recognize whether strftime actually failed or just returned "".
*/
tmpbuf[0] = '\1';
if (tmplen == 0 && tmpbuf[0] != '\0')
{
---
-cgit v0.12
-
+++ /dev/null
-From 8cdbc7fb2c8c876902e457abe46ee18a0b134486 Mon Sep 17 00:00:00 2001
-From: coypu <coypu@sdf.org>
-Date: Wed, 2 Mar 2016 19:38:48 +0200
-Subject: gdate: Move warning pragma outside of function
-
-Commit 0817af40e8c74c721c30f6ef482b1f53d12044c7 breaks the build on
-older versions of GCC, which don't allow pragma inside functions.
-
-https://bugzilla.gnome.org/761550
----
- glib/gdate.c | 8 +++++---
- 1 file changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/glib/gdate.c b/glib/gdate.c
-index cdc735c..92c34d2 100644
---- a/glib/gdate.c
-+++ b/glib/gdate.c
-@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d,
- *
- * Returns: number of characters written to the buffer, or 0 the buffer was too small
- */
-+#pragma GCC diagnostic push
-+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
-+
- gsize
- g_date_strftime (gchar *s,
- gsize slen,
-@@ -2494,10 +2497,7 @@ g_date_strftime (gchar *s,
- * recognize whether strftime actually failed or just returned "".
- */
- tmpbuf[0] = '\1';
-- #pragma GCC diagnostic push
-- #pragma GCC diagnostic ignored "-Wformat-nonliteral"
- tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm);
-- #pragma GCC diagnostic pop
-
- if (tmplen == 0 && tmpbuf[0] != '\0')
- {
-@@ -2552,3 +2552,5 @@ g_date_strftime (gchar *s,
- return retval;
- #endif
- }
-+
-+#pragma GCC diagnostic pop
---
-cgit v0.12
-
bool "enable anonymous authentication support"
default y
+config GNUTLS_TPM
+ bool "enable tpm support"
+ select GNUTLS_PKCS11
+ default n
+
config GNUTLS_PKCS11
bool "enable smart card (PKCS11) support"
select GNUTLS_EXT_LIBTASN1
include $(TOPDIR)/rules.mk
PKG_NAME:=gnutls
-PKG_VERSION:=3.4.14
-PKG_RELEASE:=1
+PKG_VERSION:=3.5.4
+PKG_RELEASE:=3
PKG_USE_MIPS16:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.4
-PKG_MD5SUM:=ad3e269a6793424d5d21c9626e1c9ef1
+PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5
+PKG_MD5SUM:=c17e20d0f6b040580df57f5f94e3610f
#PKG_FIXUP:=autoreconf gettext-version
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
PKG_LICENSE:=LGPLv2.1+
CONFIG_GNUTLS_PKCS11 \
CONFIG_GNUTLS_PSK \
CONFIG_GNUTLS_SRP \
+ CONFIG_GNUTLS_TPM \
CONFIG_LIBNETTLE_MINI \
include $(INCLUDE_DIR)/package.mk
$(call Package/gnutls/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Encryption
TITLE+= (certool utility)
DEPENDS+= +libgnutls
endef
$(call Package/gnutls/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Encryption
TITLE+= (utilities)
DEPENDS+= +libgnutls
endef
CONFIGURE_ARGS += --disable-ocsp
endif
+ifneq ($(CONFIG_GNUTLS_TPM),y)
+CONFIGURE_ARGS += --without-tpm
+endif
+
ifeq ($(CONFIG_GNUTLS_CRYPTODEV),y)
CONFIGURE_ARGS += --enable-cryptodev
endif
$(PKG_INSTALL_DIR)/usr/bin/p11tool \
$(1)/usr/bin/
endif
+ifeq ($(CONFIG_GNUTLS_TPM),y)
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/bin/tpmtool \
+ $(1)/usr/bin/
+endif
endef
--- /dev/null
+diff --git a/lib/x509/ip-in-cidr.h b/lib/x509/ip-in-cidr.h
+index 778502a..7613de9 100644
+--- a/lib/x509/ip-in-cidr.h
++++ b/lib/x509/ip-in-cidr.h
+@@ -36,6 +36,8 @@ static unsigned ip_in_cidr(const gnutls_datum_t *ip, const gnutls_datum_t *cidr)
+ {
+ char str_ip[48];
+ char str_cidr[97];
++ unsigned byte;
++
+ _gnutls_hard_log("matching %.*s with CIDR constraint %.*s\n",
+ (int) sizeof(str_ip),
+ _gnutls_ip_to_string(ip->data, ip->size, str_ip, sizeof(str_ip)),
+@@ -43,7 +45,7 @@ static unsigned ip_in_cidr(const gnutls_datum_t *ip, const gnutls_datum_t *cidr)
+ _gnutls_cidr_to_string(cidr->data, cidr->size, str_cidr, sizeof(str_cidr)));
+
+ unsigned ipsize = ip->size;
+- for (unsigned byte = 0; byte < ipsize; byte++)
++ for (byte = 0; byte < ipsize; byte++)
+ if (((ip->data[byte] ^ cidr->data[byte]) & cidr->data[ipsize+byte]) != 0)
+ return 0;
+
+diff --git a/lib/x509/ip.c b/lib/x509/ip.c
+index 9316933..b4b31a4 100644
+--- a/lib/x509/ip.c
++++ b/lib/x509/ip.c
+@@ -175,10 +175,13 @@ static void prefix_to_mask(unsigned prefix, unsigned char *mask, size_t mask_siz
+ *
+ * Returns: On success, %GNUTLS_E_SUCCESS (0) is returned, otherwise a negative error value.
+ -*/
+-int _gnutls_mask_ip(unsigned char *ip, const unsigned char *mask, unsigned ipsize) {
++int _gnutls_mask_ip(unsigned char *ip, const unsigned char *mask, unsigned ipsize)
++{
++ unsigned i;
++
+ if (ipsize != 4 && ipsize != 16)
+ return GNUTLS_E_MALFORMED_CIDR;
+- for (unsigned i = 0;i < ipsize; i++)
++ for (i = 0; i < ipsize; i++)
+ ip[i] &= mask[i];
+ return GNUTLS_E_SUCCESS;
+ }
+diff --git a/lib/x509/name_constraints.c b/lib/x509/name_constraints.c
+index 98c0f02..196e6d9 100644
+--- a/lib/x509/name_constraints.c
++++ b/lib/x509/name_constraints.c
+@@ -777,6 +777,7 @@ name_constraints_intersect_nodes(name_constraints_node_st * nc1,
+ *_intersection = NULL;
+ name_constraints_node_st *to_copy = NULL;
+ unsigned iplength = 0;
++ unsigned byte;
+
+ if (nc1->type != nc2->type) {
+ return GNUTLS_E_SUCCESS;
+@@ -796,7 +797,7 @@ name_constraints_intersect_nodes(name_constraints_node_st * nc1,
+ if (nc1->name.size != nc2->name.size)
+ return GNUTLS_E_SUCCESS;
+ iplength = nc1->name.size/2;
+- for (unsigned byte = 0; byte < iplength; byte++) {
++ for (byte = 0; byte < iplength; byte++) {
+ if (((nc1->name.data[byte]^nc2->name.data[byte]) // XOR of addresses
+ & nc1->name.data[byte+iplength] // AND mask from nc1
+ & nc2->name.data[byte+iplength]) // AND mask from nc2
+@@ -813,6 +814,8 @@ name_constraints_intersect_nodes(name_constraints_node_st * nc1,
+ }
+ // copy existing node if applicable
+ if (to_copy != NULL) {
++ unsigned byte;
++
+ *_intersection = name_constraints_node_new(to_copy->type, to_copy->name.data, to_copy->name.size);
+ if (*_intersection == NULL)
+ return gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
+@@ -822,7 +825,7 @@ name_constraints_intersect_nodes(name_constraints_node_st * nc1,
+ _gnutls_mask_ip(intersection->name.data, intersection->name.data+iplength, iplength);
+ _gnutls_mask_ip(nc1->name.data, nc1->name.data+iplength, iplength);
+ // update intersection, if necessary (we already know one is subset of other)
+- for (unsigned byte = 0; byte < 2 * iplength; byte++) {
++ for (byte = 0; byte < 2 * iplength; byte++) {
+ intersection->name.data[byte] |= nc1->name.data[byte];
+ }
+ }
include $(TOPDIR)/rules.mk
PKG_NAME:=libcanfestival
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE_PROTO:=hg
PKG_SOURCE_URL:=http://dev.automforge.net/CanFestival-3
PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
--cxx=$(TARGET_CXX) \
--ld=$(TARGET_CC) \
--arch=$(ARCH) \
+ --binutils=$(TARGET_CROSS) \
--os=Linux \
--kerneldir=$(LINUX_DIR) \
--prefix=/usr \
include $(TOPDIR)/rules.mk
PKG_NAME:=libcoap
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/obgm/libcoap
PKG_MAINTAINER:=Anton Glukhov <anton.a.glukhov@gmail.com>
PKG_LICENSE:=GPL-2.0+ BSD-2-Clause
-PKG_LICENSE_FILE:=COPYING LICENSE.GPL LICENSE.BSD
+PKG_LICENSE_FILES:=COPYING LICENSE.GPL LICENSE.BSD
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
--- /dev/null
+#
+# Copyright (C) 2008-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libdouble-conversion
+PKG_VERSION:=2.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=0d25506a2e7fb52928963313343e0237e890059e
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/google/double-conversion.git
+PKG_MD5SUM:=8dd6ac234054f9a6fe7f62ef1c9b5c20
+PKG_LICENSE_FILES:=COPYING LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libdouble-conversion
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles
+ URL:=https://github.com/google/double-conversion
+ DEPENDS:=+libstdcpp
+endef
+
+define Package/libdouble-conversion/description
+ double-conversion provides binary-decimal and decimal-binary routines for IEEE doubles.
+
+ The library consists of efficient conversion routines that have been extracted
+ from the V8 JavaScript engine. The code has been refactored and improved so that
+ it can be used more easily in other projects.
+endef
+
+CMAKE_OPTIONS += \
+ -DBUILD_SHARED_LIBS=ON \
+ -DBUILD_TESTING=OFF
+
+define Build/InstallDev
+ $(INSTALL_DIR) \
+ $(1)/usr/lib \
+ $(1)/usr/include/double-conversion
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/include/* \
+ $(1)/usr/include/
+
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/lib*.so* \
+ $(1)/usr/lib/
+endef
+
+define Package/libdouble-conversion/install
+ $(INSTALL_DIR) \
+ $(1)/usr/lib
+
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/lib*.so* \
+ $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdouble-conversion))
--- /dev/null
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libdrm
+PKG_VERSION:=2.4.70
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=http://dri.freedesktop.org/libdrm
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=920957cfe25a80efb02be9bd90bf3c1e
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libdrm
+ SECTION:=libs
+ CATEGORY:=Libraries
+ DEPENDS:=
+ TITLE:=libdrm
+ URL:=http://dri.freedesktop.org/
+endef
+
+CONFIGURE_ARGS += \
+ --disable-udev \
+ --enable-kms \
+ --disable-intel \
+ --disable-radeon \
+ --disable-amdgpu \
+ --disable-nouveau \
+ --disable-vmwgfx \
+ --disable-omap-experimental-api \
+ --disable-exynos-experimental-api \
+ --disable-freedreno \
+ --disable-freedreno-kgsl \
+ --disable-tegra-experimental-api \
+ --disable-vc4 \
+ --disable-cairo-tests \
+ --disable-manpages \
+ --disable-valgrind
+
+define Build/InstallDev
+ $(INSTALL_DIR) \
+ $(1)/usr/include \
+ $(1)/usr/lib
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/include/* \
+ $(1)/usr/include/
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/{pkgconfig,*.so*} \
+ $(1)/usr/lib/
+endef
+
+define Package/libdrm/install
+ $(INSTALL_DIR) \
+ $(1)/usr/lib
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+ $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libdrm))
--- /dev/null
+--- a/configure 2016-07-23 15:19:06.000000000 +0200
++++ b/configure 2016-08-27 01:11:02.440530337 +0200
+@@ -13334,98 +13334,6 @@
+ fi
+ fi
+
+-pkg_failed=no
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREADSTUBS" >&5
+-$as_echo_n "checking for PTHREADSTUBS... " >&6; }
+-
+-if test -n "$PTHREADSTUBS_CFLAGS"; then
+- pkg_cv_PTHREADSTUBS_CFLAGS="$PTHREADSTUBS_CFLAGS"
+- elif test -n "$PKG_CONFIG"; then
+- if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+- test $ac_status = 0; }; then
+- pkg_cv_PTHREADSTUBS_CFLAGS=`$PKG_CONFIG --cflags "pthread-stubs" 2>/dev/null`
+- test "x$?" != "x0" && pkg_failed=yes
+-else
+- pkg_failed=yes
+-fi
+- else
+- pkg_failed=untried
+-fi
+-if test -n "$PTHREADSTUBS_LIBS"; then
+- pkg_cv_PTHREADSTUBS_LIBS="$PTHREADSTUBS_LIBS"
+- elif test -n "$PKG_CONFIG"; then
+- if test -n "$PKG_CONFIG" && \
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
+- ($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
+- ac_status=$?
+- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+- test $ac_status = 0; }; then
+- pkg_cv_PTHREADSTUBS_LIBS=`$PKG_CONFIG --libs "pthread-stubs" 2>/dev/null`
+- test "x$?" != "x0" && pkg_failed=yes
+-else
+- pkg_failed=yes
+-fi
+- else
+- pkg_failed=untried
+-fi
+-
+-
+-
+-if test $pkg_failed = yes; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+-
+-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+- _pkg_short_errors_supported=yes
+-else
+- _pkg_short_errors_supported=no
+-fi
+- if test $_pkg_short_errors_supported = yes; then
+- PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "pthread-stubs" 2>&1`
+- else
+- PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "pthread-stubs" 2>&1`
+- fi
+- # Put the nasty error message in config.log where it belongs
+- echo "$PTHREADSTUBS_PKG_ERRORS" >&5
+-
+- as_fn_error $? "Package requirements (pthread-stubs) were not met:
+-
+-$PTHREADSTUBS_PKG_ERRORS
+-
+-Consider adjusting the PKG_CONFIG_PATH environment variable if you
+-installed software in a non-standard prefix.
+-
+-Alternatively, you may set the environment variables PTHREADSTUBS_CFLAGS
+-and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
+-See the pkg-config man page for more details." "$LINENO" 5
+-elif test $pkg_failed = untried; then
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+-$as_echo "no" >&6; }
+- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+-is in your PATH or set the PKG_CONFIG environment variable to the full
+-path to pkg-config.
+-
+-Alternatively, you may set the environment variables PTHREADSTUBS_CFLAGS
+-and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
+-See the pkg-config man page for more details.
+-
+-To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+-See \`config.log' for more details" "$LINENO" 5; }
+-else
+- PTHREADSTUBS_CFLAGS=$pkg_cv_PTHREADSTUBS_CFLAGS
+- PTHREADSTUBS_LIBS=$pkg_cv_PTHREADSTUBS_LIBS
+- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+-$as_echo "yes" >&6; }
+-
+-fi
+-
+-
+
+ pkgconfigdir=${libdir}/pkgconfig
+
include $(TOPDIR)/rules.mk
PKG_NAME:=libedit
-PKG_VERSION:=20150325-3.1
+PKG_VERSION:=20160618-3.1
PKG_RELEASE:=1
PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://thrysoee.dk/editline/
-PKG_MD5SUM:=43cdb5df3061d78b5e9d59109871b4f6
+PKG_MD5SUM:=b6e60f326a3fce91bea1a6fe4700af58
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL:=1
PKG_NAME:=libestr
PKG_VERSION:=0.1.10
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=http://libestr.adiscon.com/files/download/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
+++ /dev/null
-#
-# 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:=libevhtp-1.1
-PKG_VERSION:=1.1.7
-PKG_RELEASE:=1
-PKG_LICENSE:=BSD-3-Clause
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ellzey/libevhtp.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=f70c920d4d8d4146ff662867f47c4b5854045b3c
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libevhtp-1.1
- SECTION:=libs
- CATEGORY:=Libraries
- TITLE:=A more flexible replacement for libevent's httpd API - compatibility package
- MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
- URL:=https://github.com/ellzey/libevhtp
- DEPENDS:=+libevent2 +libevent2-pthreads +libpthread
-endef
-
-define Package/libevhtp-1.1/description
- Libevhtp was created as a replacement API for Libevent's current HTTP API.
-
- NOTE: This is an older version required for compatibility reasons. The latest version has its own package named "libevhtp".
-endef
-
-include $(INCLUDE_DIR)/cmake.mk
-
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include/libevhtp-1.1/
- $(INSTALL_DIR) $(1)/usr/lib/libevhtp-1.1/
- $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,libevhtp-1.1))
+++ /dev/null
-diff -rupN libevhtp-1.1-1.1.7-orig/CMakeLists.txt libevhtp-1.1-1.1.7/CMakeLists.txt
---- libevhtp-1.1-1.1.7-orig/CMakeLists.txt 2015-06-14 00:15:28.000000000 +0200
-+++ libevhtp-1.1-1.1.7/CMakeLists.txt 2015-06-14 00:21:17.441299942 +0200
-@@ -54,7 +54,7 @@ if (NOT HAVE_SYS_UN)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_SYS_UN")
- endif(NOT HAVE_SYS_UN)
-
--OPTION(EVHTP_DISABLE_SSL "Disable ssl support" OFF)
-+OPTION(EVHTP_DISABLE_SSL "Disable ssl support" ON)
- OPTION(EVHTP_DISABLE_EVTHR "Disable evthread support" OFF)
- OPTION(EVHTP_DIABLE_REGEX "Disable regex support" OFF)
-
-@@ -182,11 +182,11 @@ endif()
- add_library(libevhtp STATIC ${LIBEVHTP_SOURCES} ${ONIG_SOURCES})
- set_target_properties(libevhtp PROPERTIES OUTPUT_NAME "evhtp")
-
--install (TARGETS libevhtp DESTINATION lib)
--install (FILES evhtp.h DESTINATION include)
--install (FILES htparse/htparse.h DESTINATION include)
--install (FILES evthr/evthr.h DESTINATION include)
--install (FILES oniguruma/onigposix.h DESTINATION include)
-+install (TARGETS libevhtp DESTINATION lib/libevhtp-1.1)
-+install (FILES evhtp.h DESTINATION include/libevhtp-1.1)
-+install (FILES htparse/htparse.h DESTINATION include/libevhtp-1.1)
-+install (FILES evthr/evthr.h DESTINATION include/libevhtp-1.1)
-+install (FILES oniguruma/onigposix.h DESTINATION include/libevhtp-1.1)
-
- find_library (LIB_DL dl)
- set (SYS_LIBS ${LIB_DL})
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# NOTE: please DO NOT update this package without the maintainer's consent.
+# See https://github.com/haiwen/seafile/issues/1119
+
include $(TOPDIR)/rules.mk
PKG_NAME:=libevhtp
-PKG_VERSION:=1.2.10
+PKG_VERSION:=1.1.6
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
-PKG_SOURCE:=$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/ellzey/libevhtp/archive/
-PKG_MD5SUM:=e7261c7e34654f78047431d169b88806
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ellzey/libevhtp.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=91071e2f20749cd469b87ac2ef1c158dc2a6806f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_INSTALL:=1
include $(INCLUDE_DIR)/cmake.mk
-Hooks/Prepare/Post += delete_source_package
-
-define delete_source_package
- # deleting source package as its filename is ambiguous
- rm -f $(DL_DIR)/$(PKG_SOURCE)
-endef
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/{include,lib}
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevhtp.so* $(1)/usr/lib/
-
-endef
-
-define Package/libevhtp/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libevhtp.so* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,libevhtp))
+++ /dev/null
-diff -rupN libevhtp-1.2.9.orig/CMakeLists.txt libevhtp-1.2.9/CMakeLists.txt
---- libevhtp-1.2.9.orig/CMakeLists.txt 2014-03-23 12:50:50.000000000 +0100
-+++ libevhtp-1.2.9/CMakeLists.txt 2014-11-21 11:46:58.644575813 +0100
-@@ -64,7 +64,7 @@ OPTION(EVHTP_DISABLE_EVTHR "Disable
- OPTION(EVHTP_DISABLE_REGEX "Disable regex support" OFF)
-
- # -DEVHTP_BUILD_SHARED:STRING=ON
--OPTION(EVHTP_BUILD_SHARED "Build shared library too" OFF)
-+OPTION(EVHTP_BUILD_SHARED "Build shared library too" ON)
-
- # -DEVHTP_USE_DEFER_ACCEPT:STRING=ON
- OPTION(EVHTP_USE_DEFER_ACCEPT "Enable TCP_DEFER_ACCEPT" OFF)
--- /dev/null
+diff -rupN libevhtp-1.2.9.orig/htparse/htparse.c libevhtp-1.2.9/htparse/htparse.c
+--- libevhtp-1.2.9.orig/htparse/htparse.c 2014-03-23 12:50:50.000000000 +0100
++++ libevhtp-1.2.9/htparse/htparse.c 2014-12-09 01:12:22.242001241 +0100
+@@ -197,6 +197,7 @@ static const char * method_strmap[] = {
+
+ #define _MIN_READ(a, b) ((a) < (b) ? (a) : (b))
+
++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ #define _str3_cmp(m, c0, c1, c2, c3) \
+ *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0)
+
+@@ -226,6 +227,37 @@ static const char * method_strmap[] = {
+ *(uint32_t *)m == ((c3 << 24) | (c2 << 16) | (c1 << 8) | c0) \
+ && ((uint32_t *)m)[1] == ((c7 << 24) | (c6 << 16) | (c5 << 8) | c4) \
+ && m[8] == c8
++#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++#define _str3_cmp(m, c0, c1, c2, c3) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str3Ocmp(m, c0, c1, c2, c3) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str4cmp(m, c0, c1, c2, c3) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3)
++
++#define _str5cmp(m, c0, c1, c2, c3, c4) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++ && m[4] == c4
++
++#define _str6cmp(m, c0, c1, c2, c3, c4, c5) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++ && (((uint32_t *)m)[1] & 0xffff0000) == ((c4 << 24) | c5 << 16)
++
++#define _str7_cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++ && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
++
++#define _str8cmp(m, c0, c1, c2, c3, c4, c5, c6, c7) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++ && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7)
++
++#define _str9cmp(m, c0, c1, c2, c3, c4, c5, c6, c7, c8) \
++ *(uint32_t *)m == ((c0 << 24) | (c1 << 16) | (c2 << 8) | c3) \
++ && ((uint32_t *)m)[1] == ((c4 << 24) | (c5 << 16) | (c6 << 8) | c7) \
++ && m[8] == c8
++#endif
+
+ #define __HTPARSE_GENHOOK(__n) \
+ static inline int hook_ ## __n ## _run(htparser * p, htparse_hooks * hooks) { \
PKG_NAME:=libfastjson
PKG_VERSION:=0.99.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_PROTO:=git
PKG_MAINTAINER:=Dov Murik <dmurik@us.ibm.com>
PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
+From bfeac1b2d18b12c1c3c64a41a09c90f93d0ed4ca Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Mon, 15 Aug 2016 15:00:13 +0800
+Subject: [PATCH] mips: fix MIPS softfloat build issue
+
+The patch for o32.S is taken from OpenWrt packages repo 3a7a4bf "libffi:
+fix MIPS softfloat build issue with current binutils"
+
+Signed-off-by: Felix Fietkau <nbd@openwrt.org>
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ src/mips/n32.S | 17 +++++++++++++++++
+ src/mips/o32.S | 17 +++++++++++++++++
+ 2 files changed, 34 insertions(+)
+
+diff --git a/src/mips/n32.S b/src/mips/n32.S
+index c6985d3..8f25994 100644
+--- a/src/mips/n32.S
++++ b/src/mips/n32.S
+@@ -107,6 +107,16 @@ loadregs:
+
+ REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6.
+
++#ifdef __mips_soft_float
++ REG_L a0, 0*FFI_SIZEOF_ARG(t9)
++ REG_L a1, 1*FFI_SIZEOF_ARG(t9)
++ REG_L a2, 2*FFI_SIZEOF_ARG(t9)
++ REG_L a3, 3*FFI_SIZEOF_ARG(t9)
++ REG_L a4, 4*FFI_SIZEOF_ARG(t9)
++ REG_L a5, 5*FFI_SIZEOF_ARG(t9)
++ REG_L a6, 6*FFI_SIZEOF_ARG(t9)
++ REG_L a7, 7*FFI_SIZEOF_ARG(t9)
++#else
+ and t4, t6, ((1<<FFI_FLAG_BITS)-1)
+ REG_L a0, 0*FFI_SIZEOF_ARG(t9)
+ beqz t4, arg1_next
+@@ -193,6 +203,7 @@ arg7_next:
+ arg8_doublep:
+ l.d $f19, 7*FFI_SIZEOF_ARG(t9)
+ arg8_next:
++#endif
+
+ callit:
+ # Load the function pointer
+@@ -214,6 +225,7 @@ retint:
+ b epilogue
+
+ retfloat:
++#ifndef __mips_soft_float
+ bne t6, FFI_TYPE_FLOAT, retdouble
+ jal t9
+ REG_L t4, 4*FFI_SIZEOF_ARG($fp)
+@@ -272,6 +284,7 @@ retstruct_f_d:
+ s.s $f0, 0(t4)
+ s.d $f2, 8(t4)
+ b epilogue
++#endif
+
+ retstruct_d_soft:
+ bne t6, FFI_TYPE_STRUCT_D_SOFT, retstruct_f_soft
+@@ -429,6 +442,7 @@ ffi_closure_N32:
+ REG_S a6, A6_OFF2($sp)
+ REG_S a7, A7_OFF2($sp)
+
++#ifndef __mips_soft_float
+ # Store all possible float/double registers.
+ s.d $f12, F12_OFF2($sp)
+ s.d $f13, F13_OFF2($sp)
+@@ -438,6 +452,7 @@ ffi_closure_N32:
+ s.d $f17, F17_OFF2($sp)
+ s.d $f18, F18_OFF2($sp)
+ s.d $f19, F19_OFF2($sp)
++#endif
+
+ # Call ffi_closure_mips_inner_N32 to do the real work.
+ LA t9, ffi_closure_mips_inner_N32
+@@ -458,6 +473,7 @@ cls_retint:
+ b cls_epilogue
+
+ cls_retfloat:
++#ifndef __mips_soft_float
+ bne v0, FFI_TYPE_FLOAT, cls_retdouble
+ l.s $f0, V0_OFF2($sp)
+ b cls_epilogue
+@@ -500,6 +516,7 @@ cls_retstruct_f_d:
+ l.s $f0, V0_OFF2($sp)
+ l.d $f2, V1_OFF2($sp)
+ b cls_epilogue
++#endif
+
+ cls_retstruct_small2:
+ REG_L v0, V0_OFF2($sp)
+diff --git a/src/mips/o32.S b/src/mips/o32.S
+index eb27981..429dd0a 100644
--- a/src/mips/o32.S
+++ b/src/mips/o32.S
@@ -82,13 +82,16 @@ sixteen:
1:
REG_L $3, V1_OFF2($fp)
REG_L $2, V0_OFF2($fp)
+--
+2.6.4
+
include $(TOPDIR)/rules.mk
PKG_NAME:=libgcrypt
-PKG_VERSION:=1.6.1
+PKG_VERSION:=1.6.6
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.gnupg.org/gcrypt/libgcrypt
-PKG_MD5SUM:=a5a5060dc2f80bcac700ab0236ea47dc
+PKG_MD5SUM:=944cf6595021d0c33478148a315b335b
PKG_FIXUP:=patch-libtool
PKG_INSTALL:=1
#
-# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=libidn
-PKG_VERSION:=1.32
+PKG_VERSION:=1.33
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/libidn
-PKG_MD5SUM:=4dd8356ba577287ea7076bfa1554b534
+PKG_MD5SUM:=a9aa7e003665de9c82bd3f9fc6ccf308
PKG_LICENSE:=GPL-2.0+ GPL-3.0+ LGPL-2.1+ LGPL-3.0+ Apache-2.0
PKG_LICENSE_FILES:=COPYING COPYINGv2 COPYINGv3 COPYING.LESSERv2 COPYING.LESSERv3 java/LICENSE-2.0.txt
define Package/libidn/install
$(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.so.* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libidn.so* $(1)/usr/lib/
endef
$(eval $(call BuildPackage,idn))
$(call Package/jpeg/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Image Manipulation
DEPENDS:=+libjpeg
TITLE+= manipulation tools
endef
+++ /dev/null
-#
-# 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:=libnfc
-PKG_VERSION:=1.7.1
-PKG_RELEASE:=1
-PKG_INSTALL:=1
-PKG_FIXUP:=autoreconf
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/nfc-tools/libnfc
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_LICENSE:=LGPL-2.1
-PKG_MAINTAINER:=Sebastian Wendel <packages@sourceindex.de>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/libnfc/Default
- TITLE:=A open source library for Near Field Communication (NFC)
- URL:=http://nfc-tools.org/
-endef
-
-define Package/libnfc
- $(call Package/libnfc/Default)
- SECTION:=libs
- CATEGORY:=Libraries
- DEPENDS:=+libusb-compat +pcscd +ccid
-endef
-
-define Package/libnfc/description
- libnfc is the first libre, platform-independent, low level NFC SDK and Programmers API
-
- * manipulate Jewel Topaz tags using libnfc
- * manipulate MIFARE Classic and Ultralight tags using libnfc
-
-endef
-
-define Package/nfc-utils
- $(call Package/libnfc/Default)
- SECTION:=utils
- CATEGORY:=Utilities
- DEPENDS:=+libnfc
-endef
-
-define Package/nfc-utils/description
- Provide some examples shared functions like print, parity calculation, options parsing
-
- * Emulates a NFC Forum Tag Type 4 v2.0 (or v1.0)
- * Jewel dump/restore tool
- * Lists the first target present of each founded device
- * MIFARE Classic manipulation example
- * MIFARE Ultralight dump/restore tool
- * Extract NDEF Message from a NFC Forum Tag Type 3
- * Relay example using two PN532 devices
- * Lists each available NFC device
-
-endef
-
-TARGET_CFLAGS+=$(FPIC)
-CONFIGURE_ARGS+=--without-readline
-
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include
- $(CP) $(PKG_INSTALL_DIR)/usr/include/nfc $(1)/usr/include/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.{a,so*} $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnfc.pc $(1)/usr/lib/pkgconfig/
-endef
-
-define Package/libnfc/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnfc.so.* $(1)/usr/lib/
-endef
-
-define Package/nfc-utils/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-emulate-forum-tag4 $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-jewel $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-list $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfclassic $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-mfultralight $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-read-forum-tag3 $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-relay-picc $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/nfc-scan-device $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,libnfc))
-$(eval $(call BuildPackage,nfc-utils))
--- /dev/null
+#
+# libnopoll - Makefile for noPoll C WebSocket library
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nopoll
+PKG_VERSION:=0.4.2
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/ASPLes/nopoll.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=60a81fbd199551ac5dd017b9a44fb46e8530680b
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+
+PKG_MAINTAINER:=John Clark <inindev@gmail.com>
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+PKG_BUILD_PARALLEL:=1
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libnopoll
+ SECTION:=libs
+ CATEGORY:=Libraries
+ DEPENDS:=+libopenssl
+ TITLE:=noPoll C WebSocket Library
+ URL:=http://www.aspl.es/nopoll
+endef
+
+define Package/libnopoll/description
+ This package contains the noPoll C WebSocket library.
+endef
+
+CONFIGURE_ARGS += \
+ --enable-nopoll-log=no \
+ --enable-nopoll-doc=no
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/{lib,include}
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnopoll.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libnopoll/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnopoll.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libnopoll))
include $(TOPDIR)/rules.mk
PKG_NAME:=libp11
-PKG_VERSION:=20141217
-PKG_RELEASE:=1
+PKG_VERSION:=0.4.1
+PKG_RELEASE:=2
+PKG_MD5SUM:=70489f6dbe0b7fd72aab010c25016fa047723f67ea50ce9ae73bc8d38181b673
+
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/OpenSC/libp11.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=9f433022a039bbdf31f6c334f442ac3494ac4a07
+PKG_SOURCE_URL:=https://github.com/OpenSC/libp11/releases/download/$(PKG_NAME)-$(PKG_VERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_FIXUP:=libtool
+PKG_FIXUP:=libtool
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
TITLE:=PKCS#11 wrapper library
URL:=https://www.opensc-project.org/opensc/wiki/libp11
DEPENDS:=+libopenssl
+ CONFLICTS:=engine_pkcs11
endef
define Package/libp11/description
to make using PKCS#11 implementations easier.
endef
+CONFIGURE_ARGS += --with-enginesdir=/usr/lib/engines
+
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/include/libp11.h $(1)/usr/include/
endef
define Package/libp11/install
- $(INSTALL_DIR) $(1)/usr/lib
+ $(INSTALL_DIR) $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libp11.so.* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/engines
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/engines/*.so* $(1)/usr/lib/engines
+ $(LN) pkcs11.so $(1)/usr/lib/engines/libpkcs11.so
endef
$(eval $(call BuildPackage,libp11))
--- /dev/null
+Index: libp11-0.4.1/src/Makefile.am
+===================================================================
+--- libp11-0.4.1.orig/src/Makefile.am
++++ libp11-0.4.1/src/Makefile.am
+@@ -36,12 +36,6 @@ pkcs11_la_LIBADD = $(libp11_la_OBJECTS)
+ pkcs11_la_LDFLAGS = $(AM_LDFLAGS) -module -shared -shrext $(SHARED_EXT) \
+ -avoid-version -export-symbols "$(srcdir)/pkcs11.exports"
+
+-# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
+-check-local: $(LTLIBRARIES)
+- cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-install-exec-hook:
+- cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-
+ if WIN32
+ # def file required for MS users to build library
+ mylibdir=$(libdir)
+Index: libp11-0.4.1/src/Makefile.in
+===================================================================
+--- libp11-0.4.1.orig/src/Makefile.in
++++ libp11-0.4.1/src/Makefile.in
+@@ -839,7 +839,7 @@ distdir: $(DISTFILES)
+ fi; \
+ done
+ check-am: all-am
+- $(MAKE) $(AM_MAKEFLAGS) check-local
++ $(MAKE) $(AM_MAKEFLAGS)
+ check: check-am
+ all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) config.h
+ installdirs:
+@@ -910,7 +910,7 @@ install-dvi-am:
+
+ install-exec-am: install-libLTLIBRARIES
+ @$(NORMAL_INSTALL)
+- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
++ $(MAKE) $(AM_MAKEFLAGS)
+ install-html: install-html-am
+
+ install-html-am:
+@@ -955,7 +955,7 @@ uninstall-am: uninstall-enginesLTLIBRARI
+
+ .MAKE: all check-am install-am install-exec-am install-strip
+
+-.PHONY: CTAGS GTAGS TAGS all all-am check check-am check-local clean \
++.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+ clean-enginesLTLIBRARIES clean-generic clean-libLTLIBRARIES \
+ clean-libtool cscopelist-am ctags ctags-am distclean \
+ distclean-compile distclean-generic distclean-hdr \
+@@ -963,7 +963,7 @@ uninstall-am: uninstall-enginesLTLIBRARI
+ html-am info info-am install install-am install-data \
+ install-data-am install-dvi install-dvi-am \
+ install-enginesLTLIBRARIES install-exec install-exec-am \
+- install-exec-hook install-html install-html-am \
++ install-html install-html-am \
+ install-includeHEADERS install-info install-info-am \
+ install-libLTLIBRARIES install-man install-mylibDATA \
+ install-pdf install-pdf-am install-pkgconfigDATA install-ps \
+@@ -979,11 +979,6 @@ uninstall-am: uninstall-enginesLTLIBRARI
+
+ $(srcdir)/config.h.in $(srcdir)/config.h.in~
+
+-# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
+-check-local: $(LTLIBRARIES)
+- cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+-install-exec-hook:
+- cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+ @WIN32_TRUE@.libs/@WIN_LIBPREFIX@p11-@LIBP11_LT_OLDEST@.dll.def: libp11.la
+
+ .rc.lo:
#
-# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=libsearpc
-PKG_VERSION:=3.1.7
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
+PKG_VERSION:=5.1.4
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_PROTO:=git
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
+$(call include_mk, python-package.mk)
define Package/libsearpc
SECTION:=libs
TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv
-include $(INCLUDE_DIR)/host-build.mk
-
-define Host/Configure
-endef
-
-define Host/Compile
-endef
-
-define Host/Install
- $(INSTALL_DIR) $(STAGING_DIR)/host/bin
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/lib/searpc-codegen.py $(STAGING_DIR)/host/bin/
-endef
-
-$(eval $(call HostBuild))
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/{bin,include}
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
define Package/libsearpc/install
$(INSTALL_DIR) $(1)/usr/lib
- $(INSTALL_DIR) $(1)/usr/lib/python2.7/site-packages
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/pysearpc $(1)/usr/lib/python2.7/site-packages/
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/pysearpc $(1)$(PYTHON_PKG_DIR)
+ find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef
$(eval $(call BuildPackage,libsearpc))
include $(TOPDIR)/rules.mk
PKG_NAME:=libsodium
-PKG_VERSION:=1.0.10
-PKG_RELEASE:=1
+PKG_VERSION:=1.0.11
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases
-PKG_MD5SUM:=ea89dcbbda0b2b6ff6a1c476231870dd
+PKG_MD5SUM:=b58928d035064b2a46fb564937b83540
PKG_FIXUP:=libtool autoreconf
PKG_USE_MIPS16:=0
include $(TOPDIR)/rules.mk
PKG_NAME:=libstrophe
-PKG_VERSION:=0.8.8
+PKG_VERSION:=0.9.1
PKG_RELEASE=1
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_URL:=https://github.com/strophe/libstrophe/archive/
PKG_SOURCE:=$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=2db62ab21187785ec5f870adc33b74e5
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=libuv
-PKG_VERSION:=1.6.1
+PKG_VERSION:=1.9.1
PKG_RELEASE:=1
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://dist.libuv.org/dist/v$(PKG_VERSION)/
-PKG_MD5SUM:=51cfa3d8adc05852982e3c742ec3c039
+PKG_MD5SUM:=654bf6783ac7fc10435c84ec86720a6e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=libwebsockets
-PKG_VERSION:=1.7.5
+PKG_VERSION:=2.0.3
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_PROTO:=git
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://github.com/warmcat/libwebsockets.git
+PKG_SOURCE_URL:=https://codeload.github.com/warmcat/libwebsockets/tar.gz/v$(PKG_VERSION)?
+PKG_MD5SUM:=a025156d606d90579e65d53ccd062a94
+
+
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR)
TITLE:=libwebsockets
DEPENDS:=+zlib
URL:=https://libwebsockets.org
- MAINTAINER:=Karl Palsson <karlp@remake.is>
+ MAINTAINER:=Karl Palsson <karlp@etactica.com>
endef
define Package/libwebsockets-openssl
VARIANT:=cyassl
endef
+define Package/libwebsockets-full
+ $(call Package/$(PKG_NAME)/Default)
+ TITLE += (Full - OpenSSL, libuv, plugins, CGI)
+ DEPENDS += +libopenssl +libuv
+ VARIANT:=full
+endef
+
ifeq ($(BUILD_VARIANT),openssl)
CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
CMAKE_OPTIONS += -DLWS_CYASSL_INCLUDE_DIRS=$(STAGING_DIR)/usr/include
endif
+ifeq ($(BUILD_VARIANT),full)
+ CMAKE_OPTIONS += -DLWS_OPENSSL_CLIENT_CERTS=/etc/ssl/certs
+ CMAKE_OPTIONS += -DLWS_OPENSSL_SUPPORT=ON
+ CMAKE_OPTIONS += -DLWS_WITH_SSL=ON
+ CMAKE_OPTIONS += -DLWS_WITH_LIBUV=ON
+ CMAKE_OPTIONS += -DLWS_WITH_PLUGINS=ON
+ CMAKE_OPTIONS += -DLWS_WITH_SERVER_STATUS=ON
+ CMAKE_OPTIONS += -DLWS_WITH_ACCESS_LOG=ON
+ CMAKE_OPTIONS += -DLWS_WITH_CGI=ON
+endif
+
define Package/libwebsockets/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libwebsockets.so* $(1)/usr/lib/
Package/$(PKG_NAME)-cyassl/install = $(Package/$(PKG_NAME)/install)
Package/$(PKG_NAME)-openssl/install = $(Package/$(PKG_NAME)/install)
+Package/$(PKG_NAME)-full/install = $(Package/$(PKG_NAME)/install)
$(eval $(call BuildPackage,libwebsockets-openssl))
$(eval $(call BuildPackage,libwebsockets-cyassl))
+$(eval $(call BuildPackage,libwebsockets-full))
include $(TOPDIR)/rules.mk
PKG_NAME:=x264
-PKG_VERSION:=snapshot-20160416-2245-stable
-PKG_RELEASE:=1
+PKG_VERSION:=snapshot-20160815-2245-stable
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://download.videolan.org/x264/snapshots/
PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
-PKG_MD5SUM:=70953574692cb80232d2879b80a140e0
+PKG_MD5SUM:=93fa596ea1b5513fec73e9de27589dd4
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
-TARGET_CFLAGS:=-Wno-maybe-uninitialized -Wshadow -Wall -std=gnu99 -fPIC -O3 -ffast-math -I.
+TARGET_CFLAGS+=-std=gnu99 -fPIC -O3 -ffast-math -I.
MAKE_FLAGS+= LD="$(TARGET_CC) -o"
+# ARM ASM depends on ARM1156 or later, blacklist earlier or incompatible cores
+CPU_ASM_BLACKLIST:=arm920t arm926ej-s arm1136j-s arm1176jzf-s fa526 mpcore xscale
+
+ifneq ($(CONFIG_TARGET_x86),)
+ifeq ($(CONFIG_YASM),y)
+ CONFIGURE_VARS+= AS=yasm
+ MAKE_FLAGS+= AS=yasm
+else
+ CONFIGURE_VARS+= AS=
+ MAKE_FLAGS+= AS=
+ CONFIGURE_ARGS += --disable-asm
+endif
+endif
+
+ifneq ($(CONFIG_SOFT_FLOAT)$(findstring $(CONFIG_CPU_TYPE),$(CPU_ASM_BLACKLIST)),)
+CONFIGURE_VARS+= AS=
+MAKE_FLAGS+= AS=
+CONFIGURE_ARGS += --disable-asm
+endif
+
CONFIGURE_ARGS += \
--enable-shared \
--enable-pic \
--disable-cli
-ifeq ($(CONFIG_SOFT_FLOAT),y)
-CONFIGURE_ARGS += --disable-asm
-endif
-
define Package/libx264
SECTION:=libs
CATEGORY:=Libraries
TITLE:=H264/AVC free codec library.
- DEPENDS:=@BUILD_PATENTED
+ DEPENDS:=+libpthread @BUILD_PATENTED
URL:=http://www.videolan.org/developers/x264.html
endef
include $(TOPDIR)/rules.mk
-PKG_NAME:=libxerces-c
-PKG_VERSION:=3.1.3
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://git.apache.org/xerces-c.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=Xerces-C_3_1_3
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_NAME:=xerces-c
+PKG_VERSION:=3.1.4
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@APACHE/xerces/c/3/sources
+PKG_MD5SUM:=9973cc79481803f8b6652c52faf5195d963f50d209d4f681ec97e2aa014b6241
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=Apache-2.0
#
-# Copyright (C) 2007-2014 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=libzdb
-PKG_VERSION:=3.0
-PKG_RELEASE:=1
+PKG_VERSION:=3.1
+PKG_RELEASE:=3
PKG_LICENSE:=GPL-3.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.tildeslash.com/libzdb/dist/
-PKG_MD5SUM:=3bb9efff10a1f3ebc5b76c1055c48635
+PKG_MD5SUM:=01d8519a596d62f6b43559cc29ecd36d
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
-ifeq ($(CONFIG_USE_MUSL),n)
- LDFLAGS += -lnsl
-endif
-
define Package/libzdb
SECTION:=libs
CATEGORY:=Libraries
-diff -rupN libzdb-3.0.orig/configure.ac libzdb-3.0/configure.ac
---- libzdb-3.0.orig/configure.ac 2014-01-06 22:17:57.000000000 +0100
-+++ libzdb-3.0/configure.ac 2014-11-20 13:59:27.456957651 +0100
+diff -rupN libzdb-3.1.orig/configure.ac libzdb-3.1/configure.ac
+--- libzdb-3.1.orig/configure.ac 2015-08-31 14:46:02.000000000 +0200
++++ libzdb-3.1/configure.ac 2016-04-18 19:43:13.836937134 +0200
@@ -196,15 +196,6 @@ AC_SEARCH_LIBS([pthread_create], [pthrea
# Database Libraries
- DBCPPFLAGS="$DBCPPFLAGS `$MYSQLCONFIG --include`"
- DBLDFLAGS="$DBLDFLAGS `$MYSQLCONFIG --libs`"
+ DBCPPFLAGS="$DBCPPFLAGS -I$STAGING_DIR/usr/include/mysql"
-+ DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib -lmysqlclient -lz -lcrypt -lm $LDFLAGS"
++ DBLDFLAGS="$DBLDFLAGS -L$STAGING_DIR/usr/lib/mysql -L$STAGING_DIR/usr/lib -lmysqlclient -lz -lcrypt -lm"
AC_DEFINE([HAVE_LIBMYSQLCLIENT], 1, [Define to 1 to enable mysql])
else
CPPFLAGS=$svd_CPPFLAGS
- [
- svd_LDFLAGS=$LDFLAGS
- svd_CPPFLAGS=$CPPFLAGS
-- LDFLAGS="-L$with_sqlite/lib $LDFLAGS -lsqlite3"
+- LDFLAGS="-L$with_sqlite/lib $LDFLAGS"
- CPPFLAGS="-I$with_sqlite/include $CPPFLAGS"
- AC_SEARCH_LIBS([sqlite3_open], [sqlite3],
- [
- DBCPPFLAGS="$DBCPPFLAGS -I$with_sqlite/include"
- DBLDFLAGS="$DBLDFLAGS -L$with_sqlite/lib/ -lsqlite3"
-- ],[sqlite="no"])
+- ],[sqlite="no"],[-ldl])
- LDFLAGS=$svd_LDFLAGS
- CPPFLAGS=$svd_CPPFLAGS
-
- ],
-- AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"]))
+- AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"], [-ldl]))
+ AC_SEARCH_LIBS([sqlite3_open], [sqlite3], [], [sqlite="no"])
fi
],
AC_CHECK_FUNCS([timegm])
-@@ -487,11 +421,6 @@ echo "| PostgreSQL:
+@@ -516,11 +450,6 @@ echo "| PostgreSQL:
else
echo "| PostgreSQL: DISABLED |"
fi
echo "+------------------------------------------------------------+"
-diff -rupN libzdb-3.0.orig/Makefile.am libzdb-3.0/Makefile.am
---- libzdb-3.0.orig/Makefile.am 2014-01-06 22:34:08.000000000 +0100
-+++ libzdb-3.0/Makefile.am 2014-11-20 13:51:22.508204689 +0100
+diff -rupN libzdb-3.1.orig/Makefile.am libzdb-3.1/Makefile.am
+--- libzdb-3.1.orig/Makefile.am 2015-08-31 14:55:18.000000000 +0200
++++ libzdb-3.1/Makefile.am 2016-04-18 19:43:42.215769551 +0200
@@ -45,11 +45,6 @@ libzdb_la_SOURCES += src/db/sqlite/SQLit
src/db/sqlite/SQLiteResultSet.c \
src/db/sqlite/SQLitePreparedStatement.c
--- /dev/null
+#
+# Copyright (C) 2007-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=loudmouth
+PKG_VERSION:=1.5.3
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=LGPLv2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/mcabber/loudmouth.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+PKG_MD5SUM:=7616cf124a8d72d007e7475b5aeb20ad
+
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/loudmouth
+ SECTION:=libs
+ CATEGORY:=Libraries
+ DEPENDS:=+glib2 +libopenssl
+ TITLE:=loudmouth
+ URL:=https://github.com/mcabber/loudmouth
+endef
+
+define Package/loudmouth/description
+ Lightweight and easy-to-use C library for programming with the Jabber protocol
+endef
+
+CONFIGURE_ARGS += \
+ --with-ssl=openssl
+
+define Build/Configure
+ ( cd $(PKG_BUILD_DIR); ./autogen.sh )
+ $(call Build/Configure/Default)
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/include/loudmouth-1.0/ \
+ $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
+ $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/loudmouth/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/*.so* \
+ $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,loudmouth))
include $(TOPDIR)/rules.mk
PKG_NAME:=neon
-PKG_VERSION:=0.30.0
+PKG_VERSION:=0.30.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.webdav.org/neon
-PKG_MD5SUM:=fb60b3a124eeec441937a812c456fd94
+PKG_MD5SUM:=e28d77bf14032d7f5046b3930704ef41
PKG_INSTALL:=1
$(CP) $(PKG_INSTALL_DIR)/usr/include/opencv2 $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libopencv* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/opencv.pc $(1)/usr/lib/pkgconfig/
endef
define Package/opencv/install
include $(TOPDIR)/rules.mk
PKG_NAME:=openldap
-PKG_VERSION:=2.4.43
-PKG_RELEASE:=3
+PKG_VERSION:=2.4.44
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
-PKG_MD5SUM:=49ca65e27891fcf977d78c10f073c705
+PKG_MD5SUM:=693ac26de86231f8dcae2b4e9d768e51
PKG_FIXUP:=autoreconf
#
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=opus
-PKG_VERSION:=1.1
-PKG_RELEASE:=2
+PKG_VERSION:=1.1.3
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/opus/
-PKG_MD5SUM:=c5a8cf7c0b066759542bc4ca46817ac6
+PKG_MD5SUM:=32bbb6b557fe1b6066adc0ae1f08b629
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
define Package/libopus
SECTION:=libs
CATEGORY:=Libraries
- TITLE:=OPUS Codec
+ TITLE:=OPUS Audio Codec
URL:=http://opus-codec.org/
endef
--disable-doc \
--disable-extra-programs
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+ CONFIGURE_ARGS+= \
+ --enable-fixed-point
+endif
+
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/opus $(1)/usr/include/
include $(TOPDIR)/rules.mk
PKG_NAME:=poco
-PKG_VERSION:=1.7.3
+PKG_VERSION:=1.7.5
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://pocoproject.org/releases/poco-1.7.3
-PKG_MD5SUM:=a27c40529b6c32352ec890f6fe18bc0d
+PKG_SOURCE_URL:=http://pocoproject.org/releases/poco-1.7.5
+PKG_MD5SUM:=baafda4833c4dd95993398d9f237c96c
PKG_LICENSE:=BSL-1.0
PKG_LICENSE_FILES:=LICENSE
include $(TOPDIR)/rules.mk
PKG_NAME:=postgresql
-PKG_VERSION:=9.5.1
-PKG_RELEASE:=1
-PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
+PKG_VERSION:=9.5.4
+PKG_RELEASE:=4
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=PostgreSQL
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v$(PKG_VERSION) \
http://ftp.be.postgresql.org/postgresql/source/v$(PKG_VERSION) \
ftp://ftp-archives.postgresql.org/pub/source/v$(PKG_VERSION)
-PKG_MD5SUM:=11e037afaa4bd0c90bb3c3d955e2b401
+PKG_MD5SUM:=cf5e571164ad66028ecd7dd8819e3765470d45bcd440d258b686be7e69c76ed0
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0
PKG_FIXUP:=autoreconf
PKG_MACRO_PATHS:=config
+PKG_BUILD_DEPENDS += postgresql/host
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/libpq
SECTION:=libs
CATEGORY:=Libraries
- DEPENDS:=+zlib +libreadline +libpthread +libncurses
+ DEPENDS:=+zlib +libreadline +libpthread +libncursesw
TITLE:=PostgreSQL client library
URL:=http://www.postgresql.org/
SUBMENU:=database
define Package/pgsql-cli
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=+libpq +USE_UCLIBC:librt +shadow-utils +shadow-su
+ DEPENDS:=+libpq +librt
TITLE:=Command Line Interface (CLI) to PostgreSQL databases
URL:=http://www.postgresql.org/
SUBMENU:=database
Command Line Interface (CLI) to PostgreSQL databases.
endef
+define Package/pgsql-cli-extra
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libpq +librt
+ TITLE:=Command Line extras for PostgreSQL databases
+ URL:=http://www.postgresql.org/
+ SUBMENU:=database
+endef
+
+define Package/pgsql-cli-extra/description
+Command Line extras for PostgreSQL databases.
+endef
+
define Package/pgsql-server
SECTION:=utils
CATEGORY:=Utilities
- DEPENDS:=+libpq +USE_UCLIBC:librt
+ DEPENDS:=+libpq +librt +pgsql-cli
TITLE:=PostgreSQL databases Server
URL:=http://www.postgresql.org/
SUBMENU:=database
PostgreSQL databases Server.
endef
+PGSQL_CLI_EXTRA_BIN := \
+ clusterdb \
+ createdb \
+ createlang \
+ createuser \
+ dropdb \
+ droplang \
+ dropuser \
+ pgbench \
+ reindexdb \
+ vacuumdb
+
PGSQL_CONFIG_VARS:= \
pgac_cv_snprintf_long_long_int_format="%lld" \
pgac_cv_snprintf_size_t_support=yes
TARGET_CONFIGURE_OPTS+=$(PGSQL_CONFIG_VARS)
-# Need a native ecpg ,pg_config, and zic for build
-define Build/Configure
- (cd $(PKG_BUILD_DIR); rm -f config.cache; \
- $(PGSQL_CONFIG_VARS) \
- ./configure \
- --prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --datadir=/usr/share \
- --includedir=/usr/include \
- --infodir=/usr/share/info \
- --libdir=/usr/lib \
- --libexecdir=/usr/lib \
- --localstatedir=/var \
- --mandir=/usr/share/man \
- --sbindir=/usr/sbin \
- --sysconfdir=/etc \
+HOST_CONFIGURE_ARGS += \
$(DISABLE_NLS) \
- --enable-shared \
- --enable-static \
- --disable-integer-datetimes \
--disable-rpath \
--without-bonjour \
--without-gssapi \
--without-readline \
--without-tcl \
--with-zlib="yes" \
- --enable-depend \
- --with-system-timezone=/tmp \
- );
- $(MAKE) -C $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)"
- mv $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg \
- $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host
- $(MAKE) -C $(PKG_BUILD_DIR)/src/timezone CC="$(HOSTCC)"
- mv $(PKG_BUILD_DIR)/src/timezone/zic $(PKG_BUILD_DIR)/host-zic
- $(INSTALL_DIR) $(STAGING_DIR)/host/bin/
- $(CP) $(PKG_BUILD_DIR)/host-zic $(STAGING_DIR)/host/bin/zic
- $(MAKE) -C $(PKG_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
- mv $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config \
- $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host
- $(MAKE) -C $(PKG_BUILD_DIR) distclean
-
- (cd $(PKG_BUILD_DIR); rm -f config.cache; \
- $(TARGET_CONFIGURE_OPTS) \
- CFLAGS="$(TARGET_CFLAGS)" \
- CPPFLAGS="$$$$CPPFLAGS $(TARGET_CPPFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- ./configure \
- --target=$(GNU_TARGET_NAME) \
- --host=$(GNU_TARGET_NAME) \
- --build=$(GNU_HOST_NAME) \
- --program-prefix="" \
- --program-suffix="" \
- --prefix=/usr \
- --exec-prefix=/usr \
- --bindir=/usr/bin \
- --datadir=/usr/share \
- --includedir=/usr/include \
- --infodir=/usr/share/info \
- --libdir=/usr/lib \
- --libexecdir=/usr/lib \
- --localstatedir=/var \
- --mandir=/usr/share/man \
- --sbindir=/usr/sbin \
- --sysconfdir=/etc \
- $(DISABLE_NLS) \
- $(DISABLE_LARGEFILE) \
- --enable-shared \
- --enable-static \
- --disable-integer-datetimes \
+ --enable-depend
+
+CONFIGURE_ARGS += \
--disable-rpath \
--without-bonjour \
--without-gssapi \
--without-tcl \
--with-zlib="yes" \
--enable-depend \
- $(if $(CONFIG_TARGET_avr32),--disable-spinlocks) \
- );
- $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = ../../preproc/ecpg.host@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
+ $(if $(CONFIG_TARGET_avr32),--disable-spinlocks)
+
+# Need a native ecpg ,pg_config, and zic for build
+define Host/Compile
+ $(MAKE) -C $(HOST_BUILD_DIR)/src/interfaces/ecpg/preproc CC="$(HOSTCC)"
+ $(MAKE) -C $(HOST_BUILD_DIR)/src/timezone CC="$(HOSTCC)"
+ $(MAKE) -C $(HOST_BUILD_DIR)/src/bin/pg_config CC="$(HOSTCC)"
+endef
+
+define Host/Install
+ $(INSTALL_DIR) $(STAGING_DIR)/usr/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/bin/pg_config/pg_config $(STAGING_DIR)/usr/bin/
+ $(INSTALL_DIR) $(STAGING_DIR)/host/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg $(STAGING_DIR)/host/bin/
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/src/timezone/zic $(STAGING_DIR)/host/bin/
+endef
+
+define Build/Configure
+ $(Build/Configure/Default)
+ $(SED) 's@ECPG = ../../preproc/ecpg@ECPG = $(STAGING_DIR)/host/bin/ecpg@' $(PKG_BUILD_DIR)/src/interfaces/ecpg/test/Makefile.regress
endef
TARGET_CFLAGS += $(FPIC) -lpthread
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/psql $(1)/usr/bin/
endef
+define Package/pgsql-cli-extra/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(foreach bin,$(PGSQL_CLI_EXTRA_BIN),$(PKG_INSTALL_DIR)/usr/bin/$(bin)) $(1)/usr/bin/
+endef
+
define Package/pgsql-server/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_DIR) $(1)/usr/share/postgresql
- $(INSTALL_DIR) $(1)/usr/lib
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/pg_* $(PKG_INSTALL_DIR)/usr/bin/postgres \
+ $(PKG_INSTALL_DIR)/usr/bin/initdb $(1)/usr/bin/
ln -sf postgres $(1)/usr/bin/postmaster
- $(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql
-
+ $(INSTALL_DIR) $(1)/usr/share/postgresql
$(CP) $(PKG_INSTALL_DIR)/usr/share/postgresql/* \
$(1)/usr/share/postgresql
- $(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql
-
+ $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/postgresql \
- $(1)/usr/lib
-endef
+ $(1)/usr/lib/
+
+ $(INSTALL_DIR) $(1)/lib/functions
+ $(INSTALL_BIN) ./files/postgresql.sh $(1)/lib/functions/
-define Package/pgsql-server/conffiles
-/etc/config/postgresql
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/postgresql.config $(1)/etc/config/postgresql
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/postgresql.init $(1)/etc/init.d/postgresql
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bin/pg_config/pg_config.host $(1)/usr/bin/pg_config
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpq $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/include/libpq-fe.h $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/include/postgresql $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpq.{a,so*} $(1)/usr/lib/
- $(CP) $(PKG_BUILD_DIR)/src/interfaces/ecpg/preproc/ecpg.host $(1)/usr/bin/ecpg
- $(CP) $(PKG_BUILD_DIR)/host-zic $(1)/usr/bin/zic
endef
+$(eval $(call HostBuild))
$(eval $(call BuildPackage,libpq))
$(eval $(call BuildPackage,pgsql-cli))
+$(eval $(call BuildPackage,pgsql-cli-extra))
$(eval $(call BuildPackage,pgsql-server))
config postgresql config
- option PGUSER postgres
option PGDATA /var/postgresql/data
- option PGLOG /var/postgresql/data/postgresql.log
- option PG_CTL /usr/bin/pg_ctl
}
start_service() {
+ . /lib/functions/postgresql.sh
+
config_load "postgresql"
config_get pgdata config PGDATA
- config_get pguser config PGUSER
- config_get pgctl config PG_CTL
config_get pgopts config PGOPTS
user_exists postgres 5432 || user_add postgres 5432
group_exists postgres 5432 || group_add postgres 5432
+ fix_perms
+ fix_hosts
+
if [ ! -d "${pgdata}" ]; then
- echo "Create the data directory (${pgdata}) and try again"
- return 1
+ pg_init_data ${pgdata}
+ [ $? -gt 0 ] && return 1
fi
- fix_perms
- fix_hosts
+ cleanup "${pgdata}"
procd_open_instance
-
- procd_set_param user ${pguser}
+ procd_set_param user postgres
procd_set_param command $PROG
procd_append_param command -D "${pgdata}"
[ -n "${pgopts}" ] && procd_append_param command -o "${pgopts}"
-
procd_set_param respawn retry=60
procd_close_instance
+
+ procd_open_instance
+ procd_set_param user postgres
+ procd_set_param command /lib/functions/postgresql.sh init "${pgdata}"
+ procd_close_instance
}
reload_service() {
config_load "postgresql"
config_get pgdata config PGDATA
- config_get pguser config PGUSER
- config_get pgctl config PG_CTL
- ${pgctl} reload -U ${pguser} -D '${pgdata}' -s
+ /usr/bin/pg_ctl reload -U postgres -D "${pgdata}" -s
+}
+
+stop_service() {
+ config_load "postgresql"
+ config_get pgdata config PGDATA
+ /usr/bin/pg_ctl stop -U postgres -D "${pgdata}" -s
}
status() {
config_load "postgresql"
config_get pgdata config PGDATA
- config_get pguser config PGUSER
- config_get pgctl config PG_CTL
- echo "status postgres..."
- ${pgctl} status -U ${pguser} -D '${pgdata}'
- echo "ok"
+ /usr/bin/pg_ctl status -U postgres -D "${pgdata}"
}
--- /dev/null
+#!/bin/sh
+
+PSQL="/usr/bin/psql"
+
+free_megs() {
+ fsdir=$1
+ while [ ! -d "$fsdir" ]; do
+ fsdir=$(dirname $fsdir)
+ done
+ df -m $fsdir | while read fs bl us av cap mnt; do [ "$av" = "Available" ] || echo $av; done
+}
+
+pg_init_data() {
+ # make sure we got at least 50MB of free space
+ [ $(free_megs $1) -lt 50 ] && return 1
+ pg_ctl initdb -U postgres -D $1
+}
+
+pg_server_ready() {
+ t=0
+ while [ $t -le 90 ]; do
+ pg_ctl status -U postgres -D $1 2>/dev/null >/dev/null && return 0
+ t=$((t+1))
+ sleep 1
+ done
+ return 1
+}
+
+# $1: dbname, $2: username, $3: password
+pg_require_db() {
+ pg_test_db $@ && return 0
+ ( echo "CREATE DATABASE $1;"
+ echo -n "CREATE USER $2"
+ [ "$3" ] && echo -n " WITH PASSWORD '$3'"
+ echo ";"
+ echo "GRANT ALL PRIVILEGES ON DATABASE \"$1\" to $2;" ) |
+ $PSQL -U postgres -d template1 -e
+ return $?
+}
+
+pg_test_db() {
+ PGPASSWORD=$3
+ echo "SHOW ALL;" | $PSQL -U $2 -d $1 -q 2>/dev/null >/dev/null
+ return $?
+}
+
+uci_require_db() {
+ local dbname dbuser dbpass
+ config_get dbname $1 name
+ config_get dbuser $1 user
+ config_get dbpass $1 pass
+ pg_require_db $dbname $dbuser $dbpass
+}
+
+[ "$1" = "init" ] && {
+ . /lib/functions.sh
+ pg_server_ready $2 || exit 1
+ config_load postgresql
+ config_foreach uci_require_db postgres-db
+}
--- /dev/null
+Index: postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
+===================================================================
+--- postgresql-9.5.4.orig/src/bin/pg_ctl/pg_ctl.c
++++ postgresql-9.5.4/src/bin/pg_ctl/pg_ctl.c
+@@ -95,6 +95,7 @@ static char *event_source = NULL;
+ static char *register_servicename = "PostgreSQL"; /* FIXME: + version ID? */
+ static char *register_username = NULL;
+ static char *register_password = NULL;
++static char *username = "";
+ static char *argv0 = NULL;
+ static bool allow_core_files = false;
+ static time_t start_time;
+@@ -2114,6 +2115,9 @@ do_help(void)
+ #endif
+ printf(_(" -s, --silent only print errors, no informational messages\n"));
+ printf(_(" -t, --timeout=SECS seconds to wait when using -w option\n"));
++#if !defined(WIN32) && !defined(__CYGWIN__)
++ printf(_(" -U, --username=NAME user name of account PostgreSQL server is running as\n"));
++#endif
+ printf(_(" -V, --version output version information, then exit\n"));
+ printf(_(" -w wait until operation completes\n"));
+ printf(_(" -W do not wait until operation completes\n"));
+@@ -2310,6 +2314,7 @@ main(int argc, char **argv)
+ {"pgdata", required_argument, NULL, 'D'},
+ {"silent", no_argument, NULL, 's'},
+ {"timeout", required_argument, NULL, 't'},
++ {"username", required_argument, NULL, 'U'},
+ {"core-files", no_argument, NULL, 'c'},
+ {NULL, 0, NULL, 0}
+ };
+@@ -2350,20 +2355,6 @@ main(int argc, char **argv)
+ }
+ }
+
+- /*
+- * Disallow running as root, to forestall any possible security holes.
+- */
+-#ifndef WIN32
+- if (geteuid() == 0)
+- {
+- write_stderr(_("%s: cannot be run as root\n"
+- "Please log in (using, e.g., \"su\") as the "
+- "(unprivileged) user that will\n"
+- "own the server process.\n"),
+- progname);
+- exit(1);
+- }
+-#endif
+
+ env_wait = getenv("PGCTLTIMEOUT");
+ if (env_wait != NULL)
+@@ -2449,11 +2440,15 @@ main(int argc, char **argv)
+ wait_seconds_arg = true;
+ break;
+ case 'U':
++#if defined(WIN32) || defined(__CYGWIN__)
+ if (strchr(optarg, '\\'))
+ register_username = pg_strdup(optarg);
+ else
+ /* Prepend .\ for local accounts */
+ register_username = psprintf(".\\%s", optarg);
++#else
++ username = pg_strdup(optarg);
++#endif
+ break;
+ case 'w':
+ do_wait = true;
+@@ -2535,6 +2530,41 @@ main(int argc, char **argv)
+ exit(1);
+ }
+
++ /*
++ * Disallow running as root, to forestall any possible security holes.
++ */
++#if !defined(WIN32) && !defined(__CYGWIN__)
++ if (geteuid() == 0)
++ {
++ struct passwd *p;
++ if (!username || !strlen(username)) {
++ fprintf(stderr,
++ _("%s: when run as root, username needs to be provided\n"),
++ progname);
++ exit(1);
++ }
++ p = getpwnam(username);
++ if (!p) {
++ fprintf(stderr,
++ _("%s: invalid username: %s\n"),
++ progname, username);
++ exit(1);
++ }
++ if (!p->pw_uid) {
++ fprintf(stderr,
++ _("%s: user needs to be non-root\n"),
++ progname);
++ exit(1);
++ }
++ if (setgid(p->pw_gid) || setuid(p->pw_uid)) {
++ fprintf(stderr,
++ _("%s: failed to set user id %d: %d (%s)\n"),
++ progname, p->pw_uid, errno, strerror(errno));
++ exit(1);
++ }
++ }
++#endif
++
+ /* Note we put any -D switch into the env var above */
+ pg_config = getenv("PGDATA");
+ if (pg_config)
PKG_NAME:=sqlite
PKG_VERSION:=3130000
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.sqlite.org/2016/
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
+ --disable-editline
CONFIGURE_VARS += \
config_BUILD_CC="$(HOSTCC)" \
$(call Package/tiff/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Image Manipulation
TITLE+= utilities
DEPENDS:=+libtiff
endef
+++ /dev/null
-#
-# Copyright (C) 2009-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=toxcore
-PKG_VERSION:=0.0.0
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/irungentoo/toxcore.git
-PKG_SOURCE_VERSION:=6d883f488ff59b2394982b62895d50b1d1d55bf4
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-PKG_LICENSE:=GPL
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/toxcore/Default
- SECTION:=libs
- CATEGORY:=Libraries
- SUBMENU:=Networking
- TITLE:=Tox
- URL:=https://tox.im
-endef
-
-define Package/toxcore/description/Default
- Tox, a FOSS initiative, aims to be an easy to use, all-in-one
- communication platform that ensures their users full privacy and
- secure message delivery.
-endef
-
-define Package/libtoxcore
- $(call Package/toxcore/Default)
- DEPENDS:=+libsodium +librt +libpthread
- TITLE+= core library
-endef
-
-define Package/libtoxcore/description
- $(call Package/toxcore/description/Default)
-
- core library
-endef
-
-define Package/libtoxav
- $(call Package/toxcore/Default)
- DEPENDS:=+libtoxcore +libopus +libvpx
- TITLE+= A/V library
-endef
-
-define Package/libtoxav/description
- $(call Package/toxcore/description/Default)
-
- A/V library providing audio/video codec bindings
-endef
-
-define Package/libtoxdns
- $(call Package/toxcore/Default)
- DEPENDS:=+libtoxcore
- TITLE+= dns library
-endef
-
-define Package/libtoxdns/description
- $(call Package/toxcore/description/Default)
-
- DNS library
-endef
-
-define Package/libtoxencryptsave
- $(call Package/toxcore/Default)
- DEPENDS:=+libtoxcore
- TITLE+= encryptsave library
-endef
-
-define Package/libtoxencryptsave/description
- $(call Package/toxcore/description/Default)
-
- encryptsave library
-endef
-
-define Package/ntox
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=Instant Messaging
- DEPENDS:=+libtoxcore +libncurses
- TITLE:=ntox Tox command-line client
-endef
-
-define Package/ntox/description
- $(call Package/toxcore/description/Default)
-
- nTox is an ncurses-based command-line client for Tox.
-endef
-
-define Package/tox-bootstrapd
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=Instant Messaging
- DEPENDS:=+libtoxcore +libconfig
- TITLE:=Tox DHT bootstrap
-endef
-
-define Package/tox-dht-bootstrap/description
- $(call Package/toxcore/description/Default)
-
- This package provide the Tox DHT bootstrap service.
-endef
-
-CONFIGURE_ARGS+= \
- --enable-daemon \
- --enable-ntox \
- --enable-av \
- --disable-testing \
- --disable-tests
-
-define Package/libtoxav/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtoxav.*so* $(1)/usr/lib
-endef
-
-define Package/libtoxcore/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtoxcore.*so* $(1)/usr/lib
-endef
-
-define Package/libtoxdns/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtoxdns.*so* $(1)/usr/lib
-endef
-
-define Package/libtoxencryptsave/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtoxencryptsave.*so* $(1)/usr/lib
-endef
-
-define Package/tox-bootstrapd/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/tox-bootstrapd $(1)/usr/bin
-endef
-
-define Package/ntox/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/nTox $(1)/usr/bin
-endef
-
-define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include/tox
- $(CP) $(PKG_INSTALL_DIR)/usr/include/tox/*.h $(1)/usr/include/tox
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtox* $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtoxcore.pc $(1)/usr/lib/pkgconfig/
-endef
-
-$(eval $(call BuildPackage,libtoxav))
-$(eval $(call BuildPackage,libtoxcore))
-$(eval $(call BuildPackage,libtoxdns))
-$(eval $(call BuildPackage,libtoxencryptsave))
-$(eval $(call BuildPackage,ntox))
-$(eval $(call BuildPackage,tox-bootstrapd))
--- /dev/null
+#
+# 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:=emailrelay
+PKG_VERSION:=1.9
+PKG_RELEASE:=3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
+PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
+PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL
+
+
+include $(INCLUDE_DIR)/uclibc++.mk
+include $(INCLUDE_DIR)/package.mk
+
+define Package/emailrelay
+ SECTION:=mail
+ CATEGORY:=Mail
+ DEPENDS:=$(CXX_DEPENDS) +EMAILRELAY_SSL:libopenssl
+ TITLE:=A simple SMTP proxy and MTA
+ URL:=http://emailrelay.sourceforge.net/
+ MAINTAINER:=Federico Di Marco <fededim@gmail.com>
+ MENU:=1
+endef
+
+
+define Package/emailrelay/config
+config EMAILRELAY_SUPPORT_VERBOSE_DBG
+ bool "Enable support for extended logging"
+ depends on PACKAGE_emailrelay
+ default n
+ help
+ Enables support for extended logging (must also be explicitely enabled by using command line switch --debug when starting emailrelay)
+
+config EMAILRELAY_SSL
+ bool "Enable support for OpenSSL"
+ depends on PACKAGE_emailrelay
+ default y
+ select PACKAGE_libopenssl
+ help
+ Builds the package with OpenSSL support (SSMTP is supported).
+endef
+
+
+
+define Package/emailrelay/description
+ Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA).
+
+ When running as a proxy all e-mail messages can be passed through
+ a user-defined program, such as a spam filter, which can drop,
+ re-address or edit messages as they pass through. When running
+ as a store-and-forward MTA incoming messages are stored in a
+ local spool directory, and then forwarded to the next SMTP
+ server on request.
+endef
+
+
+define Package/emailrelay/conffiles
+/etc/emailrelay.auth
+endef
+
+
+CONFIGURE_ARGS += \
+ --with-pam=no \
+ --enable-testing=no
+
+CONFIGURE_VARS += \
+ CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
+
+
+ifeq ($(CONFIG_EMAILRELAY_SSL),y)
+ CONFIGURE_ARGS += \
+ --with-openssl
+else
+ CONFIGURE_ARGS += \
+ --with-openssl=no
+endif
+
+
+ifeq ($(CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG),y)
+ CONFIGURE_ARGS += \
+ --enable-debug=yes
+endif
+
+ifeq ($(CONFIG_OPENSSL_WITH_SSL3),y)
+ CONFIGURE_VARS += \
+ CXXFLAGS="$$$$CXXFLAGS -DSSL3_SUPPORT"
+endif
+
+define Package/emailrelay/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-filter-copy $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-poke $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
+endef
+
+
+$(eval $(call BuildPackage,emailrelay))
--- /dev/null
+#
+# emailrelay secrets file
+#
+#see http://emailrelay.sourceforge.net/reference.html for reference
+
+#Mostly used options:
+#
+#NONE server specifies ip address range allowed to connect to emailrelay SMTP server
+#LOGIN client specifies the credentials to be used when forwarding emails to another SMTP server
+#LOGIN server specifies the credentials to be needed to authenticate with the emailrelay SMTP server
+
+#Examples:
+#
+#NONE server 192.168.1.* keyword
+#LOGIN client smtpuser@smtpserver smtppassword
+#LOGIN server user1 secret
\ No newline at end of file
--- /dev/null
+#!/bin/sh /etc/rc.common
+#see http://emailrelay.sourceforge.net/reference.html for command line reference
+
+START=90
+
+
+start() {
+ logger -t 'emailrelay' "Starting emailrelay service."
+ service_start /usr/bin/emailrelay --as-server --poll 60 --forward-to smtpserver:smtpport --spool-dir /tmp --client-tls --client-auth /etc/emailrelay.auth --server-auth /etc/emailrelay.auth --log
+}
+
+stop() {
+ logger -t 'emailrelay' "Stopping emailrelay service."
+ service_stop /usr/bin/emailrelay
+}
--- /dev/null
+--- a/src/gssl/gssl_openssl.cpp
++++ b/src/gssl/gssl_openssl.cpp
+@@ -292,8 +292,10 @@ GSsl::Context::Context( const std::strin
+ {
+ if( (flags&3U) == 2U )
+ m_ssl_ctx = SSL_CTX_new(SSLv23_method()) ;
++#ifdef SSL3_SUPPORT
+ else if( (flags&3U) == 3U )
+ m_ssl_ctx = SSL_CTX_new(SSLv3_method()) ;
++#endif
+ else
+ m_ssl_ctx = SSL_CTX_new(TLSv1_method()) ;
+
#
# Copyright (C) 2009 David Cooper <dave@kupesoft.com>
-# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=msmtp
PKG_VERSION:=1.6.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@SF/msmtp
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/msmtp/Default
SECTION:=mail
CATEGORY:=Mail
+ DEPENDS:=$(INTL_DEPENDS)
TITLE:=Simple sendmail SMTP forwarding
URL:=http://msmtp.sourceforge.net/
endef
PKG_NAME:=ssmtp
PKG_VERSION:=2.64
-PKG_RELEASE:=3
+PKG_RELEASE:=5
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
PKG_LICENSE:=GPL-2.0+
-menu "Configuration"
- depends on PACKAGE_libffmpeg-custom
+if PACKAGE_libffmpeg-custom
config FFMPEG_CUSTOM_PATENTED
bool "Include patented codecs and technologies"
default BUILD_PATENTED
-comment "Profiles ---"
+comment "Profiles"
config FFMPEG_CUSTOM_FFSERVER_SUPPORT
bool "Include support for ffserver (FFmpeg streaming server)"
select FFMPEG_CUSTOM_DECODER_ac3
select FFMPEG_CUSTOM_DECODER_flac
select FFMPEG_CUSTOM_DECODER_h264
+ select FFMPEG_CUSTOM_DECODER_hevc
select FFMPEG_CUSTOM_DECODER_jpegls
select FFMPEG_CUSTOM_DECODER_mp3
select FFMPEG_CUSTOM_DECODER_mpeg1video
select FFMPEG_CUSTOM_DECODER_mpeg4
select FFMPEG_CUSTOM_DECODER_mpegvideo
select FFMPEG_CUSTOM_DECODER_png
+ select FFMPEG_CUSTOM_DECODER_opus
+ select FFMPEG_CUSTOM_DECODER_vc1
+ select FFMPEG_CUSTOM_DECODER_vorbis
select FFMPEG_CUSTOM_DECODER_wmav1
select FFMPEG_CUSTOM_DECODER_wmav2
- select FFMPEG_CUSTOM_DEMUXER_aac
- select FFMPEG_CUSTOM_DEMUXER_ac3
select FFMPEG_CUSTOM_DEMUXER_avi
select FFMPEG_CUSTOM_DEMUXER_flac
- select FFMPEG_CUSTOM_DEMUXER_h264
select FFMPEG_CUSTOM_DEMUXER_matroska
select FFMPEG_CUSTOM_DEMUXER_mov
select FFMPEG_CUSTOM_DEMUXER_mp3
select FFMPEG_CUSTOM_DEMUXER_mpegts
select FFMPEG_CUSTOM_DEMUXER_mpegvideo
- select FFMPEG_CUSTOM_PARSER_ac3
- select FFMPEG_CUSTOM_PARSER_flac
- select FFMPEG_CUSTOM_PARSER_h264
- select FFMPEG_CUSTOM_PARSER_mpeg4video
- select FFMPEG_CUSTOM_PARSER_mpegaudio
+ select FFMPEG_CUSTOM_DEMUXER_ogg
select FFMPEG_CUSTOM_PROTOCOL_file
config FFMPEG_CUSTOM_AUDIO_DEC_SUPPORT
select FFMPEG_CUSTOM_PROTOCOL_tcp
select FFMPEG_CUSTOM_PROTOCOL_udp
-comment "External Libraries ---"
+comment "External Libraries"
+
+config FFMPEG_CUSTOM_SELECT_mp3lame
+ bool "MP3 LAME"
+ depends on FFMPEG_CUSTOM_PATENTED
+ depends on PACKAGE_lame-lib
+ select FFMPEG_CUSTOM_DECODER_mp3
+ select FFMPEG_CUSTOM_MUXER_mp3
+ select FFMPEG_CUSTOM_DEMUXER_mp3
config FFMPEG_CUSTOM_SELECT_libopus
bool "Opus"
config FFMPEG_CUSTOM_SELECT_speex
bool "Speex"
-comment "Encoders ---"
+config FFMPEG_CUSTOM_SELECT_x264
+ bool "x264"
+ depends on FFMPEG_CUSTOM_PATENTED
+ depends on PACKAGE_libx264
+ select FFMPEG_CUSTOM_DECODER_h264
+ select FFMPEG_CUSTOM_MUXER_h264
+ select FFMPEG_CUSTOM_DEMUXER_h264
+ select FFMPEG_CUSTOM_PARSER_h264
+
+comment "Encoders"
config FFMPEG_CUSTOM_ENCODER_ac3
bool "AC3"
config FFMPEG_CUSTOM_ENCODER_zlib
bool "Zlib"
-comment "Decoders ---"
+comment "Decoders"
config FFMPEG_CUSTOM_DECODER_aac
bool "AAC (Advanced Audio Coding)"
bool "H.264"
depends on FFMPEG_CUSTOM_PATENTED
+config FFMPEG_CUSTOM_DECODER_hevc
+ bool "HEVC / H.265 Video"
+ depends on FFMPEG_CUSTOM_PATENTED
+
config FFMPEG_CUSTOM_DECODER_jpegls
bool "JPEG-LS"
bool "PNG"
select FFMPEG_CUSTOM_DECODER_zlib
+config FFMPEG_CUSTOM_DECODER_vc1
+ bool "VC-1 / WMV9"
+ depends on FFMPEG_CUSTOM_PATENTED
+
config FFMPEG_CUSTOM_DECODER_vorbis
bool "Vorbis"
select FFMPEG_CUSTOM_DEMUXER_ogg
config FFMPEG_CUSTOM_DECODER_zlib
bool "Zlib"
-comment "Muxers ---"
+comment "Muxers"
config FFMPEG_CUSTOM_MUXER_ac3
bool "AC3"
bool "FFM (ffserver live feed)"
config FFMPEG_CUSTOM_MUXER_h264
- bool "H.264"
+ bool "H.264 Raw Video"
+ depends on FFMPEG_CUSTOM_PATENTED
+
+config FFMPEG_CUSTOM_MUXER_hevc
+ bool "HEVC / H265 Raw Video"
depends on FFMPEG_CUSTOM_PATENTED
config FFMPEG_CUSTOM_MUXER_mp3
config FFMPEG_CUSTOM_MUXER_rtp
bool "RTP"
-comment "Demuxers ---"
+comment "Demuxers"
config FFMPEG_CUSTOM_DEMUXER_aac
bool "AAC"
bool "FFM (ffserver live feed)"
config FFMPEG_CUSTOM_DEMUXER_h264
- bool "H.264"
+ bool "H.264 Raw Video"
+ depends on FFMPEG_CUSTOM_PATENTED
+
+config FFMPEG_CUSTOM_DEMUXER_hevc
+ bool "HEVC / H265 Raw Video"
depends on FFMPEG_CUSTOM_PATENTED
config FFMPEG_CUSTOM_DEMUXER_matroska
config FFMPEG_CUSTOM_DEMUXER_rtp
bool "RTP"
+config FFMPEG_CUSTOM_DEMUXER_vc1
+ bool "VC-1 / WMV9 Raw Video"
+ depends on FFMPEG_CUSTOM_PATENTED
+
config FFMPEG_CUSTOM_DEMUXER_wav
bool "WAV"
config FFMPEG_CUSTOM_DEMUXER_wv
bool "WV"
-comment "Parsers ---"
+comment "Parsers"
config FFMPEG_CUSTOM_PARSER_aac
bool "AAC (Advanced Audio Coding)"
depends on FFMPEG_CUSTOM_PATENTED
select FFMPEG_CUSTOM_DECODER_h264
+config FFMPEG_CUSTOM_PARSER_hevc
+ bool "HEVC / H265"
+ depends on FFMPEG_CUSTOM_PATENTED
+ select FFMPEG_CUSTOM_DECODER_hevc
+
config FFMPEG_CUSTOM_PARSER_mpegaudio
bool "MPEG Audio"
config FFMPEG_CUSTOM_PARSER_opus
bool "Opus"
-comment "Protocols ---"
+config FFMPEG_CUSTOM_PARSER_vc1
+ bool "VC-1 / WMV9"
+ depends on FFMPEG_CUSTOM_PATENTED
+ select FFMPEG_CUSTOM_DECODER_vc1
+
+comment "Protocols"
config FFMPEG_CUSTOM_PROTOCOL_file
bool "file:"
config FFMPEG_CUSTOM_PROTOCOL_udp
bool "udp:"
-endmenu
+endif
include $(TOPDIR)/rules.mk
PKG_NAME:=ffmpeg
-PKG_VERSION:=2.7.6
-PKG_RELEASE:=1
+PKG_VERSION:=2.8.8
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://ffmpeg.org/releases/
-PKG_MD5SUM:=578c88242872e58cf0db5f23faa4b2af
+PKG_MD5SUM:=5fae1ba5a5d37a2d0de750479b7270d4
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3
flac \
gif \
h264 \
+ hevc \
jpegls \
mp2 \
mp3 \
pcm_s16be \
pcm_s16le \
png \
+ vc1 \
vorbis \
wavpack \
wmav1 \
ac3 \
ffm \
h264 \
+ hevc \
mp3 \
mp4 \
mpeg1video \
flac \
ffm \
h264 \
+ hevc \
matroska \
mov \
mp3 \
rtp \
sdp \
v4l2 \
+ vc1 \
wav \
wv \
flac \
ac3 \
h264 \
+ hevc \
mpegaudio \
mpeg4video \
mpegvideo \
+ vc1 \
FFMPEG_CUSTOM_PROTOCOLS:= \
file http icecast pipe rtp tcp udp
ac3 \
flac \
h264 \
+ hevc \
jpegls \
mp3 \
mpeg1video \
mpeg2video \
mpeg4 \
mpegvideo \
+ opus \
png \
+ vc1 \
+ vorbis \
wmav1 \
wmav2 \
FFMPEG_MINI_DEMUXERS:= \
- aac \
- ac3 \
avi \
flac \
- h264 \
matroska \
mov \
mp3 \
mpegts \
mpegvideo \
-
-FFMPEG_MINI_PARSERS:= \
- ac3 \
- flac \
- h264 \
- mpeg4video \
- mpegaudio \
+ ogg \
FFMPEG_MINI_PROTOCOLS:= \
file \
This package contains the FFmpeg streaming server.
endef
-
define Package/libffmpeg/Default
$(call Package/ffmpeg/Default)
SECTION:=libs
CATEGORY:=Libraries
TITLE+= libraries
- DEPENDS+= +libpthread +zlib +libbz2
+ DEPENDS+= @BUILD_PATENTED +libpthread +zlib +libbz2
PROVIDES:= libffmpeg
endef
define Package/libffmpeg-custom
$(call Package/libffmpeg/Default)
TITLE+= (custom)
- DEPENDS+= @DEVEL @!ALL +libopus +libspeex
+ DEPENDS+= +FFMPEG_CUSTOM_SELECT_libopus:libopus +FFMPEG_CUSTOM_SELECT_speex:libspeex \
+ +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib
+
VARIANT:=custom
MENU:=1
endef
define Package/libffmpeg-audio-dec
$(call Package/libffmpeg/Default)
TITLE+= (audio)
- DEPENDS+= @BUILD_PATENTED +libspeex
+ DEPENDS+= +libspeex
VARIANT:=audio-dec
endef
define Package/libffmpeg-full
$(call Package/libffmpeg/Default)
TITLE+= (full)
- DEPENDS+= @BUILD_PATENTED +alsa-lib
+ DEPENDS+= +alsa-lib +PACKAGE_libx264:libx264 +PACKAGE_lame-lib:lame-lib +libopus +libspeex
VARIANT:=full
endef
define Package/libffmpeg-mini
$(call Package/libffmpeg/Default)
TITLE+= (mini)
- DEPENDS+= @BUILD_PATENTED
VARIANT:=mini
endef
--enable-small \
--enable-pthreads \
--enable-zlib \
- --disable-runtime-cpudetect \
--disable-doc \
--disable-debug \
\
--enable-gpl \
--enable-version3 \
\
+ --disable-dxva2 \
+ --disable-lzma \
+ --disable-vaapi \
+ --disable-vda \
+ --disable-vdpau \
+ --disable-outdevs
+
+ifeq ($(CONFIG_SOFT_FLOAT),y)
+FFMPEG_CONFIGURE += \
--disable-altivec \
--disable-amd3dnow \
--disable-amd3dnowext \
--disable-fma3 \
--disable-fma4 \
--disable-avx2 \
- --disable-vfp \
- --disable-neon \
--disable-inline-asm \
- --disable-yasm \
--disable-mips32r2 \
--disable-mipsdspr1 \
--disable-mipsdspr2 \
--disable-mipsfpu \
- \
- --disable-dxva2 \
- --disable-lzma \
- --disable-vaapi \
- --disable-vda \
- --disable-vdpau \
- --disable-outdevs
+ --disable-runtime-cpudetect
+
+else ifneq ($(findstring arm,$(CONFIG_ARCH)),)
+FFMPEG_CONFIGURE += \
+ --disable-runtime-cpudetect
+else ifneq ($(findstring powerpc,$(CONFIG_ARCH)),)
+FFMPEG_CONFIGURE += \
+ --disable-altivec
+endif
+
+ifneq ($(CONFIG_YASM),y)
+FFMPEG_CONFIGURE += \
+ --disable-yasm
+
+endif
+
+#selectibly disable optimizations according to arch/cpu type
+ifneq ($(findstring arm,$(CONFIG_ARCH)),)
+ ifeq (,$(findstring vfp,$(CONFIG_TARGET_OPTIMIZATION)))
+ FFMPEG_CONFIGURE+= \
+ --disable-vfp
+ endif
+ ifeq (,$(findstring neon,$(CONFIG_TARGET_OPTIMIZATION)))
+ FFMPEG_CONFIGURE+= \
+ --disable-neon
+ endif
+
+endif
+
+ifeq ($(BUILD_VARIANT),full)
+ FFMPEG_CONFIGURE+= \
+ --enable-libopus --enable-decoder=libopus \
+ --enable-libspeex --enable-decoder=libspeex \
+ $(if $(CONFIG_PACKAGE_libx264),--enable-libx264) \
+ $(if $(CONFIG_PACKAGE_lame-lib),--enable-libmp3lame)
+endif
ifeq ($(BUILD_VARIANT),custom)
ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_libopus),y)
FFMPEG_CONFIGURE+= \
- --enable-libopus --enable-decoder=libopus \
-
+ --enable-libopus --enable-decoder=libopus
endif
ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_speex),y)
FFMPEG_CONFIGURE+= \
- --enable-libspeex --enable-decoder=libspeex \
+ --enable-libspeex --enable-decoder=libspeex
+endif
+
+ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_x264),y)
+ FFMPEG_CONFIGURE+= \
+ --enable-libx264
+endif
+ifeq ($(CONFIG_FFMPEG_CUSTOM_SELECT_mp3lame),y)
+ FFMPEG_CONFIGURE+= \
+ --enable-libmp3lame
endif
endif
--disable-everything \
$(call FFMPEG_ENABLE,decoder,$(FFMPEG_MINI_DECODERS)) \
$(call FFMPEG_ENABLE,demuxer,$(FFMPEG_MINI_DEMUXERS)) \
- $(call FFMPEG_ENABLE,parser,$(FFMPEG_MINI_PARSERS)) \
$(call FFMPEG_ENABLE,protocol,$(FFMPEG_MINI_PROTOCOLS)) \
endif
$(eval $(call BuildPackage,ffmpeg))
$(eval $(call BuildPackage,ffprobe))
$(eval $(call BuildPackage,ffserver))
-$(eval $(call BuildPackage,libffmpeg-custom))
+$(eval $(call BuildPackage,libffmpeg-audio-dec))
$(eval $(call BuildPackage,libffmpeg-full))
$(eval $(call BuildPackage,libffmpeg-mini))
-$(eval $(call BuildPackage,libffmpeg-audio-dec))
+ifneq ($(CONFIG_ALL),y)
+ $(eval $(call BuildPackage,libffmpeg-custom))
+endif
#
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gst1-libav
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.8.2
PKG_RELEASE:=1
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+ Ted Hess <thess@kitschensync.net>
PKG_SOURCE:=gst-libav-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-libav
-PKG_MD5SUM:=09644a38827d233f53edeac815dd0ec0
+PKG_MD5SUM:=b5f3c7a27b39b5f5c2f0bfd546b0c655020faf6b38d27b64b346c43e5ebf687a
PKG_LICENSE:=GPL-2.0 LGPL-2.0
PKG_LICENSE_FILES:=COPYING COPYING.LIB
mpeg1video \
mpeg2video \
mpeg4 \
- mpeg4aac \
mpegvideo \
pcm_s16be \
pcm_s16le \
URL:=http://www.gstreamer.net/modules/gst-libav.html
DEPENDS:= +libgstreamer1 +gstreamer1-plugins-base \
+gst1-mod-alsa +libgst1audio +libgst1pbutils +libgst1video \
- +libbz2
+ +libbz2 +liblzma
endef
define Package/gst1-libav/description
CONFIGURE_ARGS += \
--without-system-libav \
- --with-libav-extra-configure="--target-os=linux \
+ --with-libav-extra-configure="--target-os=linux --cpu=$(CONFIG_CPU_TYPE) \
--disable-bsfs \
--disable-programs \
--disable-devices \
--disable-fma3 \
--disable-fma4 \
--disable-avx2 \
- --disable-vfp \
- --disable-neon \
--disable-inline-asm \
--disable-yasm"
-# XXX: trick to force use of embedded Libav headers
-TARGET_CFLAGS += $(TARGET_CPPFLAGS) -D_GNU_SOURCE
-TARGET_CPPFLAGS :=
+TARGET_CFLAGS += -D_GNU_SOURCE
TARGET_LDFLAGS += $(FPIC)
-define Build/Prepare
-$(call Build/Prepare/Default)
-endef
-
define Package/gst1-libav/install
$(INSTALL_DIR) $(1)/usr/lib/gstreamer-$(GST_VERSION)
( cd $(PKG_INSTALL_DIR); $(CP) \
#
-# Copyright (C) 2011-2015 OpenWrt.org
+# Copyright (C) 2011-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gst1-plugins-bad
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.8.2
PKG_RELEASE:=1
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+ Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2 GPLv2
PKG_LICENSE_FILES:=COPYING.LIB COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-bad/
-PKG_MD5SUM:=7c73bec1d389f0e184ebbbbb9e9f883d
+PKG_MD5SUM:=d7995317530c8773ec088f94d9320909d41da61996b801ebacce9a56af493f97
PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
--disable-schro \
--disable-zbar \
--disable-srtp \
- --disable-hls \
\
--without-libiconv-prefix \
--without-libintl-prefix \
$$(eval $$(call BuildPackage,libgst1$(1)))
endef
+$(eval $(call GstBuildLibrary,adaptivedemux,adaptivedemux,app uridownloader,))
$(eval $(call GstBuildLibrary,photography,photography,,))
$(eval $(call GstBuildLibrary,basecamerabinsrc,basecamerabinsrc,app,))
+$(eval $(call GstBuildLibrary,uridownloader,uridownloader,,))
+$(eval $(call GstBuildLibrary,badbase,badbase,,))
# 1: short name
# 2: description
$(eval $(call GstBuildPlugin,asfmux,asf muxing support,rtp,,))
$(eval $(call GstBuildPlugin,autoconvert,autoconvert support,,,))
$(eval $(call GstBuildPlugin,bayer,bayer support,video,,))
-$(eval $(call GstBuildPlugin,camerabin2,camerabin support,basecamerabinsrc photography tag pbutils app,,))
+$(eval $(call GstBuildPlugin,camerabin2,camerabin support,basecamerabinsrc photography pbutils app,,))
$(eval $(call GstBuildPlugin,dataurisrc,dataurisrc support,,,))
$(eval $(call GstBuildPlugin,debugutilsbad,debugutils support,video,,))
$(eval $(call GstBuildPlugin,dvdspu,dvdspu support,video,,))
$(eval $(call GstBuildPlugin,fbdevsink,fbdev support,video,,))
$(eval $(call GstBuildPlugin,festival,festival support,audio,,))
+$(eval $(call GstBuildPlugin,hls,HLS support,pbutils adaptivedemux,multifile,+libnettle))
$(eval $(call GstBuildPlugin,frei0r,frei0r support,controller video,,))
$(eval $(call GstBuildPlugin,id3tag,id3tag support,tag,,))
$(eval $(call GstBuildPlugin,jpegformat,jpegformat support,tag,,))
-$(eval $(call GstBuildPlugin,liveadder,liveadder support,audio,,))
-$(eval $(call GstBuildPlugin,mpegpsdemux,mpegpsdemux support,pbutils tag,,))
+$(eval $(call GstBuildPlugin,mpegpsdemux,mpegpsdemux support,pbutils,,))
$(eval $(call GstBuildPlugin,mpegpsmux,mpegpsmux support,,,))
-#$(eval $(call GstBuildPlugin,mpegtsdemux,mpegtsdemux support,mpegts pbutils tag,,))
+#$(eval $(call GstBuildPlugin,mpegtsdemux,mpegtsdemux support,mpegts pbutils,,))
#$(eval $(call GstBuildPlugin,mpegtsmux,mpegtsmux support,video,,))
-$(eval $(call GstBuildPlugin,mxf,mxf support,audio video,,))
-$(eval $(call GstBuildPlugin,opus,OPUS plugin library,audio tag rtp,,+libopus))
+$(eval $(call GstBuildPlugin,mxf,mxf support,badbase audio video,,))
+$(eval $(call GstBuildPlugin,opusparse,OPUS streams library,pbutils,,+libopus))
$(eval $(call GstBuildPlugin,pcapparse,pcapparse support,,,))
$(eval $(call GstBuildPlugin,pnm,pnm support,video,,))
$(eval $(call GstBuildPlugin,rawparse,rawparse support,audio video,,))
-diff -u --recursive gst-plugins-bad-1.6.2-vanilla/configure.ac gst-plugins-bad-1.6.2/configure.ac
---- gst-plugins-bad-1.6.2-vanilla/configure.ac 2016-01-01 10:40:17.883755147 -0500
-+++ gst-plugins-bad-1.6.2/configure.ac 2016-01-01 10:41:14.832426692 -0500
-@@ -3455,7 +3455,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3717,7 +3717,6 @@ ext/x265/Makefile
ext/xvid/Makefile
ext/zbar/Makefile
ext/dtls/Makefile
docs/Makefile
docs/plugins/Makefile
docs/libs/Makefile
-diff -u --recursive gst-plugins-bad-1.6.2-vanilla/Makefile.am gst-plugins-bad-1.6.2/Makefile.am
---- gst-plugins-bad-1.6.2-vanilla/Makefile.am 2016-01-01 10:40:17.883755147 -0500
-+++ gst-plugins-bad-1.6.2/Makefile.am 2016-01-01 10:41:47.607858580 -0500
-@@ -2,11 +2,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,11 +2,11 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
SUBDIRS = \
gst-libs gst sys ext pkgconfig \
-diff -u --recursive gst-plugins-bad-1.6.2-vanilla/configure.ac gst-plugins-bad-1.6.2/configure.ac
---- gst-plugins-bad-1.6.2-vanilla/configure.ac 2016-01-01 11:58:54.503551141 -0500
-+++ gst-plugins-bad-1.6.2/configure.ac 2016-01-01 11:50:38.388185503 -0500
-@@ -3355,37 +3355,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -3617,38 +3617,6 @@ sys/wasapi/Makefile
sys/wininet/Makefile
sys/winks/Makefile
sys/winscreencap/Makefile
-tests/examples/mxf/Makefile
-tests/examples/opencv/Makefile
-tests/examples/uvch264/Makefile
+-tests/examples/waylandsink/Makefile
-tests/icles/Makefile
ext/voamrwbenc/Makefile
ext/voaacenc/Makefile
ext/assrender/Makefile
-diff -u --recursive gst-plugins-bad-1.6.2-vanilla/Makefile.am gst-plugins-bad-1.6.2/Makefile.am
---- gst-plugins-bad-1.6.2-vanilla/Makefile.am 2016-01-01 11:58:54.504551169 -0500
-+++ gst-plugins-bad-1.6.2/Makefile.am 2016-01-01 11:50:06.848314203 -0500
-@@ -2,11 +2,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,11 +2,11 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
SUBDIRS = \
gst-libs gst sys ext pkgconfig \
#
-# Copyright (C) 2008-2015 OpenWrt.org
+# Copyright (C) 2008-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gst1-plugins-base
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.8.2
PKG_RELEASE:=1
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+ Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2 GPLv2
PKG_LICENSE_FILES:=COPYING.LIB COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-base/
-PKG_MD5SUM:=f530fbbe287edce79c55a37bd1a39fe2
+PKG_MD5SUM:=9d7109c8fb0a5dec8edb17b0053c59a46aba7ddf48dc48ea822ebbbd4339d38d
PKG_BUILD_DEPENDS:= libgstreamer1
PKG_CONFIG_DEPENDS:= \
$(eval $(call GstBuildLibrary,riff,RIFF media,audio tag,,))
$(eval $(call GstBuildLibrary,rtp,RTP,,))
$(eval $(call GstBuildLibrary,rtsp,RTSP,,))
-$(eval $(call GstBuildLibrary,sdp,SDP,,))
+$(eval $(call GstBuildLibrary,sdp,SDP,rtp,))
$(eval $(call GstBuildLibrary,tag,tag support,,))
$(eval $(call GstBuildLibrary,video,video,,))
$(eval $(call GstBuildPlugin,playback,media decoder (v2),pbutils,,))
$(eval $(call GstBuildPlugin,gio,GIO,,,))
$(eval $(call GstBuildPlugin,ogg,Ogg,riff tag pbutils video,,+libogg))
+$(eval $(call GstBuildPlugin,opus,OPUS plugin library,pbutils video,,+libopus))
$(eval $(call GstBuildPlugin,tcp,TCP,net,,))
$(eval $(call GstBuildPlugin,theora,Theora,tag video,,+libogg +libtheora))
$(eval $(call GstBuildPlugin,typefindfunctions,'typefind' functions,audio pbutils tag video,,))
-diff -u --recursive gst-plugins-base-1.6.2-vanilla/configure.ac gst-plugins-base-1.6.2/configure.ac
---- gst-plugins-base-1.6.2-vanilla/configure.ac 2016-01-01 10:40:17.931759357 -0500
-+++ gst-plugins-base-1.6.2/configure.ac 2016-01-01 10:43:44.374351388 -0500
-@@ -921,7 +921,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -929,7 +929,6 @@ docs/design/Makefile
docs/libs/Makefile
docs/plugins/Makefile
docs/version.entities
common/Makefile
common/m4/Makefile
m4/Makefile
-diff -u --recursive gst-plugins-base-1.6.2-vanilla/Makefile.am gst-plugins-base-1.6.2/Makefile.am
---- gst-plugins-base-1.6.2-vanilla/Makefile.am 2016-01-01 10:40:17.931759357 -0500
-+++ gst-plugins-base-1.6.2/Makefile.am 2016-01-01 10:44:17.403209313 -0500
-@@ -13,7 +13,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -13,7 +13,6 @@ SUBDIRS = \
tools \
tests \
docs \
common \
m4
-@@ -24,7 +23,6 @@
+@@ -24,7 +23,6 @@ DIST_SUBDIRS = \
gst sys ext \
tools \
tests \
-diff -u --recursive gst-plugins-base-1.6.2-vanilla/configure.ac gst-plugins-base-1.6.2/configure.ac
---- gst-plugins-base-1.6.2-vanilla/configure.ac 2016-01-01 12:00:43.489564691 -0500
-+++ gst-plugins-base-1.6.2/configure.ac 2016-01-01 12:02:24.452371618 -0500
-@@ -899,23 +899,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -907,23 +907,6 @@ pkgconfig/gstreamer-video.pc
pkgconfig/gstreamer-video-uninstalled.pc
pkgconfig/gstreamer-plugins-base.pc
pkgconfig/gstreamer-plugins-base-uninstalled.pc
docs/Makefile
docs/design/Makefile
docs/libs/Makefile
-diff -u --recursive gst-plugins-base-1.6.2-vanilla/Makefile.am gst-plugins-base-1.6.2/Makefile.am
---- gst-plugins-base-1.6.2-vanilla/Makefile.am 2016-01-01 12:00:43.489564691 -0500
-+++ gst-plugins-base-1.6.2/Makefile.am 2016-01-01 12:01:54.055525170 -0500
-@@ -11,7 +11,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -11,7 +11,6 @@ SUBDIRS = \
gst-libs \
gst sys $(SUBDIRS_EXT) \
tools \
docs \
common \
m4
-@@ -22,7 +21,6 @@
+@@ -22,7 +21,6 @@ DIST_SUBDIRS = \
gst-libs \
gst sys ext \
tools \
-diff -u --recursive gst-plugins-base-1.6.2-vanilla/configure.ac gst-plugins-base-1.6.2/configure.ac
---- gst-plugins-base-1.6.2-vanilla/configure.ac 2016-01-01 12:10:41.158319142 -0500
-+++ gst-plugins-base-1.6.2/configure.ac 2016-01-01 12:07:36.271107197 -0500
-@@ -899,11 +899,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -907,11 +907,6 @@ pkgconfig/gstreamer-video.pc
pkgconfig/gstreamer-video-uninstalled.pc
pkgconfig/gstreamer-plugins-base.pc
pkgconfig/gstreamer-plugins-base-uninstalled.pc
common/Makefile
common/m4/Makefile
m4/Makefile
-diff -u --recursive gst-plugins-base-1.6.2-vanilla/Makefile.am gst-plugins-base-1.6.2/Makefile.am
---- gst-plugins-base-1.6.2-vanilla/Makefile.am 2016-01-01 12:10:41.159319170 -0500
-+++ gst-plugins-base-1.6.2/Makefile.am 2016-01-01 12:07:32.869011473 -0500
-@@ -11,13 +11,11 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -11,13 +11,11 @@ SUBDIRS = \
gst-libs \
gst sys $(SUBDIRS_EXT) \
tools \
#
-# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gst1-plugins-good
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.8.2
PKG_RELEASE:=1
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+ Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-good/
-PKG_MD5SUM:=ef4f5bc4f31f706832a234b0f603967b
+PKG_MD5SUM:=8d7549118a3b7a009ece6bb38a05b66709c551d32d2adfd89eded4d1d7a23944
PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
$(eval $(call GstBuildPlugin,flv,flv codec,audio pbutils tag video,,))
$(eval $(call GstBuildPlugin,flxdec,flx codec,,,))
#$(eval $(call GstBuildPlugin,gdkpixbuf,gdkpixbuf support,video,,))
-$(eval $(call GstBuildPlugin,goom2k1,goom support,audio video,,))
-$(eval $(call GstBuildPlugin,goom,goom support,audio video,,))
+$(eval $(call GstBuildPlugin,goom2k1,goom support,audio video pbutils,,))
+$(eval $(call GstBuildPlugin,goom,goom support,audio video pbutils,,))
$(eval $(call GstBuildPlugin,icydemux,icy demuxer,audio tag,,))
$(eval $(call GstBuildPlugin,id3demux,ID3v1/v2 demuxer,pbutils tag,,))
$(eval $(call GstBuildPlugin,imagefreeze,imagefreeze support,,,))
-diff -u --recursive gst-plugins-good-1.6.2-vanilla/configure.ac gst-plugins-good-1.6.2/configure.ac
---- gst-plugins-good-1.6.2-vanilla/configure.ac 2016-01-01 10:40:17.994764882 -0500
-+++ gst-plugins-good-1.6.2/configure.ac 2016-01-01 10:45:25.668599823 -0500
-@@ -1014,7 +1014,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1049,7 +1049,6 @@ sys/sunaudio/Makefile
sys/v4l2/Makefile
sys/waveform/Makefile
sys/ximage/Makefile
tests/Makefile
tests/check/Makefile
tests/examples/Makefile
-diff -u --recursive gst-plugins-good-1.6.2-vanilla/Makefile.am gst-plugins-good-1.6.2/Makefile.am
---- gst-plugins-good-1.6.2-vanilla/Makefile.am 2016-01-01 10:40:17.994764882 -0500
-+++ gst-plugins-good-1.6.2/Makefile.am 2016-01-01 10:45:19.923089598 -0500
-@@ -4,7 +4,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4,7 +4,6 @@ ALWAYS_SUBDIRS = \
gst sys ext \
tests \
docs \
-diff -u --recursive gst-plugins-good-1.6.2-vanilla/configure.ac gst-plugins-good-1.6.2/configure.ac
---- gst-plugins-good-1.6.2-vanilla/configure.ac 2016-01-01 12:00:52.525815362 -0500
-+++ gst-plugins-good-1.6.2/configure.ac 2016-01-01 12:03:22.198982586 -0500
-@@ -1014,21 +1014,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1049,21 +1049,6 @@ sys/sunaudio/Makefile
sys/v4l2/Makefile
sys/waveform/Makefile
sys/ximage/Makefile
common/Makefile
common/m4/Makefile
m4/Makefile
-diff -u --recursive gst-plugins-good-1.6.2-vanilla/Makefile.am gst-plugins-good-1.6.2/Makefile.am
---- gst-plugins-good-1.6.2-vanilla/Makefile.am 2016-01-01 12:00:52.525815362 -0500
-+++ gst-plugins-good-1.6.2/Makefile.am 2016-01-01 12:03:06.921556033 -0500
-@@ -2,7 +2,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,7 +2,6 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
ALWAYS_SUBDIRS = \
gst sys ext \
-diff -u --recursive gst-plugins-good-1.6.2-vanilla/configure.ac gst-plugins-good-1.6.2/configure.ac
---- gst-plugins-good-1.6.2-vanilla/configure.ac 2016-01-01 12:10:51.392608142 -0500
-+++ gst-plugins-good-1.6.2/configure.ac 2016-01-01 12:08:39.568889466 -0500
-@@ -1017,9 +1017,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1052,9 +1052,6 @@ sys/ximage/Makefile
common/Makefile
common/m4/Makefile
m4/Makefile
pkgconfig/Makefile
pkgconfig/gstreamer-plugins-good-uninstalled.pc
gst-plugins-good.spec
-diff -u --recursive gst-plugins-good-1.6.2-vanilla/Makefile.am gst-plugins-good-1.6.2/Makefile.am
---- gst-plugins-good-1.6.2-vanilla/Makefile.am 2016-01-01 12:10:51.393608170 -0500
-+++ gst-plugins-good-1.6.2/Makefile.am 2016-01-01 12:08:35.442773216 -0500
-@@ -2,7 +2,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,7 +2,6 @@ DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-d
ALWAYS_SUBDIRS = \
gst sys ext \
#
-# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gst1-plugins-ugly
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.8.2
PKG_RELEASE:=1
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+ Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gst-plugins-ugly/
-PKG_MD5SUM:=0f0e30336e3155443cd5bfec5c215d56
+PKG_MD5SUM:=9c5b33a2a98fc1d6d6c99a1b536b1fb2de45f53cc8bf8ab85a8b8141fed1a8ac
PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
PKG_CONFIG_DEPENDS:= \
-diff -u --recursive gst-plugins-ugly-1.6.2-vanilla/configure.ac gst-plugins-ugly-1.6.2/configure.ac
---- gst-plugins-ugly-1.6.2-vanilla/configure.ac 2016-01-01 12:01:01.547065731 -0500
-+++ gst-plugins-ugly-1.6.2/configure.ac 2016-01-01 12:04:18.111545715 -0500
-@@ -467,8 +467,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -478,9 +478,6 @@ ext/x264/Makefile
docs/Makefile
docs/plugins/Makefile
docs/version.entities
-tests/Makefile
-tests/check/Makefile
+-tests/files/Makefile
m4/Makefile
pkgconfig/Makefile
pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
-diff -u --recursive gst-plugins-ugly-1.6.2-vanilla/Makefile.am gst-plugins-ugly-1.6.2/Makefile.am
---- gst-plugins-ugly-1.6.2-vanilla/Makefile.am 2016-01-01 12:01:01.547065731 -0500
-+++ gst-plugins-ugly-1.6.2/Makefile.am 2016-01-01 12:04:12.087377153 -0500
+--- a/Makefile.am
++++ b/Makefile.am
@@ -1,7 +1,7 @@
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
-diff -u --recursive gst-plugins-ugly-1.6.2-vanilla/configure.ac gst-plugins-ugly-1.6.2/configure.ac
---- gst-plugins-ugly-1.6.2-vanilla/configure.ac 2016-01-01 12:11:03.267943540 -0500
-+++ gst-plugins-ugly-1.6.2/configure.ac 2016-01-01 12:13:30.992120335 -0500
-@@ -464,9 +464,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -475,9 +475,6 @@ ext/mpg123/Makefile
ext/sidplay/Makefile
ext/twolame/Makefile
ext/x264/Makefile
m4/Makefile
pkgconfig/Makefile
pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
-diff -u --recursive gst-plugins-ugly-1.6.2-vanilla/Makefile.am gst-plugins-ugly-1.6.2/Makefile.am
---- gst-plugins-ugly-1.6.2-vanilla/Makefile.am 2016-01-01 12:11:03.268943568 -0500
-+++ gst-plugins-ugly-1.6.2/Makefile.am 2016-01-01 12:13:28.110038773 -0500
+--- a/Makefile.am
++++ b/Makefile.am
@@ -1,7 +1,7 @@
DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
#
-# Copyright (C) 2008-2015 OpenWrt.org
+# Copyright (C) 2008-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=gstreamer1
-PKG_VERSION:=1.6.2
+PKG_VERSION:=1.8.2
PKG_RELEASE:=1
-PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> \
+ Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2
PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://gstreamer.freedesktop.org/src/gstreamer/
-PKG_MD5SUM:=5e610b5a94c209487310739b39b6c464
+PKG_MD5SUM:=9dbebe079c2ab2004ef7f2649fa317cabea1feb4fb5605c24d40744b90918341
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=autogen.sh aclocal.m4
-diff -u --recursive gstreamer-1.6.2-vanilla/configure.ac gstreamer-1.6.2/configure.ac
---- gstreamer-1.6.2-vanilla/configure.ac 2016-01-01 10:40:18.040768907 -0500
-+++ gstreamer-1.6.2/configure.ac 2016-01-01 10:48:24.160887684 -0500
-@@ -980,7 +980,6 @@
- libs/gst/net/Makefile
+--- a/configure.ac
++++ b/configure.ac
+@@ -998,7 +998,6 @@ libs/gst/net/Makefile
plugins/Makefile
plugins/elements/Makefile
+ plugins/tracers/Makefile
-po/Makefile.in
tests/Makefile
tests/benchmarks/Makefile
tests/check/Makefile
-diff -u --recursive gstreamer-1.6.2-vanilla/Makefile.am gstreamer-1.6.2/Makefile.am
---- gstreamer-1.6.2-vanilla/Makefile.am 2016-01-01 10:40:18.040768907 -0500
-+++ gstreamer-1.6.2/Makefile.am 2016-01-01 10:48:19.150568341 -0500
-@@ -9,7 +9,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -9,7 +9,6 @@ aclocal_DATA = gst-element-check-@GST_AP
SUBDIRS = pkgconfig \
gst libs plugins tests \
docs \
m4 \
common \
data
-@@ -22,7 +21,6 @@
+@@ -22,7 +21,6 @@ endif
DIST_SUBDIRS = pkgconfig \
gst libs plugins tools tests \
docs \
-diff -u --recursive gstreamer-1.6.2-vanilla/configure.ac gstreamer-1.6.2/configure.ac
---- gstreamer-1.6.2-vanilla/configure.ac 2016-01-01 12:01:10.863324404 -0500
-+++ gstreamer-1.6.2/configure.ac 2016-01-01 12:05:07.794937166 -0500
-@@ -980,21 +980,6 @@
- libs/gst/net/Makefile
+--- a/configure.ac
++++ b/configure.ac
+@@ -998,21 +998,6 @@ libs/gst/net/Makefile
plugins/Makefile
plugins/elements/Makefile
+ plugins/tracers/Makefile
-tests/Makefile
-tests/benchmarks/Makefile
-tests/check/Makefile
tools/Makefile
common/Makefile
common/m4/Makefile
-diff -u --recursive gstreamer-1.6.2-vanilla/Makefile.am gstreamer-1.6.2/Makefile.am
---- gstreamer-1.6.2-vanilla/Makefile.am 2016-01-01 12:01:10.862324377 -0500
-+++ gstreamer-1.6.2/Makefile.am 2016-01-01 12:05:03.190808129 -0500
-@@ -7,7 +7,7 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -7,7 +7,7 @@ aclocaldir = $(datadir)/aclocal
aclocal_DATA = gst-element-check-@GST_API_VERSION@.m4
SUBDIRS = pkgconfig \
docs \
m4 \
common \
-@@ -19,7 +19,7 @@
+@@ -19,7 +19,7 @@ endif
# These are all the possible subdirs
DIST_SUBDIRS = pkgconfig \
-diff -u --recursive gstreamer-1.6.2-vanilla/configure.ac gstreamer-1.6.2/configure.ac
---- gstreamer-1.6.2-vanilla/configure.ac 2016-01-01 12:11:19.150392204 -0500
-+++ gstreamer-1.6.2/configure.ac 2016-01-01 12:06:49.611795028 -0500
-@@ -983,18 +983,6 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -1001,18 +1001,6 @@ plugins/tracers/Makefile
tools/Makefile
common/Makefile
common/m4/Makefile
m4/Makefile
pkgconfig/Makefile
stamp.h
-diff -u --recursive gstreamer-1.6.2-vanilla/Makefile.am gstreamer-1.6.2/Makefile.am
---- gstreamer-1.6.2-vanilla/Makefile.am 2016-01-01 12:11:19.151392233 -0500
-+++ gstreamer-1.6.2/Makefile.am 2016-01-01 12:06:41.546568365 -0500
-@@ -8,7 +8,6 @@
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -8,7 +8,6 @@ aclocal_DATA = gst-element-check-@GST_AP
SUBDIRS = pkgconfig \
gst libs plugins \
m4 \
common \
data
-@@ -20,7 +19,6 @@
+@@ -20,7 +19,6 @@ endif
# These are all the possible subdirs
DIST_SUBDIRS = pkgconfig \
gst libs plugins tools \
-diff -u --recursive gstreamer-1.6.2-vanilla/gst/gstplugin.c gstreamer-1.6.2/gst/gstplugin.c
---- gstreamer-1.6.2-vanilla/gst/gstplugin.c 2016-01-01 12:37:38.178990140 -0500
-+++ gstreamer-1.6.2/gst/gstplugin.c 2016-01-01 12:38:30.431328737 -0500
-@@ -732,15 +732,8 @@
+--- a/gst/gstplugin.c
++++ b/gst/gstplugin.c
+@@ -732,15 +732,8 @@ _priv_gst_plugin_load_file_for_registry
goto return_error;
}
include $(TOPDIR)/rules.mk
PKG_NAME:=xupnpd
-PKG_REV:=fdeeb919264c1dde4a2ead5045eefbe54011b2dc
-PKG_VERSION:=2016-05-11
+PKG_REV:=5c08c051caa0062cc1c401b2d26d1f36dffe9c55
+PKG_VERSION:=2016-07-06
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
include $(TOPDIR)/rules.mk
PKG_NAME:=youtube-dl
-PKG_VERSION:=2016.07.11
+PKG_VERSION:=2016.09.19
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://youtube-dl.org/downloads/$(PKG_VERSION)/
-PKG_MD5SUM:=2175d314e9a2715bf724b8c683ee536f
+PKG_SOURCE_URL:=https://yt-dl.org/downloads/$(PKG_VERSION)/
+PKG_MD5SUM:=c760476f7950fb579c430e2db069fc8c
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=Unlicense
--- /dev/null
+#
+# Copyright (C) 2016 Toke Høiland-Jørgensen
+#
+# This is free software, licensed under the GNU General Public License v3 or
+# later.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=acme
+PKG_SOURCE_VERSION:=1e6b68f5d187fa3d64c889d04a77ee1c79726282
+PKG_VERSION:=1.1
+PKG_RELEASE:=1
+PKG_LICENSE:=GPLv3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE).tar.xz
+PKG_SOURCE_URL:=git://github.com/Neilpang/acme.sh.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
+PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)
+LUCI_DIR:=/usr/lib/lua/luci
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/acme
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+curl +ca-certificates +uhttpd-mod-tls +openssl-util
+ TITLE:=ACME (Letsencrypt) client
+ PKGARCH:=all
+ MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+endef
+
+define Package/acme/description
+ A client for issuing Letsencrypt certificates.
+endef
+
+define Package/acme/conffiles
+/etc/config/acme
+/etc/acme
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/acme/install
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/acme.config $(1)/etc/config/acme
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/acme.init $(1)/etc/init.d/acme
+ $(INSTALL_DIR) $(1)/usr/lib/acme
+ $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/acme/run-acme
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/acme.sh $(1)/usr/lib/acme/acme.sh
+endef
+
+define Package/luci-app-acme
+ SECTION:=luci
+ CATEGORY:=LuCI
+ TITLE:=ACME package - LuCI interface
+ MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+ PKGARCH:=all
+ DEPENDS:= lua luci-base +acme luci-app-uhttpd
+ SUBMENU:=3. Applications
+endef
+
+define Package/luci-app-acme/description
+ Control the ACME Letsencrypt certificate interface
+endef
+
+define Package/luci-app-acme/install
+ $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
+ $(INSTALL_DATA) ./files/acme-controller.lua $(1)$(LUCI_DIR)/controller/acme.lua
+ $(INSTALL_DATA) ./files/acme-cbi.lua $(1)$(LUCI_DIR)/model/cbi/acme.lua
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/uci-defaults-acme $(1)/etc/uci-defaults/luci-acme
+endef
+
+define Package/luci-app-acme/postinst
+#!/bin/sh
+[ -x /etc/uci-defaults/luci-acme ] && /etc/uci-defaults/luci-acme || exit 0
+endef
+
+define Package/luci-app-acme/postrm
+#!/bin/sh
+which uci > /dev/null || exit 0
+uci -q get ucitrack.@acme[0] > /dev/null && {
+ uci delete ucitrack.@acme[0]
+ uci commit
+}
+endef
+
+
+$(eval $(call BuildPackage,acme))
+$(eval $(call BuildPackage,luci-app-acme))
--- /dev/null
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2016 Toke Høiland-Jørgensen <toke@toke.dk>
+
+# 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.
+
+]]--
+
+m = Map("acme", translate("ACME certificates"),
+ translate("This configures ACME (Letsencrypt) automatic certificate installation. " ..
+ "Simply fill out this to have the router configured with Letsencrypt-issued " ..
+ "certificates for the web interface. " ..
+ "Note that the domain names in the certificate must already be configured to " ..
+ "point at the router's public IP address. " ..
+ "Once configured, issuing certificates can take a while. " ..
+ "Check the logs for progress and any errors."))
+
+s = m:section(TypedSection, "acme", translate("ACME global config"))
+s.anonymous = true
+
+st = s:option(Value, "state_dir", translate("State directory"),
+ translate("Where certs and other state files are kept."))
+st.rmempty = false
+st.datatype = "string"
+
+ae = s:option(Value, "account_email", translate("Account email"),
+ translate("Email address to associate with account key."))
+ae.rmempty = false
+
+d = s:option(Flag, "debug", translate("Enable debug logging"))
+d.rmempty = false
+
+cs = m:section(TypedSection, "cert", translate("Certificate config"))
+cs.anonymous = false
+cs.addremove = true
+
+e = cs:option(Flag, "enabled", translate("Enabled"))
+e.rmempty = false
+
+us = cs:option(Flag, "use_staging", translate("Use staging server"),
+ translate("Get certificate from the Letsencrypt staging server " ..
+ "(use for testing; the certificate won't be valid)."))
+us.rmempty = false
+
+kl = cs:option(Value, "keylength", translate("Key length"),
+ translate("Number of bits (minimum 2048)."))
+kl.rmempty = false
+kl.datatype = "and(uinteger,min(2048))"
+
+u = cs:option(Flag, "update_uhttpd", translate("Use for uhttpd"),
+ translate("Update the uhttpd config with this certificate once issued " ..
+ "(only select this for one certificate)."))
+u.rmempty = false
+
+dom = cs:option(DynamicList, "domains", translate("Domain names"),
+ translate("Domain names to include in the certificate. " ..
+ "The first name will be the subject name, subsequent names will be alt names. " ..
+ "Note that all domain names must point at the router in the global DNS."))
+dom.datatype = "list(string)"
+
+return m
--- /dev/null
+module("luci.controller.acme", package.seeall)
+
+function index()
+ entry({"admin", "services", "acme"},
+ cbi("acme"),
+ _("ACME certs"), 50).dependent = false
+end
--- /dev/null
+config acme
+ option state_dir '/etc/acme'
+ option account_email 'email@example.org'
+ option debug 0
+
+config cert 'example'
+ option enabled 0
+ option use_staging 0
+ option keylength 2048
+ option update_uhttpd 1
+ list domains example.org
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+
+START=50
+SCRIPT=/usr/lib/acme/run-acme
+
+start_service()
+{
+ procd_open_instance
+ procd_set_param command $SCRIPT
+ procd_set_param file /etc/config/acme
+ procd_set_param stdout 1
+ procd_set_param stderr 1
+ procd_close_instance
+}
+
+reload_service() {
+ rc_procd start_service "$@"
+ return 0
+}
+
+stop_service() {
+ return 0
+}
+
+boot() {
+ $SCRIPT check_cron
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger acme
+}
--- /dev/null
+#!/bin/sh
+# Wrapper for acme.sh to work on openwrt.
+#
+# 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 <toke@toke.dk>
+
+CHECK_CRON=$1
+ACME=/usr/lib/acme/acme.sh
+export SSL_CERT_DIR=/etc/ssl/certs
+
+UHTTPD_REDIRECT_HTTPS=
+UHTTPD_LISTEN_HTTP=
+STATE_DIR='/etc/acme'
+ACCOUNT_EMAIL=
+DEBUG=0
+
+. /lib/functions.sh
+
+check_cron()
+{
+ [ -f "/etc/crontabs/root" ] && grep -q '/etc/init.d/acme' /etc/crontabs/root && return
+ echo "0 0 * * * /etc/init.d/acme start" >> /etc/crontabs/root
+ /etc/init.d/cron start
+}
+
+pre_checks()
+{
+ echo "Running pre checks."
+ check_cron
+
+ UHTTPD_REDIRECT_HTTPS=$(uci get uhttpd.main.redirect_https)
+ UHTTPD_LISTEN_HTTP=$(uci get uhttpd.main.listen_http)
+
+ uci set uhttpd.main.redirect_https=1
+ uci set uhttpd.main.listen_http='0.0.0.0:80'
+ uci commit uhttpd
+ /etc/init.d/uhttpd reload || return 1
+
+ iptables -I input_rule -p tcp --dport 80 -j ACCEPT || return 1
+ return 0
+}
+
+post_checks()
+{
+ echo "Running post checks (cleanup)."
+ iptables -D input_rule -p tcp --dport 80 -j ACCEPT
+
+ uci set uhttpd.main.redirect_https="$UHTTPD_REDIRECT_HTTPS"
+ uci set uhttpd.main.listen_http="$UHTTPD_LISTEN_HTTP"
+ uci commit uhttpd
+ /etc/init.d/uhttpd reload
+}
+
+err_out()
+{
+ post_checks
+ exit 1
+}
+
+int_out()
+{
+ post_checks
+ trap - SIGINT
+ kill -SIGINT $$
+}
+
+issue_cert()
+{
+ local section="$1"
+ local acme_args=
+ local enabled
+ local use_staging
+ local update_uhttpd
+ local keylength
+ local domains
+ local main_domain
+
+ config_get_bool enabled "$section" enabled 0
+ config_get_bool use_staging "$section" use_staging
+ config_get_bool update_uhttpd "$section" update_uhttpd
+ config_get domains "$section" domains
+ config_get keylength "$section" keylength
+
+ [ "$enabled" -eq "1" ] || return
+
+ [ "$DEBUG" -eq "1" ] && acme_args="$acme_args --debug"
+
+ set -- $domains
+ main_domain=$1
+
+ if [ -e "$STATE_DIR/$main_domain" ]; then
+ $ACME --home "$STATE_DIR" --renew -d "$main_domain" $acme_args || return 1
+ return 0
+ fi
+
+
+ acme_args="$acme_args $(for d in $domains; do echo -n "-d $d "; done)"
+ acme_args="$acme_args --webroot $(uci get uhttpd.main.home)"
+ acme_args="$acme_args --keylength $keylength"
+ [ -n "$ACCOUNT_EMAIL" ] && acme_args="$acme_args --accountemail $ACCOUNT_EMAIL"
+ [ "$use_staging" -eq "1" ] && acme_args="$acme_args --staging"
+
+ if ! $ACME --home "$STATE_DIR" --issue $acme_args; then
+ echo "Issuing cert for $main_domain failed. It may be necessary to remove $STATE_DIR/$main_domain to recover." >&2
+ return 1
+ fi
+
+ if [ "$update_uhttpd" -eq "1" ]; then
+ uci set uhttpd.main.key="$STATE_DIR/${main_domain}/${main_domain}.key"
+ uci set uhttpd.main.cert="$STATE_DIR/${main_domain}/fullchain.cer"
+ # commit and reload is in post_checks
+ fi
+
+}
+
+load_vars()
+{
+ local section="$1"
+
+ STATE_DIR=$(config_get "$section" state_dir)
+ ACCOUNT_EMAIL=$(config_get "$section" account_email)
+ DEBUG=$(config_get "$section" debug)
+}
+
+if [ -n "$CHECK_CRON" ]; then
+ check_cron
+ exit 0
+fi
+
+config_load acme
+config_foreach load_vars acme
+
+pre_checks || exit 1
+trap err_out SIGHUP SIGTERM
+trap int_out SIGINT
+
+config_foreach issue_cert cert
+post_checks
+
+exit 0
--- /dev/null
+#!/bin/sh
+
+uci -q batch <<-EOF >/dev/null
+ delete ucitrack.@acme[-1]
+ add ucitrack acme
+ add_list ucitrack.@bcp38[0].init=acme
+ commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0
--- /dev/null
+--- a/acme.sh 2016-08-05 17:00:58.000000000 +0200
++++ b/acme.sh 2016-08-05 17:13:58.582459764 +0200
+@@ -48,9 +48,9 @@
+
+ _info() {
+ if [ -z "$2" ] ; then
+- echo "[$(date)] $1"
++ echo "$1"
+ else
+- echo "[$(date)] $1='$2'"
++ echo "$1='$2'"
+ fi
+ }
+
include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=1.4.3
+PKG_VERSION:=1.5.3
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
define Package/$(PKG_NAME)/description
Powerful adblock script to block ad/abuse domains.
-Currently the script supports 20 domain blacklist sites plus manual black- and whitelist overrides.
+The script supports many domain blacklist sites plus manual black- and whitelist overrides.
Please see https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md for further information.
endef
$(INSTALL_DATA) ./files/adblock-helper.sh $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
- $(INSTALL_BIN) ./files/adblock.hotplug $(1)/etc/hotplug.d/iface/99-adblock
+ $(INSTALL_BIN) ./files/adblock.hotplug $(1)/etc/hotplug.d/iface/90-adblock
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/adblock.init $(1)/etc/init.d/adblock
* [feodotracker](https://feodotracker.abuse.ch)
* => daily updates, approx. 0-10 entries
* [hphosts](https://hosts-file.net)
- * => monthly updates, approx. 390.000 entries
+ * => monthly updates, approx. 50.000 entries
* [malwaredomains](http://malwaredomains.com)
* => daily updates, approx. 16.000 entries
* [malwaredomainlist](http://www.malwaredomainlist.com)
* => weekly updates, approx. 600 entries
* [ruadlist/easylist](https://code.google.com/p/ruadlist)
* => weekly updates, approx. 2.000 entries
+ * [securemecca](http://www.securemecca.com)
+ * => infrequent updates, approx. 25.000 entries
* [shallalist](http://www.shallalist.de) (categories "adv" "costtraps" "spyware" "tracker" "warez" enabled by default)
* => daily updates, approx. 32.000 entries (a short description of all shallalist categories can be found [online](http://www.shallalist.de/categories.html))
* [spam404](http://www.spam404.com)
* [zeus tracker](https://zeustracker.abuse.ch)
* => daily updates, approx. 440 entries
* zero-conf like automatic installation & setup, usually no manual changes needed (i.e. ip address, network devices etc.)
-* supports a wide range of router modes (incl. AP mode), as long as the firewall and the DNS server are enabled & in use
+* supports a wide range of router modes (incl. AP mode), as long as firewall and dnsmasq are installed and in use
* full IPv4 and IPv6 support
* each blocklist source will be updated and processed separately
* timestamp check to download and process only updated adblock list sources
* status & error logging to stdout and syslog
* use two dynamic uhttpd instances as adblock pixel server, separated for ads delivered on port 80 and on port 443
* use dynamic iptables chains/rulesets for adblock related redirects/rejects
-* init system support (start/stop/restart/reload/toggle/stats/cfgup)
-* hotplug support, the adblock start will be triggered by wan 'ifup' event
+* init system support (start/stop/restart/reload/toggle/stats/cfgup/envchk/query)
+* hotplug support, the adblock start will be triggered by wan 'ifup' event, this can be restricted to a certain wan interface or disabled at all (see config options below)
* toggle to quickly switch adblock 'on' or 'off'
+* envchk function to check the volatile adblock environment only (without list updates)
+* query function to quickly identify blocked (sub-)domains, i.e. for whitelisting
* optional: automatic adblock list backup/restore, backups will be (de-)compressed on the fly (disabled by default)
* optional: add new adblock sources via uci config (see example below)
* **white-/blacklist:** add domain white- or blacklist entries to always-allow or -deny certain (sub) domains, by default both lists are located in _/etc/adblock_. Please add one domain per line - ip addresses, wildcards & regex are _not_ allowed (see example below)
* **backup/restore:** enable the backup/restore feature, to restore automatically the latest compressed backup of your adblock lists in case of any processing error (i.e. a single blocklist source is down). Please use an (external) solid partition and _not_ your volatile router temp directory for this
* **list updates:** for a scheduled call of the adblock service add an appropriate crontab entry (see example below)
+* **hotplug fine tuning:** to restrict hotplug support to a certain wan interface or to disable it at all, you can set 'adb\_hotplugif' to an existing interface like 'wan' or to a non-existing 'dummy' interface
* **new list sources:** you could add new blocklist sources on your own via uci config, all you need is a source url and an awk one-liner (see example below)
-* **AP mode:** in 'AP mode' adblock uses automatically the local router ip as nullip address. To make sure that your LuCI interface will be still accessible, you have to change the local uhttpd instance to ports <> 80/443 (see example below)
+* **AP mode:** in 'AP mode' adblock uses automatically the local router ip as nullip address. To make sure that your LuCI interface will be still accessible, you have to change the local uhttpd instance to ports <> 80/443 (see example below), also make sure that firewall and dnsmasq are installed and running
* **restricted mode:** to disable flash writes with adblock status information to the adblock config file (used by LuCI frontend), please set 'adb\_restricted' to '1'
* **adblock toggle:** to quickly switch adblocking 'on' or 'off', simply use _/etc/init.d/adblock toggle_
* **adblock statistics:** to update only the adblock statistics (without updating the block lists as well), please run _/etc/init.d/adblock stats_
+* **adblock query `<DOMAIN>`:** to query the active blocklists for a specific domain, please run _/etc/init.d/adblock query `<DOMAIN>`_ (see example below)
* **configuration update:** to update an outdated adblock config file with the current default version, please run _/etc/init.d/adblock cfgup_, make your individual changes and start the adblock service again
* **debugging:** for script debugging please set the 'adb\_debug' variable in the header of _/etc/init.d/adblock_ to '1'
+* **mute output** to mute the normal adblock output and print only warn/error messages, please set 'adb\_loglevel to '0'
* **disable active dns probing in windows:** to prevent a possible yellow exclamation mark on your internet connection icon (which wrongly means connected, but no internet), please change the following registry key/value from "1" to "0" _HKLM\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet\EnableActiveProbing_
## Further adblock config options
* adb\_forcedns => redirect all local DNS queries to the local dnsmasq resolver (default: '1', enabled / always disabled in 'AP mode')
* adb\_fetchttl => set the timeout for list downloads (default: '5' seconds)
* adb\_restricted => disable updates of the adblock config file (no flash writes) during runtime (default: '0', disabled)
+ * adb\_hotplugif => restrict hotplug support to a certain wan interface or disable it at all (default: '', disabled)
+ * adb\_loglevel => set it to '0' to mute normal adblock output and print only error messages (default: '1', normal output)
## Examples
list listen_https '0.0.0.0:445'
</code></pre>
-**example grep for blocked (sub-)domains in adblock source files:**
+**example to query active blocklists for a certain (sub-)domain, i.e. for whitelisting:**
<pre><code>
-grep "google-analytics.com" "/tmp/dnsmasq.d/adb_list"*
+/etc/init.d/adblock query "example.www.doubleclick.net"
+=> distinct results for domain 'example.www.doubleclick.net' (overall 0)
+ no matches in active blocklists
+=> distinct results for domain 'www.doubleclick.net' (overall 1)
+ adb_list.winhelp : www.doubleclick.net
+=> distinct results for domain 'doubleclick.net' (overall 252)
+ adb_list.adaway : ad-g.doubleclick.net
+ adb_list.hphosts : 1016557.fls.doubleclick.net
+ adb_list.rolist : feedads.g.doubleclick.net
+ adb_list.securemecca : 1168945.fls.doubleclick.net
+ adb_list.sysctl : ad.co.doubleclick.net
+ adb_list.whocares : 3ad.doubleclick.net
+ adb_list.winhelp : 1435575.fls.doubleclick.net
-This will output all matches with corresponding source files:
- /tmp/dnsmasq.d/adb_list.winhelp:address=/ssl.google-analytics.com/198.18.0.1
- /tmp/dnsmasq.d/adb_list.winhelp:address=/www.google-analytics.com/198.18.0.1
- /tmp/dnsmasq.d/adb_list.yoyo:address=/google-analytics.com/198.18.0.1
+The query function checks against the submitted (sub-)domain and recurses automatically to the upper top level domain(s).
+For every domain it returns the overall count plus a distinct list of active blocklists with the first relevant result.
+In the example above you have to whitelist "www.doubleclick.net" to free the submitted domain.
</code></pre>
-**example to find blocked domains on certain sites for whitelisting:**
+**example to identify blocked domains during web browsing, i.e. for whitelisting:**
<pre><code>
1. the easy way ...
enable the network analysis builtins in chrome or firefox to identify domains
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+adb_scriptver="1.5.3"
+adb_mincfgver="2.5"
+adb_hotplugif=""
adb_lanif="lan"
adb_nullport="65534"
adb_nullportssl="65535"
adb_forcedns=1
adb_fetchttl=5
adb_restricted=0
+adb_loglevel=1
adb_uci="$(which uci)"
# f_envload: load adblock environment
f_exit
fi
- # check opkg availability
- #
- if [ -f "/var/lock/opkg.lock" ]
- then
- rc=-10
- f_log "adblock installation finished successfully, 'opkg' currently locked by package installer"
- f_exit
- fi
-
# uci function to parse global section by callback
#
config_cb()
if [ -z "${adb_enabled}" ] || [ -z "${adb_cfgver}" ] || [ "${adb_cfgver%%.*}" != "${adb_mincfgver%%.*}" ]
then
rc=-1
- f_log "outdated adblock config (${adb_mincfgver} vs. ${adb_cfgver}), please run '/etc/init.d/adblock cfgup' to update your configuration"
+ f_log "outdated adblock config (${adb_cfgver} vs. ${adb_mincfgver}), please run '/etc/init.d/adblock cfgup' to update your configuration"
f_exit
elif [ "${adb_cfgver#*.}" != "${adb_mincfgver#*.}" ]
then
if [ "${adb_enabled}" != "1" ]
then
rc=-10
- f_log "adblock is currently disabled, please set adblock.global.adb_enabled=1' to use this service"
+ f_log "adblock is currently disabled, please set adb_enabled to '1' to use this service"
f_exit
fi
- # get list with all installed packages
+ # check opkg availability
#
- pkg_list="$(opkg list-installed)"
- if [ -z "${pkg_list}" ]
+ adb_pkglist="$(opkg list-installed)"
+ if [ $(($?)) -eq 255 ]
+ then
+ rc=-10
+ f_log "adblock installation finished successfully, 'opkg' currently locked by package installer"
+ f_exit
+ elif [ -z "${adb_pkglist}" ]
then
rc=-1
f_log "empty 'opkg' package list, please check your installation"
f_exit
fi
- adb_sysver="$(printf "${pkg_list}" | grep "^base-files -")"
+ adb_sysver="$(printf "${adb_pkglist}" | grep "^base-files -")"
adb_sysver="${adb_sysver##*-}"
# get lan ip addresses
then
adb_nullipv4="${adb_ipv4}"
adb_nullipv6="${adb_ipv6}"
- if [ -n "$(${adb_uci} -q get uhttpd.main.listen_http | grep -Fo "80")" ] ||
- [ -n "$(${adb_uci} -q get uhttpd.main.listen_https | grep -Fo "443")" ]
+ if [ -n "$(${adb_uci} -q get uhttpd.main.listen_http | grep -o ":80$")" ] ||
+ [ -n "$(${adb_uci} -q get uhttpd.main.listen_https | grep -o ":443$")" ]
then
rc=-1
f_log "AP mode detected, please set local LuCI instance to ports <> 80/443"
f_exit
- elif [ -z "$(pgrep -f "dnsmasq")" ]
- then
- rc=-1
- f_log "please enable the local dnsmasq instance to use adblock"
- f_exit
- elif [ ! -f "/var/run/fw3.state" ]
- then
- rc=-1
- f_log "please enable the local firewall to use adblock"
- f_exit
else
apmode_ok="true"
fi
# check general package dependencies
#
- f_depend "busybox"
- f_depend "uci"
- f_depend "uhttpd"
- f_depend "iptables"
- f_depend "kmod-ipt-nat"
+ f_depend "busybox -"
+ f_depend "uci -"
+ f_depend "uhttpd -"
+ f_depend "iptables -"
+ f_depend "kmod-ipt-nat -"
+ f_depend "firewall -"
+ f_depend "dnsmasq*"
# check ipv6 related package dependencies
#
if [ -n "${adb_wanif6}" ]
then
- f_depend "ip6tables" "true"
+ f_depend "ip6tables -" "true"
if [ "${package_ok}" = "false" ]
then
f_log "package 'ip6tables' not found, IPv6 support will be disabled"
unset adb_wanif6
else
- f_depend "kmod-ipt-nat6" "true"
+ f_depend "kmod-ipt-nat6 -" "true"
if [ "${package_ok}" = "false" ]
then
f_log "package 'kmod-ipt-nat6' not found, IPv6 support will be disabled"
# check uclient-fetch/wget dependencies
#
- f_depend "uclient-fetch" "true"
+ f_depend "uclient-fetch -" "true"
if [ "${package_ok}" = "true" ]
then
- f_depend "libustream-polarssl" "true"
+ f_depend "libustream-polarssl -" "true"
if [ "${package_ok}" = "false" ]
then
- f_depend "libustream-\(mbedtls\|openssl\|cyassl\)" "true"
+ f_depend "libustream-\(mbedtls\|openssl\|cyassl\) -" "true"
if [ "${package_ok}" = "true" ]
then
adb_fetch="$(which uclient-fetch)"
fi
if [ -z "${adb_fetch}" ]
then
- f_depend "wget" "true"
+ f_depend "wget -" "true"
if [ "${package_ok}" = "true" ]
then
- adb_fetch="$(which wget)"
+ adb_fetch="$(which /usr/bin/wget* | head -1)"
fetch_parm="--no-config --quiet --tries=1 --no-cache --no-cookies --max-redirect=0 --dns-timeout=${adb_fetchttl} --connect-timeout=${adb_fetchttl} --read-timeout=${adb_fetchttl}"
response_parm="--spider --server-response"
- else
+ fi
+ if [ -z "${adb_fetch}" ]
+ then
rc=-1
f_log "please install 'uclient-fetch' or 'wget' with ssl support to use adblock"
f_exit
# check ca-certificate package and set fetch parm accordingly
#
- f_depend "ca-certificates" "true"
+ f_depend "ca-certificates -" "true"
if [ "${package_ok}" = "false" ]
then
fetch_parm="${fetch_parm} --no-check-certificate"
#
if [ -n "${adb_wanif4}" ] && [ -n "${adb_wanif6}" ]
then
- f_uhttpd "adbIPv4+6_80" "1" "-p ${adb_ipv4}:${adb_nullport} -p [${adb_ipv6}]:${adb_nullport}"
- f_uhttpd "adbIPv4+6_443" "0" "-p ${adb_ipv4}:${adb_nullportssl} -p [${adb_ipv6}]:${adb_nullportssl}"
+ f_uhttpd "adbIPv46_80" "1" "-p ${adb_ipv4}:${adb_nullport} -p [${adb_ipv6}]:${adb_nullport}"
+ f_uhttpd "adbIPv46_443" "0" "-p ${adb_ipv4}:${adb_nullportssl} -p [${adb_ipv6}]:${adb_nullportssl}"
elif [ -n "${adb_wanif4}" ]
then
f_uhttpd "adbIPv4_80" "1" "-p ${adb_ipv4}:${adb_nullport}"
# remove temporary package list
#
- unset pkg_list
+ unset adb_pkglist
}
# f_depend: check package dependencies
local check_only="${2}"
package_ok="true"
- check="$(printf "${pkg_list}" | grep "^${package} -")"
+ check="$(printf "${adb_pkglist}" | grep "^${package}")"
if [ "${check_only}" = "true" ] && [ -z "${check}" ]
then
package_ok="false"
rm_fw="$(iptables -w -t nat -vnL | grep -Fo "adb-")"
if [ -n "${rm_fw}" ]
then
- iptables-save -t nat | grep -Fv -- "adb-" | iptables-restore
- iptables-save -t filter | grep -Fv -- "adb-" | iptables-restore
+ iptables-save | grep -Fv -- "adb-" | iptables-restore
if [ -n "$(lsmod | grep -Fo "ip6table_nat")" ]
then
- ip6tables-save -t nat | grep -Fv -- "adb-" | ip6tables-restore
- ip6tables-save -t filter | grep -Fv -- "adb-" | ip6tables-restore
+ ip6tables-save | grep -Fv -- "adb-" | ip6tables-restore
fi
fi
}
local log_msg="${1}"
local class="info "
- # check for terminal session
- #
+ if [ $((rc)) -gt 0 ]
+ then
+ class="error"
+ elif [ $((rc)) -lt 0 ]
+ then
+ class="warn "
+ fi
if [ -t 1 ]
then
log_parm="-s"
fi
-
- # log to different output devices and set log class accordingly
- #
- if [ -n "${log_msg}" ]
+ if [ -n "${log_msg}" ] && ([ $((adb_loglevel)) -gt 0 ] || [ "${class}" != "info " ])
then
- if [ $((rc)) -gt 0 ]
- then
- class="error"
- fi
logger ${log_parm} -t "adblock[${adb_pid}] ${class}" "${log_msg}" 2>&1
fi
}
if [ -n "${adb_wanif4}" ]
then
ipv4_blk="$(iptables -t nat -vxnL adb-nat | awk '$3 ~ /^DNAT$/ {sum += $1} END {printf sum}')"
- ipv4_all="$(iptables -t nat -vxnL PREROUTING | awk '$3 ~ /^prerouting_rule$/ {sum += $1} END {printf sum}')"
+ ipv4_all="$(iptables -t nat -vxnL PREROUTING | awk '$3 ~ /^(delegate_prerouting|prerouting_rule)$/ {sum += $1} END {printf sum}')"
if [ $((ipv4_all)) -gt 0 ] && [ $((ipv4_blk)) -gt 0 ] && [ $((ipv4_all)) -gt $((ipv4_blk)) ]
then
ipv4_pct="$(printf "${ipv4_blk}" | awk -v all="${ipv4_all}" '{printf( "%5.2f\n",$1/all*100)}')"
else
rc=0
fi
- "${adb_uci}" -q commit "adblock"
+ if [ -n "$("${adb_uci}" -q changes adblock)" ]
+ then
+ "${adb_uci}" -q commit "adblock"
+ fi
rm -f "${adb_pidfile}"
exit ${rc}
}
#
adb_pid="${$}"
adb_pidfile="/var/run/adblock.pid"
-adb_scriptver="1.4.3"
-adb_mincfgver="2.3"
adb_scriptdir="${0%/*}"
+
if [ -r "${adb_pidfile}" ]
then
rc=255
# main loop for all block list sources
#
+f_log "use '${adb_fetch}' for list downloads"
+
for src_name in ${adb_sources}
do
# check disabled sources
then
if [ "${src_name}" = "blacklist" ]
then
- tmp_domains="$(cat "${url}")"
+ tmp_domains="$(strings -n 1 "${url}")"
elif [ "${src_name}" = "shalla" ]
then
shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
break
fi
done
- tmp_domains="$(cat "${shalla_file}")"
+ tmp_domains="$(strings -n 1 "${shalla_file}")"
rm -rf "${adb_tmpdir}/BL"
rm -f "${shalla_archive}"
rm -f "${shalla_file}"
fi
else
- tmp_domains="$(${adb_fetch} ${fetch_parm} -O- "${url}")"
+ tmp_domains="$(${adb_fetch} ${fetch_parm} -O- "${url}" | strings -n 1)"
fi
rc=${?}
else
config adblock 'global'
option adb_enabled '1'
- option adb_cfgver '2.3'
+ option adb_cfgver '2.5'
option adb_whitelist '/etc/adblock/adblock.whitelist'
option adb_whitelist_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\"^\"\$1\"\\\|[.]\"\$1)}'
option adb_forcedns '1'
option enabled '1'
option adb_src 'https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'mozilla driven content blocklist, numerous updates on the same day, approx. 6.500 entries'
+ option adb_src_desc 'mozilla driven blocklist, numerous updates on the same day, approx. 6.500 entries'
config source 'dshield'
option enabled '0'
option adb_src 'http://www.dshield.org/feeds/suspiciousdomains_Low.txt'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'broad blocklist for suspicious domains, daily updates, approx. 4.500 entries'
+ option adb_src_desc 'generic blocklist, daily updates, approx. 4.500 entries'
config source 'feodo'
option enabled '0'
option adb_src 'https://feodotracker.abuse.ch/blocklist/?download=domainblocklist'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'focus on feodo botnet domains, daily updates, approx. 0-10 entries'
+ option adb_src_desc 'focus on feodo botnet, daily updates, approx. 0-10 entries'
config source 'hphosts'
option enabled '0'
- option adb_src 'https://hosts-file.net/download/hosts.txt'
+ option adb_src 'https://hosts-file.net/ad_servers.txt'
option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
- option adb_src_desc 'broad blocklist against ad-, tracking- and other malicious hosts, monthly updates, approx. 390.000 entries'
+ option adb_src_desc 'broad blocklist, monthly updates, approx. 50.000 entries'
config source 'malware'
option enabled '0'
option adb_src 'https://mirror.cedia.org.ec/malwaredomains/justdomains'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'broad blocklist for malware domains, daily updates, approx. 16.000 entries'
+ option adb_src_desc 'broad blocklist, daily updates, approx. 16.000 entries'
config source 'malwarelist'
option enabled '0'
option adb_src 'http://www.malwaredomainlist.com/hostslist/hosts.txt'
option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
- option adb_src_desc 'generic blocklist for malware domains, daily updates, approx. 1.500 entries'
+ option adb_src_desc 'focus on malware, daily updates, approx. 1.500 entries'
config source 'openphish'
option enabled '0'
option adb_src 'https://openphish.com/feed.txt'
option adb_src_rset '{FS=\"/\"} \$3 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$3)}'
- option adb_src_desc 'focus on phishing domains, numerous updates on the same day, approx. 1.800 entries'
+ option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 1.800 entries'
config source 'palevo'
option enabled '0'
option adb_src 'https://palevotracker.abuse.ch/blocklists.php?download=domainblocklist'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'focus on palevo worm domains, daily updates, approx. 15 entries'
+ option adb_src_desc 'focus on palevo worm, daily updates, approx. 15 entries'
config source 'ransomware'
option enabled '0'
option adb_src 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'focus on ransomware domains, numerous updates on the same day, approx. 130 entries'
+ option adb_src_desc 'focus on ransomware, numerous updates on the same day, approx. 130 entries'
config source 'rolist'
option enabled '0'
option adb_src 'https://easylist-downloads.adblockplus.org/rolist+easylist.txt'
option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
- option adb_src_desc 'focus on romanian ad related domains plus generic easylist additions, weekly updates, approx. 600 entries'
+ option adb_src_desc 'focus on romanian ads plus generic easylist additions, weekly updates, approx. 600 entries'
config source 'ruadlist'
option enabled '0'
option adb_src 'https://easylist-downloads.adblockplus.org/ruadlist+easylist.txt'
option adb_src_rset '{FS=\"[|^]\"} \$0 ~/^\|\|([A-Za-z0-9_-]+\.){1,}[A-Za-z]+\^$/{print tolower(\$3)}'
- option adb_src_desc 'focus on russian ad related domains plus generic easylist additions, weekly updates, approx. 2.000 entries'
+ option adb_src_desc 'focus on russian ads plus generic easylist additions, weekly updates, approx. 2.000 entries'
+
+config source 'securemecca'
+ option enabled '0'
+ option adb_src 'http://securemecca.com/Downloads/hosts.txt'
+ option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
+ option adb_src_desc 'broad blocklist, infrequent updates, approx. 25.000 entries'
config source 'shalla'
option enabled '0'
option adb_src 'http://www.shallalist.de/Downloads/shallalist.tar.gz'
option adb_src_rset '{FS=\"/\"} \$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'broad blocklist subdivided in different categories (adv, costtraps, spyware, tracker and warez enabled by default), daily updates, approx. 32.000 entries'
+ option adb_src_desc 'broad blocklist subdivided in different categories, daily updates, approx. 32.000 entries'
list adb_src_cat 'adv'
list adb_src_cat 'costtraps'
list adb_src_cat 'spyware'
option enabled '0'
option adb_src 'https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'generic blocklist for suspicious domains, infrequent updates, approx. 5.000 entries'
+ option adb_src_desc 'generic blocklist, infrequent updates, approx. 5.000 entries'
config source 'sysctl'
option enabled '0'
option adb_src 'http://sysctl.org/cameleon/hosts'
option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
- option adb_src_desc 'generic blocklist for ad related domains, weekly updates, approx. 21.000 entries'
+ option adb_src_desc 'broad blocklist, weekly updates, approx. 21.000 entries'
config source 'whocares'
option enabled '0'
option adb_src 'http://someonewhocares.org/hosts/hosts'
option adb_src_rset '\$0 ~/^127\.0\.0\.1[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
- option adb_src_desc 'broad blocklist for suspicious domains, weekly updates, approx. 12.000 entries'
+ option adb_src_desc 'broad blocklist, weekly updates, approx. 12.000 entries'
config source 'winspy'
option enabled '0'
option adb_src 'https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/win10/spy.txt'
option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
- option adb_src_desc 'focus on windows spy & telemetry domains, infrequent updates, approx. 120 entries'
+ option adb_src_desc 'focus on windows spy & telemetry, infrequent updates, approx. 140 entries'
config source 'winhelp'
option enabled '0'
option adb_src 'http://winhelp2002.mvps.org/hosts.txt'
option adb_src_rset '\$0 ~/^0\.0\.0\.0[ \t]+([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$2)}'
- option adb_src_desc 'broad blocklist for suspicious domains, infrequent updates, approx. 15.000 entries'
+ option adb_src_desc 'broad blocklist, infrequent updates, approx. 15.000 entries'
config source 'yoyo'
option enabled '1'
option enabled '0'
option adb_src 'https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist'
option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'focus on zeus botnet domains, daily updates, approx. 440 entries'
+ option adb_src_desc 'focus on zeus botnet, daily updates, approx. 440 entries'
adb_pid="${$}"
adb_helper="/usr/bin/adblock-helper.sh"
adb_pidfile="/var/run/adblock.pid"
+adb_enabled="$(/etc/init.d/adblock enabled; echo $?)"
-if [ -f "${adb_pidfile}" ] || [ "${ACTION}" != "ifup" ]
+if [ "${adb_enabled}" = "1" ] || [ -f "${adb_pidfile}" ] || [ "${ACTION}" != "ifup" ]
then
exit 0
fi
if [ "${INTERFACE}" = "${adb_wanif4}" ] || [ "${INTERFACE}" = "${adb_wanif6}" ]
then
- /etc/init.d/adblock start
- f_log "adblock service started due to '${ACTION}' of '${INTERFACE}' interface"
+ if [ -z "${adb_hotplugif}" ] || [ "${INTERFACE}" = "${adb_hotplugif}" ]
+ then
+ /etc/init.d/adblock start
+ f_log "adblock service started due to '${ACTION}' of '${INTERFACE}' interface"
+ fi
fi
#!/bin/sh /etc/rc.common
#
-START=99
-EXTRA_COMMANDS="toggle stats cfgup"
+START=90
+EXTRA_COMMANDS="toggle stats cfgup envchk query"
EXTRA_HELP=" toggle Toggle adblock 'on' or 'off'
stats Update adblock statistics
- cfgup Update adblock configuration file"
+ cfgup Update adblock configuration file
+ envchk Check/Set adblock environment
+ query <DOMAIN> Query active blocklists for specific domain"
adb_debug=0
adb_pid="${$}"
fi
return 0
}
+
+query()
+{
+ domain="${1}"
+ tld="${domain#*.}"
+ list_dns="$(find "${adb_dnsdir}" -maxdepth 1 -type f -name "${adb_dnsprefix}*" -print)"
+ if [ -z "${list_dns}" ]
+ then
+ f_log "no active blocklists found, please start adblock first"
+ elif [ -z "${domain}" ] || [ "${domain}" = "${tld}" ]
+ then
+ f_log "invalid domain query input, please submit a specific (sub-)domain, i.e. 'www.abc.xyz'"
+ else
+ while [ "${domain}" != "${tld}" ]
+ do
+ search="${domain//./\.}"
+ result="$(grep -Hm 1 "[/\.]${search}/" "${adb_dnsdir}/adb_list"* | awk -F ':|/' '{print " "$4"\t: "$6}')"
+ count="$(grep -hc "[/\.]${search}/" "${adb_dnsdir}/adb_list"* | awk '{sum += $1} END {printf sum}')"
+ printf "%s\n" "=> distinct results for domain '${domain}' (overall ${count})"
+ if [ -z "${result}" ]
+ then
+ printf "%s\n" " no matches in active blocklists"
+ else
+ printf "%s\n" "${result}"
+ fi
+ domain="${tld}"
+ tld="${domain#*.}"
+ done
+ fi
+ return 0
+}
+
+envchk()
+{
+ adb_loglevel=0
+ f_envcheck
+ rm -f "${adb_tmpfile}"
+ rm -rf "${adb_tmpdir}"
+ adb_loglevel=1
+ f_log "adblock environment check finished successfully"
+ return 0
+}
<html>
- <body>
+ <head>
+ <script>window.close();</script>
+ </head>
+ <body>
<img src="data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=" alt=""></img>
</body>
</html>
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=addrwatch
+PKG_VERSION:=0.8
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-master.tar.gz
+PKG_SOURCE_URL:=https://github.com/fln/addrwatch/releases/download/$(PKG_VERSION)/
+PKG_MD5SUM:=8f401415be993005fa5fb58a05e14295
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-master
+PKG_FIXUP:=autoreconf
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/addrwatch
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libpcap +libevent2
+ TITLE:=IPv4/IPv6 and ethernet address pairing tool
+ URL:=https://github.com/fln/addrwatch
+ MAINTAINER:=Ondrej Caletka <ondrej@caletka.cz>
+endef
+
+define Package/addrwatch/description
+ This is a tool similar to arpwatch. It main purpose is to monitor network and
+ log discovered ethernet/ip pairings. Addrwatch is extremely useful in networks
+ with IPv6 autoconfiguration (RFC4862) enabled. It allows to track IPv6
+ addresses of hosts using IPv6 privacy extensions (RFC4941).
+endef
+
+define Package/addrwatch/conffiles
+ /etc/config/addrwatch
+endef
+
+define Package/addrwatch/install
+ $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/addrwatch $(1)/usr/sbin/
+ $(INSTALL_BIN) ./files/addrwatch.init $(1)/etc/init.d/addrwatch
+ $(INSTALL_CONF) ./files/addrwatch.config $(1)/etc/config/addrwatch$
+endef
+
+$(eval $(call BuildPackage,addrwatch))
--- /dev/null
+
+config addrwatch
+ option disabled '0'
+ list interface 'lan'
+ #list interface 'wan'
+ #option syslog '1'
+ #option verbose '0'
+ #option output '/var/log/addrwatch'
+ #list blacklist '192.168.1.1'
+ #option hashsize '1'
+ #option ratelimit '-1'
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2016 OpenWrt.org
+
+START=50
+USE_PROCD=1
+
+. /lib/functions/network.sh
+
+validate_section_addrwatch() {
+ uci_validate_section addrwatch addrwatch "${1}" \
+ 'disabled:bool:0' \
+ 'interface:list(string):lan' \
+ 'syslog:bool:1' \
+ 'output:string' \
+ 'quiet:bool:0' \
+ 'verbose:bool:0' \
+ 'ipv4only:bool:0' \
+ 'ipv6only:bool:0' \
+ 'blacklist:list(or(ip4addr,ip6addr))' \
+ 'hashsize:range(1,65536):1024'\
+ 'ratelimit:integer:3600'
+ return $?
+}
+
+start_instance() {
+ local cfg="$1"
+ local disabled interface syslog output quiet verbose ipv4only ipv6only
+ local blacklist hashsize ratelimit
+ local netdevs=""
+
+ validate_section_addrwatch "${cfg}" || {
+ echo "validation of config $cfg failed"
+ return 1
+ }
+ [ $disabled -ne 0 ] && return 1
+
+ for iface in $interface; do
+ local netdev
+ network_get_physdev netdev "${iface}"
+ append netdevs "${netdev}"
+ done
+
+ procd_open_instance
+ procd_set_param command /usr/sbin/addrwatch
+ [ "${syslog}" -eq 1 ] && procd_append_param command --syslog
+ [ -n "${output}" ] && procd_append_param command --output "$output"
+ [ "$quiet" -eq 1 ] && procd_append_param command --quiet
+ [ "$verbose" -eq 1 ] && procd_append_param command --verbose
+ [ "$ipv4only" -eq 1 ] && procd_append_param command --ipv4only
+ [ "$ipv6only" -eq 1 ] && procd_append_param command --ipv6only
+ [ -n "$hashsize" ] && procd_append_param command --hashsize "$hashsize"
+ [ -n "$ratelimit" ] && procd_append_param command --ratelimit "$ratelimit"
+ for blitem in $blacklist; do
+ procd_append_param command "--blacklist=${blitem}"
+ done
+ procd_append_param command $netdevs
+ procd_set_param netdev $netdevs
+ procd_set_param respawn
+ procd_open_trigger
+ for iface in $interface; do
+ procd_add_interface_trigger "interface.*" ${iface} /etc/init.d/addrwatch reload
+ done
+ procd_close_trigger
+ procd_close_instance
+}
+
+start_service() {
+ config_load 'addrwatch'
+ config_foreach start_instance 'addrwatch'
+}
+
+service_triggers() {
+ procd_add_reload_trigger 'addrwatch'
+}
--- /dev/null
+--- a/configure.ac
++++ b/configure.ac
+@@ -56,9 +56,6 @@ AC_CHECK_HEADERS([arpa/inet.h netinet/in
+ # Checks for typedefs, structures, and compiler characteristics.
+ AC_C_INLINE
+ AC_TYPE_PID_T
+-AC_CHECK_DECLS([sys_siglist], [], [
+- AC_MSG_ERROR([Unable to find sys_siglist declaration.])
+-], [[#include <signal.h>]])
+ AC_TYPE_UINT32_T
+ AC_TYPE_UINT16_T
+ AC_TYPE_UINT8_T
+--- a/src/addrwatch.c
++++ b/src/addrwatch.c
+@@ -339,7 +339,7 @@ void reload_cb(evutil_socket_t fd, short
+ void reload_cb(int fd, short events, void *arg)
+ #endif
+ {
+- log_msg(LOG_DEBUG, "Received signal (%d), %s", fd, sys_siglist[fd]);
++ log_msg(LOG_DEBUG, "Received signal (%d), %s", fd, strsignal(fd));
+ log_msg(LOG_DEBUG, "Reopening output files");
+
+ output_flatfile_reload();
+@@ -353,7 +353,7 @@ void stop_cb(evutil_socket_t fd, short e
+ void stop_cb(int fd, short events, void *arg)
+ #endif
+ {
+- log_msg(LOG_DEBUG, "Received signal (%d), %s", fd, sys_siglist[fd]);
++ log_msg(LOG_DEBUG, "Received signal (%d), %s", fd, strsignal(fd));
+ #if HAVE_LIBEVENT2
+ event_base_loopbreak(cfg.eb);
+ #else
--- /dev/null
+--- a/src/addrwatch.c
++++ b/src/addrwatch.c
+@@ -492,7 +492,7 @@ int main(int argc, char *argv[])
+ argp_parse(&argp, argc, argv, 0, &optind, 0);
+
+ if (!cfg.hostname) {
+- cfg.hostname_len = sysconf(_SC_HOST_NAME_MAX);
++ cfg.hostname_len = HOST_NAME_MAX;
+ cfg.hostname = (char *)calloc(cfg.hostname_len, sizeof(char));
+ gethostname(cfg.hostname, cfg.hostname_len);
+ }
include $(TOPDIR)/rules.mk
PKG_NAME:=aria2
-PKG_VERSION:=1.25.0
-PKG_RELEASE:=2
+PKG_VERSION:=1.28.0
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_VERSION)/
-PKG_MD5SUM:=edc7f20ba182cec30384489fd3dfe135
+PKG_MD5SUM:=f649ab30f3b09d0c0ebb816ce0c0205d
PKG_INSTALL:=1
PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, Hsing-Wang Liao <kuoruan@gmail.com>
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=autossh
+PKG_VERSION:=1.4e
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_SOURCE_URL:=http://www.harding.motd.ca/autossh/
+PKG_MD5SUM:=f86684b96e99d22b2e9d35dc63b0aa29
+PKG_LICENSE:=0BSD
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/autossh
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=Autossh client
+ URL:=http://www.harding.motd.ca/autossh/
+ MAINTAINER:=Christian Beier <cb@shoutrlabs.com>
+ SUBMENU:=SSH
+endef
+
+define Build/Compile
+ $(call Build/Compile/Default, -f Makefile \
+ CFLAGS="$(TARGET_CFLAGS) -Wall -D\"SSH_PATH=\\\"\$$$$(SSH)\\\"\" -D\"VER=\\\"\$$$$(VER)\\\"\"" \
+ all \
+ )
+endef
+
+define Package/autossh/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/autossh $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/autossh.init $(1)/etc/init.d/autossh
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/autossh.config $(1)/etc/config/autossh
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+ $(INSTALL_DATA) ./files/autossh.hotplug $(1)/etc/hotplug.d/iface/20-autossh
+endef
+
+define Package/autossh/conffiles
+/etc/config/autossh
+endef
+
+$(eval $(call BuildPackage,autossh))
--- /dev/null
+config autossh
+ option ssh '-i /etc/dropbear/id_rsa -N -T -R 2222:localhost:22 user@host'
+ option gatetime '0'
+ option monitorport '20000'
+ option poll '600'
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2007 OpenWrt.org
+
+/etc/init.d/autossh enabled && {
+
+ [ "$ACTION" = "ifup" ] && {
+ /etc/init.d/autossh start
+ }
+
+ [ "$ACTION" = "ifdown" ] && {
+ /etc/init.d/autossh stop
+ }
+
+}
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2007-2011 OpenWrt.org
+
+START=80
+
+start_instance() {
+ local section="$1"
+
+ config_get ssh "$section" 'ssh'
+ config_get gatetime "$section" 'gatetime'
+ config_get monitorport "$section" 'monitorport'
+ config_get poll "$section" 'poll'
+
+ export AUTOSSH_GATETIME="${gatetime:-30}"
+ export AUTOSSH_POLL="${poll:-600}"
+ service_start /usr/sbin/autossh -M ${monitorport:-20000} -f ${ssh}
+}
+
+boot() {
+ return
+}
+
+start() {
+ config_load 'autossh'
+ config_foreach start_instance 'autossh'
+}
+
+stop() {
+ service_stop /usr/sbin/autossh
+}
#
# Copyright (C) 2006-2012 OpenWrt.org
-# 2014 Noah Meyerhans <frodo@morgul.net>
+# 2014-2016 Noah Meyerhans <frodo@morgul.net>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=bind
-PKG_VERSION:=9.9.8-P4
-PKG_RELEASE:=3
+PKG_VERSION:=9.10.4-P4
+PKG_RELEASE:=1
USERID:=bind=57:bind=57
PKG_MAINTAINER:=Noah Meyerhans <frodo@morgul.net>
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:=5e401f6cf024f596044d733ceb0d6415
+PKG_MD5SUM:=e110904a1d54f83f01d4be8bcd842927
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libtool.m4
PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
PKG_CONFIG_DEPENDS := \
CONFIG_OPENSSL_WITH_EC \
-Index: bind-9.9.4/bin/Makefile.in
+Index: bind-9.10.4-P3/bin/Makefile.in
===================================================================
---- bind-9.9.4.orig/bin/Makefile.in
-+++ bind-9.9.4/bin/Makefile.in
+--- bind-9.10.4-P3.orig/bin/Makefile.in
++++ bind-9.10.4-P3/bin/Makefile.in
@@ -19,7 +19,7 @@ srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
--SUBDIRS = named rndc dig dnssec tools tests nsupdate \
-+SUBDIRS = named rndc dig dnssec tools nsupdate \
+-SUBDIRS = named rndc dig delv dnssec tools tests nsupdate \
++SUBDIRS = named rndc dig delv dnssec tools nsupdate \
check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
TARGETS =
-Index: bind-9.9.4/lib/Makefile.in
+Index: bind-9.10.4-P3/lib/Makefile.in
===================================================================
---- bind-9.9.4.orig/lib/Makefile.in
-+++ bind-9.9.4/lib/Makefile.in
+--- bind-9.10.4-P3.orig/lib/Makefile.in
++++ bind-9.10.4-P3/lib/Makefile.in
@@ -23,7 +23,7 @@ top_srcdir = @top_srcdir@
# Attempt to disable parallel processing.
.NOTPARALLEL:
.NO_PARALLEL:
--SUBDIRS = isc isccc dns isccfg bind9 lwres tests
-+SUBDIRS = isc isccc dns isccfg bind9 lwres
+-SUBDIRS = isc isccc dns isccfg bind9 lwres irs tests samples
++SUBDIRS = isc isccc dns isccfg bind9 lwres irs samples
TARGETS =
@BIND9_MAKE_RULES@
---- a/configure.in
-+++ b/configure.in
-@@ -93,26 +93,11 @@ esac
+Index: bind-9.10.4-P3/configure.in
+===================================================================
+--- bind-9.10.4-P3.orig/configure.in
++++ bind-9.10.4-P3/configure.in
+@@ -167,26 +167,11 @@ esac
#
AC_CONFIG_FILES([make/rules make/includes])
include $(TOPDIR)/rules.mk
PKG_NAME:=bmon
-PKG_VERSION:=3.8
-PKG_RELEASE:=2
+PKG_VERSION:=3.9
+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:=162ce0d108ff32cbf44b874c5a7e8147
+PKG_MD5SUM:=a959371dc6f8eecdfe27c088447ec636
PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
PKG_LICENSE:=MIT
PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://github.com/coova/coova-chilli
chilli_inst=$2
if [ "$chilli_inst" != "" ]
then
- rm -f /var/run/chilli_${chilli_inst}*
+ rm -f /var/run/chilli_${chilli_inst}.*
chilli_conf=/var/run/chilli_${chilli_inst}.conf
eval "start_chilli_$chilli_inst=1"
fi
PKG_NAME:=ddns-scripts
# Version == major.minor.patch
# increase on new functionality (minor) or patches (patch)
-PKG_VERSION:=2.7.3
+PKG_VERSION:=2.7.5
# Release == build
# increase on changes of services files or tld_names.dat
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
##### **********************************
define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.defaults $(1)/etc/uci-defaults/ddns
$(INSTALL_DIR) $(1)/etc/hotplug.d/iface
$(INSTALL_BIN) $(PKG_BUILD_DIR)/files/ddns.hotplug $(1)/etc/hotplug.d/iface/95-ddns
$(INSTALL_DIR) $(1)/etc/init.d
$(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
--- /dev/null
+#!/bin/sh
+
+# add new section "ddns" "global" if not exists
+/sbin/uci -q get ddns.global > /dev/null || /sbin/uci -q set ddns.global='ddns'
+/sbin/uci -q get ddns.global.date_format > /dev/null || /sbin/uci -q set ddns.global.date_format='%F %R'
+/sbin/uci -q get ddns.global.log_lines > /dev/null || /sbin/uci -q set ddns.global.log_lines='250'
+/sbin/uci -q get ddns.global.allow_local_ip > /dev/null || /sbin/uci -q set ddns.global.allow_local_ip='0'
+/sbin/uci -q commit ddns
+
+# fix some service_name entries to new once
+/bin/sed -i \
+ -e '/service_name/s/CloudFlare/cloudflare\.com/g' \
+ -e '/service_name/s/NoIP\.com/no-ip\.com/g' \
+ -e '/service_name/s/No-IP\.com/no-ip\.com/g' \
+ -e '/service_name/s/freedns.afraid.org/afraid.org/g' \
+ -e '/service_name/s/free.editdns.net/editdns.net/g' \
+ -e '/service_name/s/domains.google.com/google.com/g' \
+ -e '/service_name/s/spdns.de/spdyn.de/g' \
+ -e '/service_name/s/strato.de/strato.com/g' \
+ /etc/config/ddns
+
+# clear LuCI indexcache
+rm -f /tmp/luci-indexcache >/dev/null 2>&1
+
+exit 0
. /lib/functions/network.sh
# GLOBAL VARIABLES #
-VERSION="2.6.4-1"
+VERSION="2.7.5"
SECTION_ID="" # hold config's section name
VERBOSE_MODE=1 # default mode is log to console, but easily changed with parameter
PID_SLEEP=0 # ProcessID of current background "sleep"
+# 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=""
+
+# Name Server Lookup Programs
+BIND_HOST=$(which host)
+KNOT_HOST=$(which khost)
+DRILL=$(which drill)
+HOSTIP=$(which hostip)
+NSLOOKUP=$(which nslookup)
+NSLOOKUP_MUSL=$($(which nslookup) localhost 2>&1 | grep -F "(null)") # not empty busybox compiled with musl
+
+# Transfer Programs
+WGET=$(which wget)
+WGET_SSL=$(which wget-ssl)
+
+CURL=$(which curl)
+# CURL_SSL not empty then SSL support available
+CURL_SSL=$($(which curl) -V 2>/dev/null | grep "Protocols:" | grep -F "https")
+# CURL_PROXY not empty then Proxy support available
+CURL_PROXY=$(find /lib /usr/lib -name libcurl.so* -exec grep -i "all_proxy" {} 2>/dev/null \;)
+
+UCLIENT_FETCH=$(which uclient-fetch)
+# UCLIENT_FETCH_SSL not empty then SSL support available
+UCLIENT_FETCH_SSL=$(find /lib /usr/lib -name libustream-ssl.so* 2>/dev/null)
+
+# Global configuration settings
# allow NON-public IP's
ALLOW_LOCAL_IP=$(uci -q get ddns.global.allow_local_ip) || ALLOW_LOCAL_IP=0
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
+[ -n "$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
# 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
+# used by /etc/hotplug.d/iface/95-ddns on IFUP
# and by /etc/init.d/ddns start
start_daemon_for_all_ddns_sections()
{
# 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'
+# used by /etc/hotplug.d/iface/95-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() {
verify_host_port() {
local __HOST=$1
local __PORT=$2
+ local __NC=$(which nc)
+ local __NCEXT=$($(which nc) --help 2>&1 | grep "\-w" 2>/dev/null) # busybox nc compiled with extensions
local __IP __IPV4 __IPV6 __RUNPROG __PROG __ERR
# return codes
# 1 system specific error
__IPV6=$(echo $__HOST | grep -m 1 -o "$IPV6_REGEX")
# if FQDN given get IP address
[ -z "$__IPV4" -a -z "$__IPV6" ] && {
- if [ -n "$(which host)" ]; then # use BIND host if installed
+ if [ -n "$BIND_HOST" ]; then # use BIND host if installed
__PROG="BIND host"
- __RUNPROG="$(which host) -t ANY $__HOST >$DATFILE 2>$ERRFILE"
+ __RUNPROG="$BIND_HOST $__HOST >$DATFILE 2>$ERRFILE"
+ elif [ -n "$KNOT_HOST" ]; then # use Knot host if installed
+ __PROG="Knot host"
+ __RUNPROG="$KNOT_HOST $__HOST >$DATFILE 2>$ERRFILE"
+ elif [ -n "$DRILL" ]; then # use drill if installed
+ __PROG="drill"
+ __RUNPROG="$DRILL -V0 $__HOST A >$DATFILE 2>$ERRFILE" # IPv4
+ __RUNPROG="$__RUNPROG; $DRILL -V0 $__HOST AAAA >>$DATFILE 2>>$ERRFILE" # IPv6
+ elif [ -n "$HOSTIP" ]; then # use hostip if installed
+ __PROG="hostip"
+ __RUNPROG="$HOSTIP $__HOST >$DATFILE 2>$ERRFILE" # IPv4
+ __RUNPROG="$__RUNPROG; $HOSTIP -6 $__HOST >>$DATFILE 2>>$ERRFILE" # IPv6
else # use BusyBox nslookup
__PROG="BusyBox nslookup"
- __RUNPROG="$(which nslookup) $__HOST >$DATFILE 2>$ERRFILE"
+ __RUNPROG="$NSLOOKUP $__HOST >$DATFILE 2>$ERRFILE"
fi
write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
return 2
}
# extract IP address
- if [ -x /usr/bin/host ]; then # use BIND host if installed
+ if [ -n "$BIND_HOST" -o -n "$KNOT_HOST" ]; then # use BIND host or Knot 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}' )
+ elif [ -n "$DRILL" ]; then # use drill if installed
+ __IPV4=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5}' | grep -m 1 -o "$IPV4_REGEX")
+ __IPV6=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5}' | grep -m 1 -o "$IPV6_REGEX")
+ elif [ -n "$HOSTIP" ]; then # use hostip if installed
+ __IPV4=$(cat $DATFILE | grep -m 1 -o "$IPV4_REGEX")
+ __IPV6=$(cat $DATFILE | grep -m 1 -o "$IPV6_REGEX")
else # use BusyBox nslookup
__IPV4=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV4_REGEX\).*$/\\1/p }")
__IPV6=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($IPV6_REGEX\).*$/\\1/p }")
# 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 && \
+ $__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"
+ $__NC --help 2>&1 | grep "\-w" >/dev/null 2>&1 && __NCEXT="TRUE"
# connectivity test
# run busybox nc to HOST PORT
[ $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 </dev/null >$DATFILE 2>$ERRFILE"
+ __RUNPROG="$__NC -w 1 $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
__ERR=$?
write_log 7 "$(cat $ERRFILE)"
return 3
else # nc compiled without extensions (no timeout support)
- __RUNPROG="timeout 2 -- /usr/bin/nc $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
+ __RUNPROG="timeout 2 -- $__NC $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
__ERR=$?
[ $# -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
- if [ -n "$(which wget-ssl)" -a $USE_CURL -eq 0 ]; then # except global option use_curl is set to "1"
- __PROG="$(which wget-ssl) -nv -t 1 -O $DATFILE -o $ERRFILE" # non_verbose no_retry outfile errfile
+ if [ -n "$WGET_SSL" -a $USE_CURL -eq 0 ]; then # except global option use_curl is set to "1"
+ __PROG="$WGET_SSL -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
# 2nd choice is cURL IPv4/IPv6/HTTPS
# libcurl might be compiled without Proxy or HTTPS Support
- elif [ -n "$(which curl)" ]; then
- __PROG="$(which curl) -RsS -o $DATFILE --stderr $ERRFILE"
+ elif [ -n "$CURL" ]; then
+ __PROG="$CURL -RsS -o $DATFILE --stderr $ERRFILE"
# check HTTPS support
- /usr/bin/curl -V | grep "Protocols:" | grep -F "https" >/dev/null 2>&1
- [ $? -eq 1 -a $use_https -eq 1 ] && \
+ [ -z "$CURL_SSL" -a $use_https -eq 1 ] && \
write_log 13 "cURL: libcurl compiled without https support"
# force network/interface-device to use for communication
if [ -n "$bind_network" ]; then
# or check if libcurl compiled with proxy support
if [ -z "$proxy" ]; then
__PROG="$__PROG --noproxy '*'"
- else
+ elif [ -z "$CURL_PROXY" ]; then
# 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"
+ write_log 13 "cURL: libcurl compiled without Proxy support"
fi
__RUNPROG="$__PROG '$__URL'" # build final command
__PROG="cURL" # reuse for error logging
# uclient-fetch possibly with ssl support if /lib/libustream-ssl.so installed
- elif [ -n "$(which uclient-fetch)" ]; then
- __PROG="$(which uclient-fetch) -q -O $DATFILE"
+ elif [ -n "$UCLIENT_FETCH" ]; then
+ __PROG="$UCLIENT_FETCH -q -O $DATFILE"
# force network/ip not supported
[ -n "$__BINDIP" ] && \
write_log 14 "uclient-fetch: FORCE binding to specific address not supported"
[ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6" # force IPv4/IPv6
fi
# https possibly not supported
- [ $use_https -eq 1 -a ! -f /lib/libustream-ssl.so ] && \
+ [ $use_https -eq 1 -a -z "$UCLIENT_FETCH_SSL" ] && \
write_log 14 "uclient-fetch: no HTTPS support! Additional install one of ustream-ssl packages"
# proxy support
[ -z "$proxy" ] && __PROG="$__PROG -Y off" || __PROG="$__PROG -Y on"
__PROG="uclient-fetch" # reuse for error logging
# Busybox Wget or any other wget in search $PATH (did not support neither IPv6 nor HTTPS)
- elif [ -n "$(which wget)" ]; then
- __PROG="$(which wget) -q -O $DATFILE"
+ elif [ -n "$WGET" ]; then
+ __PROG="$WGET -q -O $DATFILE"
# force network/ip not supported
[ -n "$__BINDIP" ] && \
write_log 14 "BusyBox Wget: FORCE binding to specific address not supported"
# 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"
+ __IP=$(echo $1 | grep -m 1 -o "$IPV4_REGEX") # valid IPv4 or
+ [ -z "$__IP" ] && __IP=$(echo $1 | grep -m 1 -o "$IPV6_REGEX") # IPv6
fi
+ [ -z "$__IP" ] && {
+ write_log 3 "No or private or invalid IP '$1' given! Please check your configuration"
+ return 127
+ }
if [ -n "$update_script" ]; then
write_log 7 "parsing script '$update_script'"
local __CNT=0 # error counter
local __ERR=255
local __REGEX __PROG __RUNPROG __DATA __IP
- local __MUSL=$(nslookup localhost 2>&1 | grep -qF "(null)"; echo $?) # 0 == busybox compiled with musl "(null)" found
# return codes
# 1 no IP detected
[ $# -lt 1 -o $# -gt 2 ] && write_log 12 "Error calling 'get_registered_ip()' - wrong number of parameters"
- [ $is_glue -eq 1 -a -z "$(which host)" ] && write_log 14 "Lookup of glue records is only supported using BIND host"
+ [ $is_glue -eq 1 -a -z "$BIND_HOST" ] && write_log 14 "Lookup of glue records is only supported using BIND host"
write_log 7 "Detect registered/public IP"
# set correct regular expression
[ $use_ipv6 -eq 0 ] && __REGEX="$IPV4_REGEX" || __REGEX="$IPV6_REGEX"
- if [ -n "$(which host)" ]; then
- __PROG="$(which host)"
+ if [ -n "$BIND_HOST" ]; then
+ __PROG="$BIND_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"
__RUNPROG="$__PROG $lookup_host $dns_server >$DATFILE 2>$ERRFILE"
__PROG="BIND host"
- elif [ -n "$(which khost)" ]; then
- __PROG="$(which khost)"
+ elif [ -n "$KNOT_HOST" ]; then
+ __PROG="$KNOT_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"
__RUNPROG="$__PROG $lookup_host $dns_server >$DATFILE 2>$ERRFILE"
__PROG="Knot host"
- elif [ -n "$(which drill)" ]; then
- __PROG="$(which drill) -V0" # drill options name @server type
+ elif [ -n "$DRILL" ]; then
+ __PROG="$DRILL -V0" # drill options name @server type
if [ $force_ipversion -eq 1 ]; then # force IP version
[ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6"
fi
__RUNPROG="$__PROG >$DATFILE 2>$ERRFILE"
__PROG="drill"
- elif [ -n "$(which hostip)" ]; then # hostip package installed
- __PROG="$(which hostip)"
+ elif [ -n "$HOSTIP" ]; then # hostip package installed
+ __PROG="$HOSTIP"
[ $force_dnstcp -ne 0 ] && \
write_log 14 "hostip - no support for 'DNS over TCP'"
# we got NO ip for dns_server, so build command
[ -z "$__IP" -a -n "$dns_server" ] && {
- __IP="\`/usr/bin/hostip"
+ __IP="\`$HOSTIP"
[ $use_ipv6 -eq 1 -a $force_ipversion -eq 1 ] && __IP="$__IP -6"
__IP="$__IP $dns_server | grep -m 1 -o"
[ $use_ipv6 -eq 1 -a $force_ipversion -eq 1 ] \
[ -n "$dns_server" ] && __PROG="$__PROG -r $__IP"
__RUNPROG="$__PROG $lookup_host >$DATFILE 2>$ERRFILE"
__PROG="hostip"
- elif [ -n "$(which 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'"
- [ $__MUSL -eq 0 -a -n "$dns_server" ] && \
- write_log 14 "Busybox compiled with musl - nslookup - no support to set/use DNS Server"
+ elif [ -n "$NSLOOKUP" ]; then # last use BusyBox nslookup
+ [ $force_dnstcp -ne 0 ] && \
+ write_log 14 "Busybox nslookup - no support for 'DNS over TCP'"
+ [ -n "$NSLOOKUP_MUSL" -a -n "$dns_server" ] && \
+ write_log 14 "Busybox compiled with musl - nslookup don't support the use of DNS Server"
+ [ $force_ipversion -ne 0 ] && \
+ write_log 5 "Busybox nslookup - no support to 'force IP Version' (ignored)"
- __RUNPROG="$(which nslookup) $lookup_host $dns_server >$DATFILE 2>$ERRFILE"
+ __RUNPROG="$NSLOOKUP $lookup_host $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"
write_log 3 "$__PROG error: '$__ERR'"
write_log 7 "$(cat $ERRFILE)"
else
- if [ "$__PROG" = "BIND host" ]; then
+ if [ -n "$BIND_HOST" ]; then
if [ $is_glue -eq 1 ]; then
__DATA=$(cat $DATFILE | grep "^$lookup_host" | grep -m 1 -o "$__REGEX" )
else
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
fi
- elif [ "$__PROG" = "Knot host" ]; then
+ elif [ -n "$KNOT_HOST" ]; then
__DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
- elif [ "$__PROG" = "drill" ]; then
+ elif [ -n "$DRILL" ]; then
__DATA=$(cat $DATFILE | awk '/^'"$lookup_host"'/ {print $5; exit}' )
- elif [ "$__PROG" = "hostip" ]; then
+ elif [ -n "$HOSTIP" ]; then
__DATA=$(cat $DATFILE | grep -m 1 -o "$__REGEX")
- else
+ elif [ -n "$NSLOOKUP" ]; then
__DATA=$(cat $DATFILE | sed -ne "/^Name:/,\$ { s/^Address[0-9 ]\{0,\}: \($__REGEX\).*$/\\1/p }" )
fi
[ -n "$__DATA" ] && {
expand_ipv6() {
# Original written for bash by
- # Author: Florian Streibelt <florian@f-streibelt.de>
+ #.Author: Florian Streibelt <florian@f-streibelt.de>
# Date: 08.04.2012
# License: Public Domain, but please be fair and
# attribute the original author(s) and provide
# a link to the original source for corrections:
#. https://github.com/mutax/IPv6-Address-checks
- # $1 IPv6 t0 expand
+ # $1 IPv6 to expand
# $2 name of variable to store expanded IPv6
[ $# -ne 2 ] && write_log 12 "Error calling 'expand_ipv6()' - wrong number of parameters"
# variables in big chars beginning with "__" are local defined inside functions only
# set -vx #script debugger
-. /usr/lib/ddns/dynamic_dns_functions.sh # global vars are also defined here
+. $(dirname $0)/dynamic_dns_functions.sh # global vars are also defined here
[ $# -lt 1 -o -n "${2//[0-3]/}" -o ${#2} -gt 1 ] && {
- echo -e "\n ddns-scripts Version: $VERSION"
- echo -e "\n USAGE:"
- echo " $0 [OPTION]"
- echo " [OPTION] '-V' or '--version' display version and exit"
- echo -e "\n $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"
+ local __ME=$(basename $0)
+ cat << EOF
+ddns-scripts Version: $VERSION
+
+Usage:
+ $__ME -V display version and exit
+ $__ME --version display version and exit
+
+ $__ME <SECTION> <VERBOSE_MODE>
+ <SECTION> service section as defined in /etc/config/ddns
+ <VERBOSE_MODE> '0' NO output to console
+ '1' output to console
+ '2' output to console AND logfile
+ + run once WITHOUT retry on error
+ '3' output to console AND logfile
+ + run once WITHOUT retry on error
+ + NOT sending update to DDNS service
+
+EOF
exit 1
}
[ "$1" = "-V" -o "$1" = "--version" ] && {
- echo -e "ddns-scripts $VERSION\n"
+ printf %s\\n "ddns-scripts $VERSION"
exit 0
}
[ "$LOCAL_IP" != "$REGISTERED_IP" ] \
&& write_log 6 "Update successful - IP '$LOCAL_IP' send" \
|| write_log 6 "Forced update successful - IP: '$LOCAL_IP' send"
+ elif [ $ERR_LAST -eq 127 ]; then
+ write_log 3 "No update send to DDNS Provider"
else
write_log 3 "IP update not accepted by DDNS Provider"
fi
# "answer" single words inside providers answer string; use "|" to combine "or"
#
# 44444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
+#
+# cloudflare.com !!! Please install additional package "ddns-scripts_cloudflare"
+# no-ip.com / noip.com !!! Please install additional package "ddns-scripts_no-ip_com"
-"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-"changeip.com" "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]"
-"zoneedit.com" "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
-"free.editdns.net" "http://dyndns-free.editdns.net/api/dynLinux.php?p=[PASSWORD]&r=[DOMAIN]"
+"3322.org" "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
-# freedns.afraid.org is weird, you just need an update code, for which we use the password variable
-"freedns.afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
+"able.or.kr" "http://able.or.kr/ddns/src/update.php?hostname=[DOMAIN]&myip=[IP]&ddnsuser=[USERNAME]&pwd=[PASSWORD]"
-# DNS Max and resellers' update urls
-"dnsmax.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
-"thatip.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
+"afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
-# Hurricane Electric Dynamic DNS
-"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"all-inkl.com" "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]"
-# DNSdynamic.org
-"dnsdynamic.org" "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"changeip.com" "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]" "Successful"
+
+"core-networks.de" "http://[USERNAME]:[PASSWORD]@dyndns.core-networks.de/?hostname=[DOMAIN]&myip=[IP]&keepipv6=1" "good"
-# dnsExit.com free dynamic DNS update url
-"dnsexit.com" "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
+"ddns.com.br" "http://[DOMAIN]:[PASSWORD]@members.ddns.com.br/nic/update?hostname=[DOMAIN]&myip=[IP]"
-# OVH
-"ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
+# "ddnss.de" "http://[USERNAME]:[PASSWORD]@ip4.ddnss.de/upd.php?host=[DOMAIN]&ip=[IP]" "good|nochg"
+"ddnss.de" "http://ip4.ddnss.de/upd.php?user=[USERNAME]&pwd=[PASSWORD]&host=[DOMAIN]&ip=[IP]" "good|nochg"
-# dns-o-matic is a free service by opendns.com for updating multiple hosts
-"dnsomatic.com" "http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"ddo.jp" "http://free.ddo.jp/dnsupdate.php?dn=[DOMAIN]&pw=[PASSWORD]&ip=[IP]"
-# 3322.org
-"3322.org" "http://[USERNAME]:[PASSWORD]@members.3322.org/dyndns/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
+"desec.io" "http://[USERNAME]:[PASSWORD]@update.dedyn.io/?hostname=[DOMAIN]&myipv4=[IP]" "good|nochg"
-# namecheap.com
-"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
+"dhis.org" "http://[USERNAME]:[PASSWORD]@is.dhis.org/"
-# easydns.com dynamic DNS
-"easydns.com" "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
+"dnsdynamic.org" "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# Winco DDNS
-"ddns.com.br" "http://[DOMAIN]:[PASSWORD]@members.ddns.com.br/nic/update?hostname=[DOMAIN]&myip=[IP]"
+"dnsexit.com" "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]" "0=|1="
-# Mythic Beasts (https://www.mythic-beasts.com) Dynamic DNS
-"mythic-beasts.com" "http://dnsapi4.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20A%20DYNAMIC_IP&origin=."
+"dnshome.de" "http://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip=[IP]"
-# Securepoint Dynamic-DNS-Service (http://www.spdns.de)
-"spdns.de" "http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"dnsmadeeasy.com" "http://www.dnsmadeeasy.com/servlet/updateip?username=[USERNAME]&password=[PASSWORD}&id=[DOMAIN]&ip=[IP]" "success|ip-same"
-# duiadns.net - free dynamic DNS
-"duiadns.net" "http://ipv4.duia.ro/dynamic.duia?host=[DOMAIN]&password=[PASSWORD]&ip4=[IP]"
+"dnsmax.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
-# Two-DNS - Simply. Connected. Everywhere.
-"twodns.de" "http://[USERNAME]:[PASSWORD]@update.twodns.de/update?hostname=[DOMAIN]&ip=[IP]"
+"dnsomatic.com" "http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# MyDNS.JP
-"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
+"dnspark.com" "http://[USERNAME]:[PASSWORD]@control.dnspark.com/api/dynamic/update.php?hostname=[DOMAIN]&ip=[IP]" "ok|nochange"
-# LoopiaDNS
-"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
+"do.de" "http://ddns.do.de/?myip=[IP]&hostname=[DOMAIN]&username=[USERNAME]&password=[PASSWORD]" "good|nochg"
-# SelfHost.de
-"selfhost.de" "http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1" "good|nochg"
+"domopoli.de" "http://[USERNAME]:[PASSWORD]@http://dyndns.domopoli.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
-"no-ip.pl" "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
+"dtdns.com" "http://www.dtdns.com/api/autodns.cfm?id=[DOMAIN]&pw=[PASSWORD]&ip=[IP]"
-# domains.google.com non free service - require HTTPS communication
-"domains.google.com" "http://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+"duckdns.org" "http://www.duckdns.org/update?domains=[USERNAME]&token=[PASSWORD]&ip=[IP]" "OK"
-# Schokokeks Hosting, schokokeks.org
-"schokokeks.org" "http://[USERNAME]:[PASSWORD]@dyndns.schokokeks.org/nic/update?myip=[IP]" "good|nochg"
+"duiadns.net" "http://[USERNAME]:[PASSWORD]@ipv4.duia.ro/dynamic.duia?host=[DOMAIN]&ip4=[IP]"
-# STRATO AG
-"strato.de" "http://[USERNAME]:[PASSWORD]@dyndns.strato.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+"dy.fi" "http://[USERNAME]:[PASSWORD]@www.dy.fi/nic/update?hostname=[DOMAIN]" "good|nochg"
-# Variomedia AG
-"variomedia.de" "http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"dyndns.it" "http://[USERNAME]:[PASSWORD]@update.dyndns.it/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"dyn.com" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"dyndnss.net" "http://www.dyndnss.net/?user=[USERNAME]&pass=[PASSWORD]&domain=[DOMAIN]&updater=other"
+
+"dynsip.org" "http://[USERNAME]:[PASSWORD]@dynsip.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
-# DtDNS
-"dtdns.com" "http://www.dtdns.com/api/autodns.cfm?id=[DOMAIN]&pw=[PASSWORD]&ip=[IP]"
+"dyns.net" "http://www.dyns.net/postscript011.php?username=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&ip=[IP]" "200"
-# dy.fi Dynamic DNS for finnish users (IP autodetected by provider)
-"dy.fi" "http://[USERNAME]:[PASSWORD]@www.dy.fi/nic/update?hostname=[DOMAIN]" "good|nochg"
+"dynu.com" "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myip=[IP]&username=[USERNAME]&password=[PASSWORD]"
-# duckdns.org
-"duckdns.org" "http://www.duckdns.org/update?domains=[USERNAME]&token=[PASSWORD]&ip=[IP]" "OK"
+"dynv6.com" "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv4=[IP]" "updated"
-# zzzz.io Free Dynamic DNS
-"zzzz.io" "https://zzzz.io/api/v1/update/[DOMAIN]/?token=[PASSWORD]&ip=[IP]" "Updated|No change"
+"easydns.com" "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/generic.php?hostname=[DOMAIN]&myip=[IP]" "NOERROR"
-# dynu.com
-"dynu.com" "http://api.dynu.com/nic/update?hostname=[DOMAIN]&myip=[IP]&username=[USERNAME]&password=[PASSWORD]"
+"editdns.net" "http://dyndns-free.editdns.net/api/dynLinux.php?p=[PASSWORD]&r=[DOMAIN]"
-# nubem.com
-"nubem.com" "http://[USERNAME]:[PASSWORD]@nubem.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+"goip.de" "http://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip4=[IP]"
-# nettica.com
-"nettica.com" "http://www.nettica.com/Domain/Update.aspx?U=[USERNAME]&PC=[PASSWORD]&FQDN=[DOMAIN]&N=[IP]"
+"google.com" "http://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# zerigo.com
-"zerigo.com" "http://update.zerigo.com/dynamic?host=[DOMAIN]&ip=[IP]&user=[USERNAME]&password=[PASSWORD]"
+"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# regfish.de
-"regfish.de" "http://dyndns.regfish.de/?fqdn=[DOMAIN]&forcehost=1&authtype=secure&token=[PASSWORD]&ipv4=[IP]" "success|100|101"
+"joker.com" "http://svc.joker.com/nic/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=[DOMAIN]" "good|nochg"
-# nsupdate.info - a free service - supports https
-"nsupdate.info" "http://[USERNAME]:[PASSWORD]@ipv4.nsupdate.info/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"loopia.com" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# dyndnss.net
-"dyndnss.net" "http://www.dyndnss.net/?user=[USERNAME]&pass=[PASSWORD]&domain=[DOMAIN]&updater=other"
+"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# goip.de
-"https://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip6=[IP]"
+"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
-# myonlineportal.net
"myonlineportal.net" "http://[USERNAME]:[PASSWORD]@myonlineportal.net/updateddns?hostname=[DOMAIN]&ip=[IP]" "good|nochg"
-# dyns.net
-"dyns.net" "http://www.dyns.net/postscript011.php?username=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&ip=[IP]" "200"
+"mythic-beasts.com" "http://dnsapi4.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20A%20DYNAMIC_IP&origin=."
+
+"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
+
+"nettica.com" "http://www.nettica.com/Domain/Update.aspx?U=[USERNAME]&PC=[PASSWORD]&FQDN=[DOMAIN]&N=[IP]"
+
+"no-ip.pl" "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
+
+"nsupdate.info" "http://[USERNAME]:[PASSWORD]@ipv4.nsupdate.info/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"nubem.com" "http://[USERNAME]:[PASSWORD]@nubem.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+
+"opendns.com" "http://[USERNAME]:[PASSWORD]@updates.opendns.com/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"oray.com" "http://[USERNAME]:[PASSWORD]@ddns.oray.com/ph/update?hostname=[DOMAIN]&myip=[IP]"
+
+"ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"regfish.de" "http://dyndns.regfish.de/?fqdn=[DOMAIN]&forcehost=1&authtype=secure&token=[PASSWORD]&ipv4=[IP]" "success|100|101"
+
+"schokokeks.org" "http://[USERNAME]:[PASSWORD]@dyndns.schokokeks.org/nic/update?myip=[IP]" "good|nochg"
+
+"selfhost.de" "http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1" "good|nochg|200|204"
+
+"sitelutions.com" "http://www.sitelutions.com/dnsup?user=[USERNAME]&pass=[PASSWORD]&id=[DOMAIN]&ip=[IP]" "success"
+
+"spdyn.de" "http://[USERNAME]:[PASSWORD]@update.spdyn.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"strato.com" "http://[USERNAME]:[PASSWORD]@dyndns.strato.com/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"system-ns.com" "http://system-ns.com/api?type=dynamic&command=set&domain=[DOMAIN]&token=[PASSWORD]&ip=[IP]" "0"
+
+"thatip.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
+
+"twodns.de" "http://[USERNAME]:[PASSWORD]@update.twodns.de/update?hostname=[DOMAIN]&ip=[IP]"
+
+"udmedia.de" "http://[USERNAME]:[PASSWORD]@www.udmedia.de/nic/update?myip=[IP]"
+
+"variomedia.de" "http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"xlhost.de" "http://[USERNAME]:[PASSWORD]@nsupdate.xlhost.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"zerigo.com" "http://update.zerigo.com/dynamic?user=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&ip=[IP]" "ok"
+
+"zoneedit.com" "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
-# dnshome.de
-"dnshome.de" ""https://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip=[IP]"
+"zzzz.io" "http://zzzz.io/api/v1/update/[DOMAIN]/?token=[PASSWORD]&ip=[IP]" "Updated|No change"
# "answer" words inside providers answer string; use "|" to combine "or"
#
# 66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
+#
+# cloudflare.com !!! Please install additional package "ddns-scripts_cloudflare"
+# no-ip.com / noip.com !!! Please install additional package "ddns-scripts_no-ip_com"
-# IPv6 @ Securepoint Dynamic-DNS-Service
-"spdns.de" "http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
-# IPv6 @ Hurricane Electric Dynamic DNS
-"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"all-inkl.com" "http://[USERNAME]:[PASSWORD]@dyndns.kasserver.com/?myip=[IP]"
-# IPv6 @ MyDNS.JP
-"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV6ADDR=[IP]"
+"core-networks.de" "http://[USERNAME]:[PASSWORD]@dyndns.core-networks.de/?hostname=[DOMAIN]&myip=[IP]&keepipv4=1" "good"
-# IPv6 @ no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
-"no-ip.pl" "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
+# "ddnss.de" "http://[USERNAME]:[PASSWORD]@ip6.ddnss.de/upd.php?host=[DOMAIN]&ip6=[IP]" "good|nochg"
+"ddnss.de" "http://ip6.ddnss.de/upd.php?user=[USERNAME]&pwd=[PASSWORD]&host=[DOMAIN]&ip6=[IP]" "good|nochg"
-# IPv6 @ freedns.afraid.org
-"freedns.afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
+"desec.io" "http://[USERNAME]:[PASSWORD]@update.dedyn.io/?hostname=[DOMAIN]&myipv6=[IP]" "good|nochg"
-# IPv6 @ LoopiaDNS
-"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
+"dhis.org" "http://[USERNAME]:[PASSWORD]@is.dhis.org/"
-# Variomedia AG
-"variomedia.de" "http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"dnshome.de" "http://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip6=[IP]"
+
+"do.de" "http://ddns.do.de/?myip=[IP]&hostname=[DOMAIN]&username=[USERNAME]&password=[PASSWORD]" "good|nochg"
+
+"duckdns.org" "http://www.duckdns.org/update?domains=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]" "OK"
-# IPv6 @ Dyn.com
+"duiadns.net" "http://[USERNAME]:[PASSWORD]@ipv6.duia.ro/dynamic.duia?host=[DOMAIN]&ip6=[IP]"
+
+"dyn.com" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# duckdns.org
-"duckdns.org" "http://www.duckdns.org/update?domains=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]" "OK"
+"dynv6.com" "http://dynv6.com/api/update?hostname=[DOMAIN]&token=[PASSWORD]&ipv6=[IP]" "updated"
-# IPv6 @ zzzz.io Free Dynamic DNS
-"zzzz.io" "https://zzzz.io/api/v1/update/[DOMAIN]/?token=[PASSWORD]&type=aaaa&ip=[IP]" "Updated|No change"
+"goip.de" "http://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip6=[IP]"
-# IPv6 @ zerigo.com
-"zerigo.com" "http://update.zerigo.com/dynamic?host=[DOMAIN]&ip=[IP]&user=[USERNAME]&password=[PASSWORD]"
+"google.com" "http://[USERNAME]:[PASSWORD]@domains.google.com/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# IPv6 @ regfish.de
-"regfish.de" "http://dyndns.regfish.de/?fqdn=[DOMAIN]&forcehost=1&authtype=secure&token=[PASSWORD]&ipv6=[IP]" "success|100|101"
+"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# Mythic Beasts (https://www.mythic-beasts.com) Dynamic DNS
-"mythic-beasts.com" "http://dnsapi6.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20AAAA%20DYNAMIC_IP&origin=."
+"loopia.com" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# nsupdate.info - a free service - supports https
-"nsupdate.info" "http://[USERNAME]:[PASSWORD]@ipv6.nsupdate.info/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]" "good|nochg"
-# goip.de
-"https://www.goip.de/setip?username=[USERNAME]&password=[PASSWORD]&subdomain=[DOMAIN]&ip6=[IP]"
+"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV6ADDR=[IP]"
-# myonlineportal.net
"myonlineportal.net" "http://[USERNAME]:[PASSWORD]@myonlineportal.net/updateddns?hostname=[DOMAIN]&ip6=[IP]" "good|nochg"
-# dnshome.de
-"dnshome.de" ""https://[USERNAME]:[PASSWORD]@www.dnshome.de/dyndns.php?hostname=[DOMAIN]&ip6=[IP]"
+"mythic-beasts.com" "http://dnsapi6.mythic-beasts.com/?domain=[USERNAME]&password=[PASSWORD]&command=REPLACE%20[DOMAIN]%2060%20AAAA%20DYNAMIC_IP&origin=."
+
+"no-ip.pl" "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
+
+"nsupdate.info" "http://[USERNAME]:[PASSWORD]@ipv6.nsupdate.info/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"regfish.de" "http://dyndns.regfish.de/?fqdn=[DOMAIN]&forcehost=1&authtype=secure&token=[PASSWORD]&ipv6=[IP]" "success|100|101"
+
+"spdyn.de" "http://[USERNAME]:[PASSWORD]@update.spdyn.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"udmedia.de" "http://[USERNAME]:[PASSWORD]@www.udmedia.de/nic/update?myip=[IP]"
+
+"variomedia.de" "http://[USERNAME]:[PASSWORD]@dyndns.variomedia.de/nic/update?hostname=[DOMAIN]&myip=[IP]" "good|nochg"
+
+"zerigo.com" "http://update.zerigo.com/dynamic?user=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&ip=[IP]" "ok"
+
+"zzzz.io" "http://zzzz.io/api/v1/update/[DOMAIN]/?token=[PASSWORD]&type=aaaa&ip=[IP]" "Updated|No change"
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
+// Please pull this list from, and only from https://publicsuffix.org/list/public_suffix_list.dat ,
+// rather than any other VCS sites. Pulling from any other URL is not guaranteed to be supported.
+
+// Instructions on pulling and using this list can be found at https://publicsuffix.org/list/ .
+
// ===BEGIN ICANN DOMAINS===
// ac : https://en.wikipedia.org/wiki/.ac
kamiamakusa.kumamoto.jp
kashima.kumamoto.jp
kikuchi.kumamoto.jp
-kosa.kumamoto.jp
kumamoto.kumamoto.jp
mashiki.kumamoto.jp
mifune.kumamoto.jp
lib.co.us
lib.ct.us
lib.dc.us
-lib.de.us
+// lib.de.us Issue #243 - Moved to Private section at request of Ed Moore <Ed.Moore@lib.de.us>
lib.fl.us
lib.ga.us
lib.gu.us
*.zw
-// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2016-05-09T22:17:27Z
+// List of new gTLDs imported from https://newgtlds.icann.org/newgtlds.csv on 2016-08-17T00:17:46Z
// aaa : 2015-02-26 American Automobile Association, Inc.
aaa
// africa : 2014-03-24 ZA Central Registry NPC trading as Registry.Africa
africa
-// africamagic : 2015-03-05 Electronic Media Network (Pty) Ltd
-africamagic
-
// agakhan : 2015-04-23 Fondation Aga Khan (Aga Khan Foundation)
agakhan
// blockbuster : 2015-07-30 Dish DBS Corporation
blockbuster
-// blog : 2015-05-14 PRIMER NIVEL S.A.
+// blog : 2015-05-14
blog
// bloomberg : 2014-07-17 Bloomberg IP Holdings LLC
// dance : 2013-10-24 United TLD Holdco Ltd.
dance
+// data : 2016-06-02 Dish DBS Corporation
+data
+
// date : 2014-11-20 dot Date Limited
date
// docs : 2014-10-16 Charleston Road Registry Inc.
docs
+// doctor : 2016-06-02 Brice Trail, LLC
+doctor
+
// dodge : 2015-07-30 FCA US LLC.
dodge
// drive : 2015-03-05 Charleston Road Registry Inc.
drive
-// dstv : 2015-03-12 MultiChoice (Proprietary) Limited
-dstv
-
// dtv : 2015-06-04 Dish DBS Corporation
dtv
// dvag : 2014-06-23 Deutsche Vermögensberatung Aktiengesellschaft DVAG
dvag
+// dvr : 2016-05-26 Hughes Satellite Systems Corporation
+dvr
+
// dwg : 2015-07-23 Autodesk, Inc.
dwg
// eat : 2014-01-23 Charleston Road Registry Inc.
eat
+// eco : 2016-07-08 Big Room Inc.
+eco
+
// edeka : 2014-12-18 EDEKA Verband kaufmännischer Genossenschaften e.V.
edeka
// flowers : 2014-10-09 Uniregistry, Corp.
flowers
-// flsmidth : 2014-07-24 FLSmidth A/S
-flsmidth
-
// fly : 2014-05-08 Charleston Road Registry Inc.
fly
// game : 2015-05-28 Uniregistry, Corp.
game
-// games : 2015-05-28 Foggy Beach, LLC
+// games : 2015-05-28
games
// gap : 2015-07-31 The Gap, Inc.
// got : 2014-12-18 Amazon EU S.à r.l.
got
-// gotv : 2015-03-12 MultiChoice (Proprietary) Limited
-gotv
-
// grainger : 2015-05-07 Grainger Registry Services, LLC
grainger
// gripe : 2014-03-06 Corn Sunset, LLC
gripe
+// grocery : 2016-06-16 Wal-Mart Stores, Inc.
+grocery
+
// group : 2014-08-15 Romeo Town, LLC
group
// kuokgroup : 2015-04-09 Kerry Trading Co. Limited
kuokgroup
-// kyknet : 2015-03-05 Electronic Media Network (Pty) Ltd
-kyknet
-
// kyoto : 2014-11-07 Academic Institution: Kyoto Jyoho Gakuen
kyoto
// mango : 2013-10-24 PUNTO FA S.L.
mango
+// map : 2016-06-09 Charleston Road Registry Inc.
+map
+
// market : 2014-03-06
market
// meo : 2014-11-07 PT Comunicacoes S.A.
meo
+// merckmsd : 2016-07-14 MSD Registry Holdings, Inc.
+merckmsd
+
// metlife : 2015-05-07 MetLife Services and Solutions, LLC
metlife
// mma : 2014-11-07 MMA IARD
mma
-// mnet : 2015-03-05 Electronic Media Network (Pty) Ltd
-mnet
+// mobile : 2016-06-02 Dish DBS Corporation
+mobile
// mobily : 2014-12-18 GreenTech Consultancy Company W.L.L.
mobily
// mtr : 2015-03-12 MTR Corporation Limited
mtr
-// multichoice : 2015-03-12 MultiChoice (Proprietary) Limited
-multichoice
-
// mutual : 2015-04-02 Northwestern Mutual MU TLD Registry, LLC
mutual
// mutuelle : 2015-06-18 Fédération Nationale de la Mutualité Française
mutuelle
-// mzansimagic : 2015-03-05 Electronic Media Network (Pty) Ltd
-mzansimagic
-
// nab : 2015-08-20 National Australia Bank Limited
nab
// nagoya : 2013-10-24 GMO Registry, Inc.
nagoya
-// naspers : 2015-02-12 Intelprop (Proprietary) Limited
-naspers
-
// nationwide : 2015-07-23 Nationwide Mutual Insurance Company
nationwide
// organic : 2014-03-27 Afilias Limited
organic
-// orientexpress : 2015-02-05 Belmond Ltd.
+// orientexpress : 2015-02-05
orientexpress
// origins : 2015-10-01 The Estée Lauder Companies Inc.
// pay : 2015-08-27 Amazon EU S.à r.l.
pay
-// payu : 2015-02-12 MIH PayU B.V.
-payu
-
// pccw : 2015-05-14 PCCW Enterprises Limited
pccw
// pharmacy : 2014-06-19 National Association of Boards of Pharmacy
pharmacy
+// phd : 2016-07-28 Charleston Road Registry Inc.
+phd
+
// philips : 2014-11-07 Koninklijke Philips N.V.
philips
+// phone : 2016-06-02 Dish DBS Corporation
+phone
+
// photo : 2013-11-14 Uniregistry, Corp.
photo
// racing : 2014-12-04 Premier Registry Limited
racing
+// radio : 2016-07-21 European Broadcasting Union (EBU)
+radio
+
// raid : 2015-07-23 Johnson Shareholdings, Inc.
raid
// scot : 2014-01-23 Dot Scot Registry Limited
scot
+// search : 2016-06-09 Charleston Road Registry Inc.
+search
+
// seat : 2014-05-22 SEAT, S.A. (Sociedad Unipersonal)
seat
// sucks : 2014-12-22 Vox Populi Registry Inc.
sucks
-// supersport : 2015-03-05 SuperSport International Holdings Proprietary Limited
-supersport
-
// supplies : 2013-12-19 Atomic Fields, LLC
supplies
// ===BEGIN PRIVATE DOMAINS===
// (Note: these are in alphabetical order by company name)
+// Agnat sp. z o.o. : https://domena.pl
+// Submitted by Przemyslaw Plewa <it-admin@domena.pl>
+beep.pl
+
// Alces Software Ltd : http://alces-software.com
// Submitted by Mark J. Titorenko <mark.titorenko@alces-software.com>
*.compute.estate
us-gov-west-1.compute.amazonaws.com
us-west-1.compute.amazonaws.com
us-west-2.compute.amazonaws.com
-us-east-1.amazonaws.com
compute-1.amazonaws.com
z-1.compute-1.amazonaws.com
z-2.compute-1.amazonaws.com
+us-east-1.amazonaws.com
compute.amazonaws.com.cn
cn-north-1.compute.amazonaws.com.cn
// Association potager.org : https://potager.org/
// Submitted by Lunar <jardiniers@potager.org>
-potager.org
+pimienta.org
poivron.org
+potager.org
sweetpepper.org
-pimienta.org
+
+// ASUSTOR Inc. : http://www.asustor.com
+// Submitted by Vincent Tseng <vincenttseng@asustor.com>
+myasustor.com
// AVM : https://avm.de
// Submitted by Andreas Weise <a.weise@avm.de>
myfritz.net
+// backplane : https://www.backplane.io
+// Submitted by Anthony Voutas <anthony@backplane.io>
+backplaneapp.io
+
// BetaInABox
// Submitted by Adrian <adrian@betainabox.com>
betainabox.com
+// BinaryLane : http://www.binarylane.com
+// Submitted by Nathan O'Sullivan <nathan@mammoth.com.au>
+bnr.la
+
// Boxfuse : https://boxfuse.com
// Submitted by Axel Fontaine <axel@boxfuse.com>
boxfuse.io
+// BrowserSafetyMark
+// Submitted by Dave Tharp <browsersafetymark.io@quicinc.com>
+browsersafetymark.io
+
+// callidomus: https://www.callidomus.com/
+// Submitted by Marcus Popp <admin@callidomus.com>
+mycd.eu
+
// CentralNic : http://www.centralnic.com/names/domains
// Submitted by registry <gavin.brown@centralnic.com>
ae.org
// c.la : http://www.c.la/
c.la
+// certmgr.org : https://certmgr.org
+// Submitted by B. Blechschmidt <hostmaster@certmgr.org>
+certmgr.org
+
// Citrix : https://citrix.com
// Submitted by Alex Stoddard <alex.stoddard@citrix.com>
xenapponazure.com
+// ClearVox : http://www.clearvox.nl/
+// Submitted by Leon Rowland <leon@clearvox.nl>
+virtueeldomein.nl
+
// cloudControl : https://www.cloudcontrol.com/
// Submitted by Tobias Wilken <tw@cloudcontrol.com>
cloudcontrolled.com
// Submitted by Damien Tournoud <damien@commerceguys.com>
*.platform.sh
+// Craynic, s.r.o. : http://www.craynic.com/
+// Submitted by Ales Krajnik <ales.krajnik@craynic.com>
+realm.cz
+
+// Cryptonomic : https://cryptonomic.net/
+// Submitted by Andrew Cady <public-suffix-list@cryptonomic.net>
+*.cryptonomic.net
+
// Cupcake : https://cupcake.io/
// Submitted by Jonathan Rudenberg <jonathan@cupcake.io>
cupcake.is
// Submitted by Ricardo Padilha <rpadilha@drobo.com>
mydrobo.com
+// Drud Holdings, LLC. : https://www.drud.com/
+// Submitted by Kevin Bridges <kevin@drud.com>
+drud.io
+drud.us
+
// DuckDNS : http://www.duckdns.org/
// Submitted by Richard Harper <richard@duckdns.org>
duckdns.org
uk.eu.org
us.eu.org
+// Evennode : http://www.evennode.com/
+// Submitted by Michal Kralik <support@evennode.com>
+eu-1.evennode.com
+eu-2.evennode.com
+us-1.evennode.com
+us-2.evennode.com
+
// Facebook, Inc.
// Submitted by Peter Ruibal <public-suffix@fb.com>
apps.fbsbx.com
a.prod.fastly.net
global.prod.fastly.net
+// Featherhead : https://featherhead.xyz/
+// Submitted by Simon Menke <simon@featherhead.xyz>
+fhapp.xyz
+
// Firebase, Inc.
// Submitted by Chris Raynor <chris@firebase.com>
firebaseapp.com
gist.githubcloud.com
*.githubcloudusercontent.com
+// GitLab, Inc.
+// Submitted by Alex Hanselka <alex@gitlab.com>
+gitlab.io
+
// GlobeHosting, Inc.
// Submitted by Zoltan Egresi <egresi@globehosting.com>
ro.com
+ro.im
+shop.ro
// GoIP DNS Services : http://www.goip.de
// Submitted by Christian Poulter <milchstrasse@goip.de>
// Submitted by Shahidh K Muhammed <shahidh@hasura.io>
hasura-app.io
+// Hepforge : https://www.hepforge.org
+// Submitted by David Grellscheid <admin@hepforge.org>
+hepforge.org
+
// Heroku : https://www.heroku.com/
// Submitted by Tom Maher <tmaher@heroku.com>
herokuapp.com
biz.at
info.at
+// Joyent : https://www.joyent.com/
+// Submitted by Brian Bennett <brian.bennett@joyent.com>
+*.triton.zone
+*.cns.joyent.com
+
+// JS.ORG : http://dns.js.org
+// Submitted by Stefan Keim <admin@js.org>
+js.org
+
+// .KRD : http://nic.krd/data/krd/Registration%20Policy.pdf
+co.krd
+edu.krd
+
+// Magento Commerce
+// Submitted by Damien Tournoud <dtournoud@magento.cloud>
+*.magentosite.cloud
+
+// Meteor Development Group : https://www.meteor.com/hosting
+// Submitted by Pierre Carrier <pierre@meteor.com>
+meteorapp.com
+eu.meteorapp.com
+
// Michau Enterprises Limited : http://www.co.pl/
co.pl
// Submitted by registry <lendl@nic.at>
priv.at
+// Protonet GmbH : http://protonet.io
+// Submitted by Martin Meier <admin@protonet.io>
+protonet.io
+
// Publication Presse Communication SARL : https://ppcom.fr
// Submitted by Yaacov Akiba Slama <admin@chirurgiens-dentistes-en-france.fr>
chirurgiens-dentistes-en-france.fr
// Submitted by Daniel Dent (https://www.danieldent.com/)
qa2.com
+// QNAP System Inc : https://www.qnap.com
+// Submitted by Nick Chang <nickchang@qnap.com>
+dev-myqnapcloud.com
+alpha-myqnapcloud.com
+myqnapcloud.com
+
// Rackmaze LLC : https://www.rackmaze.com
// Submitted by Kirill Pertsev <kika@rackmaze.com>
rackmaze.com
// Submitted by Asheesh Laroia <asheesh@sandstorm.io>
sandcats.io
+// SBE network solutions GmbH : https://www.sbe.de/
+// Submitted by Norman Meilick <nm@sbe.de>
+logoip.de
+logoip.com
+
// Service Online LLC : http://drs.ua/
// Submitted by Serhii Bulakh <support@drs.ua>
biz.ua
co.ua
pp.ua
+// Shopblocks : http://www.shopblocks.com/
+// Submitted by Alex Bowers <alex@shopblocks.com>
+myshopblocks.com
+
// SinaAppEngine : http://sae.sina.com.cn/
// Submitted by SinaAppEngine <saesupport@sinacloud.com>
sinaapp.com
alpha.bounty-full.com
beta.bounty-full.com
+// staticland : https://static.land
+// Submitted by Seth Vincent <sethvincent@gmail.com>
+static.land
+dev.static.land
+sites.static.land
+
// SpaceKit : https://www.spacekit.io/
// Submitted by Reza Akhavan <spacekit.io@gmail.com>
spacekit.io
+// Stackspace : https://www.stackspace.io/
+// Submitted by Lina He <info@stackspace.io>
+stackspace.space
+
// Synology, Inc. : https://www.synology.com/
// Submitted by Rony Weng <ronyweng@synology.com>
diskstation.me
med.pl
sopot.pl
-// TownNews.com domains : http://www.townnews.com
+// TownNews.com : http://www.townnews.com
// Submitted by Dustin Ward <dward@townnews.com>
bloxcms.com
townnews-staging.com
+// TuxFamily : http://tuxfamily.org
+// Submitted by TuxFamily administrators <adm@staff.tuxfamily.org>
+tuxfamily.org
+
// UDR Limited : http://www.udr.hk.com
// Submitted by registry <hostmaster@udr.hk.com>
hk.com
ltd.hk
inc.hk
+// .US
+// Submitted by Ed Moore <Ed.Moore@lib.de.us>
+lib.de.us
+
// Viprinet Europe GmbH : http://www.viprinet.com
// Submitted by Simon Kissel <hostmaster@viprinet.com>
router.management
+// Wikimedia Labs : https://wikitech.wikimedia.org
+// Submitted by Yuvi Panda <yuvipanda@wikimedia.org>
+wmflabs.org
+
// Yola : https://www.yola.com/
// Submitted by Stefano Rivera <stefano@yola.com>
yolasite.com
#
local __TTL=600 #.preset DNS TTL (in seconds)
local __RRTYPE __PW __TCP
+local __PROG=$(which nsupdate) # BIND nsupdate ?
+[ -z "$__PROG" ] && __PROG=$(which knsupdate) # Knot nsupdate ?
-[ -x /usr/bin/nsupdate ] || write_log 14 "'nsupdate' not installed or not executable !"
-
+[ -z "$__PROG" ] && write_log 14 "'nsupdate' or 'knsupdate' not installed !"
[ -z "$username" ] && write_log 14 "Service section not configured correctly! Missing 'username'"
[ -z "$password" ] && write_log 14 "Service section not configured correctly! Missing 'password'"
[ -z "$dns_server" ] && write_log 14 "Service section not configured correctly! Missing 'dns_server'"
update add $domain $__TTL $__RRTYPE $__IP
show
send
+answer
quit
EOF
-/usr/bin/nsupdate -d $__TCP $DATFILE >$ERRFILE 2>&1
+$__PROG -d $__TCP $DATFILE >$ERRFILE 2>&1
# nsupdate always return success
-write_log 7 "nsupdate reports:\n$(cat $ERRFILE)"
+write_log 7 "(k)nsupdate reports:\n$(cat $ERRFILE)"
return 0
\ No newline at end of file
--- /dev/null
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=dhcp-forwarder
+PKG_VERSION:=0.11
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=@SAVANNAH/dhcp-fwd/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=9d1ea7939fef93ae7d7caef43397a908
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Scott K Logan <logans@cottsay.net>
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/dhcp-forwarder
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=IP Addresses and Names
+ TITLE:=DHCP relay agent
+ URL:=http://www.nongnu.org/dhcp-fwd/
+ USERID:=dhcp-fwd=375:dhcp-fwd=375
+endef
+
+define Package/dhcp-forwarder/description
+ This program forwards DHCP messages between subnets with different sublayer
+ broadcast domains. It is similarly to the DHCP relay agent dhcrelay of ISC's
+ DHCP, but has the following features which are important for me:
+
+ - Runs as non-root in a chroot-jail
+ - Uses "normal" AF_INET sockets; this allows to uses packetfilters to filter
+ incoming messages.
+ - The DHCP agent IDs can be defined freely
+ - Has a small memory footprint when using dietlibc
+
+ It tries to be RFC 2131/2132 and 3046 compliant. Probably it works with BOOTP
+ (RFC 951) also, but since the handling of the giaddr field is described
+ misleading (see RFC 1542), there may occur problems.
+endef
+
+define Package/dhcp-forwarder/conffiles
+/etc/dhcp-fwd.conf
+endef
+
+CONFIGURE_ARGS += \
+ --disable-dietlibc \
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ DESTDIR="$(PKG_INSTALL_DIR)" \
+ cfg_filename="/etc/dhcp-fwd.conf" \
+ all install
+endef
+
+define Package/dhcp-forwarder/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/etc $(1)/etc/init.d
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dhcp-fwd $(1)/usr/bin/
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/contrib/dhcp-fwd.conf $(1)/etc/
+ $(INSTALL_BIN) ./files/dhcp-fwd.init $(1)/etc/init.d/dhcp-fwd
+endef
+
+$(eval $(call BuildPackage,dhcp-forwarder))
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=50
+USE_PROCD=1
+
+LOG_D=/var/log
+RUN_D=/var/run
+CHR_D=/var/lib/dhcp-fwd
+PID_F=$RUN_D/dhcp-fwd.pid
+
+start_service() {
+ [ -d $LOG_D ] || mkdir -p $LOG_D
+ [ -d $RUN_D ] || mkdir -p $RUN_D
+ [ -d $CHR_D ] || mkdir -p $CHR_D && chown dhcp-fwd:dhcp-fwd $CHR_D -R
+
+ procd_open_instance
+ procd_set_param command dhcp-fwd -n
+ procd_set_param respawn
+ procd_close_instance
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger "dhcp"
+}
#
-# Copyright (C) 2009-2016 OpenWrt.org
+# Copyright (C) 2016 OpenWrt.org
+# Copyright (C) 2012-2016 Black Roland and contributors (https://github.com/black-roland/exOpenWrt/graphs/contributors)
+# Copyright (C) 2011-2012 Entware
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=dnscrypt-proxy
-PKG_VERSION:=1.6.1
-PKG_RELEASE:=2
+PKG_VERSION:=1.7.0
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://download.dnscrypt.org/dnscrypt-proxy
-PKG_MD5SUM:=6fc2a8c57007d582dee3313979a4d1b5
+PKG_MD5SUM:=95df7262964dc22da62f7f6f0466c50e
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
- DEPENDS:=+libsodium
URL:=http://dnscrypt.org/
MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
endef
define Package/dnscrypt-proxy
$(call Package/dnscrypt-proxy/Default)
+ DEPENDS:=+libsodium +dnscrypt-proxy-resolvers
TITLE:=A tool for securing communications between a client and a DNS resolver
endef
a client and its first-level resolver.
endef
+define Package/dnscrypt-proxy-resolvers
+ $(call Package/dnscrypt-proxy/Default)
+ TITLE:=Package with current list of dnscrypt-proxy resolvers
+ VERSION:=$(PKG_VERSION)+git-20160829-65a9553-$(PKG_RELEASE)
+endef
+
+define Package/dnscrypt-proxy-resolvers/description
+ Package with current list of dnscrypt-proxy resolvers.
+endef
+
define Package/hostip
$(call Package/dnscrypt-proxy/Default)
+ DEPENDS:=+libsodium
TITLE:=Resolver to IPv4 or IPv6 addresses
endef
$(call Build/Configure/Default, \
--prefix=/usr \
--disable-ssp \
+ --disable-plugins \
)
endef
define Package/dnscrypt-proxy/install
$(INSTALL_DIR) $(1)/usr/sbin
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/dnscrypt-proxy $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/usr/share/dnscrypt-proxy
- $(CP) $(PKG_INSTALL_DIR)/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv $(1)/usr/share/dnscrypt-proxy/
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/dnscrypt-proxy.init $(1)/etc/init.d/dnscrypt-proxy
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) ./files/dnscrypt-proxy.config $(1)/etc/config/dnscrypt-proxy
endef
-define Package/dnscrypt-proxy/postinst
-#!/bin/sh
-# check if we are on real system
-if [ -z "$${IPKG_INSTROOT}" ]; then
- echo "Enabling rc.d symlink for dnscrypt-proxy"
- /etc/init.d/dnscrypt-proxy enable
-fi
-exit 0
-endef
-
-define Package/dnscrypt-proxy/prerm
-#!/bin/sh
-# check if we are on real system
-if [ -z "$${IPKG_INSTROOT}" ]; then
- echo "Removing rc.d symlink for dnscrypt-proxy"
- /etc/init.d/dnscrypt-proxy disable
-fi
-exit 0
+define Package/dnscrypt-proxy-resolvers/install
+ $(INSTALL_DIR) $(1)/usr/share/dnscrypt-proxy
+ $(CP) ./files/dnscrypt-resolvers.csv $(1)/usr/share/dnscrypt-proxy/
endef
define Package/dnscrypt-proxy/conffiles
endef
$(eval $(call BuildPackage,dnscrypt-proxy))
+$(eval $(call BuildPackage,dnscrypt-proxy-resolvers))
$(eval $(call BuildPackage,hostip))
-config dnscrypt-proxy
+config dnscrypt-proxy ns1
option address '127.0.0.1'
option port '5353'
- # option resolver 'cisco'
+ option resolver 'fvz-anyone'
# option resolvers_list '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
- # option ephemeral_keys '1'
+ # ephemeral keys option requires extra CPU cycles and can cause huge system load
+ # option ephemeral_keys '0'
# more details at https://github.com/jedisct1/dnscrypt-proxy#public-key-client-authentication
# option client_key ''
+
+# config dnscrypt-proxy ns2
+# option address '127.0.0.1'
+# option port '5454'
+# # option resolver 'd0wn-random-ns1'
+# # option resolvers_list '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
+# # option ephemeral_keys '0'
+# # option client_key ''
#!/bin/sh /etc/rc.common
START=50
+USE_PROCD=1
+PROG=/usr/sbin/dnscrypt-proxy
-start_instance () {
- local section="$1"
- config_get address "$section" 'address'
- config_get port "$section" 'port'
- config_get resolver "$section" 'resolver'
- config_get resolvers_list "$section" 'resolvers_list'
- config_get client_key "$section" 'client_key'
- config_get_bool ephemeral_keys "$section" 'ephemeral_keys'
+dnscrypt_instance() {
+ local address port resolver resolvers_list ephemeral_keys client_key
- service_start /usr/sbin/dnscrypt-proxy -d \
- -a ${address}:${port} \
- -u nobody \
- -L ${resolvers_list:-'/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'} \
- -R ${resolver:-'cisco'} \
- ${ephemeral_keys:+'-E'} \
- ${client_key:+'--client-key='$client_key}
-}
+ config_get address $1 'address'
+ config_get port $1 'port'
+ config_get resolver $1 'resolver' ''
+ config_get resolvers_list $1 'resolvers_list' '/usr/share/dnscrypt-proxy/dnscrypt-resolvers.csv'
+ config_get_bool ephemeral_keys $1 'ephemeral_keys' '0'
+ config_get client_key $1 'client_key' ''
-start() {
- config_load 'dnscrypt-proxy'
- config_foreach start_instance 'dnscrypt-proxy'
+ procd_open_instance
+ procd_set_param command $PROG -u nobody -S
+ procd_append_param command -a "$address:$port"
+ procd_append_param command -L $resolvers_list
+ [ -n "$resolver" ] && procd_append_param command -R $resolver
+ [ $ephemeral_keys -eq 1 ] && procd_append_param command -E
+ [ -n "$client_key" ] && procd_append_param command -K $client_key
+ procd_close_instance
}
-stop() {
- service_stop /usr/sbin/dnscrypt-proxy
+start_service() {
+ config_load dnscrypt-proxy
+ config_foreach dnscrypt_instance dnscrypt-proxy
}
+service_triggers() {
+ procd_add_reload_trigger 'dnscrypt-proxy'
+}
--- /dev/null
+Name,Full name,Description,Location,Coordinates,URL,Version,DNSSEC validation,No logs,Namecoin,Resolver address,Provider name,Provider public key,Provider public key TXT record\r
+4armed,4ARMED,DNSCrypt Server provided by www.4armed.com,France,,https://www.4armed.com,1,yes,yes,no,51.254.115.48,2.dnscrypt-cert.dnscrypt.4armed.io,FD3E:5887:63EA:17A9:1AF8:4325:DE82:1507:6ED0:01AB:2F9E:55DE:689B:F491:4D8E:526E,\r
+cisco,Cisco OpenDNS,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
+cisco-familyshield,Cisco OpenDNS with FamilyShield,Blocks web sites not suitable for children,Anycast,,https://www.opendns.com/home-internet-security/parental-controls/,1,no,no,no,208.67.220.123,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
+cisco-ipv6,Cisco OpenDNS over IPv6,Cisco OpenDNS IPv6 sandbox,Anycast,,https://www.opendns.com/about/innovations/ipv6/,1,no,no,no,[2620:0:ccc::2]:443,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
+cisco-port53,Cisco OpenDNS backward compatibility port 53,Remove your DNS blind spot,Anycast,,https://www.opendns.com,1,no,no,no,208.67.220.220:53,2.dnscrypt-cert.opendns.com,B735:1140:206F:225D:3E2B:D822:D7FD:691E:A1C3:3CC8:D666:8D0C:BE04:BFAB:CA43:FB79,\r
+cloudns-syd,CloudNS Sydney,CloudNS is an Australian based security focused DNS provider,"Sydney, AU",,https://cloudns.com.au,1,yes,yes,no,113.20.8.17,2.dnscrypt-cert-2.cloudns.com.au,67A4:323E:581F:79B9:BC54:825F:54FE:1025:8B4F:37EB:0D07:0BCE:4010:6195:D94F:E330,\r
+cs-cawest,CS Canada west DNSCrypt server,provided by cryptostorm.is,"Vancouver, CA",,https://cryptostorm.is,1,no,yes,no,162.221.207.228,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-cfi,CS cryptofree France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,no,212.83.175.31,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-cfii,CS secondary cryptofree France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,no,195.154.61.33,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-ch,CS Switzerland DNSCrypt server,provided by cryptostorm.is,"Baar, Switzerland",,https://cryptostorm.is,1,no,yes,no,185.60.147.77,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-de,CS Germany DNSCrypt server,provided by cryptostorm.is,"Frankfurt, Germany",,https://cryptostorm.is,1,no,yes,no,46.165.222.246,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-fr,CS France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,yes,212.129.46.86,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-fr2,CS secondary France DNSCrypt server,provided by cryptostorm.is,"Paris, France",,https://cryptostorm.is,1,no,yes,yes,212.129.46.32,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-rome,CS Italy DNSCrypt server,provided by cryptostorm.is,"Buffalo, NY",,https://cryptostorm.is,1,no,yes,no,95.141.47.58,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-useast,CS New York City NY US DNSCrypt server,provided by cryptostorm.is,"Buffalo, NY",,https://cryptostorm.is,1,no,yes,no,173.234.159.235,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-usnorth,CS Chicago IL US DNSCrypt server,provided by cryptostorm.is,"Chicago, IL",,https://cryptostorm.is,1,no,yes,no,173.234.56.115,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-ussouth,CS Dallas TX US DNSCrypt server,provided by cryptostorm.is,"Dallas, TX",,https://cryptostorm.is,1,no,yes,no,70.32.38.67,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-ussouth2,CS Atlanta GA US DNSCrypt server,provided by cryptostorm.is,"Atlanta, GA",,https://cryptostorm.is,1,no,yes,no,108.62.19.131,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-uswest,CS Seattle WA US DNSCrypt server,provided by cryptostorm.is,"Seattle, WA",,https://cryptostorm.is,1,no,yes,yes,76.164.234.11,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+cs-uswest2,CS Las Vegas NV US DNSCrypt server,provided by cryptostorm.is,"Las Vegas, NV",,https://cryptostorm.is,1,no,yes,no,104.238.194.235,2.dnscrypt-cert.cryptostorm.is,3133:72AD:5956:32C2:416B:872F:098F:851B:DDB9:6528:4C6C:BE9A:4F19:0964:30DB:A95A,\r
+d0wn-bg-ns1,OpenNIC Resolver Bulgaria 01 - d0wn,Server provided by Martin 'd0wn' Albus,Bulgaria,,https://dns.d0wn.biz,1,no,yes,yes,217.12.203.133,2.dnscrypt-cert.bg.d0wn.biz,423C:D823:B3EA:2015:F027:ECF1:5704:3EB7:764A:D02D:9447:56E6:51FD:D06F:E571:2FCC,pubkey.bg.dnscrypt.d0wn.biz\r
+d0wn-cz-ns1,OpenNIC Resolver Czech Republic 01 - d0wn,Server provided by Martin 'd0wn' Albus,Czech Republic,,https://dns.d0wn.biz,1,no,yes,yes,81.2.237.32,2.dnscrypt-cert.cz.d0wn.biz,4BAE:D9CE:1A99:42B2:44D1:4454:0C8C:EC0E:D5D8:90CE:0D9B:D3E3:93CF:7ACC:CCE0:3794,pubkey.cz.dnscrypt.d0wn.biz\r
+d0wn-de-ns1,OpenNIC Resolver Germany 01 - d0wn,Server provided by Martin 'd0wn' Albus,Germany,,https://dns.d0wn.biz,1,no,yes,yes,82.211.31.248,2.dnscrypt-cert.de.d0wn.biz,D4A8:6FB5:AA0C:2B6B:8C13:8C29:7F69:F9C8:29C8:E157:F279:6FC7:7366:290F:2A80:0AD2,pubkey.de.dnscrypt.d0wn.biz\r
+d0wn-de-ns2,OpenNIC Resolver Germany 02 - d0wn,Server provided by Martin 'd0wn' Albus,Germany,,https://dns.d0wn.biz,1,no,yes,yes,185.137.15.105,2.dnscrypt-cert.de2.d0wn.biz,8C62:691A:A7EA:69D3:8A25:86AA:2715:87F0:9B11:9159:0663:55FC:1CD0:61C5:C863:1940,pubkey.de2.dnscrypt.d0wn.biz\r
+d0wn-dk-ns1,OpenNIC Resolver Denmark 01 - d0wn,Server provided by Martin 'd0wn' Albus,Moldova,,https://dns.d0wn.biz,1,no,yes,yes,77.66.108.93,2.dnscrypt-cert.dk.d0wn.biz,0838:C9CF:2292:2D4C:4DB7:4A5E:ED10:DD36:66DD:9551:7238:6387:B7A0:2FA0:885A:5F77,pubkey.dk.dnscrypt.d0wn.biz\r
+d0wn-fr-ns2,OpenNIC Resolver France 02 - d0wn,Server provided by Martin 'd0wn' Albus,France,,https://dns.d0wn.biz,1,no,yes,yes,37.187.0.40:54,2.dnscrypt-cert.fr2.d0wn.biz,25A7:DB7B:7835:55D5:7DA4:7C0C:57F8:9C5F:0220:3D09:67E3:585A:723E:E0D1:CB38:F767,pubkey.fr2.dnscrypt.d0wn.biz\r
+d0wn-gr-ns1,OpenNIC Resolver Greece 01 - d0wn,Server provided by Martin 'd0wn' Albus & www.aws.gr,Greece,,https://dns.d0wn.biz,1,no,yes,yes,85.25.105.193,2.dnscrypt-cert.gr.d0wn.biz,D056:D3A4:9568:5AFE:4B0D:C688:7A75:41B2:7217:F0C9:75A5:A6C0:142D:363B:F992:9867,pubkey.gr.dnscrypt.d0wn.biz\r
+d0wn-is-ns1,OpenNIC Resolver Iceland 01 - d0wn,Server provided by Martin 'd0wn' Albus,France,,https://dns.d0wn.biz,1,no,yes,yes,37.235.49.61,2.dnscrypt-cert.is.d0wn.biz,2B28:974E:073A:6B38:722A:5BE1:F7A0:250C:508F:A809:238F:8F3D:76D8:6098:20D7:B2D9,pubkey.is.dnscrypt.d0wn.biz\r
+d0wn-it-ns1,OpenNIC Resolver Italy 01 - d0wn,Server provided by Martin 'd0wn' Albus,Italy,,https://dns.d0wn.biz,1,no,yes,yes,31.14.133.188,2.dnscrypt-cert.it.d0wn.biz,B8F4:76E3:1EA4:ADDB:3426:D870:2819:6989:91EE:0C5A:B789:C74E:D6D9:BFB6:6C29:1D5C,pubkey.it.dnscrypt.d0wn.biz\r
+d0wn-lv-ns1,OpenNIC Resolver Latvia 01 - d0wn,Server provided by Martin 'd0wn' Albus,Latvia,,https://dns.d0wn.biz,1,no,yes,yes,89.111.13.60,2.dnscrypt-cert.lv.d0wn.biz,1B70:FB6F:2E47:1753:91EF:1084:ECD2:983A:9018:F3E3:DDF1:E563:E528:156A:664A:1AE8,pubkey.lv.dnscrypt.d0wn.biz\r
+d0wn-md-ns1,OpenNIC Resolver Moldova 01 - d0wn,Server provided by Martin 'd0wn' Albus,Moldova,,https://dns.d0wn.biz,1,no,yes,yes,178.17.170.67:54,2.dnscrypt-cert.md.d0wn.biz,3DB2:C4CB:39E2:6B82:FDDF:6D91:1A65:D164:F4F0:D237:8CDD:0C37:469F:24BA:B9A0:F9FF,pubkey.md.dnscrypt.d0wn.biz\r
+d0wn-nl-ns1,OpenNIC Resolver Netherlands 01 - d0wn,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,95.85.9.86:80,2.dnscrypt-cert.nl.d0wn.biz,7BE6:68FE:A505:FFA7:4C27:C2CA:F881:59DA:038C:5741:13AA:2556:A4D2:2D0B:B6F0:009E,pubkey.nl.dnscrypt.d0wn.biz\r
+d0wn-nl-ns2,OpenNIC Resolver Netherlands 02 - d0wn,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,185.83.217.248:5353,2.dnscrypt-cert.nl2.d0wn.biz,DFAA:B7D8:29E6:1F34:4FED:2610:4221:70C9:ADC7:7E9F:A65F:4A46:0BAE:A735:3186:3B99,pubkey.nl2.dnscrypt.d0wn.biz\r
+d0wn-random-ns1,DNSCrypt Randomizer 01 - d0wn,Server provided by Martin 'd0wn' Albus,Moldova,,https://dns.d0wn.biz,1,no,yes,yes,178.17.170.133,2.dnscrypt-cert.random.d0wn.biz,A420:867F:ED5C:024C:C86A:EECE:AA05:194B:017F:D2FF:9E72:385A:874F:8CE5:6832:ED2E,pubkey.random.dnscrypt.d0wn.biz\r
+d0wn-random-ns2,DNSCrypt Randomizer 02 - d0wn,Server provided by Martin 'd0wn' Albus,Netherlands,,https://dns.d0wn.biz,1,no,yes,yes,185.14.29.140,2.dnscrypt-cert.random2.d0wn.biz,9112:338E:7D0B:5E78:B792:9BB6:1B75:4888:AC94:65B5:B86B:B5DE:CCF3:E5B9:15A5:DC54,pubkey.random2.dnscrypt.d0wn.biz\r
+d0wn-ru-ns1,OpenNIC Resolver Russia 01 - d0wn,Server provided by Martin 'd0wn' Albus,Russia,,https://dns.d0wn.biz,1,no,yes,yes,91.214.71.181:80,2.dnscrypt-cert.ru.d0wn.biz,0ECA:BC40:E0A1:335F:0221:4240:AB86:2919:D16A:2393:CCEB:4B40:9EB9:4F24:3077:ED99,pubkey.ru.dnscrypt.d0wn.biz\r
+d0wn-sg-ns1,OpenNIC Resolver Singapore 01 - d0wn,Server provided by Martin 'd0wn' Albus,Singapore,,https://dns.d0wn.biz,1,no,yes,yes,128.199.248.105:54,2.dnscrypt-cert.sg.d0wn.biz,D82B:2B76:1DA0:8470:B55B:820C:FAAB:9F32:D632:E9E0:5616:2CE7:7D21:E970:98FF:4A34,pubkey.sg.dnscrypt.d0wn.biz\r
+d0wn-tz-ns1,OpenNIC Resolver Tanzania 01 - d0wn,Server provided by Martin 'd0wn' Albus,Tanzania,,https://dns.d0wn.biz,1,no,yes,yes,41.79.69.13,2.dnscrypt-cert.tz.d0wn.biz,B79F:A025:1AF6:2125:DF3E:3B03:856D:4CB7:704E:45EB:B850:3A7B:C6AA:5510:D87D:087D,pubkey.tz.dnscrypt.d0wn.biz\r
+d0wn-ua-ns1,OpenNIC Resolver Ukraine 01 - d0wn,Server provided by Martin 'd0wn' Albus,Ukraine,,https://dns.d0wn.biz,1,no,yes,yes,217.12.210.54,2.dnscrypt-cert.ua.d0wn.biz,3B1E:D468:FFD3:F261:20DE:E7F1:6A74:E1D5:D59E:B40D:F3EA:99BC:0B05:70CC:292D:99BA,ppubkey.ua.dnscrypt.d0wn.biz\r
+dnscrypt.eu-dk,DNSCrypt.eu Denmark,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,77.66.84.233,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu\r
+dnscrypt.eu-dk-ipv6,DNSCrypt.eu Denmark over IPv6,"Free, non-logged, uncensored. Hosted by Netgroup.",Denmark,,https://dnscrypt.eu,1,yes,yes,no,[2001:1448:243::dc2]:443,2.dnscrypt-cert.resolver2.dnscrypt.eu,3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955,pubkey.resolver2.dnscrypt.eu\r
+dnscrypt.eu-nl,DNSCrypt.eu Holland,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,176.56.237.171,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu\r
+dnscrypt.eu-nl-ipv6,DNSCrypt.eu Holland over IPv6,"Free, non-logged, uncensored. Hosted by RamNode.",Netherlands,,https://dnscrypt.eu,1,yes,yes,no,[2a00:d880:3:1::a6c1:2e89]:443,2.dnscrypt-cert.resolver1.dnscrypt.eu,67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66,pubkey.resolver1.dnscrypt.eu\r
+dnscrypt.org-fr,DNSCrypt.org France,DNSSEC/Non-logged/Uncensored - ARM server donated by Scaleway.com,"Paris, France",,,2,yes,yes,no,212.47.228.136,2.dnscrypt-cert.fr.dnscrypt.org,E801:B84E:A606:BFB0:BAC0:CE43:445B:B15E:BA64:B02F:A3C4:AA31:AE10:636A:0790:324D,pubkey.fr.dnscrypt.org\r
+fvz-anyone,Primary OpenNIC Anycast DNS Resolver,Fusl's public primary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,185.121.177.177,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,\r
+fvz-anytwo,Secondary OpenNIC Anycast DNS Resolver,Fusl's public secondary OpenNIC Tier2 Anycast DNS Resolver,Anycast,,http://dnsrec.meo.ws/,1,no,yes,yes,185.121.177.53,2.dnscrypt-cert.dnsrec.meo.ws,1A6A:D0A3:2B4C:5A61:A695:D153:670D:69AB:1690:3F9E:C3F7:F64F:13E5:35A3:18B2:28A5,\r
+fvz-rec-at-vie-01,"opennic-fvz-rec-at-vie-01 in Vienna, Austria","Fusl's public OpenNIC Tier2 DNS Resolver in Vienna, Austria - Sponsored by dediserve (https://dediserve.com/)","Vienna, Austria",,http://meo.ws/dnsrec.php,1,no,yes,yes,79.133.43.124,2.dnscrypt-cert.fvz-rec-at-vie-01.dnsrec.meo.ws,8D64:21DA:85D0:11B2:5056:319C:A81B:C6BB:EABC:0790:3CED:1469:EA4B:91A7:9568:C6BC,\r
+fvz-rec-ca-tor-01,"opennic-fvz-rec-ca-tor-01 in Toronto, Canada","Fusl's public OpenNIC Tier2 DNS Resolver in Toronto, Canada - Sponsored by Luna Node (https://lunanode.com/)","Toronto, Canada",,http://meo.ws/dnsrec.php,1,no,yes,yes,172.81.176.146,2.dnscrypt-cert.fvz-rec-ca-tor-01.dnsrec.meo.ws,0F75:DB7D:7BF0:B078:8DF6:8472:7B1A:5069:A6EC:BDDF:FD0D:0E85:5C45:B500:D532:994F,\r
+fvz-rec-ca-tor-01-ipv6,"opennic-fvz-rec-ca-tor-01 in Toronto, Canada (IPv6)","Fusl's public OpenNIC Tier2 DNS Resolver in Toronto, Canada (IPv6) - Sponsored by Luna Node (https://lunanode.com/)","Toronto, Canada",,http://meo.ws/dnsrec.php,1,no,yes,yes,[2602:ffb6:2:0:f816:3eff:fe23:ae28]:443,2.dnscrypt-cert.fvz-rec-ca-tor-01.dnsrec.meo.ws,0F75:DB7D:7BF0:B078:8DF6:8472:7B1A:5069:A6EC:BDDF:FD0D:0E85:5C45:B500:D532:994F,\r
+fvz-rec-de-dus-01,"opennic-fvz-rec-de-dus-01 in Dusseldorf, Germany","Fusl's public OpenNIC Tier2 DNS Resolver in Dusseldorf, Germany Ports: 54, 443, 1053, 5353, 27015","Dusseldorf, Germany",,http://dnsrec.meo.ws/,1,no,yes,yes,62.141.38.230,2.dnscrypt-cert.fvz-rec-de-dus-01.dnsrec.meo.ws,7D9A:D155:4472:BFF5:E33D:6DE5:F1B3:BE34:CE0F:6D2D:D3DB:E00E:2961:5CB8:D52A:C5E3,\r
+fvz-rec-de-muc-01,"fvz-rec-de-muc-01 in Munich, Germany","Fusl's public OpenNIC Tier2 DNS Resolver in Munich, Germany - Sponsored by Zappie Host","Munich, Germany",,http://meo.ws/dnsrec.php,1,no,yes,yes,185.90.62.45,2.dnscrypt-cert.fvz-rec-de-muc-01.dnsrec.meo.ws,C392:2B83:8EB3:884B:B99B:70BD:B90A:C204:37A4:797A:35F4:3600:7641:94E3:F995:444A,\r
+fvz-rec-de-muc-01-ipv6,"fvz-rec-de-muc-01 IPv6 in Munich, Germany","Fusl's public OpenNIC Tier2 DNS Resolver in Munich, Germany - Sponsored by Zappie Host","Munich, Germany",,http://meo.ws/dnsrec.php,1,no,yes,yes,[2a05:dfc0:1ee3:dee:ba::1]:443,2.dnscrypt-cert.fvz-rec-de-muc-01.dnsrec.meo.ws,C392:2B83:8EB3:884B:B99B:70BD:B90A:C204:37A4:797A:35F4:3600:7641:94E3:F995:444A,\r
+fvz-rec-fr-sxb-01,"opennic-fvz-rec-fr-sxb-01 in Strasbourg, France","Fusl's public OpenNIC Tier2 DNS Resolver in Strasbourg, France - Sponsored by GalaxyHostPlus (https://galaxyhostplus.com/)","Strasbourg, France",,http://meo.ws/dnsrec.php,1,no,yes,yes,51.254.68.187:27015,2.dnscrypt-cert.fvz-rec-fr-sxb-01.dnsrec.meo.ws,53E7:3A2C:7EB2:C574:0C2B:8826:56EF:13CF:FA3F:1B3F:A902:7773:E0F1:A9D2:0CD7:E037,\r
+fvz-rec-gb-brs-01,"opennic-fvz-rec-gb-brs-01 in Bristol, United Kingdom","Fusl's public OpenNIC Tier2 DNS Resolver in Bristol, United Kingdom - Sponsored by a very kind person","Bristol, United Kingdom",,http://meo.ws/dnsrec.php,1,no,yes,yes,185.115.125.185,2.dnscrypt-cert.fvz-rec-gb-brs-01.dnsrec.meo.ws,FE7B:2A4C:ECBA:E837:B978:D831:BD9D:D51D:9382:7F52:2D46:3A2D:2EEB:3753:0099:E117,\r
+fvz-rec-gb-lon-01,"opennic-fvz-rec-gb-lon-01 in London, United Kingdom","Fusl's public OpenNIC Tier2 DNS Resolver in London, United Kingdom - Sponsored by Konsole (https://konsole.co.uk/)","London, United Kingdom",,http://meo.ws/dnsrec.php,1,no,yes,yes,93.170.96.119,2.dnscrypt-cert.fvz-rec-gb-lon-01.dnsrec.meo.ws,DDD8:847B:B3E8:DDE2:AB59:DB53:5381:8024:2032:E3FD:C5A2:C48A:C527:B77F:15CC:D28C,\r
+fvz-rec-gb-lon-03,"opennic-fvz-rec-gb-lon-03 in London, United Kingdom","Fusl's public OpenNIC Tier2 DNS Resolver in London, United Kingdom - Sponsored by dediserve (https://dediserve.com/)","London, United Kingdom",,http://meo.ws/dnsrec.php,1,no,yes,yes,95.154.236.104,2.dnscrypt-cert.fvz-rec-gb-lon-03.dnsrec.meo.ws,972C:778B:8F32:21DB:E10B:B13B:6AFF:FED5:EE85:C526:844A:6662:6E05:FD44:5571:0597,\r
+fvz-rec-hk-ztw-01,"opennic-fvz-rec-hk-ztw-01 in Tsuen Wan, Hong Kong","Fusl's public OpenNIC Tier2 DNS Resolver in Tsuen Wan, Hong Kong - Sponsored by dediserve (https://dediserve.com/)","Tsuen Wan, Hong Kong",,http://meo.ws/dnsrec.php,1,no,yes,yes,103.53.199.71,2.dnscrypt-cert.fvz-rec-hk-ztw-01.dnsrec.meo.ws,FD3A:5CE0:FD44:D174:681F:F008:7958:9EC8:8D4B:B2D9:32A2:2746:FEAD:77F7:3992:33FA,\r
+fvz-rec-nl-ams-01,"opennic-fvz-rec-nl-ams-01 in Amsterdam, Netherlands","Fusl's public OpenNIC Tier2 DNS Resolver in Amsterdam, Netherlands - Sponsored by dediserve (https://dediserve.com/)","Amsterdam, Netherlands",,http://meo.ws/dnsrec.php,1,no,yes,yes,93.158.205.94,2.dnscrypt-cert.fvz-rec-nl-ams-01.dnsrec.meo.ws,7B81:4CB7:D323:CCAB:EA4E:8BBA:0A44:2172:F909:62E8:699C:3B14:2DAB:8B51:D2E2:083C,\r
+fvz-rec-no-osl-01,"opennic-fvz-rec-no-osl-01 in Oslo, Norway","Fusl's public OpenNIC Tier2 DNS Resolver in Oslo, Norway - Cloud.net (https://cloud.net/)","Oslo, Norway",,http://meo.ws/dnsrec.php,1,no,yes,yes,91.247.228.155,2.dnscrypt-cert.fvz-rec-no-osl-01.dnsrec.meo.ws,0D0C:CDB0:DAF0:2EDF:E340:2251:D9CA:9EAE:BFD0:6F00:7A00:560C:FD53:78D1:2CE3:F4AA,\r
+fvz-rec-ro-buh-01,"opennic-fvz-rec-ro-buh-01 in Bucharest, Romania","Fusl's public OpenNIC Tier2 DNS Resolver in Bucharest, Romania - HostClean.net (http://www.hostclean.net/)","Bucharest, Romania",,http://meo.ws/dnsrec.php,1,no,yes,yes,89.34.26.150,2.dnscrypt-cert.fvz-rec-ro-buh-01.dnsrec.meo.ws,EAA2:541A:F705:0D97:7F8C:D5B0:7B8D:D0AD:849A:653C:9E69:C02C:AB8D:FA5B:6F99:7B96,\r
+ipredator,Ipredator.se Server,Public DNSCrypt server in Sweden provided by Ipredator.se,Sweden,,https://www.ipredator.se,1,no,yes,no,194.132.32.32,2.dnscrypt-cert.ipredator.se,C44C:566A:A8D6:46C4:32B1:04F5:3D00:961B:32DC:71CF:1C04:BD9E:B013:E480:E7A4:7828,pubkey.resolver2.ipredator.se\r
+ns0.dnscrypt.is,"ns0.dnscrypt.is in Reykjavík, Iceland","DNSSEC enabled, non-logging, uncensored. Sponsored by 1984 Hosting.","Reykjavík, Iceland",,https://dnscrypt.is,1,yes,yes,no,93.95.228.87,2.dnscrypt-cert.ns0.dnscrypt.is,EE41:6A83:451C:218F:37B2:B736:78C4:999F:7DE6:89D1:31D2:7866:7C8E:A8BB:1C95:B402,pubkey.ns0.dnscrypt.is\r
+okturtles,okTurtles,For a surveillance-free world. HTTPS is broken. DNSChain fixes it.,"Georgia, US","33.032501, -83.895699",http://okturtles.com/,1,no,yes,yes,23.226.227.93,2.dnscrypt-cert.okturtles.com,1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB,\r
+opennic-tumabox,TumaBox,Public DNS server operated by TumaBox.org,Germany,,http://wiki.tumabox.org/doku.php?id=dns,1,no,yes,yes,130.255.73.90:5353,2.tumabox.org,D591:7B11:6A35:3114:C238:AA99:A6EB:0C28:7CF7:6805:41AC:5DBF:A8A0:239E:228C:5B06,\r
+ovpnse,OVPN.se Integritet AB,Public DNS server in Sweden by OVPN.se,Sweden,"59.2877011, 18.0771273",https://www.ovpn.se,1,no,yes,no,46.227.67.134:55,2.dnscrypt-cert.dnscrypt01.ovpn.se,B0D6:3658:E23F:5AE1:495C:03C2:319D:D6F1:F2E1:E067:BD23:6F56:503F:27A8:C5D9:2390,\r
+soltysiak,Soltysiak,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,178.216.201.222:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com\r
+soltysiak-ipv6,Soltysiak over IPv6,Public DNSCrypt server in Poland,Poland,"52.4014619, 16.9278078",http://dc1.soltysiak.com/,1,yes,yes,yes,[2001:470:70:4ff::2]:2053,2.dnscrypt-cert.soltysiak.com,25C4:E188:2915:4697:8F9C:2BBD:B6A7:AFA4:01ED:A051:0508:5D53:03E7:1928:C066:8F21,pubkey.dc1.soltysiak.com\r
+yandex,Yandex,Yandex public DNS server,Anycast,,https://www.yandex.com,1,no,no,no,77.88.8.78:15353,2.dnscrypt-cert.browser.yandex.net,D384:C071:C9F7:4662:AF2A:CCD5:7B5D:CC97:14D4:07B6:AD36:01E1:AEDC:06D5:6D49:6327,\r
+++ /dev/null
-#
-# 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:=emailrelay
-PKG_VERSION:=1.9
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-src.tar.gz
-PKG_SOURCE_URL:=@SF/emailrelay/$(PKG_VERSION)
-PKG_MD5SUM:=0892fbf993407c6b5a16f96e23299b62
-
-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/emailrelay/Default
- SECTION:=net
- SUBMENU:=Web Servers/Proxies
- CATEGORY:=Network
- DEPENDS:=$(CXX_DEPENDS)
- TITLE:=A simple SMTP proxy and MTA
- URL:=http://emailrelay.sourceforge.net/
- MAINTAINER:=Federico Di Marco <fededim@gmail.com>
-endef
-
-
-define Package/emailrelay
-$(call Package/emailrelay/Default)
- TITLE+= (with OpenSSL support)
- DEPENDS+=+libopenssl
- VARIANT:=ssl
-endef
-
-define Package/emailrelay-nossl
-$(call Package/emailrelay/Default)
- TITLE+= (no SSL support)
- VARIANT:=nossl
-endef
-
-
-
-define Package/emailrelay/Default/description
- Emailrelay is a simple SMTP proxy and store-and-forward message transfer agent (MTA).
-
- When running as a proxy all e-mail messages can be passed through
- a user-defined program, such as a spam filter, which can drop,
- re-address or edit messages as they pass through. When running
- as a store-and-forward MTA incoming messages are stored in a
- local spool directory, and then forwarded to the next SMTP
- server on request.
-endef
-
-
-define Package/emailrelay/description
-$(call Package/emailrelay/Default/description)
-
- This package is built with OpenSSL support (SSMTP is supported).
-endef
-
-define Package/emailrelay-nossl/description
-$(call Package/emailrelay/Default/description)
-
- This package is built without SSL support (no SSMTP)
-endef
-
-
-define Package/emailrelay/conffiles
-/etc/emailrelay.auth
-endef
-
-define Package/emailrelay-nossl/conffiles
-/etc/emailrelay.auth
-endef
-
-CONFIGURE_ARGS += \
- --with-pam=no
-
-CONFIGURE_VARS += \
- CXXFLAGS="$$$$CXXFLAGS -fno-rtti"
-
-ifeq ($(BUILD_VARIANT),ssl)
- CONFIGURE_ARGS += \
- --with-openssl
-endif
-
-ifeq ($(BUILD_VARIANT),nossl)
- CONFIGURE_ARGS += \
- --with-openssl=no
-endif
-
-define Package/emailrelay/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-filter-copy $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-passwd $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-poke $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/main/emailrelay-submit $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/etc
- $(INSTALL_DATA) files/$(PKG_NAME).auth $(1)/etc/
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) files/$(PKG_NAME).init $(1)/etc/init.d/$(PKG_NAME)
-endef
-
-Package/emailrelay-nossl/install = $(Package/emailrelay/install)
-
-
-$(eval $(call BuildPackage,emailrelay))
-$(eval $(call BuildPackage,emailrelay-nossl))
+++ /dev/null
-#
-# emailrelay secrets file
-#
-#see http://emailrelay.sourceforge.net/reference.html for reference
-
-#Mostly used options:
-#
-#NONE server specifies ip address range allowed to connect to emailrelay SMTP server
-#LOGIN client specifies the credentials to be used when forwarding emails to another SMTP server
-#LOGIN server specifies the credentials to be needed to authenticate with the emailrelay SMTP server
-
-#Examples:
-#
-#NONE server 192.168.1.* keyword
-#LOGIN client smtpuser@smtpserver smtppassword
-#LOGIN server user1 secret
\ No newline at end of file
+++ /dev/null
-#!/bin/sh /etc/rc.common
-#see http://emailrelay.sourceforge.net/reference.html for command line reference
-
-START=90
-
-
-start() {
- logger -t 'emailrelay' "Starting emailrelay service."
- service_start /usr/bin/emailrelay --as-server --poll 60 --forward-to smtpserver:smtpport --spool-dir /tmp --client-tls --client-auth /etc/emailrelay.auth --server-auth /etc/emailrelay.auth --log
-}
-
-stop() {
- logger -t 'emailrelay' "Stopping emailrelay service."
- service_stop /usr/bin/emailrelay
-}
mkdir -p /var/db/radacct
procd_open_instance
- procd_set_param command $PROG
+ procd_set_param command $PROG -f
+ procd_set_param env LD_LIBRARY_PATH=/usr/lib/freeradius2
[ -n "$IPADDR" ] && procd_append_param command -i $IPADDR
[ -n "$OPTIONS" ] && procd_append_param command $OPTIONS
procd_set_param respawn
mkdir -p /var/db/radacct
procd_open_instance
- procd_set_param command $PROG
+ procd_set_param command $PROG -f
+ procd_set_param env LD_LIBRARY_PATH=/usr/lib/freeradius3
[ -n "$IPADDR" ] && procd_append_param command -i $IPADDR
[ -n "$OPTIONS" ] && procd_append_param command $OPTIONS
procd_set_param respawn
PKG_NAME:=fwknop
PKG_VERSION:=2.6.9
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
if [ "$option" = "uci_enabled" ] && [ "$value" -eq 1 ] ; then
> /etc/fwknop/fwknopd.conf
> /etc/fwknop/access.conf
+ chmod 600 /etc/fwknop/fwknopd.conf
+ chmod 600 /etc/fwknop/access.conf
UCI_ENABLED=1
fi
}
#
-# Copyright (C) 2009-2015 OpenWrt.org
+# Copyright (C) 2009-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=git
-PKG_VERSION:=2.8.2
+PKG_VERSION:=2.10.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/scm/git/
-PKG_MD5SUM:=b8edb4ae34828fda6aa2a4478089b107
+PKG_MD5SUM:=a9e1bf842497fc3a23e86424018b3499
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
CATEGORY:=Network
SUBMENU:=Version Control Systems
DEPENDS:=+libopenssl +libpthread +librt +zlib
- TITLE:=The fast version control system
URL:=http://git-scm.com
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
endef
define Package/git
$(call Package/git/Default)
- DEPENDS:=+libopenssl +libpthread +librt
TITLE:=The fast version control system
endef
define Package/git-http
$(call Package/git/Default)
- DEPENDS:=git +libcurl +ca-certificates
+ DEPENDS+=git +libcurl +ca-certificates
TITLE:=Git HTTP commands
endef
+++ /dev/null
---- a/Makefile
-+++ b/Makefile
-@@ -574,16 +574,7 @@ EXTRA_PROGRAMS =
- # ... and all the rest that could be moved out of bindir to gitexecdir
- PROGRAMS += $(EXTRA_PROGRAMS)
-
--PROGRAM_OBJS += credential-store.o
--PROGRAM_OBJS += daemon.o
--PROGRAM_OBJS += fast-import.o
- PROGRAM_OBJS += http-backend.o
--PROGRAM_OBJS += imap-send.o
--PROGRAM_OBJS += sh-i18n--envsubst.o
--PROGRAM_OBJS += shell.o
--PROGRAM_OBJS += show-index.o
--PROGRAM_OBJS += upload-pack.o
--PROGRAM_OBJS += remote-testsvn.o
-
- # Binary suffix, set to .exe for Windows builds
- X =
-@@ -945,6 +936,11 @@ BUILTIN_OBJS += builtin/verify-pack.o
- BUILTIN_OBJS += builtin/verify-tag.o
- BUILTIN_OBJS += builtin/worktree.o
- BUILTIN_OBJS += builtin/write-tree.o
-+BUILTIN_OBJS += builtin/daemon.o
-+BUILTIN_OBJS += builtin/fast-import.o
-+BUILTIN_OBJS += builtin/imap-send.o
-+BUILTIN_OBJS += builtin/shell.o
-+BUILTIN_OBJS += builtin/upload-pack.o
-
- GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
- EXTLIBS =
-@@ -1128,7 +1124,7 @@ endif
- EXTLIBS += -lz
-
- ifndef NO_OPENSSL
-- OPENSSL_LIBSSL = -lssl
-+ EXTLIBS += -lssl
- ifdef OPENSSLDIR
- BASIC_CFLAGS += -I$(OPENSSLDIR)/include
- OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
-@@ -2006,10 +2002,6 @@ endif
- git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
-
--git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
-- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
-- $(LIBS) $(IMAP_SEND_LDFLAGS)
--
- git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
- $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
- $(CURL_LIBCURL) $(LIBS)
-@@ -2332,10 +2324,11 @@ endif
- bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
- execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
- { test "$$bindir/" = "$$execdir/" || \
-- for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
-+ for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
- $(RM) "$$execdir/$$p" && \
- test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
- ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
-+ ln -s git "$$execdir/$$p" 2>/dev/null || \
- cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
- done; \
- } && \
---- a/builtin.h
-+++ b/builtin.h
-@@ -142,5 +142,10 @@ extern int cmd_verify_pack(int argc, con
- extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
- extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
- extern int cmd_replace(int argc, const char **argv, const char *prefix);
-+extern int cmd_daemon(int argc, char **argv, const char *prefix);
-+extern int cmd_fast_import(int argc, char **argv, const char *prefix);
-+extern int cmd_imap_send(int argc, char **argv, const char *prefix);
-+extern int cmd_shell(int argc, char **argv, const char *prefix);
-+extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
-
- #endif
---- /dev/null
-+++ b/builtin/daemon.c
-@@ -0,0 +1 @@
-+#include "../daemon.c"
---- /dev/null
-+++ b/builtin/fast-import.c
-@@ -0,0 +1 @@
-+#include "../fast-import.c"
---- /dev/null
-+++ b/builtin/imap-send.c
-@@ -0,0 +1 @@
-+#include "../imap-send.c"
---- /dev/null
-+++ b/builtin/shell.c
-@@ -0,0 +1 @@
-+#include "../shell.c"
---- /dev/null
-+++ b/builtin/upload-pack.c
-@@ -0,0 +1 @@
-+#include "../upload-pack.c"
---- a/daemon.c
-+++ b/daemon.c
-@@ -1178,7 +1178,7 @@ static int serve(struct string_list *lis
- return service_loop(&socklist);
- }
-
--int main(int argc, char **argv)
-+int cmd_daemon(int argc, char **argv, const char *prefix)
- {
- int listen_port = 0;
- struct string_list listen_addr = STRING_LIST_INIT_NODUP;
-@@ -1374,6 +1374,7 @@ int main(int argc, char **argv)
- write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
-
- /* prepare argv for serving-processes */
-+ argv_array_push(&cld_argv, "git"); /* git-daemon */
- argv_array_push(&cld_argv, argv[0]); /* git-daemon */
- argv_array_push(&cld_argv, "--serve");
- for (i = 1; i < argc; ++i)
---- a/fast-import.c
-+++ b/fast-import.c
-@@ -3381,7 +3381,7 @@ static void parse_argv(void)
- read_marks();
- }
-
--int main(int argc, char **argv)
-+int cmd_fast_import(int argc, char **argv, const char *prefix)
- {
- unsigned int i;
-
---- a/git.c
-+++ b/git.c
-@@ -313,11 +313,11 @@ static int handle_alias(int *argcp, cons
-
- struct cmd_struct {
- const char *cmd;
-- int (*fn)(int, const char **, const char *);
-+ int (*fn)(int, char **, const char *);
- int option;
- };
-
--static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
-+static int run_builtin(struct cmd_struct *p, int argc, char **argv)
- {
- int status, help;
- struct stat st;
-@@ -398,6 +398,7 @@ static struct cmd_struct commands[] = {
- { "config", cmd_config, RUN_SETUP_GENTLY },
- { "count-objects", cmd_count_objects, RUN_SETUP },
- { "credential", cmd_credential, RUN_SETUP_GENTLY },
-+ { "daemon", cmd_daemon },
- { "describe", cmd_describe, RUN_SETUP },
- { "diff", cmd_diff },
- { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
-@@ -416,6 +417,7 @@ static struct cmd_struct commands[] = {
- { "grep", cmd_grep, RUN_SETUP_GENTLY },
- { "hash-object", cmd_hash_object },
- { "help", cmd_help },
-+ { "imap-send", cmd_imap_send },
- { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
- { "init", cmd_init_db },
- { "init-db", cmd_init_db },
-@@ -465,6 +467,7 @@ static struct cmd_struct commands[] = {
- { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
- { "rm", cmd_rm, RUN_SETUP },
- { "send-pack", cmd_send_pack, RUN_SETUP },
-+ { "shell", cmd_shell },
- { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
- { "show", cmd_show, RUN_SETUP },
- { "show-branch", cmd_show_branch, RUN_SETUP },
-@@ -482,6 +485,7 @@ static struct cmd_struct commands[] = {
- { "update-server-info", cmd_update_server_info, RUN_SETUP },
- { "upload-archive", cmd_upload_archive },
- { "upload-archive--writer", cmd_upload_archive_writer },
-+ { "upload-pack", cmd_upload_pack },
- { "var", cmd_var, RUN_SETUP_GENTLY },
- { "verify-commit", cmd_verify_commit, RUN_SETUP },
- { "verify-pack", cmd_verify_pack },
---- a/imap-send.c
-+++ b/imap-send.c
-@@ -1494,7 +1494,7 @@ static int curl_append_msgs_to_imap(stru
- }
- #endif
-
--int main(int argc, char **argv)
-+int cmd_imap_send(int argc, char **argv, const char *prefix)
- {
- struct strbuf all_msgs = STRBUF_INIT;
- int total;
---- a/shell.c
-+++ b/shell.c
-@@ -138,7 +138,7 @@ static struct commands {
- { NULL },
- };
-
--int main(int argc, char **argv)
-+int cmd_shell(int argc, char **argv, const char *prefix)
- {
- char *prog;
- const char **user_argv;
---- a/upload-pack.c
-+++ b/upload-pack.c
-@@ -817,7 +817,7 @@ static int upload_pack_config(const char
- return parse_hide_refs_config(var, value, "uploadpack");
- }
-
--int main(int argc, char **argv)
-+int cmd_upload_pack(int argc, char **argv, const char *prefix)
- {
- char *dir;
- int i;
--- a/Makefile
+++ b/Makefile
-@@ -1096,7 +1096,7 @@ else
+@@ -1117,7 +1117,7 @@ else
endif
curl_check := $(shell (echo 072200; $(CURL_CONFIG) --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "072200"
include $(TOPDIR)/rules.mk
PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=37547
+PKG_SOURCE_VERSION:=38231
PKG_VERSION:=0.10.1-svn$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
# ToDo:
-# - break-out {peer,name,data}store for each backend
# - package testing stuff
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
DEPENDS:=gnunet $(DEPENDS_$(1))
$(if $(3),DEFAULT:=y if PACKAGE_gnunet)
$(if $(USERID_$(1)),USERID:=$(USERID_$(1)))
+ $(if $(CONFLICTS_$(1)),CONFLICTS:=$(CONFLICTS_$(1)))
endef
define Package/gnunet-$(1)/install
done )
( for lib in arm ats block cadet core datacache dht \
- dns dnsparser dnsstub fragmentation friends hello identity nat nse \
+ dns dnsparser fragmentation friends hello identity nat nse \
peerinfo regexblock regex revocation scalarproduct set \
statistics transport util; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
done )
- ( for plug in ats_proportional block_dht block_regex datacache_heap \
+ ( for plug in ats_proportional block_dht block_regex \
transport_tcp transport_udp transport_unix; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libgnunet_plugin_$$$$plug*.so $(1)/usr/lib/gnunet ; \
done )
$(INSTALL_BIN) ./files/gnunet-proto.sh $(1)/lib/netifd/proto/gnunet.sh
endef
-define Package/gnunet/conffiles
-/etc/config/gnunet
-endef
-
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/gnunet $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{la,so}* $(1)/usr/lib/
CONF_dv:=dv
DEPENDS_fs:=+gnunet-datastore +gnunet-peerstore +libextractor
-BIN_fs:=auto-share directory download download-manager.scm fs publish unindex search
+BIN_fs:=auto-share directory download fs publish unindex search
LIB_fs:=fs
PLUGIN_fs:=block_fs
LIBEXEC_fs:=helper-fs-publish service-fs
DEPENDS_gns-proxy:=+gnunet-gns +libgnurl +libmicrohttpd
LIBEXEC_gns-proxy:=gns-proxy
-DEPENDS_datastore:=+gnunet-gns +libsqlite3
+DEPENDS_datastore:=+gnunet-gns
BIN_datastore:=datastore
LIB_datastore:=datastore
-PLUGIN_datastore:=datastore_heap
-LIBEXEC_datastore:=daemon-latency-logger service-datastore
+LIBEXEC_datastore:=service-datastore
CONF_datastore:=datastore
BIN_peerstore:=peerstore
LIBEXEC_peerstore:=service-peerstore
CONF_peerstore:=peerstore
-DEPENDS_flat:=+gnunet-gns
-PLUGIN_flat:=namecache_flat namestore_flat
-
-DEPENDS_mysql:=+gnunet-gns +gnunet-datastore +gnunet-social +libmysqlclient
-LIB_mysql:=mysql my
-PLUGIN_mysql:=datastore_mysql psycstore_mysql
-
-DEPENDS_pgsql:=+gnunet-gns +gnunet-datastore +libpq
-LIB_pgsql:=postgres pq
-PLUGIN_pgsql:=datacache_postgres datastore_postgres namecache_postgres namestore_postgres
-
DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd +jansson
LIB_rest:=rest json jsonapi jsonapiutils
PLUGIN_rest:=rest_gns rest_identity rest_identity_provider rest_namestore
LIBEXEC_rps:=service-rps
CONF_rps:=rps
-DEPENDS_social:=+gnunet-sqlite +libmicrohttpd +jansson
+DEPENDS_social:=+gnunet-gns +libmicrohttpd +jansson
BIN_social:=identity-token multicast social
LIB_social:=consensus identityprovider multicast psyc psycstore psycutil secretsharing social
-PLUGIN_social:=psycstore_sqlite
LIBEXEC_social:=service-consensus service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-secretsharing service-social
CONF_social:=consensus multicast psyc psycstore secretsharing social
-DEPENDS_sqlite:=+gnunet-gns +gnunet-datastore +gnunet-peerstore +libsqlite3
-PLUGIN_sqlite:=datacache_sqlite datastore_sqlite namecache_sqlite namestore_sqlite peerstore_sqlite
+PLUGIN_dhtcache-heap:=datacache_heap
+CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
+
+DEPENDS_gns-flat:=+gnunet-gns
+PLUGIN_gns-flat:=namecache_flat namestore_flat
+
+DEPENDS_peerstore-flat:=+gnunet-peerstore
+PLUGIN_peerstore-flat:=peerstore_flat
+
+DEPENDS_fs-heap:=+gnunet-datastore
+PLUGIN_fs-heap:=datastore_heap
+CONFLICTS_fs-heap:=gnunet-fs-mysql gnunet-fs-pgsql gnunet-fs-sqlite
+
+DEPENDS_mysql:=+libmysqlclient
+LIB_mysql:=mysql my
+
+DEPENDS_social-mysql:=+gnunet-mysql +gnunet-social
+PLUGIN_social-mysql:=psycstore_mysql
+CONFLICTS_social-mysql:=gnunet-social-sqlite
+
+DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
+PLUGIN_fs-mysql:=datastore_mysql
+CONFLICTS_fs-mysql:=gnunet-fs-pgsql gnunet-fs-sqlite
+
+DEPENDS_pgsql:=+libpq
+LIB_pgsql:=postgres pq
+
+DEPENDS_dhtcache-pgsql:=+gnunet-pgsql
+PLUGIN_dhtcache-pgsql:=datacache_postgres
+CONFLICTS_dhtcache-pgsql:=gnunet-dhtcache-sqlite
+
+DEPENDS_fs-pgsql:=+gnunet-pgsql +gnunet-datastore
+PLUGIN_fs-pgsql:=datastore_postgres
+CONFLICTS_fs-pgsql:=gnunet-fs-sqlite
+
+DEPENDS_gns-pgsql:=+gnunet-pgsql +gnunet-gns
+PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
+CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
+
+DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
+PLUGIN_social-pgsql:=psycstore_postgres
+CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
+
+DEPENDS_sqlite:=+libsqlite3
+
+DEPENDS_gns-sqlite:=+gnunet-sqlite +gnunet-gns
+PLUGIN_gns-sqlite:=namecache_sqlite namestore_sqlite
+CONFLICTS_gns-sqlite:=gnunet-gns-flat
+
+DEPENDS_peerstore-sqlite:=+gnunet-sqlite +gnunet-peerstore
+PLUGIN_peerstore-sqlite:=peerstore_sqlite
+CONFLICTS_peerstore-sqlite:=gnunet-peerstore-flat
+
+DEPENDS_dhtcache-sqlite:=+gnunet-sqlite
+PLUGIN_dhtcache-sqlite:=datacache_sqlite
+
+DEPENDS_fs-sqlite:=+gnunet-sqlite +gnunet-datastore
+PLUGIN_fs-sqlite:=datastore_sqlite
+LIBEXEC_fs-sqlite:=daemon-latency-logger
+
+DEPENDS_social-sqlite:=+gnunet-sqlite +gnunet-social
+PLUGIN_social-sqlite:=psycstore_sqlite
DEPENDS_transport-bluetooth:=+bluez-libs
PLUGIN_transport-bluetooth:=transport_bluetooth
DEPENDS_vpn:=+kmod-tun +iptables +firewall
BIN_vpn:=vpn
-LIB_vpn:=tun vpn
+LIB_vpn:=dnsstub tun vpn
LIBEXEC_vpn:=daemon-exit daemon-pt helper-exit helper-vpn service-vpn
CONF_vpn:=exit pt vpn
define PostInstFixSUIDPerms
define Package/$(1)/postinst
#!/bin/sh
-[ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix
+[ -z "$IPKG_INSTROOT" ] || exit 0
+[ -e /usr/share/gnunet/.permfix ] && rm /usr/share/gnunet/.permfix || exit 0
endef
endef
$(eval $(call BuildPackage,gnunet))
$(eval $(call BuildComponent,conversation,conversation component,))
$(eval $(call BuildComponent,datastore,data storage components,))
-$(eval $(call BuildComponent,dv,distance-vector routing component,))
+$(eval $(call BuildComponent,dv,distance-vector routing component,y))
$(eval $(call BuildComponent,experiments,experimental components,))
-$(eval $(call BuildComponent,flat,flat storage backends,))
$(eval $(call BuildComponent,fs,file-sharing components,))
$(eval $(call BuildComponent,gns,name resolution components,y))
$(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
-$(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,))
-$(eval $(call BuildComponent,mysql,mySQL datastore backend,))
-$(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
-$(eval $(call BuildComponent,pgsql,PostgreSQL storage backends,))
+$(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
$(eval $(call BuildComponent,peerstore,peerstore local persistency component,))
$(eval $(call BuildComponent,rest,REST interface,))
-$(eval $(call BuildComponent,rps,RPS routing component,))
+$(eval $(call BuildComponent,rps,RPS routing component,y))
$(eval $(call BuildComponent,social,social components,))
-$(eval $(call BuildComponent,sqlite,libsqlite3 storage backends,y))
+$(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
+$(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
+$(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
+$(eval $(call BuildComponent,gns-flat,flat storage GNS plugins,y))
+$(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
+$(eval $(call BuildComponent,mysql,mySQL datastore backend,))
+$(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
+$(eval $(call BuildComponent,social-mysql,mySQL social plugins,))
+$(eval $(call BuildComponent,pgsql,PostgreSQL storage backends,))
+$(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
+$(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
+$(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
+$(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,))
+$(eval $(call BuildComponent,sqlite,libsqlite3 storage backends,))
+$(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
+$(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
+$(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
+$(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
+$(eval $(call BuildComponent,social-sqlite,libsqlite3 social plugins,))
$(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
$(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
$(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
-$(eval $(call BuildComponent,transport-wlan,WLAN transport,))
+$(eval $(call BuildComponent,transport-wlan,WLAN transport,y))
$(eval $(call BuildComponent,utils,administration utililties,))
$(eval $(call BuildComponent,vpn,vpn components,y))
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.dhtcache || uci set gnunet.dhtcache=gnunet-config
+
+uci -q batch <<EOF
+ set gnunet.dhtcache.DATABASE=heap
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.dhtcache || uci set gnunet.dhtcache=gnunet-config
+
+uci -q batch <<EOF
+ set gnunet.dhtcache.DATABASE=postgres
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.dhtcache || uci set gnunet.dhtcache=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.datacache_sqlite
+ set gnunet.datacache_sqlite=gnunet-config
+ set gnunet.datacache_sqlite.FILENAME=/var/run/gnunet/datacache.sqlite
+ set gnunet.dhtcache.DATABASE=sqlite
+ commit gnunet
+EOF
+++ /dev/null
-#!/bin/sh
-
-uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config
-uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
-
-uci -q batch <<EOF
- del gnunet.namestore_flat
- set gnunet.namestore_flat=gnunet-config
- set gnunet.namestore_flat.FILENAME=/etc/gnunet/namestore.flat
- set gnunet.namestore.DATABASE=flat
- set gnunet.namecache.DATABASE=flat
- commit gnunet
-EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.datastore || uci set gnunet.datastore=gnunet-config
+
+uci -q batch <<EOF
+ set gnunet.datastore.DATABASE=heap
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.datastore || uci set gnunet.datastore=gnunet-config
+
+uci -q batch <<EOF
+ set gnunet.datastore.DATABASE=postgres
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.datastore || uci set gnunet.datastore=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.datastore_sqlite
+ set gnunet.datastore_sqlite=gnunet-config
+ set gnunet.datastore_sqlite.FILENAME=/etc/gnunet/datastore.sqlite
+ set gnunet.datastore.DATABASE=sqlite
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config
+uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.namestore_flat
+ set gnunet.namestore_flat=gnunet-config
+ set gnunet.namestore_flat.FILENAME=/etc/gnunet/namestore.flat
+ set gnunet.namestore.DATABASE=flat
+ del gnunet.namecache_flat
+ set gnunet.namecache_flat=gnunet-config
+ set gnunet.namecache_flat.FILENAME=/var/run/gnunet/namecache.flat
+ set gnunet.namecache.DATABASE=flat
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config
+uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
+
+uci -q batch <<EOF
+ set gnunet.namestore.DATABASE=postgres
+ set gnunet.namecache.DATABASE=postgres
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config
+uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.namestore_sqlite
+ set gnunet.namestore_sqlite=gnunet-config
+ set gnunet.namestore_sqlite.FILENAME=/etc/gnunet/namestore.sqlite
+ set gnunet.namestore.DATABASE=sqlite
+ del gnunet.namecache_sqlite
+ set gnunet.namecache_sqlite=gnunet-config
+ set gnunet.namecache_sqlite.FILENAME=/var/run/gnunet/namecache.sqlite
+ set gnunet.namecache.DATABASE=sqlite
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.peerstore || uci set gnunet.peerstore=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.peerstore_flat
+ set gnunet.peerstore_flat=gnunet-config
+ set gnunet.peerstore_flat.FILENAME=/etc/gnunet/peerstore.flat
+ set gnunet.peerstore.DATABASE=flat
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.peerstore || uci set gnunet.peerstore=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.peerstore_sqlite
+ set gnunet.peerstore_sqlite=gnunet-config
+ set gnunet.peerstore_sqlite.FILENAME=/etc/gnunet/peerstore.sqlite
+ set gnunet.peerstore.DATABASE=sqlite
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q batch <<EOF
+ del postgresql.gnunet
+ set postgresql.gnunet=postgres-db
+ set postgresql.gnunet.name=gnunet
+ set postgresql.gnunet.user=gnunet
+ commit postgresql
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.psycstore || uci set gnunet.psycstore=gnunet-config
+
+uci -q batch <<EOF
+ set gnunet.psycstore.DATABASE=postgres
+ commit gnunet
+EOF
--- /dev/null
+#!/bin/sh
+
+uci -q get gnunet.psycstore || uci set gnunet.psycstore=gnunet-config
+
+uci -q batch <<EOF
+ del gnunet.psycstore_sqlite
+ set gnunet.psycstore_sqlite=gnunet-config
+ set gnunet.psycstore_sqlite.FILENAME=/etc/gnunet/psycstore.sqlite
+ set gnunet.psycstore.DATABASE=sqlite
+ commit gnunet
+EOF
+++ /dev/null
-#!/bin/sh
-
-uci -q get gnunet.namestore || uci set gnunet.namestore=gnunet-config
-uci -q get gnunet.namecache || uci set gnunet.namecache=gnunet-config
-
-uci -q batch <<EOF
- del gnunet.namestore_sqlite
- set gnunet.namestore_sqlite=gnunet-config
- set gnunet.namestore_sqlite.FILENAME=/etc/gnunet/namestore.sqlite
- set gnunet.namestore.DATABASE=sqlite
- set gnunet.namecache.DATABASE=sqlite
- del gnunet.peerstore_sqlite
- set gnunet.peerstore_sqlite=gnunet-config
- set gnunet.peerstore_sqlite.FILENAME=/etc/gnunet/peerstore.sqlite
- commit gnunet
-EOF
touch /etc/config/gnunet
uci batch <<EOF
-set gnunet.datastore=gnunet-config
-set gnunet.datastore.DATABASE=heap
-set gnunet.datastore.QUOTA="4 MB"
-
-set gnunet.fs=gnunet-config
-set gnunet.fs.CONTENT_PUSHING=NO
-set gnunet.fs.CONTENT_CACHING=NO
-
-set gnunet.dhtcache=gnunet-config
-set gnunet.dhtcache.QUOTA="4 MB"
-
-set gnunet.dns2gns=gnunet-config
-set gnunet.dns2gns.AUTOSTART=YES
-set gnunet.dns2gns.FORCESTART=YES
-
-set gnunet.pt=gnunet-config
-set gnunet.pt.FORCESTART=YES
-
-set gnunet.exit=gnunet-config
-set gnunet.exit.AUTOSTART=YES
-set gnunet.exit.FORCESTART=YES
-
set gnunet.nse=gnunet-config
set gnunet.nse.WORKDELAY='500 ms'
#!/bin/sh /etc/rc.common
# Copyright (C) 2015 OpenWrt.org
-START=50
-STOP=10
+START=90
USE_PROCD=1
PROG=/usr/lib/gnunet/libexec/gnunet-service-arm
include $(TOPDIR)/rules.mk
PKG_NAME:=https_dns_proxy
-PKG_VERSION:=2016-06-19
+PKG_VERSION:=2016-09-04
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_VERSION:=d50f78c7c2e9d7016ad5297e4cb0ab9e7d223a0d
+PKG_SOURCE_VERSION:=9e617b76bfd97adfff23e0e8bf2862ce4aee8682
PKG_MAINTAINER:=Aaron Drew <aarond10@gmail.com>
PKG_LICENSE:=MIT
include $(TOPDIR)/rules.mk
PKG_NAME:=irssi
-PKG_VERSION:=0.8.17
+PKG_VERSION:=0.8.20
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://irssi.org/files/
-PKG_MD5SUM:=ecf64be47978d89a742b435a81cb47db
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/irssi/irssi/releases/download/0.8.20/
+PKG_MD5SUM:=67d48c5feec2d3b949d088aa4abc3601
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
--with-perl=no \
--with-glib-prefix="$(STAGING_DIR)/usr" \
--with-textui \
- --without-terminfo \
--without-bot \
--disable-proxy
#
-# Copyright (C) 2006-2014 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=kismet
-PKG_VERSION:=2013-03-R1b
+PKG_VERSION:=2016-07-R1
PKG_RELEASE:=1
PKG_LICENSE:=LGPLv2.1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.kismetwireless.net/code
-PKG_MD5SUM:=6cdcd78baf2e15edbe8a9de3c5493f02
+PKG_MD5SUM:=7fa6e86c5078a0e7d91fc9bf954c5107
PKG_BUILD_DEPENDS:=libpcap libncurses libpcre
SECTION:=net
CATEGORY:=Network
TITLE:=Kismet
- MAINTAINER:=Sebastian Wendel <packages@sourceindex.de>
+ MAINTAINER:=Jean-Michel lacroix <lacroix@lepine-lacroix.info>
DEPENDS:= $(CXX_DEPENDS) +libnl
URL:=http://www.kismetwireless.net/
SUBMENU:=wireless
--- a/configure
+++ b/configure
-@@ -5456,9 +5456,6 @@ fi
+@@ -5981,9 +5981,6 @@ fi
#include "ipc_remote.h"
#ifndef SYS_CYGWIN
+--- a/ifcontrol.h
++++ b/ifcontrol.h
+@@ -39,7 +39,6 @@
+ #include <net/if_arp.h>
+ #include <sys/ioctl.h>
+ #include <netinet/in.h>
+-#include <netinet/if_ether.h>
+ #include <arpa/inet.h>
+ #endif
+
include $(TOPDIR)/rules.mk
PKG_NAME:=knot
-PKG_VERSION:=2.2.1
+PKG_VERSION:=2.3.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://secure.nic.cz/files/knot-dns/
-PKG_MD5SUM:=d573ecadedf4f15ec1f02671443520cb
+PKG_MD5SUM:=7ca754f972fb07faa4f30e50d8a4385b
PKG_MAINTAINER:=Daniel Salzman <daniel.salzman@nic.cz>
PKG_LICENSE:=GPL-3.0 LGPL-2.0 0BSD MIT OLDAP-2.8
DEPENDS=+knot-libdnssec
endef
+define Package/knot-zonecheck
+ $(call Package/knot/Default)
+ TITLE+= zonefile check utility
+ DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
+endef
+
define Package/knot-keymgr
$(call Package/knot/Default)
TITLE+= DNSSEC key management utility
- DEPENDS=+knot-libdnssec +knot-libzscanner
+ DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
endef
define Package/knot-tests
$(call Package/knot/Default)
TITLE+= tests
- DEPENDS=+liburcu +knot-libdnssec +knot-libknot +knot-libzscanner
+ DEPENDS=+liburcu +libedit +knot-libdnssec +knot-libknot +knot-libzscanner
endef
define Package/knot-libdnssec/description
Knot DNS simple NSEC3 hash utility.
endef
+define Package/knot-zonecheck/description
+ Knot DNS zonefile check utility.
+endef
+
define Package/knot-keymgr/description
Knot DNS DNSSEC key management utility.
endef
endef
define Package/knot/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotc $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/knotd $(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/knot
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/knsec3hash $(1)/usr/bin/
endef
+define Package/knot-zonecheck/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kzonecheck $(1)/usr/bin/
+endef
+
define Package/knot-keymgr/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/keymgr $(1)/usr/bin/
endef
define Package/knot-tests/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/libtap/tap/libtap.sh $(1)/usr/share/knot/tap/
$(INSTALL_DIR) $(1)/usr/share/knot/tests
+ find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
+ xargs -I{} basename {} | \
+ xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
+ $(INSTALL_DIR) $(1)/usr/share/knot/tests/dnssec
find $(PKG_BUILD_DIR)/src/dnssec/tests -maxdepth 1 -executable -type f | \
xargs -I{} basename {} | \
- xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec_test_{}
+ xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/src/dnssec/tests/{} $(1)/usr/share/knot/tests/dnssec/test_{}
- find $(PKG_BUILD_DIR)/tests/.libs -maxdepth 1 -executable -type f | \
+ $(INSTALL_DIR) $(1)/usr/share/knot/tests/contrib
+ find $(PKG_BUILD_DIR)/tests/contrib/.libs -maxdepth 1 -executable -type f | \
xargs -I{} basename {} | \
- xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/.libs/{} $(1)/usr/share/knot/tests/test_{}
+ xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/contrib/.libs/{} $(1)/usr/share/knot/tests/contrib/{}
+
+ $(INSTALL_DIR) $(1)/usr/share/knot/tests/libknot
+ find $(PKG_BUILD_DIR)/tests/libknot/.libs -maxdepth 1 -executable -type f | \
+ xargs -I{} basename {} | \
+ xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/libknot/.libs/{} $(1)/usr/share/knot/tests/libknot/{}
+ $(INSTALL_DIR) $(1)/usr/share/knot/tests/modules
find $(PKG_BUILD_DIR)/tests/modules/.libs -maxdepth 1 -executable -type f | \
xargs -I{} basename {} | \
- xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/test_module_{}
+ xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/modules/.libs/{} $(1)/usr/share/knot/tests/modules/test_{}
+
+ $(INSTALL_DIR) $(1)/usr/share/knot/tests/utils
+ find $(PKG_BUILD_DIR)/tests/utils/.libs -maxdepth 1 -executable -type f | \
+ xargs -I{} basename {} | \
+ xargs -I{} $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/tests/utils/.libs/{} $(1)/usr/share/knot/tests/utils/{}
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/.libs/zscanner-tool $(1)/usr/share/knot/tests/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/zscanner/tests/unittests $(1)/usr/share/knot/tests/test_zscanner
$(eval $(call BuildPackage,knot-host))
$(eval $(call BuildPackage,knot-nsupdate))
$(eval $(call BuildPackage,knot-nsec3hash))
+$(eval $(call BuildPackage,knot-zonecheck))
$(eval $(call BuildPackage,knot-keymgr))
$(eval $(call BuildPackage,knot-tests))
#!/bin/sh
cd `dirname "$0"`/tests
-../tap/runtests -b /tmp ./dnssec_test_* ./test_*
+../tap/runtests -b /tmp ./contrib/test_* ./dnssec/test_* ./libknot/test_* ./modules/test_* ./utils/test_* ./test_*
ret=$?
cd -
--- /dev/null
+From 84849be189c49ef9556bd84d5e5103317372e8a7 Mon Sep 17 00:00:00 2001
+From: Karel Slany <karel.slany@nic.cz>
+Date: Thu, 11 Aug 2016 11:39:39 +0200
+Subject: [PATCH] Added conversion to wire format when writing FNV64 hash
+ values.
+
+Test on big-endian machines have been failing.
+---
+ src/libknot/cookies/alg-fnv64.c | 6 +++---
+ tests/libknot/test_cookies-client.c | 20 ++++++++++----------
+ tests/libknot/test_cookies-server.c | 20 ++++++++++----------
+ 3 files changed, 23 insertions(+), 23 deletions(-)
+
+diff --git a/src/libknot/cookies/alg-fnv64.c b/src/libknot/cookies/alg-fnv64.c
+index 9989a4f..5e263c1 100644
+--- a/src/libknot/cookies/alg-fnv64.c
++++ b/src/libknot/cookies/alg-fnv64.c
+@@ -17,10 +17,10 @@
+ #include <assert.h>
+ #include <stdint.h>
+ #include <stdlib.h>
+-#include <string.h>
+
+ #include "contrib/fnv/fnv.h"
+ #include "contrib/sockaddr.h"
++#include "contrib/wire.h"
+ #include "libknot/attribute.h"
+ #include "libknot/cookies/alg-fnv64.h"
+ #include "libknot/rrtype/opt-cookie.h"
+@@ -80,7 +80,7 @@ static uint16_t cc_gen_fnv64(const struct knot_cc_input *input,
+ assert(KNOT_OPT_COOKIE_CLNT == sizeof(hash_val));
+
+ cc_len = sizeof(hash_val);
+- memcpy(cc_out, &hash_val, cc_len);
++ wire_write_u64(cc_out, hash_val);
+
+ return cc_len;
+ }
+@@ -127,7 +127,7 @@ static uint16_t sc_gen_fnv64(const struct knot_sc_input *input,
+ assert(SRVR_FNV64_HASH_SIZE == sizeof(hash_val));
+
+ hash_len = sizeof(hash_val);
+- memcpy(hash_out, &hash_val, hash_len);
++ wire_write_u64(hash_out, hash_val);
+
+ return hash_len;
+ }
+diff --git a/tests/libknot/test_cookies-client.c b/tests/libknot/test_cookies-client.c
+index 44be903..712dbba 100644
+--- a/tests/libknot/test_cookies-client.c
++++ b/tests/libknot/test_cookies-client.c
+@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
+ ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
+ {
+- uint8_t expected[] = { 0x74, 0x31, 0xf9, 0xa8, 0x03, 0xef, 0x15, 0xb1 };
++ uint8_t expected[] = { 0xb1, 0x15, 0xef, 0x03, 0xa8, 0xf9, 0x31, 0x74 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
+ }
+
+@@ -123,7 +123,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
+ ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
+ {
+- uint8_t expected[] = { 0x7c, 0x62, 0x25, 0xd2, 0x43, 0xdd, 0x09, 0xe7 };
++ uint8_t expected[] = { 0xe7, 0x09, 0xdd, 0x43, 0xd2, 0x25, 0x62, 0x7c };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
+ }
+
+@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
+ ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
+ {
+- uint8_t expected[] = { 0x7c, 0x62, 0x25, 0xd2, 0x43, 0xdd, 0x09, 0xe7 };
++ uint8_t expected[] = { 0xe7, 0x09, 0xdd, 0x43, 0xd2, 0x25, 0x62, 0x7c };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
+ }
+
+@@ -149,7 +149,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
+ ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
+ {
+- uint8_t expected[] = { 0x05, 0xa9, 0xd1, 0x08, 0x1b, 0x98, 0xe0, 0xaa };
++ uint8_t expected[] = { 0xaa, 0xe0, 0x98, 0x1b, 0x08, 0xd1, 0xa9, 0x05 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
+ }
+
+@@ -162,7 +162,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_cc_alg_fnv64.gen_func(&cc_in, hash, hash_len);
+ ok(hash_len != 0 && hash_len == knot_cc_alg_fnv64.cc_size, "cookies: FNV64 client cookie output");
+ {
+- uint8_t expected[] = { 0x05, 0xa9, 0xd1, 0x08, 0x1b, 0x98, 0xe0, 0xaa };
++ uint8_t expected[] = { 0xaa, 0xe0, 0x98, 0x1b, 0x08, 0xd1, 0xa9, 0x05 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 client cookie content");
+ }
+
+@@ -179,7 +179,7 @@ int main(int argc, char *argv[])
+ }
+
+ {
+- uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
++ uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
+ ret = knot_cc_check(cookie, sizeof(cookie), NULL, &knot_cc_alg_fnv64);
+ ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check no input");
+ }
+@@ -190,7 +190,7 @@ int main(int argc, char *argv[])
+ cc_in.secret_data = secret;
+ cc_in.secret_len = sizeof(secret);
+ {
+- uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
++ uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
+ ret = knot_cc_check(cookie, sizeof(cookie), &cc_in, NULL);
+ ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check no algorithm");
+ }
+@@ -201,7 +201,7 @@ int main(int argc, char *argv[])
+ cc_in.secret_data = secret;
+ cc_in.secret_len = sizeof(secret);
+ {
+- uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
++ uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
+ ret = knot_cc_check(cookie, sizeof(cookie), &cc_in, &knot_cc_alg_fnv64);
+ ok(ret == KNOT_EOK, "cookies: FNV64 client good cookie check");
+ }
+@@ -212,7 +212,7 @@ int main(int argc, char *argv[])
+ cc_in.secret_data = secret;
+ cc_in.secret_len = sizeof(secret);
+ {
+- uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xaf };
++ uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x33 };
+ ret = knot_cc_check(cookie, sizeof(cookie) - 1, &cc_in, &knot_cc_alg_fnv64);
+ ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check invalid length");
+ }
+@@ -223,7 +223,7 @@ int main(int argc, char *argv[])
+ cc_in.secret_data = secret;
+ cc_in.secret_len = sizeof(secret);
+ {
+- uint8_t cookie[] = { 0x33, 0x0c, 0xa6, 0x80, 0x94, 0x17, 0xe5, 0xae };
++ uint8_t cookie[] = { 0xaf, 0xe5, 0x17, 0x94, 0x80, 0xa6, 0x0c, 0x32 };
+ ret = knot_cc_check(cookie, sizeof(cookie), &cc_in, &knot_cc_alg_fnv64);
+ ok(ret == KNOT_EINVAL, "cookies: FNV64 client cookie check invalid cookie");
+ }
+diff --git a/tests/libknot/test_cookies-server.c b/tests/libknot/test_cookies-server.c
+index 32001c1..66a54ba 100644
+--- a/tests/libknot/test_cookies-server.c
++++ b/tests/libknot/test_cookies-server.c
+@@ -28,10 +28,10 @@
+ #include "libknot/rrtype/opt-cookie.h"
+
+ const char *cookie_opts[] = {
+- "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\xe0\xd9\x95\x4e\xbc\xc3\x99\x18", /* 8 octets long wrong server cookie. */
+- "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\xe0\xd9\x95\x4e\xbc\xc3\x99\x19", /* 8 octets long OK server cookie. */
+- "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\xc0\xbd\xdb\xec\x19\x78\x88\x38", /* 8B nonce 8B hash long wrong server cookie. */
+- "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\xc0\xbd\xdb\xec\x19\x78\x88\x39" /* 8B nonce 8B hash long OK server cookie. */
++ "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x19\x99\xc3\xbc\x4e\x95\xd9\xdf", /* 8 octets long wrong server cookie. */
++ "\x00\x0a" "\x00\x10" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x19\x99\xc3\xbc\x4e\x95\xd9\xe0", /* 8 octets long OK server cookie. */
++ "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x39\x88\x78\x19\xec\xdb\xbd\xbf", /* 8B nonce 8B hash long wrong server cookie. */
++ "\x00\x0a" "\x00\x18" "\x00\x01\x02\x03\x04\x05\x06\x07" "\x0a\x0b\x0c\x0d\x0e\x0f\x10\x11\x39\x88\x78\x19\xec\xdb\xbd\xc0"/* 8B nonce 8B hash long OK server cookie. */
+ };
+
+ #define ROPT(i) ((const uint8_t *)cookie_opts[(i)])
+@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
+ ok(hash_len != 0, "cookies: FNV64 server cookie output");
+ {
+- uint8_t expected[] = { 0x75, 0x45, 0x7c, 0x9a, 0xe0, 0x13, 0xa8, 0xea };
++ uint8_t expected[] = { 0xea, 0xa8, 0x13, 0xe0, 0x9a, 0x7c, 0x45, 0x75 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
+ }
+
+@@ -210,7 +210,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
+ ok(hash_len != 0, "cookies: FNV64 server cookie output");
+ {
+- uint8_t expected[] = { 0xc0, 0xbd, 0xdb, 0xec, 0x19, 0x78, 0x88, 0x39 };
++ uint8_t expected[] = { 0x39, 0x88, 0x78, 0x19, 0xec, 0xdb, 0xbd, 0xc0 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
+ }
+
+@@ -227,7 +227,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
+ ok(hash_len != 0, "cookies: FNV64 server cookie output");
+ {
+- uint8_t expected[] = { 0xe0, 0xd9, 0x95, 0x4e, 0xbc, 0xc3, 0x99, 0x19 };
++ uint8_t expected[] = { 0x19, 0x99, 0xc3, 0xbc, 0x4e, 0x95, 0xd9, 0xe0 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
+ }
+
+@@ -244,7 +244,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
+ ok(hash_len != 0, "cookies: FNV64 server cookie output");
+ {
+- uint8_t expected[] = { 0x4d, 0xde, 0xfa, 0x22, 0xb9, 0x0a, 0xcc, 0xd8 };
++ uint8_t expected[] = { 0xd8, 0xcc, 0x0a, 0xb9, 0x22, 0xfa, 0xde, 0x4d };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
+ }
+
+@@ -261,7 +261,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
+ ok(hash_len != 0, "cookies: FNV64 server cookie output");
+ {
+- uint8_t expected[] = { 0xa0, 0x35, 0xe3, 0xe0, 0x78, 0x7a, 0x91, 0xaf };
++ uint8_t expected[] = { 0xaf, 0x91, 0x7a, 0x78, 0xe0, 0xe3, 0x35, 0xa0 };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
+ }
+
+@@ -278,7 +278,7 @@ int main(int argc, char *argv[])
+ hash_len = knot_sc_alg_fnv64.hash_func(&sc_in, hash, hash_len);
+ ok(hash_len != 0, "cookies: FNV64 server cookie output");
+ {
+- uint8_t expected[] = { 0x8e, 0xa3, 0xf8, 0x97, 0x84, 0x0a, 0x3d, 0x8b };
++ uint8_t expected[] = { 0x8b, 0x3d, 0x0a, 0x84, 0x97, 0xf8, 0xa3, 0x8e };
+ ok(sizeof(expected) == hash_len && 0 == memcmp(expected, hash, hash_len), "cookies: FNV64 server cookie content");
+ }
+
+--
+2.7.4
+
include $(TOPDIR)/rules.mk
PKG_NAME:=knxd
-PKG_VERSION=2016-03-12
+PKG_VERSION=2016-10-08
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/knxd/knxd.git
-PKG_SOURCE_VERSION:=c8a4bb3b042de1fd692a93cdb7a307546f2be359
+PKG_SOURCE_VERSION:=43e90c6ee3028194c8ce6d7776e7dedbe1032dc1
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
--- /dev/null
+#
+# Copyright (C) 2009-2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=lcdringer
+PKG_VERSION:=0.0.2
+PKG_RELEASE:=1
+
+PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.flyn.org/projects/lcdringer
+PKG_MD5SUM:=ff3fe82593792c9111f957dd533369fb
+PKG_BUILD_DEPENDS:=+vala
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/lcdringer
+ SECTION:=network
+ CATEGORY:=Network
+ DEPENDS:=+libgee +libgstreamer1 +loudmouth @TARGET_brcm2708
+ TITLE:=lcdringer
+ URL:=http://www.flyn.org/projects/lcdringer/
+endef
+
+define Package/lcdringer/decription
+ A simple Jabber-initiated ringer meant to run on a Raspberry Pi with a PiFace CAD
+endef
+
+define Package/lcdringer/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/bin/lcdringer \
+ $(1)/usr/bin/
+ $(INSTALL_BIN) ./files/lcdringer.init $(1)/etc/init.d/lcdringer
+ $(INSTALL_DIR) $(1)/usr/share/lcdringer
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/share/lcdringer/* \
+ $(1)/usr/share/lcdringer
+endef
+
+$(eval $(call BuildPackage,lcdringer))
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2009-2012 OpenWrt.org
+
+START=60
+
+start() {
+ /usr/bin/lcdringer &
+ echo $! > /var/run/lcdringer.pid
+}
+
+stop() {
+ if [ ! -f /var/run/lcdringer.pid ]; then
+ return
+ fi
+ /bin/kill -9 `cat /var/run/lcdringer.pid`
+}
include $(TOPDIR)/rules.mk
PKG_NAME:=lftp
-PKG_VERSION:=4.7.1
+PKG_VERSION:=4.7.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://lftp.yar.ru/ftp \
http://lftp.yar.ru/ftp/old \
http://lftp.cybermirror.org \
http://lftp.cybermirror.org/old
-PKG_MD5SUM:=7dfb03c6544efeef633bc28ba7df8b77
+PKG_MD5SUM:=23deda16014412c802f095fbaa0bebee
SUBMENU:=File Transfer
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+libncurses +libopenssl +libreadline $(CXX_DEPENDS) +libexpat
+ DEPENDS:=+libncurses +libopenssl +libreadline $(CXX_DEPENDS) +libexpat +zlib
TITLE:=a sophisticated file transfer program with command line interface.
MAINTAINER:=Federico Di Marco <fededim@gmail.com>
URL:=http://lftp.yar.ru/
--without-libidn \
--without-libresolv \
--with-openssl="$(STAGING_DIR)/usr" \
+ --with-readline="$(STAGING_DIR)/usr" \
--with-zlib="$(STAGING_DIR)/usr" \
--disable-static
include $(TOPDIR)/rules.mk
PKG_NAME:=lighttpd
-PKG_VERSION:=1.4.38
+PKG_VERSION:=1.4.42
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
-PKG_MD5SUM:=7adc12323f37ed24ecf026c7547b577d
+PKG_MD5SUM:=53c55d7e1dac7adec161cd5490491f6d
PKG_LICENSE:=BSD-3c
PKG_LICENSE_FILES:=COPYING
#
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2015-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=linuxptp
PKG_VERSION:=20151118
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_REV:=999c86f4a9da4bf4508b3a69289f58166ed18a55
PKG_MAINTAINER:=Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
computers.
endef
+MAKE_VARS += \
+ EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)"
+
define Package/linuxptp/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hwstamp_ctl $(1)/usr/sbin/
-Index: linuxptp-20151118/raw.c
-===================================================================
---- linuxptp-20151118.orig/raw.c 2016-01-08 13:39:56.000000000 +0100
-+++ linuxptp-20151118/raw.c 2016-01-13 09:16:51.951784148 +0100
+--- a/raw.c
++++ b/raw.c
@@ -20,7 +20,6 @@
#include <fcntl.h>
#include <linux/filter.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netpacket/packet.h>
+--- a/util.h
++++ b/util.h
+@@ -20,6 +20,8 @@
+ #ifndef HAVE_UTIL_H
+ #define HAVE_UTIL_H
+
++#include <time.h>
++
+ #include "ddt.h"
+ #include "ether.h"
+
include $(TOPDIR)/rules.mk
PKG_NAME:=memcached
-PKG_VERSION:=1.4.26
+PKG_VERSION:=1.4.31
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://memcached.org/files
-PKG_MD5SUM:=59b7bbfbc9cde5731bf4446e1e37b440
-PKG_INSTALL:=1
+PKG_MD5SUM:=c19bb0e77e720f64f33ecb43de28a1b4
+
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
-PKG_LICENSE:=permissive free software license
+
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+#
+# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2016 Stijn Segers
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mii-tool
+PKG_VERSION=2016-10-06-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://git.code.sf.net/p/net-tools/code
+PKG_SOURCE_VERSION:=115f1af2494ded1fcd21c8419d5e289bc4df380f
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_MAINTAINER:=Stijn Segers <borromini.reg@protonmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mii-tool
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=configure media type using MII commands
+ URL:=http://net-tools.sourceforge.net/
+endef
+
+define Package/mii-tool/description
+ The mii-tool command allows you to set or autodetect the media type
+ or mii chipset-based ethernet devices. It traditionally had been
+ distributed in the net-tools package. This is a single distribution
+ optimized for embedded systems and fully automated cross/-sysroot-builds
+endef
+
+define Build/Configure
+ # Failed configure.sh leaves stub config.h around.
+ rm -f $(PKG_BUILD_DIR)/config.h
+ ( cd $(PKG_BUILD_DIR); yes $$$$'\n' | ./configure.sh config.in )
+endef
+
+define Package/mii-tool/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/mii-tool $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,mii-tool))
include $(TOPDIR)/rules.mk
PKG_NAME:=mosquitto
-PKG_VERSION:=1.4.9
+PKG_VERSION:=1.4.10
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.txt
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://mosquitto.org/files/source/
-PKG_MD5SUM:=67943e2c5afebf7329628616eb2c41c5
+PKG_MD5SUM:=61839b47b58c5799aab76584f13ed66f
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
append_if "$cfg" file persistence_file
config_get loc "$cfg" location
if [ -n "$loc" ]; then
- [ -d "$loc" ] || mkdir -p "$loc";
+ [ -d "$loc" ] || {
+ mkdir -p "$loc";
+ chown mosquitto "$loc";
+ }
echo "persistence_location $loc" >> $TCONF
fi
}
PKG_NAME:=mwan3
PKG_VERSION:=2.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_MAINTAINER:=Jeroen Louwes <jeroen.louwes@gmail.com>
PKG_LICENSE:=GPLv2
[ -x /usr/sbin/ip6tables ] || exit 7
[ -x /usr/bin/logger ] || exit 8
-local family gateway
-
config_get family $INTERFACE family ipv4
if [ "$family" == "ipv4" ]; then
#!/bin/sh
-local IP4 IP6 IPS IPT4 IPT6 LOG
-
IP4="/usr/bin/ip -4"
IP6="/usr/bin/ip -6"
IPS="/usr/sbin/ipset"
include $(TOPDIR)/rules.mk
PKG_NAME:=netatalk
-PKG_VERSION:=2.2.4
+PKG_VERSION:=3.1.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/netatalk
-PKG_MD5SUM:=40753a32340c24e4ec395aeb55ef056e
+PKG_MD5SUM:=2b40161985bb32cff5660bf689a4704f15c33bb87565efc7805dd5c75ad1fcc7
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
DEPENDS:=+libattr +libdb47 +libgcrypt +libopenssl $(LIBRPC_DEPENDS)
TITLE:=netatalk
URL:=http://netatalk.sourceforge.net
- MAINTAINER:=W. Michael Petullo <mike@flyn.org>
+ MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
endef
define Package/netatalk/decription
--with-ssl-dir="$(STAGING_DIR)/usr" \
--with-uams-path="/usr/lib/uams" \
--without-acls \
+ --without-kerberos \
+ --without-mysql \
+ --with-mysql-config=false \
--without-pam \
--disable-admin-group \
--disable-srvloc \
$(if $(CONFIG_SHADOW_PASSWORDS),--with-shadow,--without-shadow) \
--without-ldap
+define Package/netatalk/conffiles
+/etc/afp.conf
+/etc/extmap.conf
+/etc/netatalk/
+endef
+
define Package/netatalk/install
$(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/usr/lib
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_DIR) $(1)/usr/lib/uams
- $(INSTALL_DIR) $(1)/etc/netatalk
$(INSTALL_DIR) $(1)/etc/init.d
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libatalk.so* $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/dbd $(1)/usr/bin/
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/ad $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/afppasswd $(1)/usr/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/afpd $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_dbd $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/cnid_metad $(1)/usr/sbin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/uams/*.so $(1)/usr/lib/uams/
- $(CP) ./files/AppleVolumes.default $(1)/etc/netatalk/
- $(CP) $(PKG_INSTALL_DIR)/etc/netatalk/AppleVolumes.system $(1)/etc/netatalk/
- $(INSTALL_CONF) ./files/afpd.conf $(1)/etc/netatalk/
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/afp.conf $(1)/etc/
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/extmap.conf $(1)/etc/
$(INSTALL_BIN) ./files/afpd.init $(1)/etc/init.d/afpd
endef
+++ /dev/null
--
-/tmp Temp allow:root,nobody cnidscheme:dbd
+++ /dev/null
-- -noddp -uampath /usr/lib/uams -uamlist uams_guest.so,uams_passwd.so,uams_dhx_passwd.so,uams_randnum.so,uams_dhx2.so -passwdfile /etc/netatalk/afppasswd -savepassword -passwdminlen 0 -nosetpassword -defaultvol /etc/netatalk/AppleVolumes.default -systemvol /etc/netatalk/AppleVolumes.system -nouservol -guestname "nobody" -sleep 1 -icon
#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2012 OpenWrt.org
-START=70
+START=80
+STOP=10
-MAXCONS="7"
+USE_PROCD=1
-start()
-{
- service_start /usr/sbin/cnid_metad
- service_start /usr/sbin/afpd -c ${MAXCONS}
-}
+start_service() {
+ mkdir -p /var/netatalk/CNID/
-stop()
-{
- service_stop /usr/sbin/afpd
- service_stop /usr/sbin/cnid_metad
-}
+ procd_open_instance
+ procd_set_param command /usr/sbin/afpd -d -F /etc/afp.conf
+ procd_set_param file /etc/afp.conf
+ procd_set_param respawn
+ procd_close_instance
-reload()
-{
- service_reload /usr/sbin/afpd
+ procd_open_instance
+ procd_set_param command /usr/sbin/cnid_metad -d
+ procd_set_param respawn
+ procd_close_instance
}
+
--- a/macros/db3-check.m4
+++ b/macros/db3-check.m4
-@@ -148,9 +148,9 @@ AC_DEFUN([AC_PATH_BDB],[
+@@ -148,9 +148,9 @@ if test "x$bdb_required" = "xyes"; then
dnl -- LD_LIBRARY_PATH on many platforms. This will be fairly
dnl -- portable hopefully. Reference:
dnl -- http://lists.gnu.org/archive/html/autoconf/2009-03/msg00040.html
if test x"${atalk_cv_bdb_version}" = x"yes"; then
BDB_CFLAGS="-I${bdbdir}/include${subdir}"
-@@ -171,9 +171,9 @@ AC_DEFUN([AC_PATH_BDB],[
+@@ -177,9 +177,9 @@ if test "x$bdb_required" = "xyes"; then
CPPFLAGS="-I${bdbdir}/include${subdir} $CPPFLAGS"
LDFLAGS="-L$bdblibdir $LDFLAGS"
include $(TOPDIR)/rules.mk
PKG_NAME:=nmap
-PKG_VERSION:=7.12
+PKG_VERSION:=7.31
PKG_RELEASE:=1
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://nmap.org/dist/
-PKG_MD5SUM:=0764f4dabe7cccda3c49fc3990b62a8a
+PKG_MD5SUM:=f2f6660142a777862342a58cc54258ea
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
--without-liblua \
--without-zenmap
-CONFIGURE_VARS += CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
+CONFIGURE_VARS += \
+ ac_cv_dnet_bsd_bpf=no \
+ CXXFLAGS="$$$$CXXFLAGS -fno-builtin"
ifeq ($(BUILD_VARIANT),ssl)
CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr"
include $(TOPDIR)/rules.mk
PKG_NAME:=nsd
-PKG_VERSION:=4.1.9
+PKG_VERSION:=4.1.13
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.nlnetlabs.nl/downloads/nsd
-PKG_MD5SUM:=9ac1d5ba51351d3d98b7de765439af57
+PKG_MD5SUM:=a3f2a9885bc8664ba4a25c938d26a587
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=ntp
-PKG_VERSION:=4.2.8p7
+PKG_VERSION:=4.2.8p8
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
-PKG_MD5SUM:=46dfba933c3e4bc924d8e55068797578
+PKG_MD5SUM:=4a8636260435b230636f053ffd070e34
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
include $(TOPDIR)/rules.mk
PKG_NAME:=ocserv
-PKG_VERSION:=0.11.3
-PKG_RELEASE:=1
+PKG_VERSION:=0.11.5
+PKG_RELEASE:=2
PKG_USE_MIPS16:=0
PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/ocserv/
-PKG_MD5SUM:=ffe3d79662e939bb55dfe7c9e490b4f2
+PKG_MD5SUM:=fbda999ce0b528d001bb46b3db6f5d49
PKG_LICENSE:=GPLv2+
PKG_LICENSE_FILES:=COPYING
--without-libnl \
--without-gssapi \
--with-libcrypt-prefix="$(STAGING_DIR)/" \
+ --without-lz4 \
+ --with-local-talloc \
ifneq ($(CONFIG_OCSERV_PAM),y)
CONFIGURE_ARGS += --without-pam
define Package/openconnect
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+libxml2 +kmod-tun +resolveip +vpnc-scripts +OPENCONNECT_OPENSSL:libopenssl +OPENCONNECT_GNUTLS:libgnutls +OPENCONNECT_STOKEN:libstoken
+ DEPENDS:=+libxml2 +kmod-tun +resolveip +vpnc-scripts +OPENCONNECT_OPENSSL:libopenssl +OPENCONNECT_OPENSSL:p11-kit +OPENCONNECT_OPENSSL:libp11 +OPENCONNECT_GNUTLS:libgnutls +OPENCONNECT_STOKEN:libstoken
TITLE:=OpenConnect VPN client (Cisco AnyConnect compatible)
MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
URL:=http://www.infradead.org/openconnect/
include $(TOPDIR)/rules.mk
PKG_NAME:=openssh
-PKG_VERSION:=7.2p2
-PKG_RELEASE:=1
+PKG_VERSION:=7.3p1
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
http://ftp.belnet.be/pub/OpenBSD/OpenSSH/portable/
-PKG_MD5SUM:=13009a9156510d8f27e752659075cced
+PKG_MD5SUM:=dfadd9f035d38ce5d58a3bf130b86d08
PKG_LICENSE:=BSD ISC
PKG_LICENSE_FILES:=LICENCE
+++ /dev/null
---- a/cipher.c
-+++ b/cipher.c
-@@ -88,8 +88,10 @@ static const struct sshcipher ciphers[]
- { "3des-cbc", SSH_CIPHER_SSH2, 8, 24, 0, 0, 0, 1, EVP_des_ede3_cbc },
- { "blowfish-cbc",
- SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_bf_cbc },
-+#ifndef OPENSSL_NO_CAST
- { "cast128-cbc",
- SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 1, EVP_cast5_cbc },
-+#endif
- { "arcfour", SSH_CIPHER_SSH2, 8, 16, 0, 0, 0, 0, EVP_rc4 },
- { "arcfour128", SSH_CIPHER_SSH2, 8, 16, 0, 0, 1536, 0, EVP_rc4 },
- { "arcfour256", SSH_CIPHER_SSH2, 8, 32, 0, 0, 1536, 0, EVP_rc4 },
--- /dev/null
+Backport of
+https://anongit.mindrot.org/openssh.git/patch/?id=28652bca29046f62c7045e933e6b931de1d16737
+
+--- openssh-7.3p1/kex.c
++++ openssh-7.3p1/kex.c
+@@ -419,6 +419,8 @@
+ ssh_dispatch_set(ssh, SSH2_MSG_NEWKEYS, &kex_protocol_error);
+ if ((r = sshpkt_get_end(ssh)) != 0)
+ return r;
++ if ((r = ssh_set_newkeys(ssh, MODE_IN)) != 0)
++ return r;
+ kex->done = 1;
+ sshbuf_reset(kex->peer);
+ /* sshbuf_reset(kex->my); */
+--- openssh-7.3p1/packet.c
++++ openssh-7.3p1/packet.c
+@@ -1919,9 +1919,7 @@
+ return r;
+ return SSH_ERR_PROTOCOL_ERROR;
+ }
+- if (*typep == SSH2_MSG_NEWKEYS)
+- r = ssh_set_newkeys(ssh, MODE_IN);
+- else if (*typep == SSH2_MSG_USERAUTH_SUCCESS && !state->server_side)
++ if (*typep == SSH2_MSG_USERAUTH_SUCCESS && !state->server_side)
+ r = ssh_packet_enable_delayed_compress(ssh);
+ else
+ r = 0;
--- /dev/null
+diff --git a/kex.c b/kex.c
+index 50c7a0f..d09c27b 100644
+--- a/kex.c
++++ b/kex.c
+@@ -1,4 +1,4 @@
+-/* $OpenBSD: kex.c,v 1.118 2016/05/02 10:26:04 djm Exp $ */
++/* $OpenBSD: kex.c,v 1.127 2016/10/10 19:28:48 markus Exp $ */
+ /*
+ * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
+ *
+@@ -472,6 +472,7 @@ kex_input_kexinit(int type, u_int32_t seq, void *ctxt)
+ if (kex == NULL)
+ return SSH_ERR_INVALID_ARGUMENT;
+
++ ssh_dispatch_set(ssh, SSH2_MSG_KEXINIT, NULL);
+ ptr = sshpkt_ptr(ssh, &dlen);
+ if ((r = sshbuf_put(kex->peer, ptr, dlen)) != 0)
+ return r;
include $(TOPDIR)/rules.mk
PKG_NAME:=privoxy
-PKG_VERSION:=3.0.24
-PKG_RELEASE:=1
+PKG_VERSION:=3.0.26
+PKG_RELEASE:=2
PKG_SOURCE:=privoxy-$(PKG_VERSION)-stable-src.tar.gz
PKG_SOURCE_URL:=@SF/ijbswa
-PKG_MD5SUM:=44a47d1a5000db8cccd61ace0e25e7f7
+PKG_MD5SUM:=8a1c842112ccea68c19b7ceb4a0e999f
PKG_BUILD_DIR:=$(BUILD_DIR)/privoxy-$(PKG_VERSION)-stable
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
$(1)/etc/config
$(INSTALL_DATA) ./files/privoxy.upgrade $(1)/lib/upgrade/keep.d/privoxy
$(INSTALL_BIN) ./files/privoxy.init $(1)/etc/init.d/privoxy
- $(INSTALL_BIN) ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/80-privoxy
+ $(INSTALL_BIN) ./files/privoxy.hotplug $(1)/etc/hotplug.d/iface/95-privoxy
$(INSTALL_CONF) ./files/privoxy.config $(1)/etc/config/privoxy
endef
#!/bin/sh /etc/rc.common
-START=80
-STOP=20
+START=95
+STOP=10
PIDFILE=/var/run/privoxy.pid
CFGFILE=/var/etc/privoxy.conf
_uci2conf() {
# redefined callback for options when calling config_load
- option_cb()
- {
- # $1 name of variable
- # $2 value
- local __OPT="$1"
- local __VAL="$2"
- case $__OPT in
- confdir|templdir|temporary_directory|logdir|logfile)
- # needs to be handled separately because we need to set permissions
- # AND needs to be defined first because of a BUG inside privoxy
- # require directories to be defined first inside config
- ;;
- debug_*)
- [ $__VAL -eq 0 ] && return # not set ignore
- echo -e "debug\t$(echo $__OPT | sed -e 's#debug_##g')" >> $CFGTEMP ;;
- *)
- # detect list options (LENGTH) and ignore
- echo $__OPT | grep -i "_LENGTH" >/dev/null 2>&1 && return
- # detect list options (ITEM) and ignore
- echo $__OPT | grep -i "_ITEM" >/dev/null 2>&1 && __OPT=$(echo $__OPT | sed -e "s#_ITEM.*##g")
- # uci only accept "_" but we need "-"
- local __OPT=$(echo $__OPT | sed -e "s#_#-#g")
- # write to config
- echo -e "$__OPT\t$__VAL" >> $CFGTEMP
- ;;
- esac
+ config_cb() {
+ if [ ."$2" != ."privoxy" ]; then
+ option_cb() { return 0; }
+ else
+ option_cb()
+ {
+ # $1 name of variable
+ # $2 value
+ local __OPT="$1"
+ local __VAL="$2"
+ case $__OPT in
+ confdir|templdir|temporary_directory|logdir|logfile)
+ # needs to be handled separately because we need to set permissions
+ # AND needs to be defined first because of a BUG inside privoxy
+ # require directories to be defined first inside config
+ ;;
+ debug_*)
+ [ $__VAL -eq 0 ] && return # not set ignore
+ echo -e "debug\t$(echo $__OPT | sed -e 's#debug_##g')" >> $CFGTEMP ;;
+ *)
+ # detect list options (LENGTH) and ignore
+ echo $__OPT | grep -i "_LENGTH" >/dev/null 2>&1 && return
+ # detect list options (ITEM) and ignore
+ echo $__OPT | grep -i "_ITEM" >/dev/null 2>&1 && __OPT=$(echo $__OPT | sed -e "s#_ITEM.*##g")
+ # uci only accept "_" but we need "-"
+ local __OPT=$(echo $__OPT | sed -e "s#_#-#g")
+ # write to config
+ echo -e "$__OPT\t$__VAL" >> $CFGTEMP
+ ;;
+ esac
+ }
+ fi
}
# temporary config file
echo -e "temporary-directory\t$_TMP_DIR" >> $CFGTEMP
fi
- config_load privoxy # calling above option_cb() and write the rest into $CFGTEMP
+ config_load "privoxy" # calling above option_cb() and write the rest into $CFGTEMP
# move temp to final privoxy readable configuration
mv -f $CFGTEMP $CFGFILE
PKG_NAME:=radicale
PKG_VERSION:=1.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Christian Schoenebeck <christian.schoenebeck@gmail.com>
PKG_LICENSE:=GPL-3.0
PKG_BUILD_DIR:=$(BUILD_DIR)/Radicale-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
# no default dependencies
-PKG_DEFAULT_DEPENDS=
+PKG_DEFAULT_DEPENDS:=
define Package/$(PKG_NAME)/Default
SECTION:=net
CATEGORY:=Network
SUBMENU:=Web Servers/Proxies
URL:=http://radicale.org/
+ TITLE:=Radicale CalDAV/CardDAV server
PKGARCH:=all
USERID:=radicale=5232:radicale=5232
endef
define Package/$(PKG_NAME)-py2
$(call Package/$(PKG_NAME)/Default)
- PYTHON_VERSION:=2.7
- TITLE:=Radicale CalDAV/CardDAV server (Python 2)
- VARIANT:=python2
+ TITLE+= (Python 2)
+ VARIANT:=2
DEPENDS:=+python-logging +python-openssl +python-xml +python-codecs
endef
define Package/$(PKG_NAME)-py3
$(call Package/$(PKG_NAME)/Default)
- PYTHON_VERSION:=3.4
- TITLE:=Radicale CalDAV/CardDAV server (Python 3)
- VARIANT:=python3
- DEPENDS:=+python3-logging +python3-openssl +python3-xml +python3-codecs +python3-email @BROKEN
+ TITLE+= (Python 3)
+ VARIANT:=3
+ DEPENDS:=+python3-logging +python3-openssl +python3-xml +python3-codecs +python3-email
endef
# shown in LuCI package description
The Radicale Project is a CalDAV (calendar) and CardDAV (contact) server.
It aims to be a light solution, easy to use, easy to install, easy to configure.
As a consequence, it requires few software dependances and is pre-configured to work out-of-the-box.
- !!! Will install and use Python $(PYTHON_VERSION) !!!
+ !!! Will install and use Python $(VARIANT) !!!
.
Version : $(PKG_VERSION)
Homepage: http://radicale.org/
- .
- $(PKG_MAINTAINER)
endef
Package/$(PKG_NAME)-py3/config = $(Package/$(PKG_NAME)-py2/config)
Package/$(PKG_NAME)-py3/conffiles = $(Package/$(PKG_NAME)-py2/conffiles)
define Build/Configure
+ # nothing to configure
endef
define Build/Compile
+ # nothing to compile
endef
define Package/$(PKG_NAME)-py2/preinst
[ -n "$${IPKG_INSTROOT}" ] && exit 0 # if run within buildroot exit
# stop service if PKG_UPGRADE
- [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/$(PKG_NAME) stop >/dev/null 2>&1
+ [ "$${PKG_UPGRADE}" = "1" ] && /etc/init.d/radicale stop >/dev/null 2>&1
exit 0 # suppress errors from stop command
endef
$(call Package/$(PKG_NAME)-py2/preinst)
endef
-define Package/$(PKG_NAME)-py2/install
+define Package/$(PKG_NAME)/inst_all
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/radicale.init $(1)/etc/init.d/radicale
$(INSTALL_DATA) ./files/radicale.users $(1)/etc/radicale/users
$(INSTALL_DATA) ./files/radicale.rights $(1)/etc/radicale/rights
- $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/radicale
- $(CP) \
- $(PKG_BUILD_DIR)/radicale/* \
- $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/radicale
-
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/radicale $(1)/usr/bin/
endef
+define Package/$(PKG_NAME)-py2/install
+ $(call Package/$(PKG_NAME)/inst_all, $(1))
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/radicale
+ $(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON_PKG_DIR)/radicale
+endef
define Package/$(PKG_NAME)-py3/install
- $(call Package/$(PKG_NAME)-py2/install, $(1))
+ $(call Package/$(PKG_NAME)/inst_all, $(1))
+ $(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)/radicale
+ $(CP) $(PKG_BUILD_DIR)/radicale/* $(1)$(PYTHON3_PKG_DIR)/radicale
endef
define Package/$(PKG_NAME)-py2/postinst
include $(TOPDIR)/rules.mk
PKG_NAME:=radsecproxy
-PKG_VERSION:=1.6.7
-PKG_RELEASE:=2
+PKG_VERSION:=1.6.8
+PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://software.uninett.no/radsecproxy/
-PKG_MD5SUM:=d76cf4fc68515667b8c67387f5045150
+PKG_MD5SUM:=b868f7faf4887a10376d1bd96ef75368
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=LICENSE
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=rp-pppoe
+PKG_VERSION:=3.11
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Daniel Dickinson <lede@daniel.thecshore.com>
+PKG_LICENSE:=LGPL-2.0+
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://roaringpenguin.com/files/download
+PKG_MD5SUM:=13b5900c56bd602df6cc526e5e520722
+
+PKG_BUILD_DEPENDS:=ppp
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/rp-pppoe/Default
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=PPPoE (PPP over Ethernet)
+ URL:=http://roaringpenguin.com/products/pppoe
+ SUBMENU:=dial-in/up
+endef
+
+define Package/rp-pppoe/Default/description
+ Dubbed RP-PPPoE, this open-source product is ideal for Linux users with
+ a DSL "modem" whose Internet service provider uses PPPoE.
+endef
+
+define Package/rp-pppoe-common
+ $(call Package/rp-pppoe/Default)
+ TITLE+= common
+ DEPENDS:=+ppp
+endef
+
+define Package/rp-pppoe-common/description
+$(call Package/rp-pppoe/Default/description)
+
+ This package contains files common to server and relay.
+endef
+
+define Package/rp-pppoe-common/conffiles
+/etc/config/pppoe
+endef
+
+define Package/rp-pppoe-relay
+ $(call Package/rp-pppoe/Default)
+ DEPENDS:=+rp-pppoe-common
+ TITLE+= relay
+ DEFAULT:=n
+endef
+
+define Package/rp-pppoe-relay/description
+$(call Package/rp-pppoe/Default/description)
+
+ This package contains pppoe-relay.
+endef
+
+define Package/rp-pppoe-relay/conffiles
+/etc/default/pppoe-relay
+endef
+
+define Package/rp-pppoe-server
+ $(call Package/rp-pppoe/Default)
+ DEPENDS:=+rp-pppoe-common
+ TITLE+= server
+endef
+
+define Package/rp-pppoe-server/conffiles
+/etc/ppp/pppoe-server-options
+/etc/ppp/options
+/etc/ppp/pap-secrets
+/etc/ppp/chap-secrets
+/etc/default/pppoe-server
+endef
+
+define Package/rp-pppoe-server/description
+$(call Package/rp-pppoe/Default/description)
+
+ This package contains pppoe-server.
+endef
+
+define Package/rp-pppoe-sniff
+ $(call Package/rp-pppoe/Default)
+ DEPENDS:=+ppp @BROKEN
+ TITLE+= sniffer
+endef
+
+define Package/rp-pppoe-sniff/description
+$(call Package/rp-pppoe/Default/description)
+
+ This package contains pppoe-sniff.
+endef
+
+TARGET_CFLAGS += -I$(PKG_BUILD_DIR)/src/libevent -isystem $(PKG_BUILD_DIR)/missing-headers
+CONFIGURE_PATH := ./src
+CONFIGURE_ARGS += ac_cv_path_PPPD=/usr/sbin/pppd --enable-plugin=$(STAGING_DIR)/usr/include/
+MAKE_FLAGS := DESTDIR="$(PKG_INSTALL_DIR)" install
+MAKE_PATH := ./src
+
+define Build/Prepare
+ mkdir -p $(PKG_BUILD_DIR)/missing-headers/net
+ $(CP) ./files/ppp_defs.h $(PKG_BUILD_DIR)/missing-headers/net/
+ $(call Build/Prepare/Default,$(1),$(2),$(3))
+endef
+
+define Package/rp-pppoe-common/install
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/pppoe.config $(1)/etc/config/pppoe
+endef
+
+define Package/rp-pppoe-relay/install
+ $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/pppoe-relay.init $(1)/etc/init.d/pppoe-relay
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-relay $(1)/usr/sbin/
+ $(INSTALL_DATA) ./files/pppoe-relay.default $(1)/etc/uci-defaults/
+endef
+
+define Package/rp-pppoe-server/install
+ $(INSTALL_DIR) $(1)/etc/init.d $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/pppoe-server.init $(1)/etc/init.d/pppoe-server
+ $(INSTALL_DIR) $(1)/etc/ppp
+ $(INSTALL_CONF) ./files/ppp/{options,pap-secrets,pppoe-server-options} $(1)/etc/ppp/
+ $(INSTALL_DIR) $(1)/etc/ppp/plugins
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-server $(1)/usr/sbin/
+ $(CP) $(PKG_INSTALL_DIR)/etc/ppp/plugins/rp-pppoe.so $(1)/etc/ppp/plugins/
+ $(INSTALL_DATA) ./files/pppoe-server.default $(1)/etc/uci-defaults/
+endef
+
+define Package/rp-pppoe-sniff/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_INSTALL_DIR)/usr/sbin/pppoe-sniff $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,rp-pppoe-common))
+$(eval $(call BuildPackage,rp-pppoe-relay))
+$(eval $(call BuildPackage,rp-pppoe-server))
+$(eval $(call BuildPackage,rp-pppoe-sniff))
--- /dev/null
+#debug
+logfile /dev/null
+noipdefault
+noaccomp
+nopcomp
+nocrtscts
+lock
+maxfail 0
+lcp-echo-failure 5
+lcp-echo-interval 1
--- /dev/null
+# client server secret IP addresses
+* * * *
--- /dev/null
+# PPP options for the PPPoE server
+# LIC: GPL
+require-pap
+login
+lcp-echo-interval 10
+lcp-echo-failure 2
+mru 1492
+mtu 1492
+
--- /dev/null
+#ifndef _NET_PPP_DEFS_H
+#define _NET_PPP_DEFS_H
+
+#define __need_time_t
+#include <time.h>
+
+#include <asm/types.h>
+#include <linux/ppp_defs.h>
+
+#endif
+
--- /dev/null
+#!/bin/sh
+
+if [ -e /etc/default/pppoe-relay ]; then
+ if [ -z "$(uci get pppoe.@pppoe_relay[-1] 2>/dev/null)" ]; then
+ uci add pppoe pppoe_relay
+ fi
+ uci set pppoe.@pppoe-relay[-1].use_non_uci_config=1
+ uci commit pppoe
+fi
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=50
+USE_PROCD=1
+
+pppoe_triggers() {
+ local cfg="$1"
+ local interface server_interfaces client_interfaces both_interfaces
+ config_get server_interfaces "$cfg" server_interface
+ config_get client_interfaces "$cfg" client_interface
+ config_get both_interfaces "$cfg" both_interfaces
+ for interface in $server_interfaces; do
+ append interfaces "$interface" "|"
+ done
+ for interface in $client_interfaces; do
+ append interfaces "$interface" "|"
+ done
+ for interface in $both_interfaces; do
+ append interfaces "$interface" "|"
+ done
+}
+
+pppoe_relay_instance() {
+ local cfg="$1"
+ local interface server_interfaces client_interfaces both_interfaces maxsessions timeout OPTIONS
+ config_get server_interfaces "$cfg" server_interface
+ config_get client_interfaces "$cfg" client_interface
+ config_get both_interfaces "$cfg" both_interfaces
+ config_get maxsessions "$cfg" maxsesssions
+ config_get timeout "$cfg" timeout
+ config_get_bool use_non_uci_config "$cfg" use_non_uci_config 0
+
+ if [ "$use_non_uci_config" -gt 0 ]; then
+ . /etc/default/pppoe-relay
+ else
+ [ -z "${server_interfaces}${client_interfaces}${both_interfaces}" ] && return 1
+ for interface in $server_interfaces; do
+ append OPTIONS "-S $interface"
+ done
+ for interface in $client_interfaces; do
+ append OPTIONS "-C $interface"
+ done
+ for interface in $both_interfaces; do
+ append OPTIONS "-B $interface"
+ done
+ [ -n "$maxsesssions" ] && append OPTIONS "-n $maxsesssions"
+ [ -n "$timeout" ] && append OPTIONS "-i $timeout"
+ fi
+
+ procd_open_instance
+ procd_set_param command /usr/sbin/pppoe-relay -F
+ procd_append_param command $OPTIONS
+ procd_close_instance
+}
+
+start_service() {
+ local use_non_uci_config
+
+ config_load pppoe
+ config_foreach pppoe_relay_instance pppoe_relay
+}
+
+reload_triggers() {
+ local interfaces
+
+ config_load pppoe
+ config_foreach pppoe_triggers pppoe_relay
+
+ procd_add_reload_trigger "pppoe"
+ procd_add_interface_trigger "$interfaces"
+}
--- /dev/null
+#!/bin/sh
+
+if [ -e /etc/default/pppoe-server ]; then
+ if [ -z "$(uci get pppoe.@pppoe_server[-1] 2>/dev/null)" ]; then
+ uci add pppoe pppoe_server_
+ fi
+ uci set pppoe.@pppoe-server[-1].use_non_uci_config=1
+ uci commit pppoe
+fi
+
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2011 OpenWrt.org
+
+START=50
+USE_PROCD=1
+
+pppoe_triggers() {
+ local cfg="$1"
+ local interface
+ config_get interface "$cfg" interface
+}
+
+pppoe_instance() {
+ local cfg="$1"
+ local interface ac_name service_names service_name maxsessionsperpeer localip firstremoteip maxsessions optionsfiles randomsession unit offset timeout mss sync OPTIONS
+ config_get interface "$cfg" interface
+ config_get ac_name "$cfg" ac_name
+ config_get service_names "$cfg" service_name
+ config_get maxsessionsperpeer "$cfg" maxsesssionsperpeer
+ config_get localip "$cfg" localip
+ config_get firstremoteip "$cfg" firstremoteip
+ config_get maxsessions "$cfg" maxsessions
+ config_get optionsfile "$cfg" optionsfile
+ config_get_bool randomsession "$cfg" randomsession 1
+ config_get_bool unit "$cfg" unit 0
+ config_get offset "$cfg" offset
+ config_get timeout "$cfg" timeout
+ config_get mss "$cfg" mss
+ config_get_bool sync "$cfg" sync 0
+ config_get use_non_uci_config "$cfg" use_non_uci_config 0
+
+ if [ "$use_non_uci_config" -gt 0 ]; then
+ . /etc/default/pppoe-server
+ else
+ [ -z "$interface" ] && return 1
+ [ -n "$ac_name" ] && append OPTIONS "-C $ac_name"
+ for service_name in $service_names; do
+ append OPTIONS "-S $service_name"
+ done
+ append OPTIONS "-I $interface"
+ [ -n "$maxsesssionsperpeer" ] && append OPTIONS "-x $maxsesssionsperpeer"
+ [ -n "$localip" ] && append OPTIONS "-L $localip"
+ [ -n "$firstremoteip" ] && append OPTIONS "-R $firstremoteip"
+ [ -n "maxsessions" ] && append OPTIONS "-N $maxsessions"
+ [ -n "optionsfile" ] && append OPTIONS "-O $optionsfile"
+ [ "$randomsession" = "1" ] && append OPTIONS "-r"
+ [ "$unit" = "1" ] && append OPTIONS "-u"
+ [ -n "$offset" ] && append OPTIONS "-o $offset"
+ [ -n "$timeout" ] && append OPTIONS "-T $timeout"
+ [ -n "$mss" ] && append OPTIONS "-m $mss"
+ [ "$sync" = "1" ] && append OPTIONS "-s"
+ fi
+
+ procd_open_instance
+ procd_set_param command /usr/sbin/pppoe-server -F
+ procd_append_param command $OPTIONS
+ procd_set_param file /etc/ppp/options
+ procd_append_param file /etc/ppp/pppoe-server-options
+ procd_close_instance
+}
+
+start_service() {
+ config_load pppoe
+ config_foreach pppoe_instance pppoe_server
+}
+
+service_triggers() {
+ local interface
+ config_load pppoe
+ config_foreach pppoe_triggers pppoe_server
+
+ procd_add_reload_trigger "pppoe"
+ procd_add_interface_trigger "$interface"
+}
--- /dev/null
+#config pppoe_server
+# option interface eth1
+# option ac_name access-concentrator-name
+# list service_name service-name1
+# list service_name service-name2
+# option maxsessionsperpeer 0
+# option localip 192.168.2.1
+# option firsremoteip 192.168.2.2
+# option maxsessions 64
+# option optionsfile /etc/ppp/pppoe-server-options
+# option randomsessions 1
+# option unit 0
+# option offset 0
+# option timeout 60
+# option mss 1468
+# option sync 0
+
+#config pppoe_relay
+# list server_interface eth1
+# list client_interface eth0
+# list both_interface eth2
+# option maxsessions 64
+# option timeout 60
--- /dev/null
+--- a/src/configure
++++ b/src/configure
+@@ -3661,7 +3661,7 @@ done
+
+ for ac_header in linux/if.h
+ do :
+- ac_fn_c_check_header_compile "$LINENO" "linux/if.h" "ac_cv_header_linux_if_h" "#include<sys/socket.h>
++ ac_fn_c_check_header_compile "$LINENO" "linux/if.h" "ac_cv_header_linux_if_h" "#include <sys/socket.h>
+ "
+ if test "x$ac_cv_header_linux_if_h" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+@@ -3675,10 +3675,11 @@ done
+ for ac_header in linux/if_pppox.h
+ do :
+ ac_fn_c_check_header_compile "$LINENO" "linux/if_pppox.h" "ac_cv_header_linux_if_pppox_h" "
+-#include<sys/socket.h>
+-#include<net/ethernet.h>
+-#include<linux/if.h>
+-#include<linux/in.h>
++#include <sys/socket.h>
++#include <net/ethernet.h>
++#include <linux/if.h>
++#include <linux/in.h>
++#include <linux/in6.h>
+
+ "
+ if test "x$ac_cv_header_linux_if_pppox_h" = x""yes; then :
+@@ -4611,7 +4612,7 @@ esac
+ $as_echo_n "checking packing order of bit fields... " >&6; }
+ if test "${rpppoe_cv_pack_bitfields+set}" != set ; then
+ if test "$cross_compiling" = yes; then :
+- $ECHO "no defaults for cross-compiling"; exit 0
++ rpppoe_cv_pack_bitfields="$ac_cv_pack_bitfields"
+ else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
--- /dev/null
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -71,7 +71,7 @@ pppoe-sniff: pppoe-sniff.o if.o common.o
+ @CC@ -o $@ $^ $(LDFLAGS)
+
+ pppoe-server: pppoe-server.o if.o debug.o common.o md5.o libevent/libevent.a @PPPOE_SERVER_DEPS@
+- @CC@ -o $@ @RDYNAMIC@ $^ $(LDFLAGS) $(PPPOE_SERVER_LIBS) -Llibevent -levent
++ @CC@ -o $@ @RDYNAMIC@ $^ $(LDFLAGS) $(PPPOE_SERVER_LIBS)
+
+ pppoe: pppoe.o if.o debug.o common.o ppp.o discovery.o
+ @CC@ -o $@ $^ $(LDFLAGS)
--- /dev/null
+Index: rp-pppoe-3.11/src/configure
+===================================================================
+--- rp-pppoe-3.11.orig/src/configure 2016-05-21 23:42:58.142423086 -0400
++++ rp-pppoe-3.11/src/configure 2016-05-21 23:42:58.178423086 -0400
+@@ -3646,7 +3646,7 @@
+ done
+
+
+-for ac_header in fcntl.h sys/dlpi.h sys/ioctl.h sys/time.h syslog.h unistd.h net/if_arp.h netinet/if_ether.h getopt.h sys/uio.h sys/param.h fcntl.h net/bpf.h netpacket/packet.h net/ethernet.h asm/types.h linux/if_packet.h linux/if_ether.h sys/socket.h sys/cdefs.h net/if.h net/if_dl.h net/if_ether.h net/if_types.h netinet/if_ether.h net/if_types.h net/if_dl.h
++for ac_header in fcntl.h sys/dlpi.h sys/ioctl.h sys/time.h syslog.h unistd.h net/if_arp.h getopt.h sys/uio.h sys/param.h fcntl.h net/bpf.h netpacket/packet.h asm/types.h linux/if_packet.h linux/if_ether.h sys/socket.h sys/cdefs.h net/if.h net/if_dl.h net/if_types.h net/if_types.h net/if_dl.h
+ do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+Index: rp-pppoe-3.11/src/if.c
+===================================================================
+--- rp-pppoe-3.11.orig/src/if.c 2012-08-17 14:31:25.000000000 -0400
++++ rp-pppoe-3.11/src/if.c 2016-05-21 23:45:13.546423086 -0400
+@@ -30,10 +30,6 @@
+ #include <linux/if_packet.h>
+ #endif
+
+-#ifdef HAVE_NET_ETHERNET_H
+-#include <net/ethernet.h>
+-#endif
+-
+ #ifdef HAVE_ASM_TYPES_H
+ #include <asm/types.h>
+ #endif
+Index: rp-pppoe-3.11/src/plugin.c
+===================================================================
+--- rp-pppoe-3.11.orig/src/plugin.c 2012-08-17 14:31:25.000000000 -0400
++++ rp-pppoe-3.11/src/plugin.c 2016-05-21 23:43:55.314423086 -0400
+@@ -49,7 +49,6 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <signal.h>
+-#include <net/ethernet.h>
+ #include <net/if_arp.h>
+ #include <linux/ppp_defs.h>
+ #include <linux/if_pppox.h>
start_service() {
procd_open_instance
- procd_set_param command /usr/sbin/rsyslogd
+ procd_set_param command /usr/sbin/rsyslogd -n
procd_close_instance
}
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-ccnet
-PKG_VERSION:=4.1.2
-PKG_RELEASE=$(PKG_SOURCE_VERSION)-2
+PKG_VERSION:=5.1.4
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/haiwen/ccnet.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=a73109f09af4ecc49cdc4c57cdde51b38e15c31a
+PKG_SOURCE_VERSION:=44f74fdc5160c1bf16a92e71d79b856763ddbc15
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
+$(call include_mk, python-package.mk)
define Package/seafile-ccnet
SECTION:=net
DEPENDS:=+libsearpc +libevent2 +libopenssl \
+glib2 +python +libzdb +libuuid \
+libpthread +libsqlite3 +jansson $(ICONV_DEPENDS)
+ EXTRA_DEPENDS:=libsearpc (=5.1.4-8998e7b2c5587f0b94c48db24e2952d08def5add-1)
endef
define Package/seafile-ccnet/description
--disable-compile-demo \
--disable-console
-PKG_BUILD_DEPENDS:=vala/host \
- libsearpc/host
+PKG_BUILD_DEPENDS:=vala/host
TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
-L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz
define Package/seafile-ccnet/install
$(INSTALL_DIR) $(1)/usr/{bin,lib}
- $(INSTALL_DIR) $(1)/usr/lib/python2.7/site-packages
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(CP) $(PKG_INSTALL_DIR)/usr/bin/ccnet* $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/ccnet $(1)/usr/lib/python2.7/site-packages/
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/ccnet $(1)$(PYTHON_PKG_DIR)
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libccnet.so* $(1)/usr/lib/
+ find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/include/ccnet* $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libccnet.pc $(1)/usr/lib/pkgconfig/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libccnet.a $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libccnet.so* $(1)/usr/lib/
endef
--- /dev/null
+diff -rupN seafile-ccnet-5.1.1.orig/lib/Makefile.am seafile-ccnet-5.1.1/lib/Makefile.am
+--- seafile-ccnet-5.1.1.orig/lib/Makefile.am 2016-04-21 11:04:46.000000000 +0200
++++ seafile-ccnet-5.1.1/lib/Makefile.am 2016-04-22 10:02:52.583732050 +0200
+@@ -1,3 +1,4 @@
++include $(TOPDIR)/rules.mk
+
+ AM_CPPFLAGS = @GLIB2_CFLAGS@ -I$(top_srcdir)/include \
+ -I$(top_srcdir)/include/ccnet \
+@@ -72,11 +73,11 @@ ccnet-client.c: ccnet-object.h
+
+ ccnet-object.h: ${ccnet_object_define}
+ rm -f $@
+- valac --pkg posix ${ccnet_object_define} -C -H ccnet-object.h
++ "$(STAGING_DIR)/host/bin/valac" --pkg posix ${ccnet_object_define} -C -H ccnet-object.h
+
+ ccnetobj.c: ${ccnet_object_define}
+ rm -f $@
+- valac -C --pkg posix ${ccnet_object_define}
++ "$(STAGING_DIR)/host/bin/valac" -C --pkg posix ${ccnet_object_define}
+
+ searpc_gen = searpc-signature.h searpc-marshal.h
+
+@@ -86,7 +87,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_t
+ @rm -f rpc_table.tmp
+ @touch rpc_table.tmp
+ @echo "[libsearpc]: generating rpc header files"
+- @PYTHON@ `which searpc-codegen.py` ${top_srcdir}/lib/rpc_table.py
++ @PYTHON@ "$(STAGING_DIR)/usr/bin/searpc-codegen.py" ${top_srcdir}/lib/rpc_table.py
+ @echo "[libsearpc]: done"
+ @mv -f rpc_table.tmp $@
+
+++ /dev/null
-diff -rupN seafile-ccnet-4.1.2.orig/include/ccnet/ccnet-client.h seafile-ccnet-4.1.2/include/ccnet/ccnet-client.h
---- seafile-ccnet-4.1.2.orig/include/ccnet/ccnet-client.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/include/ccnet/ccnet-client.h 2015-09-09 19:22:23.515461892 +0200
-@@ -10,11 +10,7 @@
- #include <glib.h>
- #include <glib-object.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #include "ccnet-session-base.h"
-
-diff -rupN seafile-ccnet-4.1.2.orig/include/ccnet/cevent.h seafile-ccnet-4.1.2/include/ccnet/cevent.h
---- seafile-ccnet-4.1.2.orig/include/ccnet/cevent.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/include/ccnet/cevent.h 2015-09-09 19:22:23.516461920 +0200
-@@ -6,13 +6,9 @@
- #ifndef CEVENT_H
- #define CEVENT_H
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/event_compat.h>
- #include <event2/event_struct.h>
--#else
--#include <event.h>
--#endif
-
- #include <glib.h>
-
-diff -rupN seafile-ccnet-4.1.2.orig/lib/job-mgr.c seafile-ccnet-4.1.2/lib/job-mgr.c
---- seafile-ccnet-4.1.2.orig/lib/job-mgr.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/job-mgr.c 2015-09-09 19:22:23.516461920 +0200
-@@ -1,11 +1,7 @@
- /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/event_compat.h>
--#else
--#include <event.h>
--#endif
-
- #include <string.h>
- #include <stdlib.h>
-diff -rupN seafile-ccnet-4.1.2.orig/lib/libccnet_utils.h seafile-ccnet-4.1.2/lib/libccnet_utils.h
---- seafile-ccnet-4.1.2.orig/lib/libccnet_utils.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/libccnet_utils.h 2015-09-09 19:22:23.517461948 +0200
-@@ -15,11 +15,7 @@
- #include <glib-object.h>
- #include <stdlib.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #ifdef WIN32
- #include <errno.h>
-diff -rupN seafile-ccnet-4.1.2.orig/lib/mainloop.c seafile-ccnet-4.1.2/lib/mainloop.c
---- seafile-ccnet-4.1.2.orig/lib/mainloop.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/mainloop.c 2015-09-09 19:22:23.517461948 +0200
-@@ -3,13 +3,9 @@
- #include "include.h"
- #include <ccnet.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/event_compat.h>
- #include <event2/event_struct.h>
--#else
--#include <event.h>
--#endif
-
- static int
- cmdrsp_cb (const char *code, char *content, int clen, void *data)
-diff -rupN seafile-ccnet-4.1.2.orig/lib/net.h seafile-ccnet-4.1.2/lib/net.h
---- seafile-ccnet-4.1.2.orig/lib/net.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/net.h 2015-09-09 19:22:23.517461948 +0200
-@@ -19,11 +19,7 @@
- #include <netinet/tcp.h>
- #endif
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #ifdef WIN32
- #define ECONNREFUSED WSAECONNREFUSED
-diff -rupN seafile-ccnet-4.1.2.orig/lib/packet-io.h seafile-ccnet-4.1.2/lib/packet-io.h
---- seafile-ccnet-4.1.2.orig/lib/packet-io.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/packet-io.h 2015-09-09 19:22:23.518461976 +0200
-@@ -5,11 +5,7 @@
-
- #include <packet.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- struct buffer;
-
-diff -rupN seafile-ccnet-4.1.2.orig/lib/processor.c seafile-ccnet-4.1.2/lib/processor.c
---- seafile-ccnet-4.1.2.orig/lib/processor.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/processor.c 2015-09-09 19:22:23.518461976 +0200
-@@ -4,11 +4,7 @@
-
- #include <pthread.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
--#else
--#include <event.h>
--#endif
-
- #include "ccnet-client.h"
- #include "processor.h"
-diff -rupN seafile-ccnet-4.1.2.orig/lib/timer.c seafile-ccnet-4.1.2/lib/timer.c
---- seafile-ccnet-4.1.2.orig/lib/timer.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/timer.c 2015-09-09 19:22:23.519462004 +0200
-@@ -1,12 +1,8 @@
- /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/event_compat.h>
- #include <event2/event_struct.h>
--#else
--#include <event.h>
--#endif
-
- #include <sys/time.h>
-
-diff -rupN seafile-ccnet-4.1.2.orig/lib/utils.h seafile-ccnet-4.1.2/lib/utils.h
---- seafile-ccnet-4.1.2.orig/lib/utils.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/lib/utils.h 2015-09-09 19:22:23.519462004 +0200
-@@ -11,11 +11,7 @@
- #include <glib-object.h>
- #include <stdlib.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #ifdef WIN32
- #include <errno.h>
-diff -rupN seafile-ccnet-4.1.2.orig/net/cluster/server.c seafile-ccnet-4.1.2/net/cluster/server.c
---- seafile-ccnet-4.1.2.orig/net/cluster/server.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/cluster/server.c 2015-09-09 19:24:33.800125741 +0200
-@@ -6,11 +6,7 @@
- #include <stdio.h>
- #include <getopt.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/dns.h>
--#else
--#include <evdns.h>
--#endif
-
- #include "inner-session.h"
- #include "outer-session.h"
-diff -rupN seafile-ccnet-4.1.2.orig/net/common/connect-mgr.h seafile-ccnet-4.1.2/net/common/connect-mgr.h
---- seafile-ccnet-4.1.2.orig/net/common/connect-mgr.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/common/connect-mgr.h 2015-09-09 19:22:23.520462032 +0200
-@@ -3,11 +3,7 @@
- #ifndef CCNET_CONNECTION_MANAGER
- #define CCNET_CONNECTION_MANAGER
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
--#else
--#include <event.h>
--#endif
-
- #include "timer.h"
-
-diff -rupN seafile-ccnet-4.1.2.orig/net/common/packet-io.c seafile-ccnet-4.1.2/net/common/packet-io.c
---- seafile-ccnet-4.1.2.orig/net/common/packet-io.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/common/packet-io.c 2015-09-09 19:22:23.521462060 +0200
-@@ -13,13 +13,9 @@
-
- #include <unistd.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/bufferevent.h>
- #include <event2/bufferevent_struct.h>
--#else
--#include <event.h>
--#endif
-
- #include <glib.h>
- #include <errno.h>
-diff -rupN seafile-ccnet-4.1.2.orig/net/common/packet-io.h seafile-ccnet-4.1.2/net/common/packet-io.h
---- seafile-ccnet-4.1.2.orig/net/common/packet-io.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/common/packet-io.h 2015-09-09 19:22:23.521462060 +0200
-@@ -5,13 +5,9 @@
-
- #include "packet.h"
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
- #include <event2/buffer.h>
- #include <event2/buffer_compat.h>
--#else
--#include <evutil.h>
--#endif
-
- /* struct evbuffer; */
- /* for libevent2 */
-diff -rupN seafile-ccnet-4.1.2.orig/net/common/peer.c seafile-ccnet-4.1.2/net/common/peer.c
---- seafile-ccnet-4.1.2.orig/net/common/peer.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/common/peer.c 2015-09-09 19:22:23.522462088 +0200
-@@ -2,14 +2,10 @@
-
- #include "common.h"
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/bufferevent.h>
- #include <event2/bufferevent_compat.h>
- #include <event2/bufferevent_struct.h>
--#else
--#include <event.h>
--#endif
-
- #include <stdio.h>
- #include <stdlib.h>
-diff -rupN seafile-ccnet-4.1.2.orig/net/common/session.h seafile-ccnet-4.1.2/net/common/session.h
---- seafile-ccnet-4.1.2.orig/net/common/session.h 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/common/session.h 2015-09-09 19:22:23.523462116 +0200
-@@ -3,13 +3,9 @@
- #ifndef CCNET_SESSION_H
- #define CCNET_SESSION_H
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/event_compat.h>
- #include <event2/event_struct.h>
--#else
--#include <event.h>
--#endif
-
- #include <glib.h>
- #include <glib/gstdio.h>
-diff -rupN seafile-ccnet-4.1.2.orig/net/daemon/ccnet-daemon.c seafile-ccnet-4.1.2/net/daemon/ccnet-daemon.c
---- seafile-ccnet-4.1.2.orig/net/daemon/ccnet-daemon.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/daemon/ccnet-daemon.c 2015-09-09 19:24:59.313846178 +0200
-@@ -6,12 +6,8 @@
- #include <stdio.h>
- #include <getopt.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/dns.h>
- #include <event2/dns_compat.h>
--#else
--#include <evdns.h>
--#endif
-
- #include "daemon-session.h"
- #include "rpc-service.h"
-diff -rupN seafile-ccnet-4.1.2.orig/net/daemon/ccnet-test.c seafile-ccnet-4.1.2/net/daemon/ccnet-test.c
---- seafile-ccnet-4.1.2.orig/net/daemon/ccnet-test.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/daemon/ccnet-test.c 2015-09-09 19:24:45.089444412 +0200
-@@ -5,11 +5,7 @@
-
- #include <stdio.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/dns.h>
--#else
--#include <evdns.h>
--#endif
-
- #include "utils.h"
-
-diff -rupN seafile-ccnet-4.1.2.orig/net/server/ccnet-server.c seafile-ccnet-4.1.2/net/server/ccnet-server.c
---- seafile-ccnet-4.1.2.orig/net/server/ccnet-server.c 2015-09-09 18:49:35.000000000 +0200
-+++ seafile-ccnet-4.1.2/net/server/ccnet-server.c 2015-09-09 19:25:53.967392265 +0200
-@@ -6,11 +6,7 @@
- #include <stdio.h>
- #include <getopt.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/dns.h>
--#else
--#include <evdns.h>
--#endif
-
- #include "server-session.h"
- #include "user-mgr.h"
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-seahub
-PKG_VERSION:=4.1.2
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
+PKG_VERSION:=5.1.4
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
PKG_LICENSE:=Apache-2.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/haiwen/seahub.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=3fb1288f920de03a4e2e6a06b60671ce98971742
+PKG_SOURCE_VERSION:=1e1c02aa4f2a0256ffa29a28224aad2d678f43a0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
include $(INCLUDE_DIR)/package.mk
TITLE:=Seafile server - seahub component
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=http://seafile.com/
- DEPENDS:=+python +simplejson +pillow +python-setuptools
+ DEPENDS:=+simplejson +python +pillow +chardet +django +django-appconf \
+ +django-compressor +django-constance +django-jsonfield +django-picklefield \
+ +django-postoffice +django-restframework +django-statici18n +et_xmlfile \
+ +flup +gunicorn +jdcal +openpyxl +python-dateutil +python-mysql +pytz +rcssmin
endef
-define Package/seafile-seahub/description
- The web end of seafile server.
-
- NOTE: in order to have better performance, language support is turned off by default.
- Please set 'USE_I18N = True' in seahub_settings.py to support multiple languages.
-endef
-
-PKG_BUILD_DEPENDS:=python-setuptools
-PYTHONPATH:=$(PYTHONPATH):$(PKG_BUILD_DIR)/thirdpart
-
-define Download/django
- FILE=Django-1.5.8.tar.gz
- URL=https://www.djangoproject.com/m/releases/1.5/
- MD5SUM:=675fc736e2c29090f005e217ccf90b5b
-endef
-
-define Download/djblets
- PROTO=git
- URL=https://github.com/djblets/djblets.git
- SUBDIR=djblets-0.6.14
- FILE=djblets-0.6.14.tar.gz
- VERSION=58c09bae9b71ac164f78c76746fd2e545aae6c68
-endef
-
-define Download/gunicorn
- FILE=gunicorn-0.16.1.tar.gz
- URL=https://pypi.python.org/packages/source/g/gunicorn/
- MD5SUM:=d53d5d04d941f2a3089e814e753a218f
-endef
-
-define Download/six
- FILE=six-1.4.1.tar.gz
- URL=https://pypi.python.org/packages/source/s/six/
- MD5SUM:=bdbb9e12d3336c198695aa4cf3a61d62
-endef
-
-define Download/chardet
- FILE=chardet-2.1.1.tar.gz
- URL=https://pypi.python.org/packages/source/c/chardet/
- MD5SUM:=295367fd210d20f3febda615a88e1ef0
-endef
-
-define Download/flup
- FILE=flup-1.0.2-py2.6.egg
- URL=https://pypi.python.org/packages/2.6/f/flup/
- MD5SUM:=93ec6e3baeee3e5649a8456105178d4e
-endef
-
-define Download/lockfile
- FILE=lockfile-0.9.1.tar.gz
- URL=https://pypi.python.org/packages/source/l/lockfile/
- MD5SUM:=ce61468d4c1263e3005737bbed2641f0
-endef
-
-define Download/python-daemon
- FILE=python-daemon-1.5.5.tar.gz
- URL=https://pypi.python.org/packages/source/p/python-daemon/
- MD5SUM:=1f6cd41473c2e201021a0aeef395b2b1
+define Build/Configure
endef
-define Download/python-dateutil
- FILE=python-dateutil-1.5.tar.gz
- URL=https://pypi.python.org/packages/source/p/python-dateutil/
- MD5SUM:=0dcb1de5e5cad69490a3b6ab63f0cfa5
+define Build/Compile
+ $(call Build/Compile/Default,locale)
endef
-define Build/Configure
-endef
+define Package/seafile-seahub/description
+ The web end of seafile server.
-define Build/Compile
- # Download python dependencies
- $(eval $(call Download,django))
- $(eval $(call Download,djblets))
- $(eval $(call Download,gunicorn))
- $(eval $(call Download,six))
- $(eval $(call Download,chardet))
- $(eval $(call Download,flup))
- $(eval $(call Download,lockfile))
- $(eval $(call Download,python-daemon))
- $(eval $(call Download,python-dateutil))
- # Install python dependencies
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/Django-1.5.8.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/djblets-0.6.14.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/gunicorn-0.16.1.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/six-1.4.1.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/chardet-2.1.1.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/flup-1.0.2-py2.6.egg)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/lockfile-0.9.1.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/python-daemon-1.5.5.tar.gz)
- $(call HostPython,, \
- $(STAGING_DIR_ROOT)/usr/bin/easy_install -d $(PKG_BUILD_DIR)/thirdpart -Z -N \
- $(DL_DIR)/python-dateutil-1.5.tar.gz)
+ NOTE: in order to have better performance, localization support is turned off by default.
+ Please set 'USE_I18N = True' in seahub_settings.py if you intend to use languages other than English.
endef
define Package/seafile-seahub/install
$(CP) $(PKG_BUILD_DIR)/*.{sh,template,py,txt} $(1)/usr/share/seafile/seafile-server/seahub/
$(CP) $(PKG_BUILD_DIR)/{CONTRIBUTORS,HACKING,README.markdown} $(1)/usr/share/seafile/seafile-server/seahub/
$(CP) $(PKG_BUILD_DIR)/pylintrc* $(1)/usr/share/seafile/seafile-server/seahub/
- # fix python exec path in scripts
- sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/chardetect.py
- sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/django-admin.py
- sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn
- sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_django
- sed -i 's/#!.*/#!\/usr\/bin\/python/g' $(1)/usr/share/seafile/seafile-server/seahub/thirdpart/gunicorn_paster
find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
- sed -i "s/\(SEAFILE_VERSION\s*=\s*\)'\([0-9]\.[0-9]\.[0-9]\)'/\1'$(PKG_VERSION)'/g" $(1)/usr/share/seafile/seafile-server/seahub/seahub/settings.py
+ $(SED) "s/\(SEAFILE_VERSION\s*=\s*\)'\([0-9]\.[0-9]\.[0-9]\)'/\1'$(PKG_VERSION)'/g" $(1)/usr/share/seafile/seafile-server/seahub/seahub/settings.py
endef
$(eval $(call BuildPackage,seafile-seahub))
--- /dev/null
+diff -rupN seafile-seahub-5.1.1.orig/Makefile seafile-seahub-5.1.1/Makefile
+--- seafile-seahub-5.1.1.orig/Makefile 2016-04-26 23:59:48.000000000 +0200
++++ seafile-seahub-5.1.1/Makefile 2016-04-28 09:03:35.507105416 +0200
+@@ -1,3 +1,6 @@
++include $(TOPDIR)/rules.mk
++$(call include_mk, python-package.mk)
++
+ PROJECT=seahub
+
+ develop: setup-git
+@@ -9,7 +12,7 @@ dist: locale uglify statici18n collectst
+
+ locale:
+ @echo "--> Compile locales"
+- django-admin.py compilemessages
++ $(call HostPython,,$(STAGING_DIR)/usr/bin/django-admin.py compilemessages)
+ @echo ""
+
+ uglify:
+@@ -19,7 +22,7 @@ uglify:
+
+ statici18n:
+ @echo "--> Generate JS locale files in static/scripts/i18n"
+- python manage.py compilejsi18n
++ $(call HostPython,,manage.py compilejsi18n)
+
+ collectstatic:
+ @echo "--> Collect django static files to media/assets"
--- /dev/null
+menu "Configuration"
+ depends on PACKAGE_seafile-server
+
+config SEAFILE_FUSE_SUPPORT
+ bool "Enable FUSE support"
+ select PACKAGE_libfuse
+ default n
+
+config SEAFILE_CONSOLE_SUPPORT
+ bool "Enable seafile server console"
+ default n
+
+config SEAFILE_RIAK_SUPPORT
+ bool "Enable support for riak backend"
+ default n
+endmenu
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-# NOTE: make sure to update EXTRA_DEPENDS in case of version/release changes!
-
include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-server
-PKG_VERSION:=4.1.2
-PKG_RELEASE=$(PKG_SOURCE_VERSION)-5
+PKG_VERSION:=5.1.4
+PKG_RELEASE=$(PKG_SOURCE_VERSION)-1
PKG_LICENSE:=GPL-3.0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/haiwen/seafile.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=c0166019c712e2e1d5e532fd5f7401b1b72db6d8
+PKG_SOURCE_VERSION:=b9dc96ee845bb0148d9075aec597e6e07652cbdc
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
+$(call include_mk, python-package.mk)
define Package/seafile-server
SECTION:=net
TITLE:=Seafile server
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=http://seafile.com/
- DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub \
- +sqlite3-cli +python-mysql +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 \
- +libmysqlclient +libpthread +libuuid \
- +bash +sudo +procps-ng +procps-ng-pkill $(ICONV_DEPENDS)
- EXTRA_DEPENDS:=seafile-ccnet (=4.1.2-a73109f09af4ecc49cdc4c57cdde51b38e15c31a-2), seafile-seahub (=4.1.2-3fb1288f920de03a4e2e6a06b60671ce98971742)
+ DEPENDS:=+libarchive +libopenssl +glib2 +libsearpc +seafile-ccnet +seafile-seahub +sqlite3-cli +python-mysql +python-urllib3 \
+ +jansson +libevent2 +libevent2-openssl +zlib +libzdb +libsqlite3 +libmysqlclient \
+ +libpthread +libuuid +bash +procps-ng +procps-ng-pkill +SEAFILE_FUSE_SUPPORT:libfuse $(ICONV_DEPENDS)
+ EXTRA_DEPENDS:=seafile-ccnet (=5.1.4-44f74fdc5160c1bf16a92e71d79b856763ddbc15-1), seafile-seahub (=5.1.4-1e1c02aa4f2a0256ffa29a28224aad2d678f43a0-1)
+ MENU:=1
endef
-define Package/seafile-server/description
- Open source cloud storage with advanced features on privacy protection and teamwork.
+define Package/seafile-server/config
+ source "$(SOURCE)/Config.in"
endef
-define Package/seafile-server/conffiles
-/etc/config/seafile
+define Package/seafile-server/description
+ Open source cloud storage with advanced features on privacy protection and teamwork.
endef
-CONFIGURE_ARGS += --disable-riak \
- --disable-client \
- --disable-fuse \
+CONFIGURE_ARGS += --disable-client \
--enable-server \
--enable-python \
--disable-static-build \
- --disable-server-pkg \
- --disable-console
+ --disable-server-pkg
-PKG_BUILD_DEPENDS:=vala/host \
- libsearpc/host \
- libevhtp-1.1
+ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
+ CONFIGURE_ARGS += --enable-fuse
+ TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/fuse
+else
+ CONFIGURE_ARGS += --disable-fuse
+endif
+
+ifeq ($(CONFIG_SEAFILE_CONSOLE_SUPPORT),y)
+ CONFIGURE_ARGS += --enable-console
+else
+ CONFIGURE_ARGS += --disable-console
+endif
+ifeq ($(CONFIG_SEAFILE_RIAK_SUPPORT),y)
+ CONFIGURE_ARGS += --enable-riak
+else
+ CONFIGURE_ARGS += --disable-riak
+endif
+
+PKG_BUILD_DEPENDS:=vala/host libevhtp
+
+# This is required as python-package.mk overrides the default setting of having interlinking enabled
+ifdef CONFIG_USE_MIPS16
+ TARGET_CFLAGS += -minterlink-mips16
+endif
TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv \
- -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz
+ -L$(STAGING_DIR)/usr/lib/mysql -lmysqlclient -lz -levent_openssl -levent
+
+define Package/seafile-server/conffiles
+/etc/config/seafile
+endef
define Package/seafile-server/install
$(INSTALL_DIR) $(1)/usr/{bin,lib}
- $(INSTALL_DIR) $(1)/usr/lib/python2.7/site-packages
- $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server/runtime
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DIR) $(1)/usr/share/seafile/seafile-server
+ $(INSTALL_DIR) $(1)/usr/share/seafile/conf
+ $(INSTALL_DIR) $(1)/etc/{config,init.d}
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/seafile/ $(1)/usr/lib/python2.7/site-packages/
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/seaserv/ $(1)/usr/lib/python2.7/site-packages/
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/scripts/seaf-gc.sh $(1)/usr/share/seafile/seafile-server/
+ $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fsck.sh $(1)/usr/share/seafile/seafile-server/
+ifeq ($(CONFIG_SEAFILE_FUSE_SUPPORT),y)
+ $(CP) $(PKG_BUILD_DIR)/scripts/seaf-fuse.sh $(1)/usr/share/seafile/seafile-server/
+endif
$(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.py $(1)/usr/share/seafile/seafile-server/
$(CP) $(PKG_BUILD_DIR)/scripts/setup-seafile-mysql.sh $(1)/usr/share/seafile/seafile-server/
$(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.py $(1)/usr/share/seafile/seafile-server/
$(CP) $(PKG_BUILD_DIR)/scripts/sqlite2mysql.sh $(1)/usr/share/seafile/seafile-server/
+ $(CP) $(PKG_BUILD_DIR)/scripts/check_init_admin.py $(1)/usr/share/seafile/seafile-server/
$(CP) $(PKG_BUILD_DIR)/scripts/upgrade/ $(1)/usr/share/seafile/seafile-server/
- $(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
$(CP) ./files/seafile.conf $(1)/etc/config/seafile
+ $(INSTALL_BIN) ./files/seafile.init $(1)/etc/init.d/seafile
+ $(INSTALL_BIN) ./files/seahub.init $(1)/etc/init.d/seahub
+ find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(CP) $(PKG_INSTALL_DIR)/usr/include/seafile/ $(1)/usr/include/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libseafile.so* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seafile/ $(1)$(PYTHON_PKG_DIR)/
+ $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/seaserv/ $(1)$(PYTHON_PKG_DIR)/
endef
define Package/seafile-server/postinst
#!/bin/sh
+[ ! -f /etc/init.d/seafile ] && exit 0
-if ! group_exists seafile; then
- group_add_next seafile; fi
-
-SEAFILE_GID=$$(grep -s '^seafile:' "$${IPKG_INSTROOT}/etc/group" | cut -d: -f3)
-
-if ! user_exists seafile; then
- user_add seafile "" "$${SEAFILE_GID}" seafile /usr/share/seafile /bin/sh; fi
-
-if [ -z "$${IPKG_INSTROOT}" ]
+if [ ! -d /usr/share/seafile/seafile-data ]
then
- chown -R seafile:seafile /usr/share/seafile/
- chmod -R o-rwx /usr/share/seafile/
+ echo "*** Installation completed, running configuration script..."
+ /etc/init.d/seafile setup
- if [ ! -d /usr/share/seafile/seafile-data ]
+ if [ $$? -ne 0 ]
then
- echo "*** Installation completed, running configuration script..."
- /etc/init.d/seafile setup
-
- if [ $$? -ne 0 ]
- then
- echo
- echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
- echo "*** \"/etc/init.d/seafile setup\""
- fi
-
echo
- echo "*** NOTE: you need to create an admin account before using Seafile."
- echo "*** Please run \"/etc/init.d/seafile create_admin\" to do so."
- else
- echo "*** It seems you are upgrading from an older version."
- echo "*** If so, please run the appropriate upgrade scripts before using the new version of Seafile."
- echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
- echo
- echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
+ echo "*** ERROR: Configuration failed. Please fix the issues if any and re-run the script using the command below:"
+ echo "*** \"/etc/init.d/seafile setup\""
fi
else
- cat > "$${IPKG_INSTROOT}/etc/uci-defaults/99_seafile-server" << EOF
-#!/bin/sh
-
-chown -R seafile:seafile /usr/share/seafile/
-chmod -R o-rwx /usr/share/seafile/
-exit 0
-EOF
+ echo "*** seafile-data directory already exists."
+ echo
+ echo "*** In case you are upgrading seafile, please run the appropriate upgrade script"
+ echo "*** manually before using the new version."
+ echo "*** Upgrade scripts are located at \"/usr/share/seafile/seafile-server/upgrade\""
+ echo
+ echo "*** For more information, please read http://manual.seafile.com/deploy/upgrade.html"
fi
endef
# Start Seahub in fastcgi mode - 1 = enable, 0 = disable
SEAHUB_FASTCGI=0
+# Listen on the port specified below (defaults to 8000)
+SEAHUB_PORT=8000
+# Method of serving requests (fastcgi mode only) - threaded or prefork
+# Using threaded mode is recommended as it consumes less resources
+SEAHUB_METHOD=threaded
+# The maximum number of worker processes/threads (fastcgi mode only)
+# General formula: (2 x $num_cores) + 1
+# To set the number of workers in WSGI mode (which is the default)
+# please edit /usr/share/seafile/seafile-server/runtime/seahub.conf
+SEAHUB_WORKERS=3
-#!/bin/sh /etc/rc.common
+#!/bin/bash /etc/rc.common
-START=99
+START=98
APP=seafile
EXTRA_HELP=" setup Runs the setup script
create_admin Creates the administrative login
reset_admin Alias to create_admin"
EXTRA_COMMANDS="setup create_admin reset_admin"
-SEAHUB_FASTCGI=0
+TOPDIR=/usr/share/seafile
+default_ccnet_conf_dir=${TOPDIR}/ccnet
+central_config_dir=${TOPDIR}/conf
+seaf_controller=/usr/bin/seafile-controller
-[ -f /etc/config/seafile ] && \
- . /etc/config/seafile
+function validate_ccnet_conf_dir () {
+ if [[ ! -d ${default_ccnet_conf_dir} ]]; then
+ echo "Error: there is no ccnet config directory."
+ echo "Have you run \"/etc/init.d/seafile setup\"?"
+ echo ""
+ exit 1
+ fi
+}
+
+function validate_central_conf_dir () {
+ if [[ ! -d ${central_config_dir} ]]; then
+ echo "Error: there is no conf/ directory."
+ echo "Have you run \"/etc/init.d/seafile setup\"?"
+ echo ""
+ exit 1
+ fi
+}
+
+function read_seafile_data_dir () {
+ seafile_ini=${default_ccnet_conf_dir}/seafile.ini
+ if [[ ! -f ${seafile_ini} ]]; then
+ echo "Error: ${seafile_ini} not found."
+ exit 1
+ fi
+ seafile_data_dir=$(cat "${seafile_ini}")
+ if [[ ! -d ${seafile_data_dir} ]]; then
+ echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
+ echo "Please check it first, or create this directory yourself."
+ echo ""
+ exit 1
+ fi
+}
+
+function test_config() {
+ if ! ${seaf_controller} --test \
+ -c "${default_ccnet_conf_dir}" \
+ -d "${seafile_data_dir}" \
+ -F "${central_config_dir}" ; then
+ exit 1
+ fi
+}
+
+function check_component_running() {
+ name=$1
+ cmd=$2
+ if pid=$(pgrep -f "$cmd" 2>/dev/null); then
+ return 1
+ fi
+}
-export PATH="/usr/share/seafile/seafile-server/seahub/thirdpart:${PATH}"
-export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:${PYTHONPATH}"
+function validate_already_running () {
+ check_component_running "seafile-controller" "seafile-controller -F ${central_config_dir}" || return 1
+ check_component_running "ccnet-server" "ccnet-server -F ${central_config_dir}" || return 1
+ check_component_running "seaf-server" "seaf-server -F ${central_config_dir}" || return 1
+ check_component_running "fileserver" "fileserver -F ${central_config_dir}" || return 1
+ check_component_running "seafdav" "wsgidav.server.run_server" || return 1
+}
+
+function start_seafile_server () {
+ if ! validate_already_running; then
+ if [[ "$name" == "seafile-controller" ]]; then
+ echo "Seafile already running."
+ else
+ echo "Error: component [$name] is already running. Please try stopping it manually by running \"kill $pid\"."
+ echo "To force killing the process, use \"kill -9 $pid\"."
+ fi
+ exit 1
+ fi
+ validate_central_conf_dir
+ validate_ccnet_conf_dir
+ read_seafile_data_dir
+ test_config
+
+ echo "Starting seafile server, please wait ..."
-start() {
- if [ ! -d /var/run/seafile ]
- then
- mkdir /var/run/seafile
- chown seafile:seafile /var/run/seafile
- chmod o-rwx /var/run/seafile
+ ${seaf_controller} \
+ -F "${central_config_dir}" \
+ -c "${default_ccnet_conf_dir}" \
+ -d "${seafile_data_dir}"
+
+ sleep 3
+
+ # check if seafile server started successfully
+ if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
+ echo "Failed to start seafile server"
+ exit 1
fi
- if [ ${SEAHUB_FASTCGI} -eq 1 ]; then
- cd "/usr/share/seafile" && \
- sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
- "/usr/bin/seafile-admin" start --fastcgi
+ echo "Seafile server started"
+ echo
+}
+
+function stop_seafile_server () {
+ if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
+ echo "Seafile server not running"
else
- cd "/usr/share/seafile" && \
- sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
- "/usr/bin/seafile-admin" start
+ echo "Stopping seafile server ..."
+ pkill -SIGTERM -f "seafile-controller -F ${central_config_dir}"
+ pkill -f "ccnet-server -F ${central_config_dir}"
+ pkill -f "seaf-server -F ${central_config_dir}"
+ pkill -f "fileserver -F ${central_config_dir}"
+ pkill -f "soffice.*--invisible --nocrashreport"
+ pkill -f "wsgidav.server.run_server"
+ retry=1
+ while ! validate_already_running && [ $retry -lt 60 ]; do sleep 1; ((retry++)); done
+ if ! validate_already_running; then
+ echo "Error: [$name] component is still running. Please try stopping it manually by running \"kill $pid\"."
+ echo "To force killing the process, use \"kill -9 $pid\"."
+ fi
+
fi
}
-stop() {
- cd "/usr/share/seafile" && \
- sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
- "/usr/bin/seafile-admin" stop
+function restart_seafile_server () {
+ stop_seafile_server
+ start_seafile_server
+}
+
+function start() {
+ start_seafile_server
+}
+
+function stop() {
+ stop_seafile_server
+}
+
+function restart() {
+ restart_seafile_server
}
-setup() {
- cd "/usr/share/seafile" && \
- sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
- "/usr/bin/seafile-admin" setup
+function setup() {
+ cd "$TOPDIR" && \
+ /usr/bin/seafile-admin setup
}
-create_admin() {
- cd "/usr/share/seafile" && \
- sudo PYTHONPATH="${PYTHONPATH}" -u seafile -E \
- "/usr/bin/seafile-admin" create-admin
+function create_admin() {
+ cd "$TOPDIR" && \
+ /usr/bin/seafile-admin create-admin
}
-reset_admin() {
+function reset_admin() {
create_admin
}
--- /dev/null
+#!/bin/bash /etc/rc.common
+
+START=99
+APP=seahub
+EXTRA_HELP=" clearsessions Clears expired sessions from database"
+EXTRA_COMMANDS="clearsessions"
+
+SEAHUB_FASTCGI=0
+SEAHUB_PORT=8000
+SEAHUB_METHOD=threaded
+SEAHUB_WORKERS=3
+
+[ -f /etc/config/seafile ] && \
+ . /etc/config/seafile
+
+INSTALLPATH=/usr/share/seafile/seafile-server
+TOPDIR=$(dirname "${INSTALLPATH}")
+default_ccnet_conf_dir=${TOPDIR}/ccnet
+central_config_dir=${TOPDIR}/conf
+
+manage_py=${INSTALLPATH}/seahub/manage.py
+gunicorn_conf=${INSTALLPATH}/runtime/seahub.conf
+pidfile=/var/run/seafile/seahub.pid
+errorlog=${INSTALLPATH}/runtime/error.log
+accesslog=${INSTALLPATH}/runtime/access.log
+gunicorn_exe=/usr/bin/gunicorn
+
+function check_python_executable() {
+ if [[ "$PYTHON" != "" && -x $PYTHON ]]; then
+ return 0
+ fi
+
+ if which python2.7 2>/dev/null 1>&2; then
+ PYTHON=python2.7
+ elif which python27 2>/dev/null 1>&2; then
+ PYTHON=python27
+ else
+ echo
+ echo "Can't find a python executable of version 2.7 or above in PATH"
+ echo "Install python 2.7+ before continue."
+ echo "Or if you installed it in a non-standard PATH, set the PYTHON enviroment varirable to it"
+ echo
+ exit 1
+ fi
+}
+
+function validate_ccnet_conf_dir() {
+ if [[ ! -d ${default_ccnet_conf_dir} ]]; then
+ echo "Error: there is no ccnet config directory."
+ echo "Have you run '/etc/init.d/seafile setup'?"
+ echo ""
+ exit 1
+ fi
+}
+
+function read_seafile_data_dir() {
+ seafile_ini=${default_ccnet_conf_dir}/seafile.ini
+ if [[ ! -f ${seafile_ini} ]]; then
+ echo "Error: ${seafile_ini} not found."
+ exit 1
+ fi
+ seafile_data_dir=$(cat "${seafile_ini}")
+ if [[ ! -d ${seafile_data_dir} ]]; then
+ echo "Your seafile server data directory \"${seafile_data_dir}\" is invalid or doesn't exits."
+ echo "Please check it first, or create this directory yourself."
+ echo ""
+ exit 1
+ fi
+}
+
+function validate_seahub_running() {
+ if pid=$(pgrep -f "${manage_py}" 2>/dev/null); then
+ return 1
+ elif pid=$(pgrep -f "seahub.wsgi:application" 2>/dev/null); then
+ return 1
+ fi
+}
+
+function validate_port() {
+ if ! [[ ${SEAHUB_PORT} =~ ^[1-9][0-9]{1,4}$ ]] ; then
+ printf "\033[033m${SEAHUB_PORT}\033[m is not a valid port number\n"
+ exit 1
+ fi
+}
+
+function warning_if_seafile_not_running() {
+ if ! pgrep -f "seafile-controller -F ${central_config_dir}" 2>/dev/null 1>&2; then
+ echo
+ echo "Error: seafile-controller not running. Have you run \"/etc/init.d/seafile start\"?"
+ echo
+ exit 1
+ fi
+}
+
+function prepare_seahub_log_dir() {
+ logdir="${TOPDIR}/logs"
+ if ! [[ -d "${logsdir}" ]]; then
+ if ! mkdir -p "${logdir}"; then
+ echo "Error: failed to create log dir \"${logdir}\""
+ exit 1
+ fi
+ fi
+ export SEAHUB_LOG_DIR="${logdir}"
+}
+
+function before_start() {
+ prepare_env
+ warning_if_seafile_not_running
+ if ! validate_seahub_running; then
+ echo "Seahub is already running."
+ exit 1
+ fi
+ prepare_seahub_log_dir
+ validate_port
+}
+
+function start_seahub() {
+ before_start
+ echo "Starting seahub at port ${SEAHUB_PORT} ..."
+ check_init_admin
+ $PYTHON $gunicorn_exe seahub.wsgi:application -c "${gunicorn_conf}" -b "0.0.0.0:${SEAHUB_PORT}" --preload
+
+ # Ensure seahub is started successfully
+ retry=1
+ while ! validate_seahub_running && [[ ! -f "${pidfile}" ]] && [[ $retry -lt 120 ]]; do sleep 1; ((retry++)); done
+ if ! validate_seahub_running && [[ -f "${pidfile}" ]]; then
+ echo
+ echo "Seahub is started"
+ echo
+ else
+ printf "\033[33mError: Seahub failed to start.\033[m\n"
+ exit 1
+ fi
+}
+
+function start_seahub_fastcgi() {
+ before_start
+
+ # Returns 127.0.0.1 if SEAFILE_FASTCGI_HOST is unset or hasn't got any value,
+ # otherwise returns value of SEAFILE_FASTCGI_HOST environment variable
+ address=`(test -z "$SEAFILE_FASTCGI_HOST" && echo "127.0.0.1") || echo $SEAFILE_FASTCGI_HOST`
+
+ echo "Starting seahub (fastcgi) at ${address}:${SEAHUB_PORT} ..."
+ check_init_admin
+ $PYTHON "${manage_py}" runfcgi host=${address} port=${SEAHUB_PORT} pidfile=${pidfile} \
+ outlog=${accesslog} errlog=${errorlog} maxchildren=${SEAHUB_WORKERS} method=${SEAHUB_METHOD}
+
+ # Ensure seahub is started successfully
+ retry=1
+ while ! validate_seahub_running && [[ ! -f "${pidfile}" ]] && [[ $retry -lt 120 ]]; do sleep 1; ((retry++)); done
+ if ! validate_seahub_running && [[ -f "${pidfile}" ]]; then
+ echo
+ echo "Seahub is started"
+ echo
+ else
+ printf "\033[33mError: Seahub failed to start.\033[m\n"
+ exit 1
+ fi
+}
+
+function prepare_env() {
+ check_python_executable
+ validate_ccnet_conf_dir
+ read_seafile_data_dir
+
+ export CCNET_CONF_DIR=${default_ccnet_conf_dir}
+ export SEAFILE_CONF_DIR=${seafile_data_dir}
+ export SEAFILE_CENTRAL_CONF_DIR=${central_config_dir}
+ export PYTHONPATH="${INSTALLPATH}/seahub:${INSTALLPATH}/seahub/thirdpart:${PYTHONPATH}"
+}
+
+function clear_sessions() {
+ prepare_env
+
+ echo "Start clear expired session records ..."
+ $PYTHON "${manage_py}" clearsessions
+
+ echo
+ echo "Done"
+ echo
+}
+
+function stop_seahub() {
+ if [[ -f ${pidfile} ]]; then
+ pid=$(cat "${pidfile}")
+ echo "Stopping seahub ..."
+ kill ${pid}
+ rm -f ${pidfile}
+ retry=1
+ while ! validate_seahub_running && [ $retry -lt 60 ]; do sleep 1; ((retry++)); done
+ if ! validate_seahub_running; then
+ echo "Error: seahub cannot be stopped. Please try stopping it manually by running \"kill $(echo "$pid" | tr '\n' ' ')\"."
+ echo "To force killing the processes, use \"kill -9 $(echo "$pid" | tr '\n' ' ')\"."
+ fi
+ else
+ echo "Seahub is not running"
+ fi
+}
+
+function check_init_admin() {
+ check_init_admin_script=${INSTALLPATH}/check_init_admin.py
+ if ! $PYTHON $check_init_admin_script; then
+ exit 1
+ fi
+}
+
+function start() {
+ if [ "$SEAHUB_FASTCGI" == "1" ]; then
+ start_seahub_fastcgi
+ else
+ start_seahub
+ fi
+}
+
+function stop() {
+ stop_seahub
+}
+
+function restart() {
+ stop
+ start
+}
+
+function clearsessions() {
+ clear_sessions
+}
-diff -rupN seafile-3.1.7-server.orig/scripts/seaf-gc.sh seafile-3.1.7-server/scripts/seaf-gc.sh
---- seafile-3.1.7-server.orig/scripts/seaf-gc.sh 2014-10-16 05:30:04.000000000 +0200
-+++ seafile-3.1.7-server/scripts/seaf-gc.sh 2014-12-13 00:51:12.919136978 +0100
-@@ -6,11 +6,10 @@ SCRIPT=$(readlink -f "$0")
- INSTALLPATH=$(dirname "${SCRIPT}")
+diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fsck.sh seafile-server-5.1.1/scripts/seaf-fsck.sh
+--- seafile-server-5.1.1.orig/scripts/seaf-fsck.sh 2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/seaf-fsck.sh 2016-04-22 09:10:13.075581325 +0200
+@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
TOPDIR=$(dirname "${INSTALLPATH}")
default_ccnet_conf_dir=${TOPDIR}/ccnet
+ default_conf_dir=${TOPDIR}/conf
+-seaf_fsck=${INSTALLPATH}/seafile/bin/seaf-fsck
++seaf_fsck=/usr/bin/seaf-fsck
+
+ export PATH=${INSTALLPATH}/seafile/bin:$PATH
+ export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
+diff -rupN seafile-server-5.1.1.orig/scripts/seaf-gc.sh seafile-server-5.1.1/scripts/seaf-gc.sh
+--- seafile-server-5.1.1.orig/scripts/seaf-gc.sh 2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/seaf-gc.sh 2016-04-22 09:10:27.211581999 +0200
+@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
+ TOPDIR=$(dirname "${INSTALLPATH}")
+ default_ccnet_conf_dir=${TOPDIR}/ccnet
+ default_conf_dir=${TOPDIR}/conf
-seaf_gc=${INSTALLPATH}/seafile/bin/seafserv-gc
+seaf_gc=/usr/bin/seafserv-gc
seaf_gc_opts=""
--export PATH=${INSTALLPATH}/seafile/bin:$PATH
--export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
-+export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH"
-
- script_name=$0
- function usage () {
-@@ -78,9 +77,7 @@ function run_seaf_gc () {
-
- echo "Starting seafserv-gc, please wait ..."
-
-- LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH ${seaf_gc} \
-- -c "${default_ccnet_conf_dir}" -d "${seafile_data_dir}" \
-- ${seaf_gc_opts}
-+ ${seaf_gc} -c "${default_ccnet_conf_dir}" -d "${seafile_data_dir}" ${seaf_gc_opts}
+ export PATH=${INSTALLPATH}/seafile/bin:$PATH
+diff -rupN seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh seafile-server-5.1.1/scripts/setup-seafile-mysql.sh
+--- seafile-server-5.1.1.orig/scripts/setup-seafile-mysql.sh 2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/setup-seafile-mysql.sh 2016-04-22 09:11:50.083585953 +0200
+@@ -40,15 +40,10 @@ function check_python_executable() {
+ function check_python_module () {
+ module=$1
+ name=$2
+- hint=$3
+ printf " Checking python module: ${name} ... "
+ if ! $PYTHON -c "import ${module}" 2>/dev/null 1>&2; then
+ echo
+ printf "\033[33m ${name} \033[m is not installed, Please install it first.\n"
+- if [[ "${hint}" != "" ]]; then
+- printf "${hint}"
+- echo
+- fi
+ err_and_quit;
+ fi
+ echo -e "Done."
+@@ -70,14 +65,10 @@ function check_python () {
+ if [[ $PYTHON == "python2.6" ]]; then
+ py26="2.6"
+ fi
+- hint="\nOn Debian/Ubntu: apt-get install python-setuptools\nOn CentOS/RHEL: yum install python${py26}-distribute"
+- check_python_module pkg_resources setuptools "${hint}"
+-
+- hint="\nOn Debian/Ubntu: apt-get install python-imaging\nOn CentOS/RHEL: yum install python${py26}-imaging"
+- check_python_module PIL python-imaging "${hint}"
- echo "seafserv-gc run done"
+- hint='\nOn Debian/Ubuntu:\n\nsudo apt-get install python-mysqldb\n\nOn CentOS/RHEL:\n\nsudo yum install MySQL-python'
+- check_python_module MySQLdb python-mysqldb "${hint}"
++ check_python_module pkg_resources setuptools
++ check_python_module PIL python-imaging
++ check_python_module MySQLdb python-mysqldb
+ fi
echo
-diff -rupN seafile-3.1.7-server.orig/scripts/setup-seafile-mysql.sh seafile-3.1.7-server/scripts/setup-seafile-mysql.sh
---- seafile-3.1.7-server.orig/scripts/setup-seafile-mysql.sh 2014-10-16 05:30:04.000000000 +0200
-+++ seafile-3.1.7-server/scripts/setup-seafile-mysql.sh 2014-12-13 00:51:49.242172631 +0100
-@@ -9,6 +9,8 @@ set -e
- SCRIPT=$(readlink -f "$0")
- INSTALLPATH=$(dirname "${SCRIPT}")
+ }
+@@ -85,5 +76,6 @@ function check_python () {
+ check_python;
+ export PYTHON=$PYTHON
+export PYTHONPATH="/usr/share/seafile/seafile-server/seahub/thirdpart:$PYTHONPATH"
-+
- cd "$INSTALLPATH"
- python_script=setup-seafile-mysql.py
+ exec $PYTHON "$python_script"
+diff -rupN seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh seafile-server-5.1.1/scripts/sqlite2mysql.sh
+--- seafile-server-5.1.1.orig/scripts/sqlite2mysql.sh 2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/scripts/sqlite2mysql.sh 2016-04-22 09:02:22.047558854 +0200
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # This shell script and corresponding sqlite2mysql.py are used to
+ # migrate Seafile data from SQLite to MySQL.
-diff -rupN seafile-3.1.7-server.orig/controller/seafile-controller.c seafile-3.1.7-server/controller/seafile-controller.c
---- seafile-3.1.7-server.orig/controller/seafile-controller.c 2014-10-16 05:30:04.000000000 +0200
-+++ seafile-3.1.7-server/controller/seafile-controller.c 2014-11-28 16:50:24.053674057 +0100
+diff -rupN seafile-server-5.1.1.orig/controller/seafile-controller.c seafile-server-5.1.1/controller/seafile-controller.c
+--- seafile-server-5.1.1.orig/controller/seafile-controller.c 2016-04-19 15:44:32.000000000 +0200
++++ seafile-server-5.1.1/controller/seafile-controller.c 2016-04-19 16:23:05.785000218 +0200
@@ -21,7 +21,7 @@
SeafileController *ctl;
char *bin_dir = NULL;
char *installpath = NULL;
-@@ -614,9 +614,9 @@ stop_ccnet_server ()
+@@ -575,9 +575,9 @@ stop_ccnet_server ()
static void
init_pidfile_path (SeafileController *ctl)
{
-diff -rupN seafile-3.1.7-server.orig/tools/seafile-admin seafile-3.1.7-server/tools/seafile-admin
---- seafile-3.1.7-server.orig/tools/seafile-admin 2014-10-16 05:30:04.000000000 +0200
-+++ seafile-3.1.7-server/tools/seafile-admin 2014-12-22 21:52:25.929781054 +0100
-@@ -416,13 +416,13 @@ def create_gunicorn_conf():
- content = '''\
- import os
- daemon = True
--workers = 3
-+workers = 1
-+threads = 3
+diff -rupN seafile-server-5.1.1.orig/tools/seafile-admin seafile-server-5.1.1/tools/seafile-admin
+--- seafile-server-5.1.1.orig/tools/seafile-admin 2016-04-19 15:44:33.000000000 +0200
++++ seafile-server-5.1.1/tools/seafile-admin 2016-04-26 10:55:11.826798430 +0200
+@@ -449,9 +449,12 @@ workers = 3
# Logging
runtime_dir = os.path.dirname(__file__)
-pidfile = os.path.join(runtime_dir, 'seahub.pid')
+pidfile = '/var/run/seafile/seahub.pid'
errorlog = os.path.join(runtime_dir, 'error.log')
--accesslog = os.path.join(runtime_dir, 'access.log')
+ accesslog = os.path.join(runtime_dir, 'access.log')
++
++# for file upload, we need a longer timeout value (default is only 30s, too short)
++timeout = 1200
'''
+
try:
- with open(confpath, 'w') as fp:
-@@ -607,6 +607,7 @@ def start_seahub_gunicorn():
- 'gunicorn_django',
- '-c', conf[CONF_SEAHUB_CONF],
- '-b', '0.0.0.0:%s' % conf[CONF_SEAHUB_PORT],
-+ '-t', '120',
- ]
+@@ -526,6 +529,7 @@ def check_django_version():
- info('Starting seahub...')
-@@ -625,6 +626,7 @@ def start_seahub_fastcgi():
- 'pidfile=%(pidfile)s',
- 'outlog=%(outlog)s',
- 'errlog=%(errlog)s',
-+ 'method=threaded',
- ]
- cmdline = ' '.join(argv) % \
-@@ -693,7 +695,7 @@ def check_layout(args):
- conf[CONF_SEAFILE_DIR] = seafile_data_dir
- conf[CONF_SEAHUB_DIR] = seahub_dir
- conf[CONF_SEAHUB_CONF] = seahub_conf
-- conf[CONF_SEAHUB_PIDFILE] = os.path.join(runtime_dir, 'seahub.pid')
-+ conf[CONF_SEAHUB_PIDFILE] = '/var/run/seafile/seahub.pid'
- conf[CONF_SEAHUB_OUTLOG] = os.path.join(runtime_dir, 'access.log')
- conf[CONF_SEAHUB_ERRLOG] = os.path.join(runtime_dir, 'error.log')
+ def check_python_module(import_name, package_name=None, silent=False):
++ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "seahub.settings")
+ package_name = package_name or import_name
+ if not silent:
+ info('checking %s' % package_name)
+@@ -785,7 +789,7 @@ def check_layout(args):
+ conf[CONF_SEAFILE_DIR] = seafile_data_dir
+ conf[CONF_SEAHUB_DIR] = seahub_dir
+ conf[CONF_SEAHUB_CONF] = seahub_conf
+- conf[CONF_SEAHUB_PIDFILE] = os.path.join(runtime_dir, 'seahub.pid')
++ conf[CONF_SEAHUB_PIDFILE] = '/var/run/seafile/seahub.pid'
+ conf[CONF_SEAHUB_OUTLOG] = os.path.join(runtime_dir, 'access.log')
+ conf[CONF_SEAHUB_ERRLOG] = os.path.join(runtime_dir, 'error.log')
-@@ -738,10 +740,9 @@ def setup_seafile(args):
+@@ -836,10 +840,13 @@ def setup_seafile(args):
print '-----------------------------------------------------------------'
print '-----------------------------------------------------------------'
print
- print 'To start/stop seafile server:'
-+ print 'To start, stop or restart seafile server, please run as root:'
++ print 'To start, stop or restart seafile:'
++ print
++ print highlight(' # /etc/init.d/seafile { start | stop | restart }')
print
- print highlight(' $ cd %s' % cwd)
- print highlight(' $ %s { start | stop }' % SCRIPT_NAME)
-+ print highlight(' # /etc/init.d/seafile { start | stop | restart }')
++ print 'To start, stop or restart seahub:'
++ print
++ print highlight(' # /etc/init.d/seahub { start | stop | restart }')
print
print 'If you have any problem, refer to\n'
print
-@@ -802,8 +803,7 @@ def start_seafile(args):
+@@ -903,8 +910,7 @@ def start_seafile(args):
def stop_seafile(dummy):
info('Stopping seafile server')
pkill('seafile-controller')
+++ /dev/null
-diff -rupN seafile-server-4.1.2.orig/server/Makefile.am seafile-server-4.1.2/server/Makefile.am
---- seafile-server-4.1.2.orig/server/Makefile.am 2015-05-02 11:04:11.000000000 +0200
-+++ seafile-server-4.1.2/server/Makefile.am 2015-06-14 01:28:55.924834806 +0200
-@@ -4,6 +4,7 @@ AM_CFLAGS = -DPKGDATADIR=\"$(pkgdatadir)
- -DPACKAGE_DATA_DIR=\""$(pkgdatadir)"\" \
- -DSEAFILE_SERVER \
- -DFULL_FEATURE \
-+ -I$(STAGING_DIR)/usr/include/libevhtp-1.1 \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/lib \
- -I$(top_builddir)/lib \
-@@ -122,4 +123,4 @@ seaf_server_LDADD = @CCNET_LIBS@ \
- @SEARPC_LIBS@ @JANSSON_LIBS@ @ZDB_LIBS@ @CURL_LIBS@ ${LIB_WS32} @ZLIB_LIBS@ \
- @LIBARCHIVE_LIBS@
-
--seaf_server_LDFLAGS = @STATIC_COMPILE@ @SERVER_PKG_RPATH@
-+seaf_server_LDFLAGS = @STATIC_COMPILE@ @SERVER_PKG_RPATH@ -L$(STAGING_DIR)/usr/lib/libevhtp-1.1
--- /dev/null
+diff -rupN seafile-server-5.1.1.orig/lib/Makefile.am seafile-server-5.1.1/lib/Makefile.am
+--- seafile-server-5.1.1.orig/lib/Makefile.am 2016-04-21 11:05:26.000000000 +0200
++++ seafile-server-5.1.1/lib/Makefile.am 2016-04-22 10:09:41.567751561 +0200
+@@ -1,3 +1,5 @@
++include $(TOPDIR)/rules.mk
++
+ pcfiles = libseafile.pc
+ pkgconfig_DATA = $(pcfiles)
+ pkgconfigdir = $(libdir)/pkgconfig
+@@ -35,7 +37,7 @@ seafile-rpc-wrapper.c: seafile-object.h
+
+ seafile-object.h: ${seafile_object_define}
+ rm -f $@
+- valac --pkg posix ${seafile_object_define} -C -H seafile-object.h
++ "$(STAGING_DIR)/host/bin/valac" --pkg posix ${seafile_object_define} -C -H seafile-object.h
+
+ DISTCLEANFILES = ${searpc_gen}
+
+@@ -64,7 +66,7 @@ rpc_table.stamp: ${top_srcdir}/lib/rpc_t
+ @rm -f rpc_table.tmp
+ @touch rpc_table.tmp
+ @echo "[libsearpc]: generating rpc header files"
+- @PYTHON@ `which searpc-codegen.py` ${top_srcdir}/lib/rpc_table.py
++ @PYTHON@ "$(STAGING_DIR)/usr/bin/searpc-codegen.py" ${top_srcdir}/lib/rpc_table.py
+ @echo "[libsearpc]: done"
+ @mv -f rpc_table.tmp $@
+
+@@ -74,7 +76,7 @@ vala.stamp: ${seafile_object_define}
+ rm -f ${seafile_object_gen}
+ @rm -f vala.tmp
+ @touch vala.tmp
+- valac -C --pkg posix $^
++ "$(STAGING_DIR)/host/bin/valac" -C --pkg posix $^
+ @mv -f vala.tmp $@
+
+ ${seafile_object_gen}: vala.stamp
+@@ -90,5 +92,5 @@ install-data-local:
+ if MACOS
+ sed -i '' -e "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
+ else
+- ${SED} -i "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
++ ${SED} "s|(DESTDIR)|${DESTDIR}|g" $(pcfiles)
+ endif
+++ /dev/null
-diff -rupN seafile-server-4.1.2.orig/lib/net.c seafile-server-4.1.2/lib/net.c
---- seafile-server-4.1.2.orig/lib/net.c 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/lib/net.c 2015-09-14 20:20:30.906021296 +0200
-@@ -31,11 +31,7 @@
-
- #include <fcntl.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #include "net.h"
-
-diff -rupN seafile-server-4.1.2.orig/lib/net.h seafile-server-4.1.2/lib/net.h
---- seafile-server-4.1.2.orig/lib/net.h 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/lib/net.h 2015-09-14 20:20:30.906021296 +0200
-@@ -19,11 +19,7 @@
- #include <netinet/tcp.h>
- #endif
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #ifdef WIN32
- #define ECONNREFUSED WSAECONNREFUSED
-diff -rupN seafile-server-4.1.2.orig/lib/utils.h seafile-server-4.1.2/lib/utils.h
---- seafile-server-4.1.2.orig/lib/utils.h 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/lib/utils.h 2015-09-14 20:20:30.907021326 +0200
-@@ -13,11 +13,7 @@
- #include <stdlib.h>
- #include <sys/stat.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/util.h>
--#else
--#include <evutil.h>
--#endif
-
- #ifdef __linux__
- #include <endian.h>
-diff -rupN seafile-server-4.1.2.orig/server/access-file.c seafile-server-4.1.2/server/access-file.c
---- seafile-server-4.1.2.orig/server/access-file.c 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/server/access-file.c 2015-09-14 20:20:30.907021326 +0200
-@@ -3,13 +3,9 @@
- #define DEBUG_FLAG SEAFILE_DEBUG_HTTP
- #include "log.h"
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
- #include <event2/bufferevent.h>
- #include <event2/bufferevent_struct.h>
--#else
--#include <event.h>
--#endif
-
- #include <evhtp.h>
-
-diff -rupN seafile-server-4.1.2.orig/server/http-server.c seafile-server-4.1.2/server/http-server.c
---- seafile-server-4.1.2.orig/server/http-server.c 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/server/http-server.c 2015-09-14 20:20:30.908021355 +0200
-@@ -6,11 +6,7 @@
- #include <locale.h>
- #include <sys/types.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
--#else
--#include <event.h>
--#endif
-
- #include <evhtp.h>
-
-diff -rupN seafile-server-4.1.2.orig/server/listen-mgr.c seafile-server-4.1.2/server/listen-mgr.c
---- seafile-server-4.1.2.orig/server/listen-mgr.c 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/server/listen-mgr.c 2015-09-14 20:23:15.614452334 +0200
-@@ -3,11 +3,9 @@
- #include <event2/event.h>
- #include <event2/listener.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/bufferevent.h>
- #include <event2/buffer_compat.h>
- #include <event2/bufferevent_struct.h>
--#endif
-
-
- #include "seafile-session.h"
-diff -rupN seafile-server-4.1.2.orig/server/upload-file.c seafile-server-4.1.2/server/upload-file.c
---- seafile-server-4.1.2.orig/server/upload-file.c 2015-09-09 19:31:56.000000000 +0200
-+++ seafile-server-4.1.2/server/upload-file.c 2015-09-14 20:20:30.909021385 +0200
-@@ -6,11 +6,7 @@
- #include <getopt.h>
- #include <fcntl.h>
-
--#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
- #include <event2/event.h>
--#else
--#include <event.h>
--#endif
-
- #include <evhtp.h>
-
--- /dev/null
+diff -rupN seafile-server-5.1.1.orig/lib/repo.vala seafile-server-5.1.1/lib/repo.vala
+--- seafile-server-5.1.1.orig/lib/repo.vala 2016-04-19 15:44:32.000000000 +0200
++++ seafile-server-5.1.1/lib/repo.vala 2016-04-25 21:29:33.327962235 +0200
+@@ -30,7 +30,7 @@ public class Repo : Object {
+ // data format version
+ public int version { get; set; }
+
+- public int last_modify { get; set; }
++ public int64 last_modify { get; set; }
+ public int64 size { get; set; }
+ public int64 file_count { get; set; }
+ public string head_cmmt_id { get; set; }
+@@ -40,7 +40,7 @@ public class Repo : Object {
+ public string repo_id { get; set; }
+ public string repo_name { get; set; }
+ public string repo_desc { get; set; }
+- public int last_modified { get; set; }
++ public int64 last_modified { get; set; }
+
+ // Section 2: Encryption related
+ // Members in this section should be set for every Repo object
+@@ -63,7 +63,7 @@ public class Repo : Object {
+ get { return _relay_id; }
+ set { _relay_id = value; }
+ }
+- public int last_sync_time { get; set; }
++ public int64 last_sync_time { get; set; }
+ public bool auto_sync { get; set; }
+ public bool worktree_invalid { get; set; }
+
+@@ -155,7 +155,7 @@ public class DeletedEntry : Object {
+ public string obj_name { get; set; }
+ public string basedir { get; set; }
+ public int mode { get; set; }
+- public int delete_time { get; set; }
++ public int64 delete_time { get; set; }
+ public int64 file_size { get; set; }
+ public string scan_stat { get; set; }
+ }
--- /dev/null
+diff -rupN seafile-server-5.1.1.orig/scripts/seaf-fuse.sh seafile-server-5.1.1/scripts/seaf-fuse.sh
+--- seafile-server-5.1.1.orig/scripts/seaf-fuse.sh 2016-05-29 08:43:19.000000000 +0200
++++ seafile-server-5.1.1/scripts/seaf-fuse.sh 2016-05-29 09:13:06.286680653 +0200
+@@ -7,7 +7,7 @@ INSTALLPATH=$(dirname "${SCRIPT}")
+ TOPDIR=$(dirname "${INSTALLPATH}")
+ default_ccnet_conf_dir=${TOPDIR}/ccnet
+ default_conf_dir=${TOPDIR}/conf
+-seaf_fuse=${INSTALLPATH}/seafile/bin/seaf-fuse
++seaf_fuse=/usr/bin/seaf-fuse
+
+ export PATH=${INSTALLPATH}/seafile/bin:$PATH
+ export SEAFILE_LD_LIBRARY_PATH=${INSTALLPATH}/seafile/lib/:${INSTALLPATH}/seafile/lib64:${LD_LIBRARY_PATH}
+@@ -68,7 +68,7 @@ function validate_already_running () {
+ }
+
+ function warning_if_seafile_not_running () {
+- if ! pgrep -f "seafile-controller -c ${default_ccnet_conf_dir}" 2>/dev/null 1>&2; then
++ if ! pgrep -f "seafile-controller -F ${default_conf_dir}" 2>/dev/null 1>&2; then
+ echo
+ echo "Warning: seafile-controller not running. Have you run \"./seafile.sh start\" ?"
+ echo
#
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=ser2net
-PKG_VERSION:=2.10.0
-PKG_RELEASE:=2
+PKG_VERSION:=3.0
+PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/ser2net
-PKG_MD5SUM:=cd937041144de83d41d811521e72158c
+PKG_MD5SUM:=bf8af8cfacd35828a9778d69972f6345
PKG_LICENSE:=GPL-2.0+
PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
+PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
+++ /dev/null
-ser2net: Fix compilation failures due to missing TIOCSRS485 macro
-
-Patch sent upstream:
- https://sourceforge.net/p/ser2net/mailman/message/32905302/
-
-Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
-
-From: Yegor Yefremov <yegorslists@googlemail.com>
-
-include <asm-generic/ioctls.h> fixes compilations for systems,
-where <asm-generic/ioctls.h> won't be included automatically.
-
-Move special Linux includes to dataxfer.h.
-
-Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
----
- dataxfer.h | 5 +++--
- devcfg.c | 2 --
- 2 files changed, 3 insertions(+), 4 deletions(-)
-
---- a/dataxfer.h
-+++ b/dataxfer.h
-@@ -20,8 +20,6 @@
- #ifndef DATAXFER
- #define DATAXFER
-
--#include <linux/serial.h>
--
- #include "controller.h"
-
- #ifdef USE_UUCP_LOCKING
-@@ -30,6 +28,9 @@ extern int uucp_locking_enabled;
-
- #ifdef linux
-
-+#include <linux/serial.h>
-+#include <asm-generic/ioctls.h>
-+
- #define USE_RS485_FEATURE
-
- /* Check, if the toolchain provides serial_rs485 structure and macros */
---- a/devcfg.c
-+++ b/devcfg.c
-@@ -18,7 +18,6 @@
- */
-
- /* This code handles generating the configuration for the serial port. */
--
- #include <unistd.h>
- #include <termios.h>
- #include <sys/ioctl.h>
-@@ -31,7 +30,6 @@
- #include <signal.h>
- #include <errno.h>
- #include <syslog.h>
--#include <linux/serial.h>
-
- #include "ser2net.h"
- #include "selector.h"
+++ /dev/null
-From fa68debd94d40299dd2a69abd0a820ccfaadcbe8 Mon Sep 17 00:00:00 2001
-From: Michael Heimpold <michael.heimpold@i2se.com>
-Date: Wed, 22 Apr 2015 13:35:43 +0200
-Subject: [PATCH] Add support for triggering LEDs during serial traffic
-
-Signed-off-by: Michael Heimpold <michael.heimpold@i2se.com>
----
-
-Patch sent upstream:
- http://sourceforge.net/p/ser2net/mailman/message/34064847/
-
- Makefile.am | 4 +--
- dataxfer.c | 20 ++++++++++++
- readconfig.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- ser2net.conf | 13 ++++++++
- sysfs-led.c | 43 +++++++++++++++++++++++++
- sysfs-led.h | 11 +++++++
- utils.c | 30 ++++++++++++++++++
- utils.h | 9 ++++++
- 8 files changed, 228 insertions(+), 2 deletions(-)
- create mode 100644 sysfs-led.c
- create mode 100644 sysfs-led.h
-
-diff --git a/Makefile.am b/Makefile.am
-index d56179f..866eb89 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -2,9 +2,9 @@ sbin_PROGRAMS = ser2net
- ACLOCAL_AMFLAGS = -I m4
- AM_CFLAGS=-Wall
- ser2net_SOURCES = controller.c dataxfer.c devcfg.c readconfig.c selector.c \
-- ser2net.c utils.c telnet.c buffer.c
-+ ser2net.c utils.c telnet.c buffer.c sysfs-led.c
- noinst_HEADERS = controller.h dataxfer.h devio.h readconfig.h selector.h \
-- utils.h telnet.h buffer.h ser2net.h
-+ utils.h telnet.h buffer.h sysfs-led.h ser2net.h
- man_MANS = ser2net.8
- EXTRA_DIST = $(man_MANS) ser2net.conf ser2net.spec ser2net.init
-
-diff --git a/dataxfer.c b/dataxfer.c
-index 646a71b..b99cabf 100644
---- a/dataxfer.c
-+++ b/dataxfer.c
-@@ -42,6 +42,7 @@
- #include "telnet.h"
- #include "devio.h"
- #include "buffer.h"
-+#include "sysfs-led.h"
-
- #define SERIAL "term"
- #define NET "tcp "
-@@ -230,6 +231,12 @@ typedef struct port_info
- #ifdef USE_RS485_FEATURE
- struct serial_rs485 *rs485conf;
- #endif
-+
-+ /*
-+ * LED names to flash for serial traffic
-+ */
-+ char *led_tx;
-+ char *led_rx;
- } port_info_t;
-
- port_info_t *ports = NULL; /* Linked list of ports. */
-@@ -311,6 +318,8 @@ init_port_data(port_info_t *port)
- #ifdef USE_RS485_FEATURE
- port->rs485conf = NULL;
- #endif
-+ port->led_tx = NULL;
-+ port->led_rx = NULL;
- }
-
- static void
-@@ -530,6 +539,9 @@ handle_dev_fd_read(struct devio *io)
- /* Do both tracing, ignore errors. */
- do_trace(port, port->tb, port->dev_to_tcp.buf, count, SERIAL);
-
-+ if (port->led_rx)
-+ led_blink_kick(port->led_rx);
-+
- port->dev_bytes_received += count;
-
- if (port->enabled == PORT_TELNET) {
-@@ -759,6 +771,8 @@ handle_tcp_fd_read(int fd, void *data)
- return;
- }
- } else {
-+ if (port->led_tx)
-+ led_blink_kick(port->led_tx);
- port->dev_bytes_sent += count;
- port->tcp_to_dev.cursize -= count;
- if (port->tcp_to_dev.cursize != 0) {
-@@ -1854,6 +1868,12 @@ myconfig(void *data, struct absout *eout, const char *pos)
- } else if (strncmp(pos, "tb=", 3) == 0) {
- /* trace both directions. */
- port->trace_both.filename = find_tracefile(pos + 3);
-+ } else if (strncmp(pos, "led-rx=", 7) == 0) {
-+ /* LED for UART RX traffic */
-+ port->led_rx = find_led(pos + 7);
-+ } else if (strncmp(pos, "led-tx=", 7) == 0) {
-+ /* LED for UART TX traffic */
-+ port->led_tx = find_led(pos + 7);
- #ifdef USE_RS485_FEATURE
- } else if (strncmp(pos, "rs485=", 6) == 0) {
- /* get RS485 configuration. */
-diff --git a/readconfig.c b/readconfig.c
-index d4ca0d4..62cff5c 100644
---- a/readconfig.c
-+++ b/readconfig.c
-@@ -31,6 +31,7 @@
- #include "readconfig.h"
- #include "utils.h"
- #include "telnet.h"
-+#include "sysfs-led.h"
-
- #define MAX_LINE_SIZE 256 /* Maximum line length in the config file. */
-
-@@ -361,6 +362,89 @@ free_rs485confs(void)
- }
- #endif
-
-+struct led_s
-+{
-+ char *name;
-+ char *device;
-+ unsigned int duration;
-+ struct led_s *next;
-+};
-+
-+/* all LEDs in the system. */
-+struct led_s *leds = NULL;
-+
-+static void
-+handle_led(char *name, char *cfg)
-+{
-+ struct led_s *new_led;
-+ char devicename[256];
-+
-+ new_led = malloc(sizeof(*new_led));
-+ if (!new_led) {
-+ syslog(LOG_ERR, "Out of memory handling LED on %d", lineno);
-+ return;
-+ }
-+
-+ new_led->name = strdup(name);
-+ if (!new_led->name) {
-+ syslog(LOG_ERR, "Out of memory handling LED on %d", lineno);
-+ free(new_led);
-+ return;
-+ }
-+
-+ if (sscanf(cfg, "%256s %u", devicename, &new_led->duration) != 2) {
-+ syslog(LOG_ERR, "Couldn't parse LED config on %d", lineno);
-+ free(new_led->name);
-+ free(new_led);
-+ return;
-+ }
-+
-+ new_led->device = strdup(devicename);
-+ if (!new_led->device) {
-+ syslog(LOG_ERR, "Out of memory handling LED on %d", lineno);
-+ free(new_led->name);
-+ free(new_led);
-+ return;
-+ }
-+
-+ /* setup the led */
-+ led_blink_prepare(new_led->device, new_led->duration);
-+
-+ new_led->next = leds;
-+ leds = new_led;
-+}
-+
-+char *
-+find_led(const char *name)
-+{
-+ struct led_s *led = leds;
-+
-+ while (led) {
-+ if (strcmp(name, led->name) == 0)
-+ return strdup(led->device);
-+ led = led->next;
-+ }
-+ syslog(LOG_ERR, "LED %s not found, it will be ignored", name);
-+ return NULL;
-+}
-+
-+static void
-+free_leds(void)
-+{
-+ struct led_s *led;
-+
-+ while (leds) {
-+ led = leds;
-+ leds = leds->next;
-+
-+ led_off(led->device);
-+
-+ free(led->name);
-+ free(led->device);
-+ free(led);
-+ }
-+}
-+
- static int
- startswith(char *str, const char *test, char **strtok_data)
- {
-@@ -503,6 +587,21 @@ handle_config_line(char *inbuf)
- return;
- }
-
-+ if (startswith(inbuf, "LED", &strtok_data)) {
-+ char *name = strtok_r(NULL, ":", &strtok_data);
-+ char *str = strtok_r(NULL, "\n", &strtok_data);
-+ if (name == NULL) {
-+ syslog(LOG_ERR, "No LED name given on line %d", lineno);
-+ return;
-+ }
-+ if ((str == NULL) || (strlen(str) == 0)) {
-+ syslog(LOG_ERR, "No LED given on line %d", lineno);
-+ return;
-+ }
-+ handle_led(name, str);
-+ return;
-+ }
-+
- comma = strchr(inbuf, ',');
- if (comma) {
- if (!strtok_r(comma, ":", &strtok_data)) {
-@@ -568,6 +667,7 @@ readconfig(char *filename)
- #ifdef USE_RS485_FEATURE
- free_rs485confs();
- #endif
-+ free_leds();
-
- config_num++;
-
-diff --git a/ser2net.conf b/ser2net.conf
-index 870926c..dc2ba19 100644
---- a/ser2net.conf
-+++ b/ser2net.conf
-@@ -53,6 +53,8 @@
- # specified in TRACEFILE that will take all traced data.
- # tw is data written to the device, tr is data read from
- # the device, and tb is both.
-+# The "led-tx" and "led-rx" options allow to specify
-+# a LED defined above to trigger for traffic.
- #
- # or...
-
-@@ -79,6 +81,12 @@
- # This specifies a filename to trace output into, as tw=/tmp/trace1.
- # This takes the same escape sequences as banners.
- #
-+# LED:<name>:sysfs-filename duration
-+# This specifies a LED which will be configured to use linux's transient trigger.
-+# The LED is always kicked when traffic is detected on serial side. The duration
-+# is given in milliseconds. See Linux's documentation for transient trigger for
-+# details.
-+#
- # OPENSTR:<name>:str
- # This specifies a string to be transmitted to the device when the
- # port is opened. This takes the same escape sequences as banners.
-@@ -108,6 +116,9 @@ SIGNATURE:signature1:ser2net port ttyS2
-
- RS485CONF:rs485port1:0:0:0:0
-
-+LED:rx:duckbill:green:rs485 10
-+LED:tx:duckbill:red:rs485 10
-+
- TRACEFILE:tw1:/tmp/tw-\p-\Y-\M-\D-\H:\i:\s.\U
- TRACEFILE:tr1:/tmp/tr-\p-\Y-\M-\D-\H:\i:\s.\U
-
-@@ -138,3 +149,5 @@ CLOSESTR:close1:close str\r\n
-
- 3020:telnet:0:/dev/ttyUSB0:9600 banner1 remctl asdfasd
- 3021:telnet:0:/dev/ttyUSB1:9600 banner2 open1 close1 remctl
-+
-+5000:telnet:0:/dev/ttyAPP0:9600 NONE 1STOPBIT 8DATABITS -XONXOFF LOCAL -RTSCTS led-tx=tx led-rx=rx
-diff --git a/sysfs-led.c b/sysfs-led.c
-new file mode 100644
-index 0000000..efe0b29
---- /dev/null
-+++ b/sysfs-led.c
-@@ -0,0 +1,43 @@
-+/*
-+ * Copyright (C) 2015 I2SE GmbH
-+ */
-+#include <stdio.h>
-+#include <string.h>
-+
-+#include "utils.h"
-+#include "sysfs-led.h"
-+
-+#define SYSFS_LED_BASE "/sys/class/leds"
-+
-+static int led_write(char *led, char *property, char *buf)
-+{
-+ char fn[255];
-+
-+ snprintf(fn, sizeof(fn), "%s/%s/%s", SYSFS_LED_BASE, led, property);
-+
-+ return file_store(fn, buf, strlen(buf));
-+}
-+
-+int led_off(char *led)
-+{
-+ led_write(led, "trigger", "none");
-+ led_write(led, "brightness", "0");
-+ return 0;
-+}
-+
-+int led_blink_prepare(char *led, unsigned int duration)
-+{
-+ char buffer[10];
-+
-+ snprintf(buffer, sizeof(buffer), "%u", duration);
-+ led_write(led, "trigger", "transient");
-+ msleep(10);
-+ led_write(led, "state", "1");
-+ led_write(led, "duration", buffer);
-+ return 0;
-+}
-+
-+int led_blink_kick(char *led)
-+{
-+ return led_write(led, "activate", "1");
-+}
-diff --git a/sysfs-led.h b/sysfs-led.h
-new file mode 100644
-index 0000000..00b21b6
---- /dev/null
-+++ b/sysfs-led.h
-@@ -0,0 +1,11 @@
-+/*
-+ * Copyright (C) 2015 I2SE GmbH
-+ */
-+#ifndef SYSFS_LED_H
-+#define SYSFS_LED_H
-+
-+int led_off(char *led);
-+int led_blink_prepare(char *led, unsigned int duration);
-+int led_blink_kick(char *led);
-+
-+#endif /* SYSFS_LED_H */
-diff --git a/utils.c b/utils.c
-index c194c4c..c96cedb 100644
---- a/utils.c
-+++ b/utils.c
-@@ -25,6 +25,9 @@
- #include <errno.h>
- #include <unistd.h>
- #include <fcntl.h>
-+#include <time.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-
- #include "ser2net.h"
- #include "utils.h"
-@@ -205,3 +208,30 @@ write_ignore_fail(int fd, const char *data, size_t count)
- count -= written;
- }
- }
-+
-+int
-+msleep(int msec)
-+{
-+ struct timespec req;
-+
-+ req.tv_sec = 0;
-+ req.tv_nsec = msec * 1000000;
-+
-+ return nanosleep(&req, NULL);
-+}
-+
-+int
-+file_store(const char *filename, const char *buf, size_t count)
-+{
-+ int fd;
-+
-+ if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR)) == -1)
-+ return -1;
-+
-+ if (write(fd, buf, count) != count) {
-+ close(fd);
-+ return -1;
-+ }
-+
-+ return close(fd);
-+}
-diff --git a/utils.h b/utils.h
-index 582ea88..8af65ec 100644
---- a/utils.h
-+++ b/utils.h
-@@ -64,6 +64,9 @@ char *find_tracefile(const char *name);
- /* Search for RS485 configuration by name. */
- struct serial_rs485 *find_rs485conf(const char *name);
-
-+/* Search for a LED by name */
-+char *find_led(const char *name);
-+
- void check_ipv6_only(int family, struct sockaddr *addr, int fd);
-
- /* Make sure the full contents get written, return an error if it occurs. */
-@@ -72,4 +75,10 @@ int write_full(int fd, char *data, size_t count);
- /* Write the data completely out, return without comment on error. */
- void write_ignore_fail(int fd, const char *data, size_t count);
-
-+/* Helper to sleep a given amount of milli-seconds */
-+int msleep(int msec);
-+
-+/* Store the given data to a file */
-+int file_store(const char *filename, const char *buf, size_t count);
-+
- #endif /* UTILS */
---
-1.7.10.4
-
--- /dev/null
+#
+# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sipgrep
+PKG_VERSION:=20160914-devel
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/sipcapture/sipgrep
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=df8a95b066569be92aa38cad01086ea595b36863
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sipgrep
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libpcap +libpcre +libncursesw
+ TITLE:=Display and Troubleshoot SIP signaling in CLI
+ URL:=https://github.com/sipcapture/sipgrep
+endef
+
+define Package/sipgrep/description
+ SipGrep is a utility for displaying and troubleshooting SIP signaling.
+endef
+
+CONFIGURE_ARGS += \
+ --enable-ncurses
+
+define Package/sipgrep/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sipgrep $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,sipgrep))
--- /dev/null
+#
+# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sngrep
+PKG_VERSION=2016-09-27-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
+PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=COPYING
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=https://github.com/irontec/sngrep
+PKG_SOURCE_SUBDIR=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b764ec6722f4f6b4067c469b892af4d988bbeece
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sngrep
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+libpcap +libpthread +libpcre +libncursesw
+ TITLE:=Display SIP calls message flows
+ URL:=https://github.com/irontec/sngrep
+endef
+
+define Package/sngrep/description
+ sngrep is a tool for displaying SIP calls message flows from terminal.
+ It supports live capture to display realtime SIP packets and can also be used as PCAP viewer.
+endef
+
+CONFIGURE_ARGS += \
+ --with-pcre \
+ --enable-unicode \
+
+define Package/sngrep/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sngrep $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,sngrep))
include $(TOPDIR)/rules.mk
PKG_NAME:=sqm-scripts
-PKG_SOURCE_VERSION:=56677e61a0d410d744e0382c35980dd44aaa072b
-PKG_VERSION:=1.0.7
+PKG_SOURCE_VERSION:=d1855af9475f0bf553f2caca030164310172deb3
+PKG_VERSION:=1.0.8
PKG_RELEASE:=1
PKG_LICENSE:=GPLv2
include $(TOPDIR)/rules.mk
PKG_NAME:=strongswan
-PKG_VERSION:=5.5.0
+PKG_VERSION:=5.5.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://download.strongswan.org/ http://download2.strongswan.org/
-PKG_MD5SUM:=a96fa7eb6c62b40143dadb064b6bd586
+PKG_MD5SUM:=4eba9474f7dc6c8c8d7037261358e68d
PKG_LICENSE:=GPL-2.0+
-PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org>
+PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
PKG_MOD_AVAILABLE:= \
addrblock \
/etc/ipsec.secrets
/etc/ipsec.user
/etc/strongswan.conf
+/etc/strongswan.d/
endef
define Package/strongswan/install
+#undef encrypt
--- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c
+++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_ipsec.c
-@@ -18,6 +18,8 @@
- * for more details.
+@@ -19,6 +19,7 @@
*/
-+#include <musl.h>
-+
#define _GNU_SOURCE
++#include <musl.h>
#include <sys/types.h>
#include <sys/socket.h>
+ #include <stdint.h>
--- a/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
+++ b/src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c
@@ -37,6 +37,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=stunnel
-PKG_VERSION:=5.20
+PKG_VERSION:=5.36
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0+
-PKG_MAINTAINER:=Michael Haas <haas@computerlinguist.org>
+PKG_MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
PKG_LICENSE_FILES:=COPYING COPYRIGHT.GPL
-PKG_SOURCE_URL:=http://stunnel.cybermirror.org/archive/5.x/
+PKG_SOURCE_URL:= \
+ http://ftp.nluug.nl/pub/networking/stunnel/ \
+ http://www.usenix.org.uk/mirrors/stunnel/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=3264375026c2b496b5d258e243222de8
+PKG_MD5SUM:=b3c002c312e757d9a40caf95363800b3
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
define Package/stunnel
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+libopenssl +zlib
+ DEPENDS:=+libopenssl +zlib +libpthread
TITLE:=SSL TCP Wrapper
URL:=http://www.stunnel.org/
endef
CONFIGURE_ARGS+= \
--with-random=/dev/urandom \
- --with-threads=fork \
+ --with-threads=pthread \
--with-ssl=$(STAGING_DIR)/usr \
--disable-libwrap \
--disable-systemd
+++ /dev/null
---- a/configure
-+++ b/configure
-@@ -5646,66 +5646,66 @@ done
-
-
-
--for flag in -fstack-protector; do
-- as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
--$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
--if eval \${$as_CACHEVAR+:} false; then :
-- $as_echo_n "(cached) " >&6
--else
--
-- ax_check_save_flags=$CFLAGS
-- CFLAGS="$CFLAGS $flag"
-- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
--/* end confdefs.h. */
--
--int
--main ()
--{
--
-- ;
-- return 0;
--}
--_ACEOF
--if ac_fn_c_try_compile "$LINENO"; then :
-- eval "$as_CACHEVAR=yes"
--else
-- eval "$as_CACHEVAR=no"
--fi
--rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-- CFLAGS=$ax_check_save_flags
--fi
--eval ac_res=\$$as_CACHEVAR
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
--$as_echo "$ac_res" >&6; }
--if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
-- if ${CFLAGS+:} false; then :
-- case " $CFLAGS " in
-- *" $flag "*)
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5
-- (: CFLAGS already contains $flag) 2>&5
-- ac_status=$?
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; }
-- ;;
-- *)
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5
-- (: CFLAGS="$CFLAGS $flag") 2>&5
-- ac_status=$?
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; }
-- CFLAGS="$CFLAGS $flag"
-- ;;
-- esac
--else
-- CFLAGS="$flag"
--fi
--
--else
-- :
--fi
--
--done
-+#for flag in -fstack-protector; do
-+# as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh`
-+#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-+#$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-+#if eval \${$as_CACHEVAR+:} false; then :
-+# $as_echo_n "(cached) " >&6
-+#else
-+#
-+# ax_check_save_flags=$CFLAGS
-+# CFLAGS="$CFLAGS $flag"
-+# cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-+#/* end confdefs.h. */
-+
-+#int
-+#main ()
-+#{
-+#
-+# ;
-+# return 0;
-+#}
-+#_ACEOF
-+#if ac_fn_c_try_compile "$LINENO"; then :
-+# eval "$as_CACHEVAR=yes"
-+#else
-+# eval "$as_CACHEVAR=no"
-+#fi
-+#rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-+# CFLAGS=$ax_check_save_flags
-+#fi
-+#eval ac_res=\$$as_CACHEVAR
-+# { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-+#$as_echo "$ac_res" >&6; }
-+#if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then :
-+# if ${CFLAGS+:} false; then :
-+# case " $CFLAGS " in
-+# *" $flag "*)
-+# { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS already contains \$flag"; } >&5
-+# (: CFLAGS already contains $flag) 2>&5
-+# ac_status=$?
-+# $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+# test $ac_status = 0; }
-+# ;;
-+# *)
-+# { { $as_echo "$as_me:${as_lineno-$LINENO}: : CFLAGS=\"\$CFLAGS \$flag\""; } >&5
-+# (: CFLAGS="$CFLAGS $flag") 2>&5
-+# ac_status=$?
-+# $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-+# test $ac_status = 0; }
-+# CFLAGS="$CFLAGS $flag"
-+# ;;
-+# esac
-+#else
-+# CFLAGS="$flag"
-+#fi
-+#
-+#else
-+# :
-+#fi
-+#
-+#done
-
-
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -71,7 +71,7 @@ AX_APPEND_COMPILE_FLAGS([-Wformat=2])
- AX_APPEND_COMPILE_FLAGS([-Wconversion])
- AX_APPEND_COMPILE_FLAGS([-Wno-long-long])
- AX_APPEND_COMPILE_FLAGS([-Wno-deprecated-declarations])
--AX_APPEND_COMPILE_FLAGS([-fstack-protector])
-+#AX_APPEND_COMPILE_FLAGS([-fstack-protector])
- AX_APPEND_COMPILE_FLAGS([-fPIE])
- AX_APPEND_COMPILE_FLAGS([-D_FORTIFY_SOURCE=2])
- AX_APPEND_LINK_FLAGS([-fPIE -pie])
+++ /dev/null
-Index: stunnel-5.20/src/cron.c
-===================================================================
---- stunnel-5.20.orig/src/cron.c
-+++ stunnel-5.20/src/cron.c
-@@ -46,6 +46,9 @@ NOEXPORT void cron_thread(void *arg);
- #endif
- #if defined(USE_PTHREAD) || defined(USE_WIN32)
- NOEXPORT void cron_worker(void);
-+#endif
-+
-+#ifndef OPENSSL_NO_DH
- NOEXPORT void cron_dh_param(void);
- #endif
-
PKG_NAME:=tcpreplay
PKG_VERSION:=4.1.1
-PKG_RELEASE:=1
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/appneta/tcpreplay/releases/download/v$(PKG_VERSION)
PKG_MD5SUM:=80394c33fe697b53b69eac9bb0968ae9
PKG_LICENSE:=GPL-3.0
+PKG_LICENSE_FILES:=docs/LICENSE
PKG_FIXUP:=libtool
PKG_INSTALL:=1
to support switches, routers, and IP Flow/NetFlow appliances.
endef
+CONFIGURE_VARS += \
+ ac_cv_lib_nl_nl_cache_alloc=no \
+ ac_cv_lib_nl_genl_3_genl_connect=no \
+ ac_cv_lib_nl_3_nl_cache_alloc=no \
+ ac_cv_lib_dbus_1_dbus_malloc=no
+
CONFIGURE_ARGS += \
--enable-force-pf \
--enable-dynamic-link \
+++ /dev/null
-diff --git a/configure.ac b/configure.ac
-index 6c61381..7f72871 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -773,7 +773,6 @@ if ! test $using_pcap_config = yes; then
- AC_CHECK_LIB(nl, nl_cache_alloc, [nl_found=yes])
- AC_CHECK_LIB(nl-genl-3, genl_connect, [nl_genl_3_found=yes])
- AC_CHECK_LIB(nl-3, nl_cache_alloc, [nl_3_found=yes])
-- AC_CHECK_LIB(dbus-1, dbus_malloc, [dbus_1_found=yes])
- if test "$nl_found" = "yes"; then
- LPCAPLIB="$LPCAPLIB -lnl"
- fi
--- /dev/null
+--- a/src/common/fakepoll.h
++++ b/src/common/fakepoll.h
+@@ -40,11 +40,11 @@
+ #define POLL_NO_WARN
+ #define SYS_POLL_NO_WARN
+
+-#ifdef HAVE_SYS_POLL_H
+-#include <sys/poll.h>
+-#define __FAKEPOLL_H
+-#elif HAVE_POLL_H
++#ifdef HAVE_POLL_H
+ #include <poll.h>
++#define __FAKEPOLL_H
++#elif HAVE_SYS_POLL_H
++#include <sys/poll.h>
+ #define __FAKEPOLL_H
+ #endif
+
+--- a/src/common/sendpacket.c
++++ b/src/common/sendpacket.c
+@@ -148,10 +148,6 @@
+ #include "txring.h"
+ #endif
+
+-#ifndef __GLIBC__
+-typedef int socklen_t;
+-#endif
+-
+ static sendpacket_t *sendpacket_open_pf(const char *, char *);
+ static struct tcpr_ether_addr *sendpacket_get_hwaddr_pf(sendpacket_t *);
+ static int get_iface_index(int fd, const char *device, char *);
include $(TOPDIR)/rules.mk
PKG_NAME:=tinc
-PKG_VERSION:=1.0.28
+PKG_VERSION:=1.0.29
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.tinc-vpn.org/packages
-PKG_MD5SUM:=9ca14c9902fb4011b5df6a09ffd40ea9
+PKG_MD5SUM:=bb7d2a672dd6958372da23fd764ba067
PKG_INSTALL:=1
--- /dev/null
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v3.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=travelmate
+PKG_VERSION:=0.2.4
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-3.0+
+PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/$(PKG_NAME)
+ SECTION:=net
+ CATEGORY:=Network
+ TITLE:=A wlan connection manager for travel router
+ PKGARCH:=all
+endef
+
+define Package/$(PKG_NAME)/description
+A wlan connection manager for travel router.
+Please see https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md for further information.
+
+endef
+
+define Package/$(PKG_NAME)/conffiles
+/etc/config/travelmate
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/$(PKG_NAME)/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) ./files/travelmate.sh $(1)/usr/bin/
+
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/travelmate.init $(1)/etc/init.d/travelmate
+
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/travelmate.conf $(1)/etc/config/travelmate
+endef
+
+$(eval $(call BuildPackage,$(PKG_NAME)))
--- /dev/null
+# travelmate, a wlan connection manager for travel router
+
+## Description
+If you’re planning an upcoming vacation or a business trip, taking your laptop, tablet or smartphone give you the ability to connect with friends or complete work on the go. But many hotels don’t have a secure wireless network setup or you’re limited on using a single device at once. Investing in a portable, mini travel router is a great way to connect all of your devices at once while having total control over your own personalized wireless network.
+A logical combination of AP+STA mode on one physical radio allows most of OpenWrt/LEDE supported router devices to connect to a wireless hotspot/station (STA) and provide a wireless access point (AP) from that hotspot at the same time. Downside of this solution: whenever the STA interface looses the connection it will go into an active scan cycle which renders the radio unusable for AP mode operation, therefore the AP is taken down if the STA looses its association.
+To avoid these kind of deadlocks, travelmate set all station interfaces in an "always off" mode, connects automatically to available hotspots and monitor & change these uplink connections automatically if required.
+
+## Main Features
+* STA interfaces operating in an "always off" mode, to make sure that the AP is always accessible
+* fast uplink connections
+* reliable connection tracking
+* easy setup within normal OpenWrt/LEDE environment
+* status & debug logging to syslog
+* procd init system support
+
+## Prerequisites
+* [OpenWrt](https://openwrt.org) or [LEDE](https://www.lede-project.org) trunk
+* iw (default) or iwinfo for wlan scanning
+
+## OpenWrt / LEDE trunk Installation & Usage
+* install 'travelmate' (_opkg install travelmate_)
+* configure your network to support (multiple) wlan uplinks and set travelmate config options (details see below)
+* set 'trm\_enabled' option in travelmate config to '1'
+* travelmate starts automatically during boot, triggered by procd as soon as the wireless subsystem is up & running
+
+## Chaos Calmer installation notes
+* 'travelmate' is _not_ available as an ipk package in the Chaos Calmer download repository
+* download the package from a development snapshot package directory, i.e. look [here](https://downloads.lede-project.org/snapshots/packages/x86_64/packages/)
+* manually transfer the package to your routers temp directory (with tools like _sshfs_ or _winscp_)
+* install the package as described above
+
+## Travelmate config options
+* mandatory config options:
+ * trm\_enabled => main switch to enable/disable the travelmate service (default: '0', disabled)
+ * trm\_loop => loop timeout in seconds for wlan monitoring (default: '30')
+ * trm\_maxretry => how many times should travelmate try to connect to a certain uplink, to disable this check at all set it to '0' (default: '3')
+* optional config options:
+ * trm\_debug => enable/disable debug logging (default: '0', disabled)
+ * trm\_device => limit travelmate to a dedicated radio, i.e 'radio0' (default: use all radios)
+ * trm\_iw => set this option to '0' to use iwinfo for wlan scanning (default: '1', use iw)
+
+## Setup
+**1. configure a wwan interface in /etc/config/network:**
+<pre><code>
+[...]
+config interface 'wwan'
+ option proto 'dhcp'
+[...]
+</code></pre>
+
+**2. add this interface to your firewall configuration in /etc/config/firewall:**
+<pre><code>
+[...]
+config zone
+ option name 'wan'
+ option input 'REJECT'
+ option output 'ACCEPT'
+ option forward 'REJECT'
+ option masq '1'
+ option mtu_fix '1'
+ option network 'wan wan6 wwan'
+[...]
+</code></pre>
+
+**3. add required wwan stations to your wireless configuration in etc/config/wireless:**
+<pre><code>
+[...]
+config wifi-iface
+ option device 'radio0'
+ option network 'wwan'
+ option mode 'sta'
+ option ssid 'example_01'
+ option ifname 'wwan01'
+ option encryption 'psk2+ccmp'
+ option key 'abc'
+ option disabled '1'
+config wifi-iface
+ option device 'radio0'
+ option network 'wwan'
+ option mode 'sta'
+ option ssid 'example_02'
+ option ifname 'wwan02'
+ option encryption 'psk2+ccmp'
+ option key 'xyz'
+ option disabled '1'
+config wifi-iface
+ option device 'radio0'
+ option network 'wwan'
+ option mode 'sta'
+ option ssid 'example_03'
+ option ifname 'wwan03'
+ option encryption 'none'
+ option disabled '1'
+[...]
+</code></pre>
+
+**4. reload network configuration & start travelmate:**
+<pre><code>
+/etc/init.d/network reload
+/etc/init.d/travelmate start
+</code></pre>
+
+**Common runtime outputs (visible via logread)**
+
+**Success:** Sun Oct 9 17:02:21 2016 user.notice root: travelmate-0.2.1[712] info : wlan interface "wwan06" connected to uplink "blackhole.nl"
+
+**Disabled service:** Sun Oct 9 18:06:32 2016 user.notice root: travelmate-0.2.1[2379] info : travelmate is currently disabled, please set 'trm_enabled' to use this service
+
+**Misconfigured/broken uplink:** Sun Oct 9 18:56:42 2016 user.notice root: travelmate-0.2.1[2435] info : uplink "blackhole.nl" disabled due to permanent connection failures
+
+**Uplink disappeared:** Sun Oct 9 19:00:28 2016 user.notice root: travelmate-0.2.1[3876] info : uplink "Neffos C5L" get lost
+
+## Support
+Please join the travelmate discussion in this [forum thread](https://forum.openwrt.org/viewtopic.php?id=67697) or contact me by [mail](mailto:dev@brenken.org)
+
+## Removal
+* stop the travelmate daemon with _/etc/init.d/travelmate stop_
+* optional: remove the travelmate package (_opkg remove travelmate_)
+
+Have fun!
+Dirk
--- /dev/null
+# travelmate configuration, for further information
+# see 'https://github.com/openwrt/packages/blob/master/net/travelmate/files/README.md'
+
+config travelmate 'global'
+ option trm_enabled '0'
+ option trm_loop '30'
+ option trm_maxretry '3'
--- /dev/null
+#!/bin/sh /etc/rc.common
+
+START=85
+USE_PROCD=1
+
+exec 2>/dev/null
+trm_script="/usr/bin/travelmate.sh"
+
+start_service()
+{
+ ubus -t 30 wait_for network.wireless
+ if [ $(($?)) -eq 0 ]
+ then
+ procd_open_instance
+ procd_set_param command "${trm_script}"
+ procd_close_instance
+ else
+ logger -s "travelmate [procd]:" "no wlan devices found, travelmate startup canceled"
+ fi
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger "travelmate"
+}
--- /dev/null
+#!/bin/sh
+# travelmate, a wlan connection manager for travel router
+# written by Dirk Brenken (dev@brenken.org)
+
+# This is free software, licensed under the GNU General Public License v3.
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# prepare environment
+#
+LC_ALL=C
+PATH="/usr/sbin:/usr/bin:/sbin:/bin"
+trm_pid="${$}"
+trm_ver="0.2.4"
+trm_debug=0
+trm_loop=30
+trm_maxretry=3
+trm_iw=1
+trm_device=""
+
+# function to prepare all relevant AP and STA interfaces
+#
+trm_prepare()
+{
+ local config="${1}"
+ local mode="$(uci -q get wireless."${config}".mode)"
+ local device="$(uci -q get wireless."${config}".device)"
+ local network="$(uci -q get wireless."${config}".network)"
+ local ifname="$(uci -q get wireless."${config}".ifname)"
+ local disabled="$(uci -q get wireless."${config}".disabled)"
+
+ if [ "${mode}" = "ap" ] &&
+ ([ -z "${trm_device}" ] || [ "${trm_device}" = "${device}" ])
+ then
+ trm_aplist="${trm_aplist} ${ifname}"
+ if [ -z "${disabled}" ] || [ "${disabled}" = "1" ]
+ then
+ trm_set "none" "${config}" "${network}" "up"
+ fi
+ elif [ "${mode}" = "sta" ]
+ then
+ trm_stalist="${trm_stalist} ${config}_${network}"
+ if [ -z "${disabled}" ] || [ "${disabled}" = "0" ]
+ then
+ trm_set "none" "${config}" "${network}" "down"
+ fi
+ fi
+}
+
+# function to set different wlan interface status
+#
+trm_set()
+{
+ local change="${1}"
+ local config="${2}"
+ local interface="${3}"
+ local command="${4}"
+
+ if [ "${command}" = "up" ]
+ then
+ uci -q set wireless."${config}".disabled=0
+ ubus call network.interface."${interface}" "${command}"
+ trm_checklist="${trm_checklist} ${interface}"
+ elif [ "${command}" = "down" ]
+ then
+ uci -q set wireless."${config}".disabled=1
+ ubus call network.interface."${interface}" "${command}"
+ fi
+
+ trm_log "debug" "set ::: change: ${change}, config: ${config}, interface: ${interface}, command: ${command}, checklist: ${trm_checklist}, uci-changes: $(uci -q changes wireless)"
+ if [ -n "$(uci -q changes wireless)" ]
+ then
+ if [ "${change}" = "commit" ]
+ then
+ uci -q commit wireless
+ ubus call network reload
+ trm_check
+ elif [ "${change}" = "partial" ]
+ then
+ ubus call network reload
+ trm_check
+ elif [ "${change}" = "defer" ]
+ then
+ uci -q revert wireless
+ elif [ "${change}" = "revert" ]
+ then
+ uci -q revert wireless
+ ubus call network reload
+ trm_check
+ fi
+ fi
+}
+
+# function to check interface status on "up" event
+#
+trm_check()
+{
+ local interface value
+ local cnt=0
+
+ for interface in ${trm_checklist}
+ do
+ while [ $((cnt)) -lt 15 ]
+ do
+ json_load "$(ubus -S call network.interface."${interface}" status)"
+ json_get_var trm_status up
+ if [ "${trm_status}" = "1" ] || [ -n "${trm_uplink}" ]
+ then
+ trm_log "debug" "check::: interface: ${interface}, status: ${trm_status}, uplink-sta: ${trm_uplink}, uplink-ssid: ${trm_ssid} count: ${cnt}"
+ json_cleanup
+ break
+ fi
+ cnt=$((cnt+1))
+ sleep 1
+ done
+ done
+ if [ -n "${trm_uplink}" ] && [ "${trm_status}" = "0" ]
+ then
+ ubus call network reload
+ eval "trm_count_${trm_uplink}=\$((trm_count_${trm_uplink}+1))"
+ trm_checklist=""
+ trm_log "info" "uplink ${trm_ssid} get lost"
+ elif [ -z "${trm_uplink}" ] && [ -n "${trm_checklist}" ]
+ then
+ trm_checklist=""
+ fi
+}
+
+# function to write to syslog
+#
+trm_log()
+{
+ local class="${1}"
+ local log_msg="${2}"
+
+ if [ -n "${log_msg}" ] && ([ "${class}" != "debug" ] || ([ "${class}" = "debug" ] && [ $((trm_debug)) -eq 1 ]))
+ then
+ logger -t "travelmate-${trm_ver}[${trm_pid}] ${class}" "${log_msg}" 2>&1
+ fi
+}
+
+# source required system libraries
+#
+if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
+then
+ . "/lib/functions.sh"
+ . "/usr/share/libubox/jshn.sh"
+ json_init
+else
+ trm_log "error" "required system libraries not found"
+ exit 255
+fi
+
+# load uci config and check 'enabled' option
+#
+option_cb()
+{
+ local option="${1}"
+ local value="${2}"
+ eval "${option}=\"${value}\""
+}
+
+config_load travelmate
+
+if [ "${trm_enabled}" != "1" ]
+then
+ trm_log "info" "travelmate is currently disabled, please set 'trm_enabled' to '1' to use this service"
+ exit 0
+fi
+
+# check for preferred wireless tool
+#
+if [ $((trm_iw)) -eq 1 ]
+then
+ trm_scanner="$(which iw)"
+else
+ trm_scanner="$(which iwinfo)"
+fi
+
+if [ -z "${trm_scanner}" ]
+then
+ trm_log "error" "no wireless tool for wlan scanning found, please install 'iw' or 'iwinfo'"
+ exit 255
+fi
+
+# infinitive loop to establish and track STA uplink connections
+#
+while true
+do
+ if [ -z "${trm_uplink}" ] || [ "${trm_status}" = "0" ]
+ then
+ trm_uplink=""
+ trm_aplist=""
+ trm_stalist=""
+ config_load wireless
+ config_foreach trm_prepare wifi-iface
+ trm_set "commit"
+ for ap in ${trm_aplist}
+ do
+ ubus -t 10 wait_for hostapd."${ap}"
+ if [ $((trm_iw)) -eq 1 ]
+ then
+ trm_ssidlist="$(${trm_scanner} dev "${ap}" scan 2>/dev/null | awk '/SSID: /{if(!seen[$0]++){printf "\"";for(i=2; i<=NF; i++)if(i==2)printf $i;else printf " "$i;printf "\" "}}')"
+ else
+ trm_ssidlist="$(${trm_scanner} "${ap}" scan | awk '/ESSID: ".*"/{ORS=" ";if (!seen[$0]++) for(i=2; i<=NF; i++) print $i}')"
+ fi
+ trm_log "debug" "main ::: scan-tool: ${trm_scanner}, ssidlist: ${trm_ssidlist}"
+ if [ -n "${trm_ssidlist}" ]
+ then
+ for sta in ${trm_stalist}
+ do
+ trm_config="${sta%%_*}"
+ trm_network="${sta##*_}"
+ trm_ifname="$(uci -q get wireless."${trm_config}".ifname)"
+ trm_ssid="\"$(uci -q get wireless."${trm_config}".ssid)\""
+ if [ $((trm_count_${trm_config}_${trm_network})) -lt $((trm_maxretry)) ] || [ $((trm_maxretry)) -eq 0 ]
+ then
+ if [ -n "$(printf "${trm_ssidlist}" | grep -Fo "${trm_ssid}")" ]
+ then
+ trm_set "partial" "${trm_config}" "${trm_network}" "up"
+ if [ "${trm_status}" = "1" ]
+ then
+ trm_checklist="${trm_network}"
+ trm_uplink="${trm_config}_${trm_network}"
+ trm_set "defer"
+ trm_log "info" "wwan interface \"${trm_ifname}\" connected to uplink ${trm_ssid}"
+ break 2
+ else
+ trm_set "revert"
+ eval "trm_count_${trm_config}_${trm_network}=\$((trm_count_${trm_config}_${trm_network}+1))"
+ fi
+ fi
+ elif [ $((trm_count_${trm_config}_${trm_network})) -eq $((trm_maxretry)) ] && [ $((trm_maxretry)) -ne 0 ]
+ then
+ eval "trm_count_${trm_config}_${trm_network}=\$((trm_count_${trm_config}_${trm_network}+1))"
+ trm_log "info" "uplink ${trm_ssid} disabled due to permanent connection failures"
+ fi
+ done
+ fi
+ sleep 5
+ done
+ sleep 5
+ else
+ trm_check
+ if [ -n "${trm_checklist}" ]
+ then
+ sleep ${trm_loop}
+ fi
+ fi
+done
#
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=udpxy
-PKG_SOURCE_VERSION:=c045a1e855a8033c5d70ab3e42271ba5636eb520
-PKG_VERSION:=2015-03-08-$(PKG_SOURCE_VERSION)
+PKG_SOURCE_VERSION:=53e4672a7522311c40e9f6110ff256041c52c8b4
+PKG_VERSION:=2016-09-18-$(PKG_SOURCE_VERSION)
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/pcherenkov/udpxy.git
+PKG_SOURCE_URL:=https://github.com/pcherenkov/udpxy.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
+++ /dev/null
-From 26f8177f799f3cf781ed89cb28f771da7ef22421 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
-Date: Thu, 5 Mar 2015 13:42:09 +0100
-Subject: [PATCH] fix build on Mac OS X
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
----
- chipmunk/Makefile | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
---- a/chipmunk/Makefile
-+++ b/chipmunk/Makefile
-@@ -32,10 +32,13 @@ DEBUG_ON := -g
- ALL_CFLAGS = -W -Wall -Werror --pedantic $(CFLAGS)
-
- SYSTEM=$(shell uname 2>/dev/null)
--ifneq (,$(filter $(SYSTEM),FreeBSD Darwin))
-+ifneq (,$(filter $(SYSTEM),FreeBSD))
- MAKE := gmake
- GZIP := /usr/bin/gzip
- endif
-+ifneq (,$(filter $(SYSTEM),Darwin))
-+GZIP := /usr/bin/gzip
-+endif
-
- BUILDFILE = BUILD
- BUILDNO := `cat $(BUILDFILE)`
include $(TOPDIR)/rules.mk
PKG_NAME:=unbound
-PKG_VERSION:=1.5.9
+PKG_VERSION:=1.5.10
PKG_RELEASE:=3
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Michael Hanselmann <public@hansmi.ch>
+PKG_MAINTAINER:=Eric Luehrsen <ericluehrsen@hotmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.unbound.net/downloads
-PKG_MD5SUM:=0cefa62c1690b4db18583db84bff00e3
+PKG_MD5SUM:=0a3a236811f1ab5c1dc31974fa74e047
PKG_BUILD_DEPENDS:=libexpat
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
define Package/unbound/Default
- TITLE:=A validating, recursive & caching DNS resolver
+ TITLE:=Unbound is a validating, recursive, and caching DNS resolver.
URL:=http://www.unbound.net/
DEPENDS:=+libopenssl
endef
SECTION:=net
CATEGORY:=Network
SUBMENU:=IP Addresses and Names
+ USERID:=unbound=553:unbound=553
TITLE+= (daemon)
DEPENDS+= +libunbound
- USERID:=unbound:unbound
endef
define Package/unbound/description
SECTION:=libs
CATEGORY:=Libraries
TITLE+= (library)
+ DEPENDS+= +libpthread
endef
define Package/libunbound/description
endef
CONFIGURE_ARGS += \
+ --disable-dsa \
--disable-gost \
--enable-allsymbols \
--with-libexpat="$(STAGING_DIR)/usr" \
--with-ssl="$(STAGING_DIR)/usr" \
--with-pidfile=/var/run/unbound.pid \
- --with-user=unbound \
- --without-pthreads
+ --with-user=unbound
define Package/unbound/conffiles
/etc/unbound/unbound.conf
$(PKG_INSTALL_DIR)/usr/sbin/unbound-checkconf \
$(1)/usr/sbin/
$(INSTALL_DIR) $(1)/etc/unbound
- $(INSTALL_CONF) \
+ $(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/etc/unbound/unbound.conf \
- $(1)/etc/unbound/
- $(INSTALL_CONF) ./files/root.key $(1)/etc/unbound/
+ $(1)/etc/unbound/unbound.conf
+ $(INSTALL_DATA) ./files/root.key $(1)/etc/unbound/root.key
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+ $(INSTALL_BIN) ./files/unbound.iface $(1)/etc/hotplug.d/iface/25-unbound
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/unbound.init $(1)/etc/init.d/unbound
+ $(INSTALL_DIR) $(1)/usr/lib/unbound
+ $(INSTALL_DATA) ./files/unbound.sh $(1)/usr/lib/unbound/unbound.sh
+ $(INSTALL_DATA) ./files/rootzone.sh $(1)/usr/lib/unbound/rootzone.sh
endef
define Package/unbound-anchor/install
--- /dev/null
+#!/bin/sh
+##############################################################################
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# Copyright (C) 2016 Eric Luehrsen
+#
+##############################################################################
+#
+# This component needs to be used within the unbound.sh as an include. It uses
+# defaults and UCI scope variables defined there. It will copy root.key back
+# to /etc/unbound/ periodically, but avoid ROM flash abuse (UCI option).
+#
+##############################################################################
+
+rootzone_uci() {
+ # TODO: Just structure to real UCI coming soon.
+ echo
+}
+
+##############################################################################
+
+roothints_update() {
+ # TODO: Maybe this will not be implemented.
+ echo
+}
+
+##############################################################################
+
+rootkey_update() {
+ local basekey_date rootkey_date rootkey_age filestuff
+
+ # TODO: Just structure to real UCI coming soon.
+ if [ "$UNBOUND_N_ROOT_AGE" -gt 90 -o "$UNBOUND_B_DNSSEC" -lt 1 ] ; then
+ # Feature disabled
+ return 0
+ fi
+
+
+ if [ -f /etc/unbound/root.key ] ; then
+ basekey_date=$( date -r /etc/unbound/root.key +%s )
+
+ else
+ # No persistent storage key
+ basekey_date=$( date -d 2000-01-01 +%s )
+ fi
+
+
+ if [ -f "$UNBOUND_KEYFILE" ] ; then
+ # Unbound maintains it itself
+ rootkey_date=$( date -r $UNBOUND_KEYFILE +%s )
+ rootkey_age=$(( (rootkey_date - basekey_date) / 86440 ))
+
+ elif [ -x "$UNBOUND_ANCHOR" ] ; then
+ # No tmpfs key - use unbound-anchor
+ rootkey_date=$( date -I +%s )
+ rootkey_age=$(( (rootkey_date - basekey_date) / 86440 ))
+ $UNBOUND_ANCHOR -a $UNBOUND_KEYFILE
+
+ else
+ # give up
+ rootkey_age=0
+ fi
+
+
+ if [ "$rootkey_age" -gt "$UNBOUND_N_ROOT_AGE" ] ; then
+ filestuff=$( cat $UNBOUND_KEYFILE )
+
+
+ case "$filestuff" in
+ *NOERROR*)
+ # Header comment for drill and dig
+ logger -t unbound -s "root.key updated after $rootkey_age days"
+ cp -p $UNBOUND_KEYFILE /etc/unbound/root.key
+ ;;
+
+ *"state=2 [ VALID ]"*)
+ # Comment inline to key for unbound-anchor
+ logger -t unbound -s "root.key updated after $rootkey_age days"
+ cp -p $UNBOUND_KEYFILE /etc/unbound/root.key
+ ;;
+
+ *)
+ logger -t unbound -s "root.key still $rootkey_age days old"
+ ;;
+ esac
+ fi
+}
+
+##############################################################################
+
+rootzone_update() {
+ rootzone_uci
+ roothints_update
+ rootkey_update
+}
+
+##############################################################################
+
--- /dev/null
+#!/bin/sh
+##############################################################################
+#
+# Copyright (C) 2016 Eric Luehrsen
+#
+##############################################################################
+#
+# "Restart" Unbound on hotplug interface up:
+# - Clean rebind of unbound to new interfaces
+# - Some of Unbound conf options to not reload run time
+# - Unbound can grow a bit so this will shrink it back
+#
+##############################################################################
+
+if [ "$ACTION" = ifup ] && /etc/init.d/unbound enabled ; then
+ /etc/init.d/unbound restart
+fi
+
+##############################################################################
+
#!/bin/sh /etc/rc.common
-# Copyright (C) 2016 Michael Hanselmann
-
-START=61
+##############################################################################
+#
+# Copyright (C) 2016 Michael Hanselmann, Eric Luehrsen
+#
+##############################################################################
+#
+# This init script is just the entry point for Unbound UCI.
+#
+##############################################################################
+START=60
USE_PROCD=1
+PROG=/usr/sbin/unbound
+
+##############################################################################
+
+. /usr/lib/unbound/unbound.sh
+
+##############################################################################
start_service() {
- find /etc/unbound \! \( -user unbound -group unbound \) \
- -exec chown unbound:unbound {} \;
+ unbound_prepare
- find /etc/unbound \( -perm +027 -o \! -perm -600 \) \
- -exec chmod u=rwX,g=rX,o= {} \;
+ procd_open_instance
+ procd_set_param command $PROG -d -c $UNBOUND_CONFFILE
+ procd_set_param respawn
+ procd_close_instance
+}
+
+##############################################################################
- procd_open_instance
- procd_set_param command /usr/sbin/unbound
- procd_append_param command -d # don't daemonize
- procd_set_param respawn
- procd_close_instance
+stop_service() {
+ rootzone_update
}
+
+##############################################################################
+
--- /dev/null
+#!/bin/sh
+##############################################################################
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# Copyright (C) 2016 Eric Luehrsen
+#
+##############################################################################
+#
+# TODO: This file will build the UCI for Unbound. This iteration only puts
+# our default unbound configuration and root.key into /var/lib/unbound.
+#
+##############################################################################
+
+# TODO: Just default definitions versus real UCI coming soon.
+UNBOUND_B_MAN_CONF=1
+UNBOUND_B_DNSSEC=1
+UNBOUND_N_ROOT_AGE=7
+
+##############################################################################
+
+UNBOUND_ANCHOR=/usr/bin/unbound-anchor
+UNBOUND_CONTROL=/usr/bin/unbound-control
+
+UNBOUND_LIBDIR=/usr/lib/unbound
+
+UNBOUND_PIDFILE=/var/run/unbound.pid
+
+UNBOUND_VARDIR=/var/lib/unbound
+UNBOUND_CONFFILE=$UNBOUND_VARDIR/unbound.conf
+UNBOUND_KEYFILE=$UNBOUND_VARDIR/root.key
+UNBOUND_HINTFILE=$UNBOUND_VARDIR/root.hints
+UNBOUND_CHECKFILE=$UNBOUND_VARDIR/unbound.check
+
+##############################################################################
+
+. /lib/functions.sh
+. /lib/functions/network.sh
+
+. $UNBOUND_LIBDIR/rootzone.sh
+
+##############################################################################
+
+unbound_mkdir() {
+ mkdir -p $UNBOUND_VARDIR
+
+
+ if [ -f /etc/unbound/root.hints ] ; then
+ # Your own local copy of root.hints
+ cp -p /etc/unbound/root.hints $UNBOUND_HINTFILE
+
+ elif [ -f /usr/share/dns/root.hints ] ; then
+ # Debian-like package dns-root-data
+ cp -p /usr/share/dns/root.hints $UNBOUND_HINTFILE
+
+ else
+ logger -t unbound -s "iterator will use built-in root hints"
+ fi
+
+
+ if [ -f /etc/unbound/root.key ] ; then
+ # Your own local copy of a root.key
+ cp -p /etc/unbound/root.key $UNBOUND_KEYFILE
+
+ elif [ -f /usr/share/dns/root.key ] ; then
+ # Debian-like package dns-root-data
+ cp -p /usr/share/dns/root.key $UNBOUND_KEYFILE
+
+ elif [ -x "$UNBOUND_ANCHOR" ] ; then
+ $UNBOUND_ANCHOR -a $UNBOUND_KEYFILE
+
+ else
+ logger -t unbound -s "validator will use built-in trust anchor"
+ fi
+}
+
+##############################################################################
+
+unbound_conf() {
+ # TODO: Just structure to real UCI coming soon.
+ if [ "$UNBOUND_B_MAN_CONF" -gt 0 -a -f /etc/unbound/unbound.conf ] ; then
+ # You don't want UCI and use your own manual configuration
+ cp -p /etc/unbound/unbound.conf $UNBOUND_CONFFILE
+ fi
+}
+
+##############################################################################
+
+unbound_own() {
+ # Debug UCI
+ {
+ echo "# $UNBOUND_CHECKFILE generated by UCI $( date )"
+ echo
+ set | grep ^UNBOUND_
+ } > $UNBOUND_CHECKFILE
+
+
+ if [ ! -f "$UNBOUND_CONFFILE" ] ; then
+ # if somehow this happened
+ touch $UNBOUND_CONFFILE
+ fi
+
+
+ # Ensure Access
+ chown -R unbound:unbound $UNBOUND_VARDIR
+ chmod 775 $UNBOUND_VARDIR
+ chmod 664 $UNBOUND_VARDIR/*
+}
+
+##############################################################################
+
+unbound_prepare() {
+ unbound_mkdir
+ unbound_conf
+ unbound_own
+}
+
+##############################################################################
+
diff --git a/doc/example.conf.in b/doc/example.conf.in
-index ff90e3b..5c20fdf 100644
+index c520c88..98a148a 100644
--- a/doc/example.conf.in
+++ b/doc/example.conf.in
-@@ -38,6 +38,8 @@ server:
- # interface: 192.0.2.154
- # interface: 192.0.2.154@5003
- # interface: 2001:DB8::5
+@@ -1,20 +1,82 @@
+-#
+-# Example configuration file.
+-#
+-# See unbound.conf(5) man page, version 1.5.10.
+-#
+-# this is a comment.
++##############################################################################
++# MEMORY CONTROL EXAMPLE
++# In the example config settings below memory usage is reduced. Some ser-
++# vice levels are lower, notable very large data and a high TCP load are
++# no longer supported ... are exceptional for the DNS.
++# (http://unbound.net/documentation/unbound.conf.html)
++##############################################################################
+
+ #Use this to include other text into the file.
+ #include: "otherfile.conf"
+
+ # The server clause sets the main parameters.
+ server:
+- # whitespace is not necessary, but looks cleaner.
+
+- # verbosity number, 0 is least verbose. 1 is default.
++ # verbosity 1 is default
+ verbosity: 1
+
++ # Self jail Unbound with user "unbound" to /var/lib/unbound
++ # The script /etc/init.d/unbound will setup the location
++ username: "unbound"
++ directory: "/var/lib/unbound"
++ chroot: "/var/lib/unbound"
++
++ # The pid file is created before privleges drop so no concern
++ pidfile: "/var/run/unbound.pid"
++
++ # no threads and no memory slabs for threads
++ num-threads: 1
++ msg-cache-slabs: 1
++ rrset-cache-slabs: 1
++ infra-cache-slabs: 1
++ key-cache-slabs: 1
++
++ # don't be picky about interfaces but consider your firewall
+ interface: 0.0.0.0
+ interface: ::0
-
- # enable this feature to copy the source address of queries to reply.
- # Socket options are not supported on all platforms. experimental.
-@@ -57,6 +59,7 @@ server:
- # port range that can be open simultaneously. About double the
- # num-queries-per-thread, or, use as many as the OS will allow you.
- # outgoing-range: 4096
-+ outgoing-range: 60
-
- # permit unbound to use this port number or port range for
- # making outgoing queries, using an outgoing interface.
-@@ -73,9 +76,11 @@ server:
-
- # number of outgoing simultaneous tcp buffers to hold per thread.
- # outgoing-num-tcp: 10
-+ outgoing-num-tcp: 1
-
- # number of incoming simultaneous tcp buffers to hold per thread.
- # incoming-num-tcp: 10
++ access-control: 0.0.0.0/0 allow
++ access-control: ::0/0 allow
++
++ # this limits TCP service but uses less buffers
++ outgoing-num-tcp: 1
+ incoming-num-tcp: 1
-
- # buffer size for UDP port 53 incoming (SO_RCVBUF socket option).
- # 0 is system default. Use 4m to catch query spikes for busy servers.
-@@ -103,18 +108,22 @@ server:
- # buffer size for handling DNS data. No messages larger than this
- # size can be sent or received, by UDP or TCP. In bytes.
- # msg-buffer-size: 65552
++
++ # use somewhat higher port numbers versus possible NAT issue
++ outgoing-port-permit: "10240-65335"
++
++ # uses less memory but less performance
++ outgoing-range: 60
++ num-queries-per-thread: 30
++
++ # exclude large responses
+ msg-buffer-size: 8192
-
- # the amount of memory to use for the message cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
- # msg-cache-size: 4m
++
++ # tiny memory cache
++ infra-cache-numhosts: 200
+ msg-cache-size: 100k
-
- # the number of slabs to use for the message cache.
- # the number of slabs must be a power of 2.
- # more slabs reduce lock contention, but fragment memory usage.
- # msg-cache-slabs: 4
-+ msg-cache-slabs: 1
-
- # the number of queries that a thread gets to service.
- # num-queries-per-thread: 1024
-+ num-queries-per-thread: 30
-
- # if very busy, 50% queries run to completion, 50% get timeout in msec
- # jostle-timeout: 200
-@@ -125,11 +134,13 @@ server:
- # the amount of memory to use for the RRset cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
- # rrset-cache-size: 4m
+ rrset-cache-size: 100k
-
- # the number of slabs to use for the RRset cache.
- # the number of slabs must be a power of 2.
- # more slabs reduce lock contention, but fragment memory usage.
- # rrset-cache-slabs: 4
-+ rrset-cache-slabs: 1
-
- # the time to live (TTL) value lower bound, in seconds. Default 0.
- # If more than an hour could easily give trouble due to stale data.
-@@ -153,9 +164,11 @@ server:
- # the number of slabs must be a power of 2.
- # more slabs reduce lock contention, but fragment memory usage.
- # infra-cache-slabs: 4
-+ infra-cache-slabs: 1
-
- # the maximum number of hosts that are cached (roundtrip, EDNS, lame).
- # infra-cache-numhosts: 10000
-+ infra-cache-numhosts: 200
-
- # Enable IPv4, "yes" or "no".
- # do-ip4: yes
-@@ -188,6 +201,8 @@ server:
- # access-control: ::0/0 refuse
- # access-control: ::1 allow
- # access-control: ::ffff:127.0.0.1 allow
-+ access-control: 0.0.0.0/0 allow
-+ access-control: ::0/0 allow
-
- # if given, a chroot(2) is done to the given directory.
- # i.e. you can chroot to the working directory, for example,
-@@ -266,12 +284,15 @@ server:
- # positive value: fetch that many targets opportunistically.
- # Enclose the list of numbers between quotes ("").
- # target-fetch-policy: "3 2 1 0 0"
-+ target-fetch-policy: "2 1 0 0 0 0"
-
- # Harden against very small EDNS buffer sizes.
- # harden-short-bufsize: no
-+ harden-short-bufsize: yes
-
- # Harden against unseemly large queries.
- # harden-large-queries: no
-+ harden-large-queries: yes
-
- # Harden against out of zone rrsets, to avoid spoofing attempts.
- # harden-glue: yes
-@@ -367,7 +388,7 @@ server:
- # you start unbound (i.e. in the system boot scripts). And enable:
- # Please note usage of unbound-anchor root anchor is at your own risk
- # and under the terms of our LICENSE (see that file in the source).
-- # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
-+ auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@"
-
- # File with DLV trusted keys. Same format as trust-anchor-file.
- # There can be only one DLV configured, it is trusted from root down.
-@@ -456,15 +477,18 @@ server:
- # the amount of memory to use for the key cache.
- # plain value in bytes or you can append k, m or G. default is "4Mb".
- # key-cache-size: 4m
+ key-cache-size: 100k
-
- # the number of slabs to use for the key cache.
- # the number of slabs must be a power of 2.
- # more slabs reduce lock contention, but fragment memory usage.
- # key-cache-slabs: 4
-+ key-cache-slabs: 1
-
- # the amount of memory to use for the negative cache (used for DLV).
- # plain value in bytes or you can append k, m or G. default is "1Mb".
- # neg-cache-size: 1m
+ neg-cache-size: 10k
-
- # By default, for a number of zones a small default 'nothing here'
- # reply is built-in. Query traffic is thus blocked. If you
++
++ # gentle on recursion
++ target-fetch-policy: "2 1 0 0 0 0"
++ harden-large-queries: yes
++ harden-short-bufsize: yes
++
++ # DNSSEC enable by removing comments on "module-config:" and "auto-trust-
++ # -anchor-file:" The init script will copy root key to /var/lib/unbound.
++ # See package documentation for crontab entry to copy RFC5011 results back.
++ #module-config: "validator iterator"
++ #auto-trust-anchor-file: "/var/lib/unbound/root.key"
++
++ # DNSSEC needs real time to validate signatures. If your device does not
++ # have power off clock (reboot), then you may need this work around.
++ #domain-insecure: "pool.ntp.org"
++
++##############################################################################
++# Resume Stock example.conf.in
++##############################################################################
++
+ # print statistics to the log (for every thread) every N seconds.
+ # Set to "" or 0 to disable. Default is disabled.
+ # statistics-interval: 0
Note that you need to configure the firewall to allow communication between
the MYVPN interface and lan.
+If you install this package via opkg, there are reports that you must reboot
+before it can be used.
include $(TOPDIR)/rules.mk
PKG_NAME:=webui-aria2
-PKG_VERSION:=2016-05-30
+PKG_VERSION:=2016-10-11
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/ziahamza/webui-aria2.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=a4b1e954f15a2cc69dd0cb2092c44a549715b2e7
+PKG_SOURCE_VERSION:=6a29c1b1d0224e1daa88906e88bc2e177ca2ad76
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_LICENSE:=MIT
PKG_NAME:=wget
PKG_VERSION:=1.18
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
define Package/wget/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-ssl
+ ln -sf wget-ssl $(1)/usr/bin/wget
endef
define Package/wget-nossl/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/wget $(1)/usr/bin/wget-nossl
-endef
-
-define Package/wget/postinst
-#!/bin/sh
-if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
- rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
-fi
-ln -sf ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget
-endef
-
-define Package/wget/postrm
-#!/bin/sh
-rm $${IPKG_INSTROOT}/usr/bin/wget
-[ -x $${IPKG_INSTROOT}/usr/bin/wget-nossl ] && ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget || {
- ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
- $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
-}
-exit 0
-endef
-
-define Package/wget-nossl/postinst
-#!/bin/sh
-if [ -e $${IPKG_INSTROOT}/usr/bin/wget ]; then
- rm -rf $${IPKG_INSTROOT}/usr/bin/wget;
-fi
-ln -s ./wget-nossl $${IPKG_INSTROOT}/usr/bin/wget
-endef
-
-define Package/wget-nossl/postrm
-#!/bin/sh
-rm $${IPKG_INSTROOT}/usr/bin/wget
-[ -x $${IPKG_INSTROOT}/usr/bin/wget-ssl ] && ln -s ./wget-ssl $${IPKG_INSTROOT}/usr/bin/wget || {
- ln -s ../../bin/busybox $${IPKG_INSTROOT}/usr/bin/wget
- $${IPKG_INSTROOT}/usr/bin/wget 2>&1 | grep 'applet not found' > /dev/null 2>&1 && rm $${IPKG_INSTROOT}/usr/bin/wget
-}
-exit 0
+ ln -sf wget-nossl $(1)/usr/bin/wget
endef
$(eval $(call BuildPackage,wget))
PKG_NAME:=wireguard
-PKG_VERSION:=0.0.20160722
+PKG_VERSION:=0.0.20161025
PKG_RELEASE:=1
PKG_SOURCE:=WireGuard-experimental-$(PKG_VERSION).tar.xz
# This is actually SHA256, but OpenWRT/LEDE will figure it out based on the length
-PKG_MD5SUM:=0dcda97b6bb4e962f731a863df9b4291c1c453b01f4faba78be4aaa13a594242
+PKG_MD5SUM:=433fb84d00afa566d77dcb29f87c30e17c1c9c8dc9a9a0026619addfc6553027
PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/
PKG_BUILD_DIR:=$(BUILD_DIR)/WireGuard-experimental-$(PKG_VERSION)
PKG_NAME:=xl2tpd
PKG_VERSION:=devel-20151125
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=LICENSE
available=1
no_device=1
no_proto_task=1
+ teardown_on_l3_link_down=1
}
proto_l2tp_setup() {
PKG_NAME:=znc
PKG_VERSION:=1.6.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://znc.in/releases \
define Package/znc
$(Package/znc/default)
- DEPENDS:=+libopenssl +libpthread +libstdcpp +ZNC_ICU:icu
+ DEPENDS:=+libopenssl +libpthread +libstdcpp +ZNC_ICU:icu +zlib
MENU:=1
endef
--- /dev/null
+From d81a18d87d15bbf54ddbd675bfa829cf7dfdce9e Mon Sep 17 00:00:00 2001
+From: Edoardo Spadolini <kerio00@gmail.com>
+Date: Mon, 8 Feb 2016 14:01:51 +0100
+Subject: [PATCH] Add some #ifdef feature checks to fix compilation with
+ BoringSSL
+
+---
+ Csocket.cc | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- a/src/Csocket.cpp
++++ b/src/Csocket.cpp
+@@ -45,9 +45,12 @@
+
+ #ifdef HAVE_LIBSSL
+ #include <stdio.h>
++#include <openssl/ssl.h>
+ #include <openssl/conf.h>
+ #include <openssl/engine.h>
++#ifndef OPENSSL_NO_COMP
+ #include <openssl/comp.h>
++#endif
+ #endif /* HAVE_LIBSSL */
+
+ #ifdef HAVE_ICU
+@@ -531,8 +534,12 @@ void ShutdownCsocket()
+ {
+ #ifdef HAVE_LIBSSL
+ ERR_remove_state( 0 );
++#ifndef OPENSSL_NO_ENGINE
+ ENGINE_cleanup();
++#endif
++#ifndef OPENSSL_IS_BORINGSSL
+ CONF_modules_unload( 1 );
++#endif
+ ERR_free_strings();
+ EVP_cleanup();
+ CRYPTO_cleanup_all_ex_data();
+@@ -573,6 +580,7 @@ bool InitSSL( ECompType eCompressionType
+ }
+ #endif /* _WIN32 */
+
++#ifndef OPENSSL_NO_COMP
+ COMP_METHOD *cm = NULL;
+
+ if( CT_ZLIB & eCompressionType )
+@@ -588,6 +596,7 @@ bool InitSSL( ECompType eCompressionType
+ if( cm )
+ SSL_COMP_add_compression_method( CT_RLE, cm );
+ }
++#endif
+
+ // setting this up once in the begining
+ s_iCsockSSLIdx = SSL_get_ex_new_index( 0, NULL, NULL, NULL, NULL );
+@@ -1724,6 +1733,8 @@ SSL_CTX * Csock::SetupServerCTX()
+ #ifndef OPENSSL_NO_ECDH
+ // Errors for the following block are non-fatal (ECDHE is nice to have
+ // but not a requirement)
++#ifndef OPENSSL_IS_BORINGSSL
++ // BoringSSL does this thing automatically
+ #if defined( SSL_CTX_set_ecdh_auto )
+ // Auto-select sensible curve
+ if( !SSL_CTX_set_ecdh_auto( pCTX , 1 ) )
+@@ -1742,6 +1753,7 @@ SSL_CTX * Csock::SetupServerCTX()
+ ERR_clear_error();
+ }
+ #endif /* SSL_CTX_set_tmp_ecdh */
++#endif /* !OPENSSL_IS_BORINGSSL */
+ #endif /* OPENSSL_NO_ECDH */
+
+ if( !ConfigureCTXOptions( pCTX ) )
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=alsa-utils
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
+ http://alsa.cybermirror.org/utils/
+PKG_MD5SUM:=b9d6102fbbd0b68040bb77023ed30c0c
+PKG_INSTALL:=1
+PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/alsa-utils
+ SECTION:=sound
+ CATEGORY:=Sound
+ DEPENDS:=+alsa-lib +libncursesw +libpthread
+ TITLE:=ALSA (Advanced Linux Sound Architecture) utilities
+ URL:=http://www.alsa-project.org/
+endef
+
+define Package/alsa-utils-seq
+ SECTION:=sound
+ CATEGORY:=Sound
+ DEPENDS:=+alsa-lib +libpthread
+ TITLE:=ALSA sequencer utilities
+ URL:=http://www.alsa-project.org/
+endef
+
+define Package/alsa-utils-tests
+ SECTION:=sound
+ CATEGORY:=Sound
+ TITLE:=ALSA utilities test data (adds ~1.3M to image)
+ DEPENDS:=+alsa-lib +libpthread
+ URL:=http://www.alsa-project.org/
+endef
+
+CONFIGURE_ARGS+= \
+ --disable-rpath \
+ --disable-alsatest \
+ --disable-bat \
+ --disable-xmlto \
+ --with-curses=ncursesw
+
+define Package/alsa-utils/install
+ $(INSTALL_DIR) $(1)/usr/{s,}bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amixer $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alsamixer $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplay $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecord $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/alsactl $(1)/usr/sbin/
+
+ $(INSTALL_DIR) $(1)/usr/share/alsa/init
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/share/alsa/init/* \
+ $(1)/usr/share/alsa/init/
+endef
+
+define Package/alsa-utils-seq/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aconnect $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amidi $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplaymidi $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecordmidi $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqdump $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqnet $(1)/usr/bin/
+endef
+
+define Package/alsa-utils-tests/install
+ $(INSTALL_DIR) $(1)/usr/{s,}bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speaker-test $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/usr/share/sounds/alsa
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/share/sounds/alsa/* \
+ $(1)/usr/share/sounds/alsa/
+endef
+
+$(eval $(call BuildPackage,alsa-utils))
+$(eval $(call BuildPackage,alsa-utils-seq))
+$(eval $(call BuildPackage,alsa-utils-tests))
--- /dev/null
+--- 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;
include $(TOPDIR)/rules.mk
PKG_NAME:=mpd
-PKG_VERSION:=0.19.17
+PKG_VERSION:=0.19.19
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.musicpd.org/download/mpd/0.19/
-PKG_MD5SUM:=47e13f3f160bf94e7a897c5a48990f3d
+PKG_MD5SUM:=6e4fca9a9c26dad08b61bac9a91802db
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
--disable-ao \
--disable-bzip2 \
--disable-fluidsynth \
+ --disable-wildmidi \
--disable-gme \
--enable-inotify \
--disable-icu \
--disable-eventfd \
--disable-iso9660 \
--disable-jack \
- --disable-lame-encoder \
+ --disable-roar \
--disable-libwrap \
--disable-lsr \
--disable-mikmod \
--disable-sidplay \
--disable-solaris-output \
--disable-sqlite \
+ --disable-lame-encoder \
--disable-twolame-encoder \
+ --disable-shine-encoder \
--enable-wave-encoder \
--disable-wavpack \
--disable-wildmidi \
include $(TOPDIR)/rules.mk
PKG_NAME:=pulseaudio
-PKG_VERSION:=8.0
+PKG_VERSION:=9.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://freedesktop.org/software/pulseaudio/releases/
-PKG_MD5SUM:=8678442ba0bb4b4c33ac6f62542962df
+PKG_MD5SUM:=da7162541b3a9bc20576dbd0d7d1489a
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=GPL LICENSE
define Package/pulseaudio-profiles
SECTION:=sound
CATEGORY:=Sound
- DEPENDS:=pulseaudio
+ DEPENDS:=+pulseaudio
TITLE:=Profiles for Pulseaudio
URL:=http://www.pulseaudio.org
endef
+++ /dev/null
-#
-# Copyright (C) 2006-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=alsa-utils
-PKG_VERSION:=1.1.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=ftp://ftp.alsa-project.org/pub/utils/ \
- http://alsa.cybermirror.org/utils/
-PKG_MD5SUM:=b9d6102fbbd0b68040bb77023ed30c0c
-PKG_INSTALL:=1
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/alsa-utils
- SECTION:=utils
- CATEGORY:=Utilities
- DEPENDS:=+alsa-lib +libncursesw +libpthread
- TITLE:=ALSA (Advanced Linux Sound Architecture) utilities
- URL:=http://www.alsa-project.org/
-endef
-
-define Package/alsa-utils-seq
- SECTION:=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
-
-CONFIGURE_ARGS+= \
- --disable-rpath \
- --disable-alsatest \
- --disable-bat \
- --disable-xmlto \
- --with-curses=ncursesw
-
-define Package/alsa-utils/install
- $(INSTALL_DIR) $(1)/usr/{s,}bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amixer $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alsamixer $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplay $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecord $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/alsactl $(1)/usr/sbin/
-
- $(INSTALL_DIR) $(1)/usr/share/alsa/init
- $(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/share/alsa/init/* \
- $(1)/usr/share/alsa/init/
-endef
-
-define Package/alsa-utils-seq/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aconnect $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/amidi $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aplaymidi $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/arecordmidi $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqdump $(1)/usr/bin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aseqnet $(1)/usr/bin/
-endef
-
-define Package/alsa-utils-tests/install
- $(INSTALL_DIR) $(1)/usr/{s,}bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/speaker-test $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/usr/share/sounds/alsa
- $(INSTALL_DATA) \
- $(PKG_INSTALL_DIR)/usr/share/sounds/alsa/* \
- $(1)/usr/share/sounds/alsa/
-endef
-
-$(eval $(call BuildPackage,alsa-utils))
-$(eval $(call BuildPackage,alsa-utils-seq))
-$(eval $(call BuildPackage,alsa-utils-tests))
+++ /dev/null
---- 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;
--- /dev/null
+#
+# Copyright (C) 2010-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:=ap51-flash
+PKG_VERSION:=2016-10-16
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://dev.cloudtrax.com/ap51-flash.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=48b3fbac1c30c5968b2608eb09b53ea37c310a24
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
+PKG_MAINTAINER:=Russell Senior <russell@personaltelco.net>
+
+include $(INCLUDE_DIR)/package.mk
+
+ifeq ($(CONFIG_BIG_ENDIAN),y)
+ STAMP_BUILT:=$(STAMP_BUILT)_big
+endif
+
+define Package/ap51-flash
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=A tool for flashing (nearly) all ap51/ap61 based routers
+ URL:=http://dev.cloudtrax.com/wiki/ap51-flash-station
+endef
+
+TARGET_EXTRA_CFLAGS:=-DFLASH_FROM_FILE -DNO_LIBPCAP -D_GNU_SOURCE -DIPPORT_TFTP=69
+ifeq ($(CONFIG_BIG_ENDIAN),y)
+ TARGET_EXTRA_CFLAGS:=$(TARGET_EXTRA_CFLAGS) -DUIP_CONF_BYTE_ORDER=1234
+endif
+
+# pass optimization flags
+MAKE_FLAGS += \
+ OFLAGS="$(TARGET_CFLAGS)" \
+ EXTRA_CFLAGS="$(TARGET_EXTRA_CFLAGS)" \
+ REVISION="$(PKG_VERSION)" \
+ ap51-flash
+
+define Package/ap51-flash/install
+ $(INSTALL_DIR) $(1)/etc/config $(1)/etc/init.d $(1)/usr/sbin \
+ $(1)/usr/lib/ap51-flash
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/ap51-flash $(1)/usr/sbin/
+ $(INSTALL_BIN) ./files/ap51-flash.init $(1)/etc/init.d/ap51-flash
+ $(INSTALL_BIN) ./files/ap51-flash.sh $(1)/usr/lib/ap51-flash/ap51-flash.sh
+ $(INSTALL_DATA) ./files/ap51-flash.config $(1)/etc/config/ap51-flash
+endef
+
+define Package/ap51-flash/conffiles
+/etc/config/ap51-flash
+endef
+
+$(eval $(call BuildPackage,ap51-flash))
--- /dev/null
+#config flash
+# option ifname eth0.1
+# option rootfs /tmp/images/openwrt-atheros-root.squashfs
+# option kernel /tmp/images/openwrt-atheros-vmlinux.lzma
+# option ubnt /tmp/images/openwrt-atheros-ubnt5-squashfs.bin
+## option loop '1'
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2010 OpenWrt.org
+
+START=20
+
+NAME=ap51-flash
+
+start_daemon() {
+ local cfg="$1"
+
+ config_get_bool loop "$cfg" loop
+ config_get ifname "$cfg" ifname
+ config_get rootfs "$cfg" rootfs
+ config_get kernel "$cfg" kernel
+ config_get ubnt "$cfg" ubnt
+ [ "$loop" != "1" ] && loop=0
+ if [ -n "$ifname" -a -n "$rootfs" -a -n "$kernel" ] || \
+ [ -n "$ifname" -a -n "$ubnt" ]; then
+ PID="`cat /var/run/$NAME.sh-$ifname.pid 2> /dev/null`"
+ [ -z "`ps | grep "^.[ ]*$PID "`" ] && \
+ rm /var/run/$NAME.sh-$ifname.pid
+ [ -n "`ls /var/run/$NAME.sh-$ifname.pid 2> /dev/null`" ] && {
+ echo "Can't start more than one ap51-flash for interface $ifname!"
+ return 0
+ }
+ start-stop-daemon -S -b -m -p /var/run/$NAME.sh-$ifname.pid -n $NAME.sh \
+ -x /usr/lib/ap51-flash/$NAME.sh -- "$loop" "$ifname" "$rootfs" "$kernel" "$ubnt"
+ fi
+}
+
+start() {
+ config_load ap51-flash
+ config_foreach start_daemon flash
+}
+
+stop() {
+ # Terminating all ap51-flash processes
+ echo "WARNING: Going to teminate all ap51-flash processes! (hope you made sure that they're not flashing right now)"
+ echo "OR you can stop this with Ctrl+c within 10 seconds"
+ sleep 10
+ local pidfile
+ for pidfile in `ls /var/run/${NAME}.sh-*.pid 2> /dev/null`; do
+ start-stop-daemon -K -s TERM -p "${pidfile}" -n "${NAME}.sh" >/dev/null
+ rm -f "${pidfile}"
+ done
+ for pidfile in `ls /var/run/${NAME}-*.pid 2> /dev/null`; do
+ start-stop-daemon -K -s TERM -p "${pidfile}" -n "${NAME}" >/dev/null
+ rm -f "${pidfile}"
+ done
+}
--- /dev/null
+#!/bin/sh
+
+NAME=ap51-flash
+rootfs=""
+kernel=""
+ubnt=""
+
+[ $1 -eq "1" ] && loop="1"
+ifname="$2"
+[ -n "$3" ] && rootfs="--rootfs $3"
+[ -n "$4" ] && kernel="--kernel $4"
+[ -n "$5" ] && ubnt="--ubnt $5"
+
+while [ 1 ]; do
+ start-stop-daemon -S -m -p /var/run/$NAME-$ifname.pid -n $NAME \
+ -x /usr/sbin/$NAME -- --flash-from-file $rootfs $kernel $ubnt $ifname
+
+ rm /var/run/$NAME-$ifname.pid
+ [ "$loop" != "1" ] && break
+ sleep 15
+done
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bandwidthd-php
+PKG_VERSION:=2.0.1
+PKG_RELEASE:=2
+
+PKG_MAINTAINER:=Jean-Michel Lacroix <lacroix@lepine-lacroix.info>
+
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bandwidthd-php
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libpcre +libxml2 +php7 +php7-cgi +php7-mod-pgsql +php7-mod-gd
+ TITLE:=PHP files to graph bandwidthd data in a postgresql database
+ URL:=http://bandwidthd.sourceforge.net/
+endef
+
+define Package/bandwidthd-php/description
+ PHP files to graph bandwidthd data in a postgresql database
+endef
+
+define Build/Compile
+endef
+
+define Package/bandwidthd-php/install
+ $(INSTALL_DIR) $(1)/www/phphtdocs
+ $(INSTALL_DATA) ./files/legend.gif $(1)/www/phphtdocs/
+ $(INSTALL_DATA) ./files/logo.gif $(1)/www/phphtdocs/
+ $(INSTALL_DATA) ./files/details.php $(1)/www/phphtdocs/
+ $(INSTALL_DATA) ./files/footer.php $(1)/www/phphtdocs/
+ $(INSTALL_DATA) ./files/graph.php $(1)/www/phphtdocs/
+ $(INSTALL_DATA) ./files/include.php $(1)/www/phphtdocs/
+ $(INSTALL_DATA) ./files/index.php $(1)/www/phphtdocs/
+ ln -s /var/etc/bandwidthd-php.conf $(1)/www/phphtdocs/config.conf
+ $(INSTALL_DIR) $(1)//etc/config
+ $(INSTALL_CONF) ./files/bandwidthd-php.config $(1)/etc/config/bandwidthd-php
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/bandwidthd-php.init $(1)/etc/init.d/bandwidthd-php
+endef
+
+$(eval $(call BuildPackage,bandwidthd-php))
--- /dev/null
+config bandwidthd-php
+ option dflt_width '900'
+ option dflt_height '256'
+ option dflt_interval 'INT_DAILY'
+ option host '127.0.0.1'
+ option user 'postgres'
+ option dbname 'bandwidthd'
--- /dev/null
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006-2016 OpenWrt.org
+
+START=99
+
+USE_PROCD=1
+
+CONFIGNAME="bandwidthd-php"
+CONFIGFILE="/var/etc/bandwidthd-php.conf"
+
+config_cb() {
+ local cfg_type="$1"
+ local cfg_name="$2"
+ case "$cfg_type" in
+ $CONFIGNAME)
+ append cfgs "$cfg_name"
+ ;;
+ esac
+}
+
+export_number() {
+ local option="$1"
+ local section="$2"
+ local _loctmp
+ paramstr=""
+ config_get _loctmp "$section" "$option"
+ if [ -n "$_loctmp" ]; then
+ paramstr="${_loctmp}"
+ fi
+}
+
+export_string() {
+ local option="$1"
+ local section="$2"
+ local _loctmp
+ paramstr=""
+ config_get _loctmp "$section" "$option"
+ if [ -n "$_loctmp" ]; then
+ paramstr="${_loctmp}"
+ fi
+}
+
+service_triggers()
+{
+ procd_add_reload_trigger $CONFIGNAME
+}
+
+
+start_service() {
+ local conffile="<?php\n// auto-generated config file from /etc/config/${CONFIGNAME}\n"
+ rm -f $CONFIGFILE
+ touch $CONFIGFILE
+
+ config_load $CONFIGNAME
+ for cfg in $cfgs; do
+ export_number dflt_width $cfg
+ conffile="${conffile}define(\"DFLT_WIDTH\", ${paramstr:-"900"});\n"
+
+ export_number dflt_height $cfg
+ conffile="${conffile}define(\"DFLT_HEIGHT\", ${paramstr:-"256"});\n"
+
+ export_string dflt_interval $cfg
+ conffile="${conffile}define(\"DFLT_INTERVAL\", ${paramstr:-"INT_DAILY"});\n\n"'$db_connect_string = "host='
+
+ export_string host $cfg
+ conffile="${conffile}${paramstr:-"127.0.0.1"} user="
+
+ export_string user $cfg
+ conffile="${conffile}${paramstr:-"postgres"} dbname="
+
+ export_string dbname $cfg
+ conffile="${conffile}${paramstr:-"bandwidthd"}"'"'"\n?>"
+ [ -n "$conffile" ] && echo -e "$conffile" >>$CONFIGFILE
+ done
+}
--- /dev/null
+<?php
+include("include.php");
+?>
+<html>
+<center>
+<img src=logo.gif>
+<?php
+if (isset($_GET['sensor_name']))
+ $sensor_name = $_GET['sensor_name'];
+else
+ {
+ echo "<br>Please provide a sensor_name";
+ exit(1);
+ }
+
+if (isset($_GET['ip']))
+ $ip = $_GET['ip'];
+else
+ {
+ echo "<br>Please provide an ip address";
+ exit(1);
+ }
+
+echo "<h3>";
+if (strpos($ip, "/") === FALSE)
+ echo "$ip - ".gethostbyaddr($ip)."</h3>";
+else
+ echo "Total - $ip</h3>";
+
+$db = ConnectDb();
+
+if ($ip == "0.0.0.0/0")
+ {
+ $rxtable = "bd_rx_total_log";
+ $txtable = "bd_tx_total_log";
+ }
+else
+ {
+ $rxtable = "bd_rx_log";
+ $txtable = "bd_tx_log";
+ }
+
+$sql = "select rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent,
+rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
+tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
+tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
+from
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, $txtable
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = ".$txtable.".sensor_id
+and ip <<= '$ip'
+group by ip) as tx,
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, $rxtable
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = ".$rxtable.".sensor_id
+and ip <<= '$ip'
+group by ip) as rx
+
+where tx.ip = rx.ip;";
+//echo "</center><pre>$sql</pre><center>";exit(0);
+$result = pg_query($sql);
+echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>p2p<td>ftp";
+$r = pg_fetch_array($result);
+echo "<tr><td>";
+if (strpos($ip, "/") === FALSE)
+ echo "$ip<td>".gethostbyaddr($ip);
+else
+ echo "Total<td>$ip";
+echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
+ fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
+ fmtb($r['p2p']).fmtb($r['ftp']);
+echo "</table></center>";
+
+echo "<center><h4>Daily</h4></center>";
+echo "Send:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?ip=$ip&sensor_name=".$sensor_name."&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Weekly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_WEEKLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Monthly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_MONTHLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+
+echo "<center><h4>Yearly</h4></center>";
+echo "Send:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$txtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
+echo "Receive:<br><img src=graph.php?interval=".INT_YEARLY."&ip=$ip&sensor_name=$sensor_name&table=$rxtable&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+echo "<img src=legend.gif><br>";
--- /dev/null
+<?php
+echo("Page load completed in ". (time() - $starttime) ." seconds");
+?>
--- /dev/null
+<?php
+require("include.php");
+
+// Returns x location of any given timestamp
+function ts2x($ts)
+ {
+ global $timestamp, $width, $interval;
+ return(($ts-$timestamp)*(($width-XOFFSET) / $interval) + XOFFSET);
+ }
+
+// If we have multiple IP's in a result set we need to total the average of each IP's samples
+function AverageAndAccumulate()
+ {
+ global $Count, $total, $icmp, $udp, $tcp, $ftp, $http, $p2p, $YMax;
+ global $a_total, $a_icmp, $a_udp, $a_tcp, $a_ftp, $a_http, $a_p2p;
+
+ foreach ($Count as $key => $number)
+ {
+ $total[$key] /= $number;
+ $icmp[$key] /= $number;
+ $udp[$key] /= $number;
+ $tcp[$key] /= $number;
+ $ftp[$key] /= $number;
+ $http[$key] /= $number;
+ $p2p[$key] /= $number;
+ }
+
+ foreach ($Count as $key => $number)
+ {
+ $a_total[$key] += $total[$key];
+ $a_icmp[$key] += $icmp[$key];
+ $a_udp[$key] += $udp[$key];
+ $a_tcp[$key] += $tcp[$key];
+ $a_ftp[$key] += $ftp[$key];
+ $a_http[$key] += $http[$key];
+ $a_p2p[$key] += $p2p[$key];
+
+ if ($a_total[$key] > $YMax)
+ $YMax = $a_total[$key];
+ }
+
+ unset($GLOBALS['total'], $GLOBALS['icmp'], $GLOBALS['udp'], $GLOBALS['tcp'], $GLOBALS['ftp'], $GLOBALS['http'], $GLOBALS['p2p'], $GLOBALS['Count']);
+
+ $total = array();
+ $icmp = array();
+ $udp = array();
+ $tcp = array();
+ $ftp = array();
+ $http = array();
+ $p2p = array();
+ $Count = array();
+ }
+
+
+$db = ConnectDb();
+
+// Get parameters
+
+if (isset($_GET['width']))
+ $width = $_GET['width'];
+else
+ $width = DFLT_WIDTH;
+
+if (isset($_GET['height']))
+ $height = $_GET['height'];
+else
+ $height = DFLT_HEIGHT;
+
+if (isset($_GET['interval']))
+ $interval = $_GET['interval'];
+else
+ $interval = DFLT_INTERVAL;
+
+if (isset($_GET['ip']))
+ $ip = $_GET['ip'];
+else
+ exit(1);
+
+if (isset($_GET['sensor_name']))
+ $sensor_name = $_GET['sensor_name'];
+else
+ exit(1);
+
+if (isset($_GET['timestamp']))
+ $timestamp = $_GET['timestamp'];
+else
+ $timestamp = time() - $interval + (0.05*$interval);
+
+if (isset($_GET['table']))
+ $table = $_GET['table'];
+else
+ $table = "bd_rx_log";
+
+if (isset($_GET['yscale']))
+ $yscale = $_GET['yscale'];
+
+$total = array();
+$icmp = array();
+$udp = array();
+$tcp = array();
+$ftp = array();
+$http = array();
+$p2p = array();
+$Count = array();
+
+// Accumulator
+$a_total = array();
+$a_icmp = array();
+$a_udp = array();
+$a_tcp = array();
+$a_ftp = array();
+$a_http = array();
+$a_p2p = array();
+
+$sql = "select *, extract(epoch from timestamp) as ts from sensors, $table where sensors.sensor_id = ".$table.".sensor_id and ip <<= '$ip' and sensor_name = '$sensor_name' and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime order by ip;";
+//echo $sql."<br>"; exit(1);
+$result = pg_query($sql);
+
+// The SQL statement pulls the data out of the database ordered by IP address, that way we can average each
+// datapoint for each IP address to provide smoothing and then toss the smoothed value into the accumulator
+// to provide accurate total traffic rate.
+
+while ($row = pg_fetch_array($result))
+ {
+ if ($row['ip'] != $last_ip)
+ {
+ AverageAndAccumulate();
+ $last_ip = $row['ip'];
+ }
+
+ $x = ($row['ts']-$timestamp)*(($width-XOFFSET)/$interval)+XOFFSET;
+ $xint = (int) $x;
+
+ //echo "xint: ".$xint."<br>";
+ $Count[$xint]++;
+
+ if ($row['total']/$row['sample_duration'] > $SentPeak)
+ $SentPeak = $row['total']/$row['sample_duration'];
+ $TotalSent += $row['total'];
+ $total[$xint] += $row['total']/$row['sample_duration'];
+ $icmp[$xint] += $row['icmp']/$row['sample_duration'];
+ $udp[$xint] += $row['udp']/$row['sample_duration'];
+ $tcp[$xint] += $row['tcp']/$row['sample_duration'];
+ $ftp[$xint] += $row['ftp']/$row['sample_duration'];
+ $http[$xint] += $row['http']/$row['sample_duration'];
+ $p2p[$xint] += $row['p2p']/$row['sample_duration'];
+ }
+
+// One more time for the last IP
+AverageAndAccumulate();
+
+// Pull the data out of Accumulator
+$total = $a_total;
+$icmp = $a_icmp;
+$udp = $a_udp;
+$tcp = $a_tcp;
+$ftp = $a_ftp;
+$http = $a_http;
+$p2p = $a_p2p;
+
+$YMax += $YMax*0.05; // Add an extra 5%
+
+// if a y scale was specified override YMax
+if (isset($yscale))
+ $YMax = $yscale/8;
+
+// Plot the data
+
+header("Content-type: image/png");
+
+$im = imagecreate($width, $height);
+$white = imagecolorallocate($im, 255, 255, 255);
+$yellow = ImageColorAllocate($im, 255, 255, 0);
+$purple = ImageColorAllocate($im, 255, 0, 255);
+$green = ImageColorAllocate($im, 0, 255, 0);
+$blue = ImageColorAllocate($im, 0, 0, 255);
+$lblue = ImageColorAllocate($im, 128, 128, 255);
+$brown = ImageColorAllocate($im, 128, 0, 0);
+$red = ImageColorAllocate($im, 255, 0, 0);
+$black = ImageColorAllocate($im, 0, 0, 0);
+
+for($Counter=XOFFSET+1; $Counter < $width; $Counter++)
+ {
+ if (isset($total[$Counter]))
+ {
+ // Convert the bytes/sec to y coords
+ $total[$Counter] = ($total[$Counter]*($height-YOFFSET))/$YMax;
+ $tcp[$Counter] = ($tcp[$Counter]*($height-YOFFSET))/$YMax;
+ $ftp[$Counter] = ($ftp[$Counter]*($height-YOFFSET))/$YMax;
+ $http[$Counter] = ($http[$Counter]*($height-YOFFSET))/$YMax;
+ $p2p[$Counter] = ($p2p[$Counter]*($height-YOFFSET))/$YMax;
+ $udp[$Counter] = ($udp[$Counter]*($height-YOFFSET))/$YMax;
+ $icmp[$Counter] = ($icmp[$Counter]*($height-YOFFSET))/$YMax;
+
+ // Stack 'em up!
+ // Total is stacked from the bottom
+ // Icmp is on the bottom too
+ // Udp is stacked on top of icmp
+ $udp[$Counter] += $icmp[$Counter];
+ // TCP and p2p are stacked on top of Udp
+ $tcp[$Counter] += $udp[$Counter];
+ $p2p[$Counter] += $udp[$Counter];
+ // Http is stacked on top of p2p
+ $http[$Counter] += $p2p[$Counter];
+ // Ftp is stacked on top of http
+ $ftp[$Counter] += $http[$Counter];
+
+ // Plot them!
+ //echo "$Counter:".$Counter." (h-y)-t:".($height-YOFFSET) - $total[$Counter]." h-YO-1:".$height-YOFFSET-1;
+ ImageLine($im, $Counter, ($height-YOFFSET) - $total[$Counter], $Counter, $height-YOFFSET-1, $yellow);
+ ImageLine($im, $Counter, ($height-YOFFSET) - $icmp[$Counter], $Counter, $height-YOFFSET-1, $red);
+ ImageLine($im, $Counter, ($height-YOFFSET) - $udp[$Counter], $Counter, ($height-YOFFSET) - $icmp[$Counter] - 1, $brown);
+ ImageLine($im, $Counter, ($height-YOFFSET) - $tcp[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $green);
+ ImageLine($im, $Counter, ($height-YOFFSET) - $p2p[$Counter], $Counter, ($height-YOFFSET) - $udp[$Counter] - 1, $purple);
+ ImageLine($im, $Counter, ($height-YOFFSET) - $http[$Counter], $Counter, ($height-YOFFSET) - $p2p[$Counter] - 1, $blue);
+ ImageLine($im, $Counter, ($height-YOFFSET) - $ftp[$Counter], $Counter, ($height-YOFFSET) - $http[$Counter] - 1, $lblue);
+ }
+// else
+// echo $Counter." not set<br>";
+ }
+
+// Margin Text
+if ($SentPeak < 1024/8)
+ $txtPeakSendRate = sprintf("Peak Send Rate: %.1f KBits/sec", $SentPeak*8);
+else if ($SentPeak < (1024*1024)/8)
+ $txtPeakSendRate = sprintf("Peak Send Rate: %.1f MBits/sec", ($SentPeak*8.0)/1024.0);
+else
+ $txtPeakSendRate = sprintf("Peak Send Rate: %.1f GBits/sec", ($SentPeak*8.0)/(1024.0*1024.0));
+
+if ($TotalSent < 1024)
+ $txtTotalSent = sprintf("Sent %.1f KBytes", $TotalSent);
+else if ($TotalSent < 1024*1024)
+ $txtTotalSent = sprintf("Sent %.1f MBytes", $TotalSent/1024.0);
+else
+ $txtTotalSent = sprintf("Sent %.1f GBytes", $TotalSent/(1024.0*1024.0));
+
+ImageString($im, 2, XOFFSET+5, $height-20, $txtTotalSent, $black);
+ImageString($im, 2, $width/2+XOFFSET/2, $height-20, $txtPeakSendRate, $black);
+
+// Draw X Axis
+
+ImageLine($im, 0, $height-YOFFSET, $width, $height-YOFFSET, $black);
+
+// Day/Month Seperator bars
+
+if ((24*60*60*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
+ {
+ $ts = getdate($timestamp);
+ $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+
+ $x = ts2x($MarkTime);
+ while ($x < XOFFSET)
+ {
+ $MarkTime += (24*60*60);
+ $x = ts2x($MarkTime);
+ }
+
+ while ($x < ($width-10))
+ {
+ // Day Lines
+ ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+ ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+ $txtDate = strftime("%a, %b %d", $MarkTime);
+ ImageString($im, 2, $x-30, $height-YOFFSET+10, $txtDate, $black);
+
+ // Calculate Next x
+ $MarkTime += (24*60*60);
+ $x = ts2x($MarkTime);
+ }
+ }
+else if ((24*60*60*30*($width-XOFFSET))/$interval > ($width-XOFFSET)/10)
+ {
+ // Monthly Bars
+ $ts = getdate($timestamp);
+ $month = $ts['mon'];
+ $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+
+ $x = ts2x($MarkTime);
+ while ($x < XOFFSET)
+ {
+ $month++;
+ $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+ $x = ts2x($MarkTime);
+ }
+
+ while ($x < ($width-10))
+ {
+ // Day Lines
+ ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+ ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+ $txtDate = strftime("%b, %Y", $MarkTime);
+ ImageString($im, 2, $x-25, $height-YOFFSET+10, $txtDate, $black);
+
+ // Calculate Next x
+ $month++;
+ $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+ $x = ts2x($MarkTime);
+ }
+ }
+else
+ {
+ // Year Bars
+ $ts = getdate($timestamp);
+ $year = $ts['year'];
+ $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+
+ $x = ts2x($MarkTime);
+ while ($x < XOFFSET)
+ {
+ $year++;
+ $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+ $x = ts2x($MarkTime);
+ }
+
+ while ($x < ($width-10))
+ {
+ // Day Lines
+ ImageLine($im, $x, 0, $x, $height-YOFFSET, $black);
+ ImageLine($im, $x+1, 0, $x+1, $height-YOFFSET, $black);
+
+ $txtDate = strftime("%b, %Y", $MarkTime);
+ ImageString($im, 2, $x-25, $height-YOFFSET+10, $txtDate, $black);
+
+ // Calculate Next x
+ $year++;
+ $MarkTime = mktime(0, 0, 0, 1, 1, $year);
+ $x = ts2x($MarkTime);
+ }
+ }
+
+// Draw Major Tick Marks
+if ((6*60*60*($width-XOFFSET))/$interval > 10) // pixels per 6 hours is more than 2
+ $MarkTimeStep = 6*60*60; // Major ticks are 6 hours
+else if ((24*60*60*($width-XOFFSET))/$interval > 10)
+ $MarkTimeStep = 24*60*60; // Major ticks are 24 hours;
+else if ((24*60*60*30*($width-XOFFSET))/$interval > 10)
+ {
+ // Major tick marks are months
+ $MarkTimeStep = 0; // Skip the standard way of drawing major tick marks below
+
+ $ts = getdate($timestamp);
+ $month = $ts['mon'];
+ $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+
+ $x = ts2x($MarkTime);
+ while ($x < XOFFSET)
+ {
+ $month++;
+ $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+ $x = ts2x($MarkTime);
+ }
+
+ while ($x < ($width-10))
+ {
+ // Day Lines
+ $date = getdate($MarkTime);
+ if ($date['mon'] != 1)
+ {
+ ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
+ $txtDate = strftime("%b", $MarkTime);
+ ImageString($im, 2, $x-5, $height-YOFFSET+10, $txtDate, $black);
+ }
+
+ // Calculate Next x
+ $month++;
+ $MarkTime = mktime(0, 0, 0, $month, 1, $ts['year']);
+ $x = ts2x($MarkTime);
+ }
+ }
+else
+ $MarkTimeStep = 0; // Skip Major Tick Marks
+
+if ($MarkTimeStep)
+ {
+ $ts = getdate($timestamp);
+ $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+ $x = ts2x($MarkTime);
+
+ while ($x < ($width-10))
+ {
+ if ($x > XOFFSET)
+ {
+ ImageLine($im, $x, $height-YOFFSET-5, $x, $height-YOFFSET+5, $black);
+ }
+ $MarkTime += $MarkTimeStep;
+ $x = ts2x($MarkTime);
+ }
+ }
+
+// Draw Minor Tick marks
+if ((60*60*($width-XOFFSET))/$interval > 4) // pixels per hour is more than 2
+ $MarkTimeStep = 60*60; // Minor ticks are 1 hour
+else if ((6*60*60*($width-XOFFSET))/$interval > 4)
+ $MarkTimeStep = 6*60*60; // Minor ticks are 6 hours
+else if ((24*60*60*($width-XOFFSET))/$interval > 4)
+ $MarkTimeStep = 24*60*60;
+else
+ $MarkTimeStep = 0; // Skip minor tick marks
+
+if ($MarkTimeStep)
+ {
+ $ts = getdate($timestamp);
+ $MarkTime = mktime(0, 0, 0, $ts['mon'], $ts['mday'], $ts['year']);
+ $x = ts2x($MarkTime);
+
+ while ($x < ($width-10))
+ {
+ if ($x > XOFFSET)
+ {
+ ImageLine($im, $x, $height-YOFFSET, $x, $height-YOFFSET+5, $black);
+ }
+ $MarkTime += $MarkTimeStep;
+ $x = ts2x($MarkTime);
+ }
+ }
+
+// Draw Y Axis
+ImageLine($im, XOFFSET, 0, XOFFSET, $height, $black);
+
+$YLegend = 'k';
+$Divisor = 1;
+if ($YMax*8 > 1024*2)
+ {
+ $Divisor = 1024; // Display in m
+ $YLegend = 'm';
+ }
+
+if ($YMax*8 > 1024*1024*2)
+ {
+ $Divisor = 1024*1024; // Display in g
+ $YLegend = 'g';
+ }
+
+if ($YMax*8 > 1024*1024*1024*2)
+ {
+ $Divisor = 1024*1024*1024; // Display in t
+ $YLegend = 't';
+ }
+
+$YStep = $YMax/10;
+if ($YStep < 1)
+ $YStep=1;
+$YTic=$YStep;
+
+while ($YTic <= ($YMax - $YMax/10))
+ {
+ $y = ($height-YOFFSET)-(($YTic*($height-YOFFSET))/$YMax);
+ ImageLine($im, XOFFSET, $y, $width, $y, $black);
+ $txtYLegend = sprintf("%4.1f %sbits/s", (8.0*$YTic)/$Divisor, $YLegend);
+ ImageString($im, 2, 3, $y-7, $txtYLegend, $black);
+ $YTic += $YStep;
+ }
+
+imagepng($im);
+imagedestroy($im);
--- /dev/null
+<?php
+define("INT_DAILY", 60*60*24*2);
+define("INT_WEEKLY", 60*60*24*8);
+define("INT_MONTHLY", 60*60*24*35);
+define("INT_YEARLY", 60*60*24*400);
+
+define("XOFFSET", 90);
+define("YOFFSET", 45);
+
+require("config.conf");
+
+function ConnectDb()
+ {
+ global $db_connect_string;
+
+ $db = pg_pconnect($db_connect_string);
+ if (!$db)
+ {
+ printf("DB Error, could not connect to database");
+ exit(1);
+ }
+ return($db);
+ }
+
+function fmtb($kbytes)
+ {
+ $Max = 1024;
+ $Output = $kbytes;
+ $Suffix = 'K';
+
+ if ($Output > $Max)
+ {
+ $Output /= 1024;
+ $Suffix = 'M';
+ }
+
+ if ($Output > $Max)
+ {
+ $Output /= 1024;
+ $Suffix = 'G';
+ }
+
+ if ($Output > $Max)
+ {
+ $Output /= 1024;
+ $Suffix = 'T';
+ }
+
+ return(sprintf("<td align=right><tt>%.1f%s</td>", $Output, $Suffix));
+ }
+
+$starttime = time();
+set_time_limit(300);
+?>
--- /dev/null
+<?php
+include("include.php");
+?>
+<html>
+<center>
+<img src=logo.gif>
+<?php
+// Get variables from url
+
+if (isset($_GET['sensor_name']) && $_GET['sensor_name'] != "none")
+ $sensor_name = $_GET['sensor_name'];
+
+if (isset($_GET['interval']) && $_GET['interval'] != "none")
+ $interval = $_GET['interval'];
+
+if (isset($_GET['timestamp']) && $_GET['timestamp'] != "none")
+ $timestamp = $_GET['timestamp'];
+
+if (isset($_GET['subnet']) && $_GET['subnet'] != "none")
+ $subnet = $_GET['subnet'];
+
+if (isset($_GET['limit']) && $_GET['limit'] != "none")
+ $limit = $_GET['limit'];
+
+
+$db = ConnectDb();
+?>
+<FORM name="navigation" method=get action=<?php echo $PHP_SELF?>>
+<table width=100% cellspacing=0 cellpadding=5 border=1>
+<tr>
+<td><SELECT name="sensor_name">
+
+<OPTION value="none">--Select A Sensor--
+<?php
+$sql = "SELECT sensor_name from sensors order by sensor_name;";
+$result = pg_query($sql);
+while ($r = pg_fetch_array($result))
+ echo "<option value=\"".$r['sensor_name']."\" ".($sensor_name==$r['sensor_name']?"SELECTED":"").">".$r['sensor_name']."\n";
+?>
+</SELECT>
+<td><SELECT name="interval">
+<OPTION value="none">--Select An Interval--
+<OPTION value=<?php echo INT_DAILY?> <?php echo $interval==INT_DAILY?"SELECTED":""?>>Daily
+<OPTION value=<?php echo INT_WEEKLY?> <?php echo $interval==INT_WEEKLY?"SELECTED":""?>>Weekly
+<OPTION value=<?php echo INT_MONTHLY?> <?php echo $interval==INT_MONTHLY?"SELECTED":""?>>Monthly
+<OPTION value=<?php echo INT_YEARLY?> <?php echo $interval==INT_YEARLY?"SELECTED":""?>>Yearly
+<OPTION value=<?php echo 24*60*60?> <?php echo $interval==24*60*60?"SELECTED":""?>>24hrs
+<OPTION value=<?php echo 30*24*60*60?> <?php echo $interval==30*24*60*60?"SELECTED":""?>>30days
+</select>
+
+<td><SELECT name="limit">
+<OPTION value="none">--How Many Results--
+<OPTION value=20 <?php echo $limit==20?"SELECTED":""?>>20
+<OPTION value=50 <?php echo $limit==50?"SELECTED":""?>>50
+<OPTION value=100 <?php echo $limit==100?"SELECTED":""?>>100
+<OPTION value=all <?php echo $limit=="all"?"SELECTED":""?>>All
+</select>
+
+<td>Subnet Filter:<input name=subnet value="<?php echo isset($subnet)?$subnet:"0.0.0.0/0"?>">
+<input type=submit value="Go">
+</table>
+</FORM>
+<?php
+// Set defaults
+if (!isset($interval))
+ $interval = DFLT_INTERVAL;
+
+if (!isset($timestamp))
+ $timestamp = time() - $interval + (0.05*$interval);
+
+if (!isset($limit))
+ $limit = 20;
+
+// Validation
+if (!isset($sensor_name))
+ exit(0);
+
+// Print Title
+
+if (isset($limit))
+ echo "<h2>Top $limit - $sensor_name</h2>";
+else
+ echo "<h2>All Records - $sensor_name</h2>";
+
+// Sqlize the incomming variables
+if (isset($subnet))
+ $sql_subnet = "and ip <<= '$subnet'";
+
+// Sql Statement
+$sql = "select tx.ip, rx.scale as rxscale, tx.scale as txscale, tx.total+rx.total as total, tx.total as sent,
+rx.total as received, tx.tcp+rx.tcp as tcp, tx.udp+rx.udp as udp,
+tx.icmp+rx.icmp as icmp, tx.http+rx.http as http,
+tx.p2p+rx.p2p as p2p, tx.ftp+rx.ftp as ftp
+from
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, bd_tx_log
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = bd_tx_log.sensor_id
+$sql_subnet
+and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime
+group by ip) as tx,
+
+(SELECT ip, max(total/sample_duration)*8 as scale, sum(total) as total, sum(tcp) as tcp, sum(udp) as udp, sum(icmp) as icmp,
+sum(http) as http, sum(p2p) as p2p, sum(ftp) as ftp
+from sensors, bd_rx_log
+where sensor_name = '$sensor_name'
+and sensors.sensor_id = bd_rx_log.sensor_id
+$sql_subnet
+and timestamp > $timestamp::abstime and timestamp < ".($timestamp+$interval)."::abstime
+group by ip) as rx
+
+where tx.ip = rx.ip
+order by total desc;";
+
+//echo "</center><pre>$sql</pre><center>"; exit(0);
+pg_query("SET sort_mem TO 30000;");
+$result = pg_query($sql);
+pg_query("set sort_mem to default;");
+
+if ($limit == "all")
+ $limit = pg_num_rows($result);
+
+echo "<table width=100% border=1 cellspacing=0><tr><td>Ip<td>Name<td>Total<td>Sent<td>Received<td>tcp<td>udp<td>icmp<td>http<td>p2p<td>ftp";
+
+if (!isset($subnet)) // Set this now for total graphs
+ $subnet = "0.0.0.0/0";
+
+// Output Total Line
+echo "<TR><TD><a href=Total>Total</a><TD>$subnet";
+foreach (array("total", "sent", "received", "tcp", "udp", "icmp", "http", "p2p", "ftp") as $key)
+ {
+ for($Counter=0, $Total = 0; $Counter < pg_num_rows($result); $Counter++)
+ {
+ $r = pg_fetch_array($result, $Counter);
+ $Total += $r[$key];
+ }
+ echo fmtb($Total);
+ }
+echo "\n";
+
+// Output Other Lines
+for($Counter=0; $Counter < pg_num_rows($result) && $Counter < $limit; $Counter++)
+ {
+ $r = pg_fetch_array($result, $Counter);
+ echo "<tr><td><a href=#".$r['ip'].">";
+ echo $r['ip']."<td>".gethostbyaddr($r['ip']);
+ echo "</a>";
+ echo fmtb($r['total']).fmtb($r['sent']).fmtb($r['received']).
+ fmtb($r['tcp']).fmtb($r['udp']).fmtb($r['icmp']).fmtb($r['http']).
+ fmtb($r['p2p']).fmtb($r['ftp'])."\n";
+ }
+echo "</table></center>";
+
+// Output Total Graph
+for($Counter=0, $Total = 0; $Counter < pg_num_rows($result); $Counter++)
+ {
+ $r = pg_fetch_array($result, $Counter);
+ $scale = max($r['txscale'], $scale);
+ $scale = max($r['rxscale'], $scale);
+ }
+
+if ($subnet == "0.0.0.0/0")
+ $total_table = "bd_tx_total_log";
+else
+ $total_table = "bd_tx_log";
+echo "<a name=Total><h3><a href=details.php?sensor_name=$sensor_name&ip=$subnet>";
+echo "Total - Total of $subnet</h3>";
+echo "</a>";
+echo "Send:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
+echo "<img src=legend.gif><br>\n";
+if ($subnet == "0.0.0.0/0")
+ $total_table = "bd_rx_total_log";
+else
+ $total_table = "bd_rx_log";
+echo "Receive:<br><img src=graph.php?ip=$subnet&interval=$interval&sensor_name=".$sensor_name."&table=$total_table><br>";
+echo "<img src=legend.gif><br>\n";
+
+
+// Output Other Graphs
+for($Counter=0; $Counter < pg_num_rows($result) && $Counter < $limit; $Counter++)
+ {
+ $r = pg_fetch_array($result, $Counter);
+ echo "<a name=".$r['ip']."><h3><a href=details.php?sensor_name=$sensor_name&ip=".$r['ip'].">";
+ if ($r['ip'] == "0.0.0.0")
+ echo "Total - Total of all subnets</h3>";
+ else
+ echo $r['ip']." - ".gethostbyaddr($r['ip'])."</h3>";
+ echo "</a>";
+ echo "Send:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_tx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+ echo "<img src=legend.gif><br>\n";
+ echo "Receive:<br><img src=graph.php?ip=".$r['ip']."&interval=$interval&sensor_name=".$sensor_name."&table=bd_rx_log&yscale=".(max($r['txscale'], $r['rxscale']))."><br>";
+ echo "<img src=legend.gif><br>\n";
+ }
+
+include('footer.php');
define Package/bash
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Shells
TITLE:=The GNU Bourne Again SHell
DEPENDS:=+libncurses
URL:=http://www.gnu.org/software/bash/
include $(TOPDIR)/rules.mk
PKG_NAME:=btrfs-progs
-PKG_VERSION:=4.5.1
+PKG_VERSION:=4.7.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-v$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/kdave/btrfs-progs/
-PKG_MD5SUM:=31be62e9a772f297669b2ee14dc85c27
+PKG_MD5SUM:=f49bc9e143ffe60260c5bd70ef3b624576673f8b50f41e309892a425f7fbe60f
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
---- btrfs-progs-v4.2.3/chunk-recover.c
-+++ btrfs-progs-v4.2.3/chunk-recover.c.new
-@@ -883,7 +883,7 @@
+--- a/chunk-recover.c
++++ b/chunk-recover.c
+@@ -887,7 +887,7 @@ static int scan_devices(struct recover_c
for (i = 0; i < devidx; i++) {
if (dev_scans[i].bytenr == -1)
continue;
include $(TOPDIR)/rules.mk
PKG_NAME:=ccid
-PKG_VERSION:=1.4.22
+PKG_VERSION:=1.4.24
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4162
-PKG_MD5SUM:=150e1edc449ad394572dd72490b7b6f4
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4171
+PKG_MD5SUM:=62cb73c6c009c9799c526f05a05e25f00f0ad86d50f82a714dedcfbf4a7e4176
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
define Package/ccrypt
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Encryption
TITLE:=ccrypt is a utility for encrypting and decrypting files and streams
URL:=http://ccrypt.sourceforge.net/
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=collectd
-PKG_VERSION:=5.5.1
-PKG_RELEASE:=6
+PKG_VERSION:=5.5.2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=fd24b947cef9351ce3e2d6d2a0762e18
+PKG_MD5SUM:=40b83343f72089e0330f53965f1140bd
PKG_FIXUP:=autoreconf
PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
battery \
ceph \
cgroups \
- cpufreq \
curl_json \
curl_xml \
dbi \
conntrack \
contextswitch \
cpu \
+ cpufreq \
csv \
curl \
df \
syslog \
table \
tail \
+ tail_csv \
tcpconns \
teamspeak2 \
ted \
$(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,cpufreq,CPU Freq input,cpufreq,@(TARGET_x86||TARGET_x86_64||TARGET_mvebu))) # Only enable on x86 and mvebu
$(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,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,tail-csv,tail CSV input,tail_csv,))
$(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
+++ b/version-gen.sh
@@ -2,7 +2,7 @@
- DEFAULT_VERSION="5.5.1.git"
+ DEFAULT_VERSION="5.5.2.git"
-VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
+#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
--- a/configure.ac
+++ b/configure.ac
-@@ -2585,7 +2585,7 @@ then
+@@ -2626,7 +2626,7 @@ then
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
--- a/configure.ac
+++ b/configure.ac
-@@ -663,6 +663,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
+@@ -704,6 +704,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
have_termios_h="no"
AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
# For the turbostat plugin
have_asm_msrindex_h="no"
AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
-@@ -5241,6 +5244,7 @@ plugin_interface="no"
+@@ -5310,6 +5313,7 @@ plugin_interface="no"
plugin_ipmi="no"
plugin_ipvs="no"
plugin_irq="no"
plugin_load="no"
plugin_log_logstash="no"
plugin_memory="no"
-@@ -5638,6 +5642,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
+@@ -5713,6 +5717,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
AC_PLUGIN([load], [$plugin_load], [System load])
AC_PLUGIN([logfile], [yes], [File logging plugin])
-@@ -5967,6 +5972,7 @@ Configuration:
+@@ -6042,6 +6047,7 @@ Configuration:
oracle . . . . . . . $with_oracle
protobuf-c . . . . . $have_protoc_c
python . . . . . . . $with_python
Features:
daemon mode . . . . . $enable_daemon
-@@ -6016,6 +6022,7 @@ Configuration:
+@@ -6091,6 +6097,7 @@ Configuration:
iptables . . . . . . $enable_iptables
ipvs . . . . . . . . $enable_ipvs
irq . . . . . . . . . $enable_irq
# JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
-@@ -2608,6 +2608,27 @@ and all other interrupts are collected.
+@@ -2606,6 +2606,27 @@ and all other interrupts are collected.
=back
+}
--- a/src/Makefile.am
+++ b/src/Makefile.am
-@@ -454,6 +454,13 @@ irq_la_SOURCES = irq.c
+@@ -457,6 +457,13 @@ irq_la_SOURCES = irq.c
irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
endif
include $(TOPDIR)/rules.mk
PKG_NAME:=crelay
-PKG_VERSION:=0.10
+PKG_VERSION:=0.10.1
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
#!/bin/sh /etc/rc.common
-# Copyright (C) 2015 OpenWrt.org
+# Copyright (C) 2016 OpenWrt.org
NAME=crelay
START=93
procd_set_param respawn
procd_set_param command "$PROG"
- # daemon mode (not daemonized) - starts HTTP server
+ # daemon mode in foreground - starts HTTP server
procd_append_param command -d
procd_close_instance
+++ /dev/null
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -64,7 +64,7 @@ all: $(BIN)
-
- $(BIN): $(OBJ)
- @echo "[Link $(BIN)] with libs $(LIBS)"
-- @$(CC) -o $(BIN) $(OBJ) $(LIBS)
-+ @$(CC) -o $(BIN) $(OBJ) $(LDFLAGS) $(LIBS)
-
- .c.o:
- @echo "[Compile $<]"
+++ /dev/null
---- a/src/crelay.c
-+++ b/src/crelay.c
-@@ -678,10 +678,12 @@ int main(int argc, char *argv[])
- listen(sock, 5);
- syslog(LOG_DAEMON | LOG_NOTICE, "HTTP server listening on %s:%d\n", inet_ntoa(iface), port);
-
-+#if 0
- if (daemon(0, 0) == -1) {
- syslog(LOG_DAEMON | LOG_ERR, "Failed to daemonize: %s", strerror(errno));
- exit(EXIT_FAILURE);
- }
-+#endif
-
- while (1)
- {
define Package/cryptsetup/Default
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Encryption
TITLE:=Cryptsetup
DEPENDS:=+libblkid +libuuid +libpopt +lvm2 +libdevmapper +@KERNEL_DIRECT_IO
URL:=http://code.google.com/p/cryptsetup/
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=dmidecode
PKG_VERSION:=3.0
-PKG_RELEASE:=1
+PKG_RELEASE:=3
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/dmidecode
-PKG_MD5SUM:=be7501ad0f844e875976b96106afaa3c
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME)
+PKG_MD5SUM:=7ec35bb193729c1d593a1460b59d82d24b89102ab23fd0416e6cf4325d077e45
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
#
-# Copyright (C) 2006-2015 OpenWrt.org
+# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=dosfstools
-PKG_VERSION:=3.0.28
-PKG_RELEASE:=1
+PKG_VERSION:=4.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
+ http://fossies.org/linux/misc
+PKG_MD5SUM:=9037738953559d1efe04fc5408b6846216cc0138f7f9d32de80b6ec3c35e7daf
+PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=David Bonnes <david.bonnes@gmail.com>
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
- http://fossies.org/linux/misc
-PKG_MD5SUM:=64e3b3a59b51d2a97d7ac38b23a124bb
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
-define Package/dosfstools/Default
+CONFIGURE_ARGS += \
+ --without-udev
+
+define Package/dosfstools
SECTION:=utils
CATEGORY:=Utilities
- URL:=https://github.com/dosfstools
SUBMENU:=Filesystem
DEPENDS:=$(ICONV_DEPENDS)
+ TITLE:=Utilities for making and checking MS-DOS FAT filesystems
+ URL:=https://github.com/dosfstools
endef
-define Package/dosfsck
- $(call Package/dosfstools/Default)
- TITLE:=fsck (fsck.fat) utility from dosfstools
-endef
-
-define Package/dosfslabel
- $(call Package/dosfstools/Default)
- TITLE:=fslabel (fatlabel) utility from dosfstools
-endef
-
-define Package/mkdosfs
- $(call Package/dosfstools/Default)
- TITLE:=mkfs (mkfs.fat) utility from dosfstools
-endef
-
-define Package/dosfsck/description
- Utilities to create and check MS-DOS FAT filesystems.
- (fsck.vfat and fsck.fat for checking integrity of FAT volumes)
-endef
-
-define Package/dosfslabel/description
- Utilities to create and check MS-DOS FAT filesystems.
- (fatlabel for reading and writing labels of FAT volumes)
-endef
-
-define Package/mkdosfs/description
- Utilities to create and check MS-DOS FAT filesystems.
- (mkfs.vfat and mkfs.fat for creating FAT volumes)
-endef
-
-LDFLAGS+=$(ICONV_LDFLAGS)
-LDLIBS+=-liconv
-
-define Build/Configure
-endef
-
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR) \
- $(TARGET_CONFIGURE_OPTS) \
- OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE" \
- PREFIX="/usr" \
- SBINDIR="/usr/sbin" \
- LDFLAGS="$(LDFLAGS)" \
- LDLIBS="$(LDLIBS)" \
- all
- $(MAKE) -C $(PKG_BUILD_DIR) \
- $(TARGET_CONFIGURE_OPTS) \
- OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \
- PREFIX="$(PKG_INSTALL_DIR)/usr" \
- SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin" \
- install-bin
-endef
-
-define Package/dosfsck/install
- $(INSTALL_DIR) $(1)/lib/functions/fsck
- $(INSTALL_DATA) ./files/dosfsck.sh $(1)/lib/functions/fsck/
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.fat $(1)/usr/sbin/
- (cd $(1)/usr/sbin; ln -sf fsck.fat fsck.msdos; ln -sf fsck.fat fsck.vfat; ln -sf fsck.fat dosfsck)
+define Package/dosfstools/description
+ The dosfstools package includes the mkfs.fat and fsck.fat utilities, which respectively make and check MS-DOS FAT filesystems.
endef
-define Package/dosfslabel/install
+define Package/dosfstools/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fatlabel $(1)/usr/sbin/
-endef
-
-define Package/mkdosfs/install
- $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.fat $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.fat $(1)/usr/sbin/
- (cd $(1)/usr/sbin; ln -sf mkfs.fat mkfs.msdos; ln -sf mkfs.fat mkfs.vfat)
endef
-$(eval $(call BuildPackage,dosfsck))
-$(eval $(call BuildPackage,dosfslabel))
-$(eval $(call BuildPackage,mkdosfs))
+$(eval $(call BuildPackage,dosfstools))
+++ /dev/null
-#!/bin/sh
-# Copyright 2010 Vertical Communications
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-fsck_dosfsck() {
- dosfsck -p "$device" 2>&1 | logger -t "fstab: dosfsck ($device)"
- local status="$?"
- case "$status" in
- 0|1) ;; #success
- 2) reboot;;
- 4) echo "dosfsck ($device): Warning! Uncorrected errors."| logger -t fstab
- return 1
- ;;
- *) echo "dosfsck ($device): Error $status. Check not complete."| logger -t fstab;;
- esac
- return 0
-}
-
-fsck_dos() {
- fsck_dosfsck "$@"
-}
-
-fsck_vfat() {
- fsck_dosfsck "$@"
-}
-
-append libmount_known_fsck "dos"
-append libmount_known_fsck "vfat"
--- /dev/null
+From 1e76e5778a1885452939a79d9145b80634a5b023 Mon Sep 17 00:00:00 2001
+From: Andreas Bombe <aeb@debian.org>
+Date: Wed, 11 May 2016 03:44:58 +0200
+Subject: [PATCH] mkfs: Default to 64/32 heads/sectors for targets smaller than
+ 512 MB
+
+This may put defaults in certain use cases a little bit more in line
+with the old defaults in versions up to 3.0.28. It has mostly aesthetic
+value in most cases.
+
+Signed-off-by: Andreas Bombe <aeb@debian.org>
+---
+ src/mkfs.fat.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/src/mkfs.fat.c
++++ b/src/mkfs.fat.c
+@@ -519,6 +519,16 @@ static void establish_params(struct devi
+ unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
+ int def_root_dir_entries = 512;
+
++ if (info->size < 512 * 1024 * 1024) {
++ /*
++ * These values are more or less meaningless, but we can at least
++ * use less extreme values for smaller filesystems where the large
++ * dummy values signifying LBA only access are not needed.
++ */
++ sec_per_track = 32;
++ heads = 64;
++ }
++
+ if (info->type != TYPE_FIXED) {
+ /* enter default parameters for floppy disks if the size matches */
+ switch (info->size / 1024) {
--- /dev/null
+From 1c6c135ee15e449c1bf2e76d5307f83a3a1d7425 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
+Date: Tue, 11 Oct 2016 12:07:48 +0200
+Subject: [PATCH] Switch to AC_CHECK_LIB for iconv library linking.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+AC_SEARCH_LIB doesn't work properly for openwrt/lede when building dosfstools
+as a package.
+
+Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -59,7 +59,7 @@ if test "x$with_udev" != "xno"; then
+ [true])
+ fi
+
+-AC_SEARCH_LIBS(iconv_open, iconv)
++AC_CHECK_LIB(iconv, iconv_open)
+
+ AC_CONFIG_FILES([Makefile src/Makefile src/version.h
+ manpages/Makefile manpages/mkfs.fat.8
+++ /dev/null
-Index: dosfstools-3.0.28/src/mkfs.fat.c
-===================================================================
---- dosfstools-3.0.28.orig/src/mkfs.fat.c
-+++ dosfstools-3.0.28/src/mkfs.fat.c
-@@ -1412,7 +1412,7 @@ int main(int argc, char **argv)
-
- gettimeofday(&create_timeval, NULL);
- create_time = create_timeval.tv_sec;
-- volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
-+ volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
- check_atari();
-
- printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");
include $(TOPDIR)/rules.mk
PKG_NAME:=dump1090
-PKG_VERSION:=2016-06-16
+PKG_VERSION:=2016-10-02
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/mutability/dump1090.git
+PKG_SOURCE_URL:=https://github.com/mutability/dump1090.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=dfe3d7af12d0d739a1164c71086d4b37f57886d9
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_VERSION:=344415b91f018e7fd3719fe639888505c54792ad
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
define Package/dump1090
$(call Package/dump1090/Default)
TITLE+= (dump1090)
- DEPENDS+= +librtlsdr
+ DEPENDS+= +librtlsdr +uhttpd
endef
define Package/view1090
MAKE_FLAGS += \
CFLAGS="$(TARGET_CFLAGS)" \
- UNAME=Linux
+ UNAME="Linux"
define Package/dump1090/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/dump1090.init $(1)/etc/init.d/dump1090
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) files/dump1090.config $(1)/etc/config/dump1090
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_DATA) files/dump1090.default $(1)/etc/uci-defaults/00_uhttpd_dump1090
$(INSTALL_DIR) $(1)/usr/share/dump1090
$(CP) $(PKG_BUILD_DIR)/public_html/* $(1)/usr/share/dump1090
+ $(LN) /var/run/dump1090 $(1)/usr/share/dump1090/data
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
endef
option modeac '0'
option net_only '0'
option net_bind_address ''
- option net_http_port '8080'
option net_ri_port ''
option net_ro_port ''
option net_sbs_port ''
option stats_every ''
option onlyaddr '0'
option metric '0'
- option hae '0'
+ option gnss '0'
option snip ''
option debug ''
option ppm ''
option html_dir '/usr/share/dump1090'
- option write_json ''
- option write_json_every ''
+ option write_json '/var/run/dump1090'
+ option write_json_every '1'
option json_location_accuracy ''
option oversample '0'
option dcfilter '0'
--- /dev/null
+#!/bin/sh
+uci batch <<-EOF
+ set uhttpd.xupnpd=uhttpd
+ set uhttpd.xupnpd.listen_http='0.0.0.0:8080 [::]:8080'
+ set uhttpd.xupnpd.home=/usr/share/dump1090
+ set uhttpd.xupnpd.rfc1918_filter=1
+ set uhttpd.xupnpd.max_requests=3
+ set uhttpd.xupnpd.max_connections=100
+ set uhttpd.xupnpd.script_timeout=60
+ set uhttpd.xupnpd.network_timeout=30
+ set uhttpd.xupnpd.http_keepalive=20
+ set uhttpd.xupnpd.tcp_keepalive=1
+ set uhttpd.xupnpd.index_page='index.html index.htm gmap.html'
+ commit uhttpd
+EOF
+exit 0
#!/bin/sh /etc/rc.common
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
START=90
STOP=10
append_bool "$cfg" modeac "--modeac"
append_bool "$cfg" net_only "--net-only"
append_arg "$cfg" net_bind_address "--net-bind-address"
- append_arg "$cfg" net_http_port "--net-http-port"
append_arg "$cfg" net_ri_port "--net-ri-port"
append_arg "$cfg" net_ro_port "--net-ro-port"
append_arg "$cfg" net_sbs_port "--net-sbs-port"
append_arg "$cfg" stats_every "--stats-every"
append_bool "$cfg" onlyaddr "--onlyaddr"
append_bool "$cfg" metric "--metric"
- append_bool "$cfg" hae "--hae"
+ append_bool "$cfg" gnss "--gnss"
append_arg "$cfg" snip "--snip"
append_arg "$cfg" debug "--debug"
append_arg "$cfg" ppm "--ppm"
append_arg "$cfg" html_dir "--html-dir"
append_arg "$cfg" write_json "--write-json"
- append_arg "$cfg" write_json_every "write-json-every"
+ config_get aux "$cfg" "write_json"
+ [ -n "$aux" ] && mkdir -p $aux
+ append_arg "$cfg" write_json_every "--write-json-every"
append_arg "$cfg" json_location_accuracy "--json-location-accuracy"
append_bool "$cfg" oversample "--oversample"
append_bool "$cfg" dcfilter "--dcfilter"
procd_close_instance
}
-service_triggers() {
- procd_add_reload_trigger "dump1090"
-}
+service_triggers() {
+ procd_add_reload_trigger "dump1090"
+}
start_service() {
config_load dump1090
define Package/dvtm
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Terminal
DEPENDS:=+libncursesw
TITLE:=dynamic virtual terminal manager
URL:=http://www.brain-dump.org/projects/dvtm/
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=$(PKG_REV)
-PKG_MAINTAINER:=Pushpal Sidhu <psidhu@gateworks.com>
+PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=findutils
+PKG_VERSION:=4.6.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
+PKG_MD5SUM:=9936aa8009438ce185bea2694a997fc1
+PKG_MAINTAINER:=Daniel Dickinson <lede@daniel.thecshore.com>
+
+PKG_BUILD_PARALLEL:=1
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/findutils/Default
+ TITLE:=GNU findutils
+ SECTION:=utils
+ CATEGORY:=Utilities
+endef
+
+define Package/findutils/description/Default
+Replace busybox versions of findutils with full GNU versions.
+This is normally not needed as busybox is smaller and provides
+sufficient functionality, but some users may want or need
+the full functionality of the GNU tools.
+endef
+
+define Package/findutils-find
+ $(call Package/findutils/Default)
+ TITLE+= (find)
+endef
+
+define Package/findutils-find/description
+$(call Package/findutils/description/Default)
+This package contains the find utility
+endef
+
+define Package/findutils-xargs
+ $(call Package/findutils/Default)
+ TITLE := (xargs)
+endef
+
+define Package/findutils-xargs/description
+$(call Package/findutils/description/Default)
+This package contains the xargs utility
+endef
+
+define Package/findutils-locate
+ $(call Package/findutils/Default)
+ TITLE := (locate)
+endef
+
+define Package/findutils-locate/description
+$(call Package/findutils/description/Default)
+This package contains the locate and related updatedb utility
+endef
+
+CONFIGURE_ARGS += --localstatedir=/srv/var
+CONFIGURE_VARS += ac_cv_path_SORT=sort
+
+define Package/findutils-find/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/find $(1)/usr/bin/
+endef
+
+define Package/findutils-xargs/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xargs $(1)/usr/bin/
+endef
+
+define Package/findutils-locate/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/srv/var
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/locate $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/updatedb $(1)/usr/bin/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib $(1)/usr/
+endef
+
+$(eval $(call BuildPackage,findutils-find))
+$(eval $(call BuildPackage,findutils-xargs))
+$(eval $(call BuildPackage,findutils-locate))
--- /dev/null
+#
+# 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:=flent-tools
+PKG_VERSION:=0.15.0
+PKG_LICENSE:=GPLv3
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_REV).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/tohojo/flent
+PKG_REV:=fd4c41cf4667fb5203e41e7eaa805ae54820218b
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=$(PKG_REV)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/flent-tools
+ SECTION:=util
+ CATEGORY:=Utilities
+ TITLE:=Helper programs for the Flent test tool
+ URL:=https://flent.org
+ MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+ DEPENDS+=+librt
+endef
+
+define Package/flent-tc_iterate/description
+ This builds the C helper programs for gathering data for
+ the Flent network testing tool. These tools are needed for
+ gathering data when a Bash shell is not available (and also
+ perform better than the shell equivalents).
+endef
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR)/misc \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS) -std=gnu99"
+endef
+
+define Package/flent-tools/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/tc_iterate $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/wifistats_iterate $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,flent-tools))
--- /dev/null
+#
+# Copyright (C) 2008-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fontconfig
+PKG_VERSION:=2.11.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://fontconfig.org/release/
+PKG_MD5SUM:=824d000eb737af6e16c826dd3b2d6c90
+
+PKG_FIXUP:=libtool
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fontconfig
+ SECTION:=xorg-util
+ CATEGORY:=Xorg
+ SUBMENU:=font-utils
+ TITLE:=fontconfig
+ DEPENDS:=+libpthread +libexpat +libfreetype
+ URL:=http://fontconfig.org/
+endef
+
+#TODO: better put cache on persistent storage for faster boot time?
+CONFIGURE_ARGS+= \
+ --with-cache-dir=/tmp/fontconfig/cache \
+ --with-arch=$(ARCH) \
+ --disable-iconv \
+ --disable-libxml2 \
+ --disable-docs
+
+CONFIGURE_VARS+= \
+ ac_cv_prog_HASDOCBOOK=no \
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/fontconfig $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfontconfig.* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/fontconfig.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/fontconfig/install
+ $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib $(1)/usr/share/fontconfig/conf.avail
+ $(INSTALL_DIR) $(1)/etc/fonts/conf.d
+ $(CP) $(PKG_INSTALL_DIR)/etc/fonts/fonts.conf $(1)/etc/fonts
+ $(CP) $(PKG_INSTALL_DIR)/etc/fonts/conf.d/* $(1)/etc/fonts/conf.d
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/share/fontconfig/conf.avail/* $(1)/usr/share/fontconfig/conf.avail
+ $(INSTALL_DIR) $(1)/etc/init.d
+# $(INSTALL_BIN) ./files/fontconfig.init $(1)/etc/init.d/fontconfig
+endef
+
+$(eval $(call BuildPackage,fontconfig))
include $(TOPDIR)/rules.mk
PKG_NAME:=gammu
-PKG_VERSION:=1.37.3
+PKG_VERSION:=1.37.4
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://dl.cihar.com/gammu/releases/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=bdb20d5e52f750dbe9aaf1cc8eed0822
+PKG_MD5SUM:=38e6f5a48fe05a64b0f0f1dc6787f1f2
PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
PKG_LICENCE:=GPL-2.0
--- /dev/null
+# Copyright (C) 2017 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v3+.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gkermit
+PKG_VERSION:=1.00
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+PKG_SOURCE:=gku100.tar.gz
+PKG_SOURCE_URL:=ftp://kermit.columbia.edu/kermit/archives
+PKG_MD5SUM:=aea4fa728b9981fce41c9f2c635f2e05
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gkermit
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=gkermit
+ URL:=http://www.columbia.edu/kermit/gkermit.html
+endef
+
+define Package/gkermit/description
+ A minimal kermit file transfer program
+endef
+
+define Build/Prepare
+ mkdir -p $(PKG_BUILD_DIR)
+ tar -C $(PKG_BUILD_DIR) -xzvf "$(DL_DIR)/$(PKG_SOURCE)"
+endef
+
+# nothing to do
+define Build/Configure
+endef
+
+define Build/Compile
+ mkdir -p $(PKG_INSTALL_DIR)
+ $(TARGET_CC) \
+ $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) \
+ -include string.h -include unistd.h \
+ -DPOSIX -DERRNO_H \
+ -o $(PKG_INSTALL_DIR)/gkermit \
+ $(PKG_BUILD_DIR)/{gproto,gkermit,gunixio,gcmdline}.c
+endef
+
+define Package/gkermit/install
+ $(INSTALL_DIR) $(1)/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/gkermit $(1)/bin
+endef
+
+$(eval $(call BuildPackage,gkermit))
define Package/gnupg/Default
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Encryption
DEPENDS:=+zlib +libncurses +libreadline
TITLE:=GNU privacy guard - a free PGP replacement
URL:=http://www.gnupg.org/
PKG_SOURCE_URL:=http://download-mirror.savannah.gnu.org/releases/gpsd/
PKG_MD5SUM:=afd79b87337fadf38ee2a7c4314dac79
-PKG_MAINTAINER:=Pushpal Sidhu <psidhu@gateworks.com>
+PKG_MAINTAINER:=Pushpal Sidhu <psidhu.devel@gmail.com>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
nostrip=yes \
python=no \
implicit_link=no \
- chrpath=no
+ chrpath=no \
+ target="$(TARGET_CROSS:-=)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
--- /dev/null
+#
+# Copyright (C) 2016 Daniel Engberg <daniel.engberg.lists@pyret.net>
+#
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=gptfdisk
+PKG_VERSION:=1.0.1
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/gptfdisk
+PKG_MD5SUM:=d7f3d306b083123bcc6f5941efade586
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/gptfdisk/default
+ SECTION:=utils
+ CATEGORY:=Utilities
+ SUBMENU:=Disc
+ URL:=http://www.rodsbooks.com/gdisk
+ MAINTAINER:=Daniel Engberg <daniel.engberg.lists@pyret.net>
+endef
+
+define Package/gdisk
+ $(call Package/gptfdisk/default)
+ TITLE:=GPT partition table manipulation utility
+ DEPENDS:=+libstdcpp +libuuid +libpopt
+endef
+
+define Package/gdisk/description
+ GPT partition table manipulation utility with an interface
+ similar to fdisk. It can read and convert MBR partitions in GPT
+ but is otherwise unable to generate or modify MBR partitions.
+endef
+
+define Package/sgdisk
+ $(call Package/gptfdisk/default)
+ TITLE:=script-friendly GPT partition table manipulation utility
+ DEPENDS:=+libstdcpp +libuuid +libpopt
+endef
+
+define Package/sgdisk/description
+ Script-friendly GPT partition table manipulation utility.
+ It can read and convert MBR partitions in GPT but is otherwise
+ unable to generate or modify MBR partitions.
+ To the contrary of gdisk, its interface is geared towards scripts,
+ so it takes command line arguments instead of being interactive.
+ It will NOT ask confirmation before carrying out the operations.
+ It has a slightly smaller footprint than gdisk tool.
+endef
+
+define Package/cgdisk
+ $(call Package/gptfdisk/default)
+ TITLE:=ncurses-based GPT partition table manipulation utility
+ DEPENDS:=+libstdcpp +libuuid +libncurses +libpopt
+endef
+
+define Package/cgdisk/description
+ncurses-based partition table manipulation utility with GPT support.
+Similar to sfdisk, but works with GPT partitions. Shares the same limitations
+of the gdisk partition utility. While it can read and convert MBR partitions
+in GPT, it cannot modify MBR partitions on its own.
+endef
+
+define Package/gdisk/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/gdisk $(1)/usr/sbin
+endef
+
+define Package/sgdisk/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/sgdisk $(1)/usr/sbin
+endef
+
+define Package/cgdisk/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/cgdisk $(1)/usr/sbin
+endef
+
+$(eval $(call BuildPackage,gdisk))
+$(eval $(call BuildPackage,sgdisk))
+$(eval $(call BuildPackage,cgdisk))
define Package/gzip
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Compression
TITLE:=gzip (GNU zip) is a compression utility.
URL:=https://www.gnu.org/software/gzip/
MAINTAINER:=Christian Beier <dontmind@freeshell.org>
include $(INCLUDE_DIR)/package.mk
-define Package/haveged/template
+define Package/haveged
SECTION:=utils
CATEGORY:=Utilities
+ DEPENDS:=+libhavege
TITLE:=Feeds the kernel entropy pool by timing CPU loops.
URL:=http://www.issihosts.com/haveged/
endef
-define Package/haveged
- $(call Package/haveged/template)
- DEPENDS:=+libhavege
-endef
-
define Package/libhavege
- $(call Package/haveged/template)
+ CATEGORY:=Libraries
TITLE:=Library for haveged
+ URL:=http://www.issihosts.com/haveged/
endef
CONFIGURE_ARGS+= \
PKG_NAME:=hd-idle
PKG_VERSION:=1.04
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
PKG_LICENSE:=GPL-2.0
SECTION:=utils
CATEGORY:=Utilities
TITLE:=Another idle-daemon for attached hard drives
- SUBMENU:=disc
+ SUBMENU:=Disc
URL:=http://hd-idle.sourceforge.net/
endef
# Copyright (C) 2008-2011 OpenWrt.org
START=50
+STOP=10
-append_bool() {
- local section="$1"
- local option="$2"
- local value="$3"
- local _val
- config_get_bool _val "$section" "$option" '0'
- [ "$_val" -gt 0 ] && append args "$3"
-}
+USE_PROCD=1
-append_string() {
- local section="$1"
- local option="$2"
- local value="$3"
- local _val
- config_get _val "$section" "$option"
- [ -n "$_val" ] && append args "$3 $_val"
+validate_section_hdidle()
+{
+ uci_validate_section hd-idle hd-idle "${1}" \
+ 'disk:string' \
+ 'enabled:bool' \
+ 'idle_time_interval:uinteger:10' \
+ 'idle_time_unit:string:minutes'
}
compute_seconds() {
local interval="$1"
local unit="$2"
- if [ -z "$interval" ]
- then
- interval=10
- fi
-
- if [ -z "$unit" ]
- then
- unit="minutes"
- fi
-
# compute interval in seconds
case "$unit" in
"days" )
echo $interval_seconds
}
-start_service() {
- local section="$1"
- args=""
- config_get "interval" "$section" "idle_time_interval"
- config_get "unit" "$section" "idle_time_unit"
- append_string "$section" "disk" "-a"
- config_get_bool "enabled" "$section" "enabled" '1'
- [ "$enabled" -gt 0 ] || return 1
- service_start /usr/bin/hd-idle $args -i "$(compute_seconds $interval $unit)"
+hdidle_append() {
+ local disk enabled idle_time_interval idle_time_unit
+
+ validate_section_hdidle "${1}" || return
+
+ [ "$enabled" -gt 0 ] || return
+
+ if [ "$numdisks" = "0" ]; then
+ procd_open_instance
+ procd_set_param command /usr/bin/hd-idle
+ procd_append_param command -d -i 0
+ fi
+ procd_append_param command -a $disk
+ procd_append_param command -i "$(compute_seconds $idle_time_interval $idle_time_unit)"
+ numdisks=$(( numdisks + 1 ))
}
-start() {
+start_service() {
config_load "hd-idle"
- config_foreach start_service "hd-idle"
-}
-stop() {
- service_stop /usr/bin/hd-idle
+ numdisks="0"
+ config_foreach hdidle_append "hd-idle"
+
+ if [ "$numdisks" -gt 0 ]; then
+ procd_set_param respawn
+ procd_close_instance
+ fi
}
define Package/hdparm
SECTION:=utils
CATEGORY:=Utilities
- SUBMENU:=disc
+ SUBMENU:=Disc
TITLE:=Hard disk drive configuration utilitity
URL:=http://sourceforge.net/projects/hdparm/
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=joe
-PKG_VERSION:=4.2
+PKG_VERSION:=4.3
PKG_RELEASE:=1
PKG_SOURCE_URL:=@SF/joe-editor
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=0a70057cc4493320f9838822451857ef
+PKG_MD5SUM:=5a167f5e88e62c77bb42b0145d72c466
PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Vitaly Protsko <villy@sft.ru>
PKG_LICENCE:=GPL-2.0
mode,"language",rtn V Language
mode,"picture",rtn P picture %Zpicture%
mode,"type",rtn F File type [%Ztype%]
+mode,"title",rtn C Context %Ztitle%
menu,"more-options",rtn % % More options...
:defmenu more-options menu,"root",rtn
defm3down M3DOWN
defm3up M3UP
defm3drag M3DRAG
+defmiddleup MIDDLEUP
+defmiddledown MIDDLEDOWN
xtmouse ^[ [ M
extmouse ^[ [ <
include $(TOPDIR)/rules.mk
PKG_NAME:=klish
-PKG_VERSION:=2.1.1
+PKG_VERSION:=2.1.3
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=http://libcode.org/attachments/download/61/
+PKG_SOURCE_URL:=http://libcode.org/attachments/download/66/
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENCE
PKG_MAINTAINER:=Takashi Umeno <umeno.takashi@gmail.com>
-PKG_MD5SUM:=4913259794d85585de0f8791c54ac633
+PKG_MD5SUM:=7dfe46d474c02c86946c1d7a461ae549
PKG_INSTALL:=1
define Package/klish/default
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Shells
TITLE:=Kommand Line Interface SHell ($(1))
URL:=http://libcode.org/projects/klish/
endef
--- /dev/null
+#
+# Copyright (C) 2006-2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=logrotate
+PKG_VERSION:=3.10.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:= https://github.com/logrotate/logrotate/releases/download/$(PKG_VERSION)
+PKG_MD5SUM:=888f58caf07082c76f5dd39e5d30ec12
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/logrotate
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+libpopt
+ TITLE:=rotates, compresses, and mails system logs
+ URL:=https://github.com/logrotate/logrotate
+ MAINTAINER:=Christian Beier <cb@shoutrlabs.com>
+endef
+
+define Package/logrotate/description
+ logrotate is designed to ease administration of systems that generate large
+ numbers of log files. It allows auto-matic rotation, compression, removal and
+ mailing of log files. Each log file may be handled daily, weekly, monthly or
+ when it grows too large.
+endef
+
+define Package/logrotate/conffiles
+/etc/logrotate.conf
+endef
+
+CONFIGURE_ARGS += --with-acl=no
+
+EXTRA_CFLAGS += $(TARGET_CPPFLAGS) -Wno-nonnull-compare
+EXTRA_LDFLAGS += $(TARGET_LDFLAGS)
+
+define Build/Compile
+ $(call Build/Compile/Default, \
+ RPM_OPT_FLAGS:="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
+ LDFLAGS="$(EXTRA_LDFLAGS)" \
+ logrotate \
+ )
+endef
+
+define Package/logrotate/install
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) ${PKG_BUILD_DIR}/logrotate $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) ./files/logrotate.conf $(1)/etc/
+ $(INSTALL_DIR) $(1)/etc/logrotate.d
+endef
+
+$(eval $(call BuildPackage,logrotate))
--- /dev/null
+# rotate log files weekly
+weekly
+#daily
+
+# keep 4 weeks worth of backlogs
+rotate 4
+
+# create new (empty) log files after rotating old ones
+create
+
+notifempty
+nomail
+#olddir /var/log/backup/
+missingok
+#dateext
+
+# uncomment this if you want your log files compressed
+#compress
+
+# packages can drop log rotation information into this directory
+include /etc/logrotate.d
+
+# no packages own lastlog or wtmp -- we'll rotate them here
+#/var/log/wtmp {
+# monthly
+# create 0664 root utmp
+# rotate 1
+#}
+
+# system-specific logs may be also be configured here.
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-lxc
-PKG_RELEASE:=20160616
+PKG_RELEASE:=20161030
PKG_LICENSE:=Apache-2.0
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LXC management Web UI
- DEPENDS:=+luci-mod-admin-full +lxc +lxc-create +liblxc +rpcd-mod-lxc
+ DEPENDS:=+luci-mod-admin-full +lxc +lxc-create +liblxc +rpcd-mod-lxc +getopt +xz
MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr>
endef
{
var option = document.createElement('option');
option.value = data[key];
- option.text = data[key].replace(/[_:]/, ' ');
+ option.text = data[key].replace(/[_:]/g, ' ');
select.add(option, -1);
}
})
include $(TOPDIR)/rules.mk
PKG_NAME:=LVM2
-PKG_VERSION:=2.02.161
+PKG_VERSION:=2.02.165
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0 LGPL-2.1
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2/releases
-PKG_MD5SUM:=3cd2620a3c7f7f84171bb028130b9816e885ab244a2e2aadff22bc1493c91c19
+PKG_MD5SUM:=d459cfe50fd549fe41eeed4ef8fbca3f9833f68012f735adb3462483360e07c7
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
CATEGORY:=Libraries
TITLE:=The Linux Kernel Device Mapper userspace library
URL:=http://sourceware.org/dm/
- DEPENDS:=+kmod-dm +libpthread +libuuid
+ DEPENDS:=+kmod-dm +libpthread +libuuid +librt
endef
define Package/libdevmapper/description
define Package/lvm2
SECTION:=utils
CATEGORY:=Utilities
- SUBMENU:=disc
+ SUBMENU:=Disc
TITLE:=The Linux Logical Volume Manager
URL:=http://sourceware.org/lvm2/
DEPENDS:=+libdevmapper +libblkid +libreadline +libncurses
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
-@@ -1785,8 +1785,10 @@ struct cmd_context *create_toolcontext(u
- unsigned set_filters)
- {
- struct cmd_context *cmd;
-+#if defined(__GLIBC__) && !defined(VALGRIND_POOL)
- FILE *new_stream;
- int flags;
-+#endif
-
- #ifdef M_MMAP_MAX
- mallopt(M_MMAP_MAX, 0);
-@@ -1822,7 +1824,7 @@ struct cmd_context *create_toolcontext(u
+@@ -1843,7 +1843,7 @@ struct cmd_context *create_toolcontext(u
/* FIXME Make this configurable? */
reset_lvm_errno(1);
/* Set in/out stream buffering before glibc */
if (set_buffering) {
/* Allocate 2 buffers */
-@@ -2205,7 +2207,7 @@ void destroy_toolcontext(struct cmd_cont
+@@ -2224,7 +2224,7 @@ void destroy_toolcontext(struct cmd_cont
if (cmd->libmem)
dm_pool_destroy(cmd->libmem);
if (is_valid_fd(STDIN_FILENO) &&
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
-@@ -1782,6 +1782,7 @@ int lvm_split(char *str, int *argc, char
+@@ -1815,6 +1815,7 @@ int lvm_split(char *str, int *argc, char
/* Make sure we have always valid filedescriptors 0,1,2 */
static int _check_standard_fds(void)
{
int err = is_valid_fd(STDERR_FILENO);
if (!is_valid_fd(STDIN_FILENO) &&
-@@ -1808,6 +1809,12 @@ static int _check_standard_fds(void)
+@@ -1841,6 +1842,12 @@ static int _check_standard_fds(void)
strerror(errno));
return 0;
}
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
-@@ -169,12 +169,15 @@ static void _allocate_memory(void)
+@@ -174,12 +174,15 @@ static void _allocate_memory(void)
* memory on free(), this is good enough for our purposes.
*/
while (missing > 0) {
inf = mallinfo();
if (hblks < inf.hblks) {
-@@ -184,9 +187,12 @@ static void _allocate_memory(void)
+@@ -189,9 +192,12 @@ static void _allocate_memory(void)
free(areas[area]);
_size_malloc_tmp /= 2;
} else {
if (area == max_areas && missing > 0) {
/* Too bad. Warn the user and proceed, as things are
-@@ -475,8 +481,13 @@ static void _lock_mem(struct cmd_context
+@@ -480,8 +486,13 @@ static void _lock_mem(struct cmd_context
* will not block memory locked thread
* Note: assuming _memlock_count_daemon is updated before _memlock_count
*/
lib/device/dev-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
-index a9a2374..4d71967 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
-@@ -529,7 +529,7 @@ int dev_open_flags(struct device *dev, int flags, int direct, int quiet)
+@@ -529,7 +529,7 @@ int dev_open_flags(struct device *dev, i
return 0;
}
opened:
if (direct)
dev->flags |= DEV_O_DIRECT_TESTED;
---
-2.8.2
-
include $(TOPDIR)/rules.mk
PKG_NAME:=mc
-PKG_VERSION:=4.8.17
-PKG_RELEASE:=3
+PKG_VERSION:=4.8.18
+PKG_RELEASE:=1
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
PKG_LICENSE:=GPL-3.0+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://ftp.midnight-commander.org/
-PKG_MD5SUM:=0447bdddc0baa81866e66f50f9a545d29d6eebb68b0ab46c98d8fddd2bf4e44d
+PKG_MD5SUM:=f7636815c987c1719c4f5de2dcd156a0e7d097b1d10e4466d2bdead343d5bece
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf gettext-version
CATEGORY:=Utilities
DEPENDS:=+glib2 +libncurses +libmount +MC_VFS:libssh2 $(LIBRPC_DEPENDS) $(ICONV_DEPENDS)
TITLE:=Midnight Commander - a powerful visual file manager
- URL:=http://www.midnight-commander.org/
+ URL:=https://www.midnight-commander.org/
MENU:=1
endef
CONFIGURE_ARGS += \
--disable-doxygen-doc \
--with-homedir=/etc/mc \
- --with-included-gettext \
--with-screen=ncurses \
--without-gpm-mouse \
--without-x \
$(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.charsets $(1)/etc/mc
$(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.default.keymap $(1)/etc/mc
$(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.ext $(1)/etc/mc
+ $(INSTALL_DIR) $(1)/usr/share/mc/help
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/hlp/mc.hlp $(1)/usr/share/mc/help
ifeq ($(CONFIG_MC_DIFFVIEWER),y)
ln -sf mc $(1)/usr/bin/mcdiff
endif
include $(TOPDIR)/rules.mk
PKG_NAME:=mmc-utils
-PKG_VERSION=2016-06-28-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=1
+PKG_VERSION=2016-09-11-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git
-PKG_SOURCE_VERSION:=a3d3331e6854a4607133bed152988d51250107ca
+PKG_SOURCE_VERSION:=2cb6695e8dec00d887bdd5309d1b57d836fcd214
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
--- /dev/null
+Sent already upstream, no response yet.
+
+--- a/mmc.h 2016-09-11 18:01:53.000000000 +0200
++++ b/mmc.h 2016-09-23 23:41:02.462632858 +0200
+@@ -17,7 +17,6 @@
+ * those modifications are Copyright (c) 2016 SanDisk Corp.
+ */
+
+-#include <asm-generic/int-ll64.h>
+ #include <linux/mmc/ioctl.h>
+ #include <stdio.h>
+
include $(TOPDIR)/rules.mk
PKG_NAME:=nano
-PKG_VERSION:=2.6.0
+PKG_VERSION:=2.7.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE_FILES:=COPYING
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://www.nano-editor.org/dist/v2.6/
-PKG_MD5SUM:=89051965a1de963190696348bc291b86
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=@GNU/nano
+PKG_MD5SUM:=f86af39514ae74e20bef3c29cd01d1090a9aca772a70e9c9f9e70c3d14b39521
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=ncdu
-PKG_VERSION:=1.11
+PKG_VERSION:=1.12
PKG_RELEASE=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://dev.yorhel.nl/download
-PKG_MD5SUM:=9e44240a5356b029f05f0e70a63c4d12
+PKG_SOURCE_URL:=https://dev.yorhel.nl/download
+PKG_MD5SUM:=7365ac46c420bc511621216b1747984f
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
DEPENDS:=+libncurses
TITLE:=ncurses disk usage viewer
MAINTAINER:=Charles Lehner <celehner1@gmail.com>
- URL:=http://dev.yorhel.nl/ncdu
+ URL:=https://dev.yorhel.nl/ncdu
endef
define Package/ncdu/description
+++ /dev/null
---- a/src/shell.c
-+++ b/src/shell.c
-@@ -33,6 +33,7 @@
- #include <stdlib.h>
- #include <unistd.h>
-+#include <sys/wait.h>
-
- void shell_draw() {
- char *full_path;
- int res;
#
-# Copyright (C) 2007-2015 OpenWrt.org
+# Copyright (C) 2007-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_NAME:=ntfs-3g
PKG_RELEASE:=1
-PKG_VERSION:=2015.3.14
+PKG_VERSION:=2016.2.22
PKG_SOURCE:=$(PKG_NAME)_ntfsprogs-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=http://www.tuxera.com/opensource/
-PKG_MD5SUM:=8cd57768310e3b2be39b3191d808e241
+PKG_MD5SUM:=ccbe8672d0f757bd0c975b50aa4c512e
PKG_LICENSE:=GPL-2.0 LGPL-2.0
PKG_LICENSE_FILES:=COPYING COPYING.LIB
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libntfs-3g.so.* $(1)/usr/lib/
$(INSTALL_DIR) $(1)/sbin
$(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/
+ $(CP) $(PKG_INSTALL_DIR)/sbin/mount.ntfs-3g $(1)/sbin/mount.ntfs
endef
define Package/ntfs-3g/postinst
include $(TOPDIR)/rules.mk
PKG_NAME:=opensc
-PKG_VERSION:=20150513
+PKG_VERSION:=0.16.0
PKG_RELEASE:=1
+PKG_MD5SUM:=3ac8c29542bb48179e7086d35a1b8907a4e86aca3de3323c2f48bd74eaaf5729
+
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
-
-PKG_RELEASE=$(PKG_SOURCE_VERSION)
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC.git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=a09ca246a797230c14bc33a34f2dddc4a4dbff40
+PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC/releases/download/$(PKG_VERSION)/
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+
PKG_BUILD_DEPENDS:=+libpcsclite
PKG_FIXUP:=libtool
CATEGORY:=Libraries
TITLE:=OpenSC libraries for smart cards
URL:=https://github.com/OpenSC/OpenSC/wiki
- DEPENDS:=+libopenssl +libpthread
+ DEPENDS:=+libopenssl +libpthread +zlib
MENU:=1
endef
+++ /dev/null
-From 471b40173b73f213ee72bf05735abf3357658197 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Wed, 20 Feb 2013 11:54:30 +0700
-Subject: [PATCH 01/26] OpenPGP: Detect and support Gnuk Token.
-
-http://www.fsij.org/gnuk/
----
- src/libopensc/card-openpgp.c | 61 ++++++++++++++++++++++++++++++++++----------
- src/libopensc/cards.h | 1 +
- src/tools/openpgp-tool.c | 7 ++++-
- 3 files changed, 55 insertions(+), 14 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -45,6 +45,7 @@
- static struct sc_atr_table pgp_atrs[] = {
- { "3b:fa:13:00:ff:81:31:80:45:00:31:c1:73:c0:01:00:00:90:00:b1", NULL, "OpenPGP card v1.0/1.1", SC_CARD_TYPE_OPENPGP_V1, 0, NULL },
- { "3b:da:18:ff:81:b1:fe:75:1f:03:00:31:c5:73:c0:01:40:00:90:00:0c", NULL, "CryptoStick v1.2 (OpenPGP v2.0)", SC_CARD_TYPE_OPENPGP_V2, 0, NULL },
-+ { "3b:da:11:ff:81:b1:fe:55:1f:03:00:31:84:73:80:01:80:00:90:00:e4", NULL, "Gnuk v1.0.x (OpenPGP v2.0)", SC_CARD_TYPE_OPENPGP_GNUK, 0, NULL },
- { NULL, NULL, NULL, 0, 0, NULL }
- };
-
-@@ -309,6 +310,8 @@ pgp_init(sc_card_t *card)
- int r;
- struct blob *child = NULL;
-
-+ LOG_FUNC_CALLED(card->ctx);
-+
- priv = calloc (1, sizeof *priv);
- if (!priv)
- return SC_ERROR_OUT_OF_MEMORY;
-@@ -317,11 +320,11 @@ pgp_init(sc_card_t *card)
- card->cla = 0x00;
-
- /* set pointer to correct list of card objects */
-- priv->pgp_objects = (card->type == SC_CARD_TYPE_OPENPGP_V2)
-+ priv->pgp_objects = (card->type == SC_CARD_TYPE_OPENPGP_V2 || card->type == SC_CARD_TYPE_OPENPGP_GNUK)
- ? pgp2_objects : pgp1_objects;
-
- /* set detailed card version */
-- priv->bcd_version = (card->type == SC_CARD_TYPE_OPENPGP_V2)
-+ priv->bcd_version = (card->type == SC_CARD_TYPE_OPENPGP_V2 || card->type == SC_CARD_TYPE_OPENPGP_GNUK)
- ? OPENPGP_CARD_2_0 : OPENPGP_CARD_1_1;
-
- /* select application "OpenPGP" */
-@@ -436,7 +439,8 @@ pgp_get_card_features(sc_card_t *card)
- if ((pgp_get_blob(card, blob73, 0x00c0, &blob) >= 0) &&
- (blob->data != NULL) && (blob->len > 0)) {
- /* in v2.0 bit 0x04 in first byte means "algorithm attributes changeable */
-- if ((blob->data[0] & 0x04) && (card->type == SC_CARD_TYPE_OPENPGP_V2))
-+ if ((blob->data[0] & 0x04) &&
-+ (card->type == SC_CARD_TYPE_OPENPGP_V2 || card->type == SC_CARD_TYPE_OPENPGP_GNUK))
- priv->ext_caps |= EXT_CAP_ALG_ATTR_CHANGEABLE;
- /* bit 0x08 in first byte means "support for private use DOs" */
- if (blob->data[0] & 0x08)
-@@ -453,7 +457,8 @@ pgp_get_card_features(sc_card_t *card)
- priv->ext_caps |= EXT_CAP_GET_CHALLENGE;
- }
- /* in v2.0 bit 0x80 in first byte means "support Secure Messaging" */
-- if ((blob->data[0] & 0x80) && (card->type == SC_CARD_TYPE_OPENPGP_V2))
-+ if ((blob->data[0] & 0x80) &&
-+ (card->type == SC_CARD_TYPE_OPENPGP_V2 || card->type == SC_CARD_TYPE_OPENPGP_GNUK))
- priv->ext_caps |= EXT_CAP_SM;
-
- if ((priv->bcd_version >= OPENPGP_CARD_2_0) && (blob->len >= 10)) {
-@@ -1065,12 +1070,18 @@ static int
- pgp_get_pubkey(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
- {
- sc_apdu_t apdu;
-+ u8 apdu_case = SC_APDU_CASE_4;
- u8 idbuf[2];
- int r;
-
- sc_log(card->ctx, "called, tag=%04x\n", tag);
-
-- sc_format_apdu(card, &apdu, SC_APDU_CASE_4, 0x47, 0x81, 0);
-+ /* With Gnuk token, force to use short APDU */
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK) {
-+ apdu_case = SC_APDU_CASE_4_SHORT;
-+ }
-+
-+ sc_format_apdu(card, &apdu, apdu_case, 0x47, 0x81, 0);
- apdu.lc = 2;
- apdu.data = ushort2bebytes(idbuf, tag);
- apdu.datalen = 2;
-@@ -1162,6 +1173,7 @@ pgp_put_data(sc_card_t *card, unsigned i
- u8 ins = 0xDA;
- u8 p1 = tag >> 8;
- u8 p2 = tag & 0xFF;
-+ u8 apdu_case = SC_APDU_CASE_3;
- int r;
-
- LOG_FUNC_CALLED(card->ctx);
-@@ -1203,13 +1215,17 @@ pgp_put_data(sc_card_t *card, unsigned i
-
- /* Build APDU */
- if (buf != NULL && buf_len > 0) {
-- sc_format_apdu(card, &apdu, SC_APDU_CASE_3, ins, p1, p2);
-+ /* Force short APDU for Gnuk */
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK) {
-+ apdu_case = SC_APDU_CASE_3_SHORT;
-+ }
-+ sc_format_apdu(card, &apdu, apdu_case, ins, p1, p2);
-
- /* if card/reader does not support extended APDUs, but chaining, then set it */
- if (((card->caps & SC_CARD_CAP_APDU_EXT) == 0) && (priv->ext_caps & EXT_CAP_CHAINING))
- apdu.flags |= SC_APDU_FLAGS_CHAINING;
-
-- apdu.data = buf;
-+ apdu.data = (u8 *)buf;
- apdu.datalen = buf_len;
- apdu.lc = buf_len;
- }
-@@ -1336,6 +1352,7 @@ pgp_compute_signature(sc_card_t *card, c
- struct pgp_priv_data *priv = DRVDATA(card);
- sc_security_env_t *env = &priv->sec_env;
- sc_apdu_t apdu;
-+ u8 apdu_case = SC_APDU_CASE_4;
- int r;
-
- LOG_FUNC_CALLED(card->ctx);
-@@ -1344,14 +1361,19 @@ pgp_compute_signature(sc_card_t *card, c
- LOG_TEST_RET(card->ctx, SC_ERROR_INVALID_ARGUMENTS,
- "invalid operation");
-
-+ /* Force short APDU for Gnuk Token */
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK) {
-+ apdu_case = SC_APDU_CASE_4_SHORT;
-+ }
-+
- switch (env->key_ref[0]) {
- case 0x00: /* signature key */
- /* PSO SIGNATURE */
-- sc_format_apdu(card, &apdu, SC_APDU_CASE_4, 0x2A, 0x9E, 0x9A);
-+ sc_format_apdu(card, &apdu, apdu_case, 0x2A, 0x9E, 0x9A);
- break;
- case 0x02: /* authentication key */
- /* INTERNAL AUTHENTICATE */
-- sc_format_apdu(card, &apdu, SC_APDU_CASE_4, 0x88, 0, 0);
-+ sc_format_apdu(card, &apdu, apdu_case, 0x88, 0, 0);
- break;
- case 0x01:
- default:
-@@ -1360,7 +1382,7 @@ pgp_compute_signature(sc_card_t *card, c
- }
-
- apdu.lc = data_len;
-- apdu.data = data;
-+ apdu.data = (u8 *)data;
- apdu.datalen = data_len;
- apdu.le = ((outlen >= 256) && !(card->caps & SC_CARD_CAP_APDU_EXT)) ? 256 : outlen;
- apdu.resp = out;
-@@ -1384,6 +1406,7 @@ pgp_decipher(sc_card_t *card, const u8 *
- struct pgp_priv_data *priv = DRVDATA(card);
- sc_security_env_t *env = &priv->sec_env;
- sc_apdu_t apdu;
-+ u8 apdu_case = SC_APDU_CASE_4;
- u8 *temp = NULL;
- int r;
-
-@@ -1408,7 +1431,7 @@ pgp_decipher(sc_card_t *card, const u8 *
- case 0x01: /* Decryption key */
- case 0x02: /* authentication key */
- /* PSO DECIPHER */
-- sc_format_apdu(card, &apdu, SC_APDU_CASE_4, 0x2A, 0x80, 0x86);
-+ sc_format_apdu(card, &apdu, apdu_case, 0x2A, 0x80, 0x86);
- break;
- case 0x00: /* signature key */
- default:
-@@ -1417,8 +1440,13 @@ pgp_decipher(sc_card_t *card, const u8 *
- "invalid key reference");
- }
-
-+ /* Gnuk only supports short APDU, so we need to use command chaining */
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK) {
-+ apdu.flags |= SC_APDU_FLAGS_CHAINING;
-+ }
-+
- apdu.lc = inlen;
-- apdu.data = in;
-+ apdu.data = (u8 *)in;
- apdu.datalen = inlen;
- apdu.le = ((outlen >= 256) && !(card->caps & SC_CARD_CAP_APDU_EXT)) ? 256 : outlen;
- apdu.resp = out;
-@@ -1802,6 +1830,11 @@ static int pgp_gen_key(sc_card_t *card,
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
- }
-
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && key_info->modulus_len != 2048) {
-+ sc_log(card->ctx, "Gnuk does not support other key length than 2048.");
-+ LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
-+ }
-+
- /* Set attributes for new-generated key */
- r = pgp_update_new_algo_attr(card, key_info);
- LOG_TEST_RET(card->ctx, r, "Cannot set attributes for new-generated key");
-@@ -1809,7 +1842,9 @@ static int pgp_gen_key(sc_card_t *card,
- /* Test whether we will need extended APDU. 1900 is an
- * arbitrary modulus length which for sure fits into a short APDU.
- * This idea is borrowed from GnuPG code. */
-- if (card->caps & SC_CARD_CAP_APDU_EXT && key_info->modulus_len > 1900) {
-+ if (card->caps & SC_CARD_CAP_APDU_EXT
-+ && key_info->modulus_len > 1900
-+ && card->type != SC_CARD_TYPE_OPENPGP_GNUK) {
- /* We won't store to apdu variable yet, because it will be reset in
- * sc_format_apdu() */
- apdu_le = card->max_recv_size;
-Index: opensc-20150513/src/libopensc/cards.h
-===================================================================
---- opensc-20150513.orig/src/libopensc/cards.h
-+++ opensc-20150513/src/libopensc/cards.h
-@@ -105,6 +105,7 @@ enum {
- SC_CARD_TYPE_OPENPGP_BASE = 9000,
- SC_CARD_TYPE_OPENPGP_V1,
- SC_CARD_TYPE_OPENPGP_V2,
-+ SC_CARD_TYPE_OPENPGP_GNUK,
-
- /* jcop driver */
- SC_CARD_TYPE_JCOP_BASE = 10000,
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -33,6 +33,7 @@
- #include "libopensc/cards.h"
- #include "libopensc/cardctl.h"
- #include "libopensc/errors.h"
-+#include "libopensc/log.h"
- #include "util.h"
- #include "libopensc/log.h"
-
-@@ -396,6 +397,8 @@ int do_genkey(sc_card_t *card, u8 key_id
- sc_path_t path;
- sc_file_t *file;
-
-+ LOG_FUNC_CALLED(card->ctx);
-+
- if (key_id < 1 || key_id > 3) {
- printf("Unknown key ID %d.\n", key_id);
- return 1;
-@@ -487,8 +490,10 @@ int main(int argc, char **argv)
-
- /* check card type */
- if ((card->type != SC_CARD_TYPE_OPENPGP_V1) &&
-- (card->type != SC_CARD_TYPE_OPENPGP_V2)) {
-+ (card->type != SC_CARD_TYPE_OPENPGP_V2) &&
-+ (card->type != SC_CARD_TYPE_OPENPGP_GNUK)) {
- util_error("not an OpenPGP card");
-+ sc_log(card->ctx, "Card type %X", card->type);
- exit_status = EXIT_FAILURE;
- goto out;
- }
+++ /dev/null
-From 00a2c08c9125103ee0bff9af9e7ff42c5cdc14fe Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Fri, 12 Apr 2013 17:24:00 +0700
-Subject: [PATCH 02/26] OpenPGP: Add Gnuk in pkcs15 emulation layer.
-
----
- src/libopensc/pkcs15-openpgp.c | 6 ++++--
- src/libopensc/pkcs15-syn.c | 1 +
- 2 files changed, 5 insertions(+), 2 deletions(-)
-
-Index: opensc-20150513/src/libopensc/pkcs15-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/pkcs15-openpgp.c
-+++ opensc-20150513/src/libopensc/pkcs15-openpgp.c
-@@ -153,7 +153,8 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card
- u8 c4data[10];
- u8 c5data[70];
- int r, i;
-- const pgp_pin_cfg_t *pin_cfg = (card->type == SC_CARD_TYPE_OPENPGP_V2) ? pin_cfg_v2 : pin_cfg_v1;
-+ const pgp_pin_cfg_t *pin_cfg = (card->type == SC_CARD_TYPE_OPENPGP_V2 || card->type == SC_CARD_TYPE_OPENPGP_GNUK)
-+ ? pin_cfg_v2 : pin_cfg_v1;
- sc_path_t path;
- sc_file_t *file;
-
-@@ -365,7 +366,8 @@ failed: sc_debug(card->ctx, SC_LOG_DEBUG
-
- static int openpgp_detect_card(sc_pkcs15_card_t *p15card)
- {
-- if (p15card->card->type == SC_CARD_TYPE_OPENPGP_V1 || p15card->card->type == SC_CARD_TYPE_OPENPGP_V2)
-+ if (p15card->card->type == SC_CARD_TYPE_OPENPGP_V1 || p15card->card->type == SC_CARD_TYPE_OPENPGP_V2
-+ || p15card->card->type == SC_CARD_TYPE_OPENPGP_GNUK)
- return SC_SUCCESS;
- else
- return SC_ERROR_WRONG_CARD;
-Index: opensc-20150513/src/libopensc/pkcs15-syn.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/pkcs15-syn.c
-+++ opensc-20150513/src/libopensc/pkcs15-syn.c
-@@ -117,6 +117,7 @@ int sc_pkcs15_is_emulation_only(sc_card_
- case SC_CARD_TYPE_GEMSAFEV1_PTEID:
- case SC_CARD_TYPE_OPENPGP_V1:
- case SC_CARD_TYPE_OPENPGP_V2:
-+ case SC_CARD_TYPE_OPENPGP_GNUK:
- case SC_CARD_TYPE_SC_HSM:
- case SC_CARD_TYPE_DNIE_BASE:
- case SC_CARD_TYPE_DNIE_BLANK:
+++ /dev/null
-From 2d348b60ab8c22791b56f291600954abd716a791 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Fri, 22 Mar 2013 17:37:16 +0700
-Subject: [PATCH 03/26] OpenPGP: Include private DO to filesystem at driver
- initialization.
-
-In old implementation, the DOs which their access is restricted by
-PIN (like DOs 0101 -> 0104) were excluded from the fake filesystem,
-leading to that we cannot read their data later, even if we verified PIN.
----
- src/libopensc/card-openpgp.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -365,7 +365,7 @@ pgp_init(sc_card_t *card)
-
- /* Populate MF - add matching blobs listed in the pgp_objects table. */
- for (info = priv->pgp_objects; (info != NULL) && (info->id > 0); info++) {
-- if (((info->access & READ_MASK) == READ_ALWAYS) &&
-+ if (((info->access & READ_MASK) != READ_NEVER) &&
- (info->get_fn != NULL)) {
- child = pgp_new_blob(card, priv->mf, info->id, sc_file_new());
-
+++ /dev/null
-From fda9b6dd088e734de372fc85c091f88e8607bc2e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Tue, 26 Feb 2013 17:37:16 +0700
-Subject: [PATCH 04/26] PKCS15-OpenPGP: Declare DATA objects.
-
-Begin to support read/write DATA object for PKCS-OpenPGP binding.
-This object is used by TrueCrypt.
----
- src/libopensc/pkcs15-openpgp.c | 35 +++++++++++++++++++++++++++++++++++
- 1 file changed, 35 insertions(+)
-
-Index: opensc-20150513/src/libopensc/pkcs15-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/pkcs15-openpgp.c
-+++ opensc-20150513/src/libopensc/pkcs15-openpgp.c
-@@ -34,6 +34,7 @@
- #include "log.h"
-
- int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
-+static int sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *);
-
-
- #define PGP_USER_PIN_FLAGS (SC_PKCS15_PIN_FLAG_CASE_SENSITIVE \
-@@ -43,6 +44,8 @@ int sc_pkcs15emu_openpgp_init_ex(sc_pkcs
- | SC_PKCS15_PIN_FLAG_UNBLOCK_DISABLED \
- | SC_PKCS15_PIN_FLAG_SO_PIN)
-
-+#define PGP_NUM_PRIVDO 4
-+
- typedef struct _pgp_pin_cfg {
- const char *label;
- int reference;
-@@ -357,6 +360,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card
- goto failed;
- }
-
-+ /* PKCS#15 DATA object from OpenPGP private DOs */
-+ r = sc_pkcs15emu_openpgp_add_data(p15card);
-+
- return 0;
-
- failed: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP emulation: %s\n",
-@@ -364,6 +370,35 @@ failed: sc_debug(card->ctx, SC_LOG_DEBUG
- return r;
- }
-
-+static int
-+sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
-+{
-+ sc_context_t *ctx = p15card->card->ctx;
-+ int i, r;
-+
-+ LOG_FUNC_CALLED(ctx);
-+ /* There is 4 private DO from 0101 to 0104 */
-+ for (i = 1; i <= PGP_NUM_PRIVDO; i++) {
-+ sc_pkcs15_data_info_t dat_info;
-+ sc_pkcs15_object_t dat_obj;
-+ char name[8];
-+ char path[9];
-+ memset(&dat_info, 0, sizeof(dat_info));
-+ memset(&dat_obj, 0, sizeof(dat_obj));
-+
-+ sprintf(name, "PrivDO%d", i);
-+ sprintf(path, "3F00010%d", i);
-+
-+ sc_format_path(path, &dat_info.path);
-+ strlcpy(dat_obj.label, name, sizeof(dat_obj.label));
-+ strlcpy(dat_info.app_label, name, sizeof(dat_info.app_label));
-+
-+ sc_log(ctx, "Add %s data object", name);
-+ r = sc_pkcs15emu_add_data_object(p15card, &dat_obj, &dat_info);
-+ }
-+ LOG_FUNC_RETURN(ctx, r);
-+}
-+
- static int openpgp_detect_card(sc_pkcs15_card_t *p15card)
- {
- if (p15card->card->type == SC_CARD_TYPE_OPENPGP_V1 || p15card->card->type == SC_CARD_TYPE_OPENPGP_V2
+++ /dev/null
-From 6d138f0199575516bfaad18cbbafcfa2ee61e58f Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Mon, 4 Mar 2013 11:28:08 +0700
-Subject: [PATCH 05/26] OpenPGP: Support erasing (reset) card.
-
-Command: openpgp-tool --erase
----
- src/libopensc/card-openpgp.c | 64 ++++++++++++++++++++++++++++++++++++++++++++
- src/tools/openpgp-tool.c | 22 ++++++++++++++-
- 2 files changed, 85 insertions(+), 1 deletion(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -2206,6 +2206,66 @@ out:
-
- #endif /* ENABLE_OPENSSL */
-
-+/**
-+ * Erase card
-+ **/
-+static int pgp_erase_card(sc_card_t *card)
-+{
-+ sc_context_t *ctx = card->ctx;
-+ u8 *apdustring[10] = {
-+ "00:20:00:81:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:81:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:81:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:81:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:83:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:83:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:83:08:40:40:40:40:40:40:40:40",
-+ "00:20:00:83:08:40:40:40:40:40:40:40:40",
-+ "00:e6:00:00",
-+ "00:44:00:00"
-+ };
-+ u8 buf[SC_MAX_APDU_BUFFER_SIZE];
-+ u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
-+ sc_apdu_t apdu;
-+ size_t len0;
-+ int commandsnum = 10;
-+ int i, r;
-+
-+ LOG_FUNC_CALLED(ctx);
-+
-+ /* Check card version */
-+ if (card->type != SC_CARD_TYPE_OPENPGP_V2) {
-+ sc_log(ctx, "Card is not OpenPGP v2");
-+ LOG_FUNC_RETURN(ctx, SC_ERROR_NO_CARD_SUPPORT);
-+ }
-+ sc_log(ctx, "Card is OpenPGP v2. Erase card.");
-+
-+ /* Iterate over 10 commands above */
-+ for (i = 0; i < commandsnum; i++) {
-+ /* Convert the string to binary array */
-+ len0 = sizeof(buf);
-+ sc_hex_to_bin(apdustring[i], buf, &len0);
-+ printf("Sending: ");
-+ for (r = 0; r < len0; r++)
-+ printf("%02X ", buf[r]);
-+ printf("\n");
-+
-+ /* Build APDU from binary array */
-+ r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
-+ if (r) {
-+ sc_log(ctx, "Failed to build APDU");
-+ LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
-+ }
-+ apdu.resp = rbuf;
-+ apdu.resplen = sizeof(rbuf);
-+
-+ /* Send APDU to card */
-+ r = sc_transmit_apdu(card, &apdu);
-+ LOG_TEST_RET(ctx, r, "Transmiting APDU failed");
-+ }
-+ LOG_FUNC_RETURN(ctx, r);
-+}
-+
- /* ABI: card ctl: perform special card-specific operations */
- static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
- {
-@@ -2232,6 +2292,10 @@ static int pgp_card_ctl(sc_card_t *card,
- LOG_FUNC_RETURN(card->ctx, r);
- break;
- #endif /* ENABLE_OPENSSL */
-+ case SC_CARDCTL_ERASE_CARD:
-+ r = pgp_erase_card(card);
-+ LOG_FUNC_RETURN(card->ctx, r);
-+ break;
- }
-
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -78,6 +78,7 @@ static int opt_pin = 0;
- static const char *pin = NULL;
- static int opt_dump_do = 0;
- static u8 do_dump_idx;
-+static int opt_erase = 0;
-
- static const char *app_name = "openpgp-tool";
-
-@@ -94,6 +95,7 @@ static const struct option options[] = {
- { "help", no_argument, NULL, 'h' },
- { "verbose", no_argument, NULL, 'v' },
- { "version", no_argument, NULL, 'V' },
-+ { "erase", no_argument, NULL, 'E' },
- { "verify", required_argument, NULL, OPT_VERIFY },
- { "pin", required_argument, NULL, OPT_PIN },
- { "do", required_argument, NULL, 'd' },
-@@ -113,6 +115,7 @@ static const char *option_help[] = {
- /* h */ "Print this help message",
- /* v */ "Verbose operation. Use several times to enable debug output.",
- /* V */ "Show version number",
-+/* E */ "Erase (reset) the card",
- "Verify PIN (CHV1, CHV2, CHV3...)",
- "PIN string",
- /* d */ "Dump private data object number <arg> (i.e. PRIVATE-DO-<arg>)"
-@@ -232,7 +235,7 @@ static int decode_options(int argc, char
- {
- int c;
-
-- while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVd:", options, (int *) 0)) != EOF) {
-+ while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVd:E", options, (int *) 0)) != EOF) {
- switch (c) {
- case 'r':
- opt_reader = optarg;
-@@ -294,6 +297,8 @@ static int decode_options(int argc, char
- do_dump_idx = optarg[0] - '0';
- opt_dump_do++;
- actions++;
-+ case 'E':
-+ opt_erase++;
- break;
- default:
- util_print_usage_and_die(app_name, options, option_help, NULL);
-@@ -452,6 +457,18 @@ int do_verify(sc_card_t *card, char *typ
- return r;
- }
-
-+int do_erase(sc_card_t *card)
-+{
-+ int r;
-+ /* Check card version */
-+ if (card->type != SC_CARD_TYPE_OPENPGP_V2) {
-+ printf("Do not erase card which is not OpenPGP v2\n");
-+ }
-+ printf("Erase card\n");
-+ r = sc_card_ctl(card, SC_CARDCTL_ERASE_CARD, NULL);
-+ return r;
-+}
-+
- int main(int argc, char **argv)
- {
- sc_context_t *ctx = NULL;
-@@ -531,6 +548,9 @@ int main(int argc, char **argv)
- exit(EXIT_FAILURE);
- }
-
-+ if (opt_erase)
-+ exit_status != do_erase(card);
-+
- out:
- sc_unlock(card);
- sc_disconnect_card(card);
+++ /dev/null
-From 469b6567d9adc4af6f49fa65534162673060454d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Mon, 4 Mar 2013 18:13:03 +0700
-Subject: [PATCH 06/26] openpgp-tool: Support deleting key in Gnuk.
-
----
- src/tools/openpgp-tool.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 142 insertions(+)
-
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -41,6 +41,7 @@
- #define OPT_PRETTY 257
- #define OPT_VERIFY 258
- #define OPT_PIN 259
-+#define OPT_DELKEY 260
-
- /* define structures */
- struct ef_name_map {
-@@ -79,6 +80,7 @@ static const char *pin = NULL;
- static int opt_dump_do = 0;
- static u8 do_dump_idx;
- static int opt_erase = 0;
-+static int opt_delkey = 0;
-
- static const char *app_name = "openpgp-tool";
-
-@@ -98,6 +100,7 @@ static const struct option options[] = {
- { "erase", no_argument, NULL, 'E' },
- { "verify", required_argument, NULL, OPT_VERIFY },
- { "pin", required_argument, NULL, OPT_PIN },
-+ { "del-key", required_argument, NULL, OPT_DELKEY },
- { "do", required_argument, NULL, 'd' },
- { NULL, 0, NULL, 0 }
- };
-@@ -118,6 +121,7 @@ static const char *option_help[] = {
- /* E */ "Erase (reset) the card",
- "Verify PIN (CHV1, CHV2, CHV3...)",
- "PIN string",
-+ "Delete key (1, 2, 3 or all)",
- /* d */ "Dump private data object number <arg> (i.e. PRIVATE-DO-<arg>)"
- };
-
-@@ -300,6 +304,14 @@ static int decode_options(int argc, char
- case 'E':
- opt_erase++;
- break;
-+ case OPT_DELKEY:
-+ opt_delkey++;
-+ if (strcmp(optarg, "all") != 0) /* Arg string is not 'all' */
-+ key_id = optarg[0] - '0';
-+ else /* Arg string is 'all' */
-+ key_id = 'a';
-+ actions++;
-+ break;
- default:
- util_print_usage_and_die(app_name, options, option_help, NULL);
- }
-@@ -457,6 +469,133 @@ int do_verify(sc_card_t *card, char *typ
- return r;
- }
-
-+/**
-+ * Delete key, for Gnuk.
-+ **/
-+int delete_key_gnuk(sc_card_t *card, u8 key_id)
-+{
-+ sc_context_t *ctx = card->ctx;
-+ int r = SC_SUCCESS;
-+ u8 *data = NULL;
-+
-+ /* Delete fingerprint */
-+ sc_log(ctx, "Delete fingerprints");
-+ r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
-+ /* Delete creation time */
-+ sc_log(ctx, "Delete creation time");
-+ r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
-+
-+ /* Rewrite Extended Header List */
-+ sc_log(ctx, "Rewrite Extended Header List");
-+
-+ if (key_id == 1)
-+ data = "\x4D\x02\xB6";
-+ else if (key_id == 2)
-+ data = "\x4D\x02\xB8";
-+ else if (key_id == 3)
-+ data = "\x4D\x02\xA4";
-+ else
-+ return SC_ERROR_INVALID_ARGUMENTS;
-+
-+ r |= sc_put_data(card, 0x4D, data, strlen(data) + 1);
-+ return r;
-+}
-+
-+/**
-+ * Delete key, for OpenPGP card.
-+ * This function is not complete and is reserved for future version (> 2) of OpenPGP card.
-+ **/
-+int delete_key_openpgp(sc_card_t *card, u8 key_id)
-+{
-+ sc_context_t *ctx = card->ctx;
-+ char *del_fingerprint = "00:DA:00:C6:14:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00";
-+ char *del_creationtime = "00:DA:00:CD:04:00:00:00:00";
-+ /* We need to replace the 4th byte later */
-+ char *apdustring = NULL;
-+ u8 buf[SC_MAX_APDU_BUFFER_SIZE];
-+ u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
-+ sc_apdu_t apdu;
-+ size_t len0;
-+ int i;
-+ int r = SC_SUCCESS;
-+
-+ for (i = 0; i < 2; i++) {
-+ if (i == 0) /* Reset fingerprint */
-+ apdustring = del_fingerprint;
-+ else /* Reset creation time */
-+ apdustring = del_creationtime;
-+ /* Convert the string to binary array */
-+ len0 = sizeof(buf);
-+ sc_hex_to_bin(apdustring, buf, &len0);
-+
-+ /* Replace DO tag, subject to key ID */
-+ buf[3] = buf[3] + key_id;
-+
-+ /* Build APDU from binary array */
-+ r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
-+ if (r) {
-+ sc_log(ctx, "Failed to build APDU");
-+ LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
-+ }
-+ apdu.resp = rbuf;
-+ apdu.resplen = sizeof(rbuf);
-+
-+ /* Send APDU to card */
-+ r = sc_transmit_apdu(card, &apdu);
-+ LOG_TEST_RET(ctx, r, "Transmiting APDU failed");
-+ }
-+ /* TODO: Rewrite Extended Header List.
-+ * Not support by OpenGPG v2 yet */
-+ LOG_FUNC_RETURN(ctx, r);
-+}
-+
-+int delete_key(sc_card_t *card, u8 key_id)
-+{
-+ sc_context_t *ctx = card->ctx;
-+ int r;
-+
-+ LOG_FUNC_CALLED(ctx);
-+ /* Check key ID */
-+ if (key_id < 1 || key_id > 3) {
-+ sc_log(ctx, "Invalid key ID %d", key_id);
-+ LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
-+ }
-+
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK)
-+ r = delete_key_gnuk(card, key_id);
-+ else
-+ r = delete_key_openpgp(card, key_id);
-+
-+ LOG_FUNC_RETURN(ctx, r);
-+}
-+
-+int do_delete_key(sc_card_t *card, u8 key_id)
-+{
-+ sc_context_t *ctx = card->ctx;
-+ int r = SC_SUCCESS;
-+
-+ /* Currently, only Gnuk supports deleting keys */
-+ if (card->type != SC_CARD_TYPE_OPENPGP_GNUK) {
-+ printf("Only Gnuk supports deleting keys. General OpenPGP doesn't.");
-+ return SC_ERROR_NOT_SUPPORTED;
-+ }
-+
-+ if (key_id < 1 || (key_id > 3 && key_id != 'a')) {
-+ printf("Error: Invalid key id %d", key_id);
-+ return SC_ERROR_INVALID_ARGUMENTS;
-+ }
-+ if (key_id == 1 || key_id == 'a') {
-+ r |= delete_key(card, 1);
-+ }
-+ if (key_id == 2 || key_id == 'a') {
-+ r |= delete_key(card, 2);
-+ }
-+ if (key_id == 3 || key_id == 'a') {
-+ r |= delete_key(card, 3);
-+ }
-+ return r;
-+}
-+
- int do_erase(sc_card_t *card)
- {
- int r;
-@@ -548,6 +687,9 @@ int main(int argc, char **argv)
- exit(EXIT_FAILURE);
- }
-
-+ if (opt_delkey)
-+ exit_status != do_delete_key(card, key_id);
-+
- if (opt_erase)
- exit_status != do_erase(card);
-
+++ /dev/null
-From d210faa377bcec63876f84b82540b110ede16e57 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Mon, 4 Mar 2013 18:14:51 +0700
-Subject: [PATCH 07/26] OpenPGP: Correct building Extended Header List when
- importing keys.
-
----
- src/libopensc/card-openpgp.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -1988,7 +1988,7 @@ pgp_build_extended_header_list(sc_card_t
- u8 *p = NULL;
- u8 *components[] = {key_info->e, key_info->p, key_info->q, key_info->n};
- size_t componentlens[] = {key_info->e_len, key_info->p_len, key_info->q_len, key_info->n_len};
-- unsigned int componenttags[] = {0x91, 0x92, 0x93, 0x95};
-+ unsigned int componenttags[] = {0x91, 0x92, 0x93, 0x97};
- char *componentnames[] = {
- "public exponent",
- "prime p",
+++ /dev/null
-From df98874784a77c96a7a1be54412a02a53fdd3a3e Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Mon, 25 Mar 2013 11:58:38 +0700
-Subject: [PATCH 08/26] OpenPGP: Read some empty DOs from Gnuk.
-
-In Gnuk, some empty DOs are returned as not exist, instead of existing with empty value.
-So, we will consider them exist in driver.
----
- src/libopensc/card-openpgp.c | 25 +++++++++++++++++++++++++
- 1 file changed, 25 insertions(+)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -823,6 +823,23 @@ pgp_get_blob(sc_card_t *card, struct blo
- }
- }
-
-+ /* This part is for "NOT FOUND" cases */
-+
-+ /* Special case:
-+ * Gnuk does not have default value for children of DO 65 (DOs 5B, 5F2D, 5F35)
-+ * So, if these blob was not found, we create it. */
-+ if (blob->id == 0x65 && (id == 0x5B || id == 0x5F2D || id == 0x5F35)) {
-+ sc_log(card->ctx, "Create blob %X under %X", id, blob->id);
-+ child = pgp_new_blob(card, blob, id, sc_file_new());
-+ if (child) {
-+ pgp_set_blob(child, NULL, 0);
-+ *ret = child;
-+ return SC_SUCCESS;
-+ }
-+ else
-+ sc_log(card->ctx, "Not enough memory to create blob for DO %X");
-+ }
-+
- return SC_ERROR_FILE_NOT_FOUND;
- }
-
-@@ -1157,6 +1174,14 @@ pgp_get_data(sc_card_t *card, unsigned i
- LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
-
- r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-+
-+ /* For Gnuk card, if there is no certificate, it returns error instead of empty data.
-+ * So, for this case, we ignore error and consider success */
-+ if (r == SC_ERROR_DATA_OBJECT_NOT_FOUND && card->type == SC_CARD_TYPE_OPENPGP_GNUK
-+ && (tag == DO_CERT || tag == 0x0101 || tag == 0x0102 || tag == 0x0103 || tag == 0x0104)) {
-+ r = SC_SUCCESS;
-+ apdu.resplen = 0;
-+ }
- LOG_TEST_RET(card->ctx, r, "Card returned error");
-
- LOG_FUNC_RETURN(card->ctx, apdu.resplen);
+++ /dev/null
-From 42adc35954e18e24f253f710b16d850d1872bce5 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Wed, 27 Mar 2013 11:38:42 +0700
-Subject: [PATCH 09/26] PKCS15-OpenPGP: Do not show empty DO in pkcs15
- emu_init.
-
----
- src/libopensc/pkcs15-openpgp.c | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
-Index: opensc-20150513/src/libopensc/pkcs15-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/pkcs15-openpgp.c
-+++ opensc-20150513/src/libopensc/pkcs15-openpgp.c
-@@ -383,16 +383,34 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_
- sc_pkcs15_object_t dat_obj;
- char name[8];
- char path[9];
-+ u8 content[254];
- memset(&dat_info, 0, sizeof(dat_info));
- memset(&dat_obj, 0, sizeof(dat_obj));
-
- sprintf(name, "PrivDO%d", i);
- sprintf(path, "3F00010%d", i);
-
-+ /* Check if the DO can be read.
-+ * We won't expose pkcs15 DATA object if DO is empty.
-+ */
-+ r = read_file(p15card->card, path, content, sizeof(content));
-+ if (r <= 0 ) {
-+ sc_log(ctx, "Cannot read DO 010%d or there is no data in it", i);
-+ /* Skip */
-+ continue;
-+ }
- sc_format_path(path, &dat_info.path);
- strlcpy(dat_obj.label, name, sizeof(dat_obj.label));
- strlcpy(dat_info.app_label, name, sizeof(dat_info.app_label));
-
-+ /* Add DATA object to slot protected by PIN2 (PW1 with Ref 0x82) */
-+ dat_obj.flags = SC_PKCS15_CO_FLAG_PRIVATE | SC_PKCS15_CO_FLAG_MODIFIABLE;
-+ dat_obj.auth_id.len = 1;
-+ if (i == 1 || i == 3)
-+ dat_obj.auth_id.value[0] = 2;
-+ else
-+ dat_obj.auth_id.value[0] = 3;
-+
- sc_log(ctx, "Add %s data object", name);
- r = sc_pkcs15emu_add_data_object(p15card, &dat_obj, &dat_info);
- }
+++ /dev/null
-From f085e6a5f386875b5b071ef3bf115e4d9bb33bdb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Wed, 27 Mar 2013 11:39:33 +0700
-Subject: [PATCH 10/26] PKCS15-OpenPGP: Allow to store data to pkcs15 data
- object.
-
-Only one DO is supported now.
----
- src/libopensc/pkcs15-openpgp.c | 2 +-
- src/pkcs15init/pkcs15-openpgp.c | 38 +++++++++++++++++++++++++++++++++++++-
- 2 files changed, 38 insertions(+), 2 deletions(-)
-
-Index: opensc-20150513/src/libopensc/pkcs15-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/pkcs15-openpgp.c
-+++ opensc-20150513/src/libopensc/pkcs15-openpgp.c
-@@ -395,7 +395,7 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_
- */
- r = read_file(p15card->card, path, content, sizeof(content));
- if (r <= 0 ) {
-- sc_log(ctx, "Cannot read DO 010%d or there is no data in it", i);
-+ sc_log(ctx, "No data get from DO 010%d", i);
- /* Skip */
- continue;
- }
-Index: opensc-20150513/src/pkcs15init/pkcs15-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/pkcs15init/pkcs15-openpgp.c
-+++ opensc-20150513/src/pkcs15init/pkcs15-openpgp.c
-@@ -236,13 +236,16 @@ static int openpgp_emu_update_tokeninfo(
- }
-
- static int openpgp_store_data(struct sc_pkcs15_card *p15card, struct sc_profile *profile,
-- struct sc_pkcs15_object *obj, struct sc_pkcs15_der *content,
-+ struct sc_pkcs15_object *obj, struct sc_pkcs15_der *content,
- struct sc_path *path)
- {
- sc_card_t *card = p15card->card;
-+ sc_context_t *ctx = card->ctx;
- sc_file_t *file;
- sc_pkcs15_cert_info_t *cinfo;
- sc_pkcs15_id_t *cid;
-+ sc_pkcs15_data_info_t *dinfo;
-+ u8 buf[254];
- int r;
-
- LOG_FUNC_CALLED(card->ctx);
-@@ -282,6 +285,39 @@ static int openpgp_store_data(struct sc_
- content->len, 0);
- break;
-
-+ case SC_PKCS15_TYPE_DATA_OBJECT:
-+ dinfo = (sc_pkcs15_data_info_t *) obj->data;
-+ /* dinfo->app_label contains filename */
-+ sc_log(ctx, "===== App label %s", dinfo->app_label);
-+ /* Currently, we only support DO 0101. The reason is that when initializing this
-+ * pkcs15 emulation, PIN authentication is not applied and we can expose only this DO,
-+ * which is "read always".
-+ * If we support other DOs, they will not be exposed, and not helpful to user.
-+ * I haven't found a way to refresh the list of exposed DOs after verifying PIN yet.
-+ * http://sourceforge.net/mailarchive/message.php?msg_id=30646373
-+ **/
-+ sc_log(ctx, "About to write to DO 0101");
-+ sc_format_path("0101", path);
-+ r = sc_select_file(card, path, &file);
-+ LOG_TEST_RET(card->ctx, r, "Cannot select private DO");
-+ r = sc_read_binary(card, 0, buf, sizeof(buf), 0);
-+ if (r < 0) {
-+ sc_log(ctx, "Cannot read DO 0101");
-+ break;
-+ }
-+ if (r > 0) {
-+ sc_log(ctx, "DO 0101 is full.");
-+ r = SC_ERROR_TOO_MANY_OBJECTS;
-+ break;
-+ }
-+ r = sc_pkcs15init_authenticate(profile, p15card, file, SC_AC_OP_UPDATE);
-+ if (r >= 0 && content->len) {
-+ r = sc_update_binary(p15card->card, 0,
-+ (const unsigned char *) content->value,
-+ content->len, 0);
-+ }
-+ break;
-+
- default:
- r = SC_ERROR_NOT_IMPLEMENTED;
- }
+++ /dev/null
-From 752f8981bed49a98d3592ead3aa50e743318dea8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Fri, 5 Apr 2013 17:18:50 +0700
-Subject: [PATCH 11/26] OpenPGP: Provide enough buffer to read pubkey from
- Gnuk.
-
----
- src/libopensc/card-openpgp.c | 28 +++++++++++++++++++++++-----
- 1 file changed, 23 insertions(+), 5 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -265,7 +265,12 @@ static struct do_info pgp2_objects[] =
-
- /* The DO holding X.509 certificate is constructed but does not contain child DO.
- * We should notice this when building fake file system later. */
--#define DO_CERT 0x7f21
-+#define DO_CERT 0x7f21
-+/* Maximum length for response buffer when reading pubkey. This value is calculated with
-+ * 4096-bit key length */
-+#define MAXLEN_RESP_PUBKEY 527
-+/* Gnuk only support 1 key length (2048 bit) */
-+#define MAXLEN_RESP_PUBKEY_GNUK 271
-
- #define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
- struct pgp_priv_data {
-@@ -739,6 +744,14 @@ pgp_read_blob(sc_card_t *card, struct bl
- u8 buffer[2048];
- size_t buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
- ? sizeof(buffer) : 256;
-+
-+ /* Buffer length for Gnuk pubkey */
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
-+ (blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
-+ || blob->id == 0xa401 || blob->id == 0xb601 || blob->id == 0xb801)) {
-+ buf_len = MAXLEN_RESP_PUBKEY_GNUK;
-+ }
-+
- int r = blob->info->get_fn(card, blob->id, buffer, buf_len);
-
- if (r < 0) { /* an error occurred */
-@@ -1836,6 +1849,7 @@ static int pgp_gen_key(sc_card_t *card,
- u8 apdu_case;
- u8 *apdu_data;
- size_t apdu_le;
-+ size_t resplen = 0;
- int r = SC_SUCCESS;
-
- LOG_FUNC_CALLED(card->ctx);
-@@ -1876,23 +1890,27 @@ static int pgp_gen_key(sc_card_t *card,
- apdu_case = SC_APDU_CASE_4_EXT;
- }
- else {
-- apdu_le = 256;
- apdu_case = SC_APDU_CASE_4_SHORT;
-+ apdu_le = 256;
-+ resplen = MAXLEN_RESP_PUBKEY;
-+ }
-+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK) {
-+ resplen = MAXLEN_RESP_PUBKEY_GNUK;
- }
-
- /* Prepare APDU */
-- sc_format_apdu(card, &apdu, apdu_case, 0x47, 0x80, 0);
-+ sc_format_apdu(card, &apdu, apdu_case, 0x47, 0x80, 0);
- apdu.data = apdu_data;
- apdu.datalen = 2; /* Data = B600 */
- apdu.lc = 2;
- apdu.le = apdu_le;
-
- /* Buffer to receive response */
-- apdu.resp = calloc(apdu.le, 1);
-+ apdu.resplen = (resplen > 0) ? resplen : apdu_le;
-+ apdu.resp = calloc(apdu.resplen, 1);
- if (apdu.resp == NULL) {
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_ENOUGH_MEMORY);
- }
-- apdu.resplen = apdu.le;
-
- /* Send */
- sc_log(card->ctx, "Waiting for the card to generate key...");
+++ /dev/null
-From 5110ae3ba33d165c43ea5eca8f929a82d81cb3fe Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Thu, 11 Apr 2013 11:47:51 +0700
-Subject: [PATCH 12/26] OpenPGP: Support write certificate for Gnuk.
-
----
- src/libopensc/card-openpgp.c | 158 +++++++++++++++++++++++++++++++++----------
- 1 file changed, 123 insertions(+), 35 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -735,6 +735,8 @@ pgp_iterate_blobs(struct blob *blob, int
- static int
- pgp_read_blob(sc_card_t *card, struct blob *blob)
- {
-+ struct pgp_priv_data *priv = DRVDATA (card);
-+
- if (blob->data != NULL)
- return SC_SUCCESS;
- if (blob->info == NULL)
-@@ -745,6 +747,11 @@ pgp_read_blob(sc_card_t *card, struct bl
- size_t buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
- ? sizeof(buffer) : 256;
-
-+ /* Buffer length for certificate */
-+ if (blob->id == DO_CERT && priv->max_cert_size > 0) {
-+ buf_len = MIN(priv->max_cert_size, sizeof(buffer));
-+ }
-+
- /* Buffer length for Gnuk pubkey */
- if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
- (blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
-@@ -1200,49 +1207,75 @@ pgp_get_data(sc_card_t *card, unsigned i
- LOG_FUNC_RETURN(card->ctx, apdu.resplen);
- }
-
--/* ABI: PUT DATA */
--static int
--pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
-+
-+/* Internal: Write certificate for Gnuk */
-+static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
- {
-+ sc_context_t *ctx = card->ctx;
-+ size_t i = 0;
- sc_apdu_t apdu;
-+ u8 *part;
-+ size_t plen;
-+ int r = SC_SUCCESS;
-+
-+ LOG_FUNC_CALLED(ctx);
-+
-+ /* If null data is passed, delete certificate */
-+ if (buf == NULL || length == 0) {
-+ sc_format_apdu(card, &apdu, SC_APDU_CASE_1, 0xD6, 0x85, 0);
-+ r = sc_transmit_apdu(card, &apdu);
-+ LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
-+ /* Check response */
-+ r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-+ LOG_FUNC_RETURN(card->ctx, length);
-+ }
-+
-+ /* Ref: gnuk_put_binary_libusb.py and gnuk_token.py in Gnuk source tree */
-+ /* Split data to segments of 256 bytes. Send each segment via command chaining,
-+ * with particular P1 byte for each segment */
-+ while (i*256 < length) {
-+ part = (u8 *)buf + i*256;
-+ plen = MIN(length - i*256, 256);
-+
-+ sc_log(card->ctx, "Write part %d from offset 0x%X, len %d", i+1, part, plen);
-+
-+ if (i == 0) {
-+ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xD6, 0x85, 0);
-+ }
-+ else {
-+ sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xD6, i, 0);
-+ }
-+ apdu.flags |= SC_APDU_FLAGS_CHAINING;
-+ apdu.data = part;
-+ apdu.datalen = apdu.lc = plen;
-+
-+ r = sc_transmit_apdu(card, &apdu);
-+ LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
-+ /* Check response */
-+ r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-+ LOG_TEST_RET(card->ctx, r, "UPDATE BINARY returned error");
-+
-+ /* To next part */
-+ i++;
-+ }
-+ LOG_FUNC_RETURN(card->ctx, length);
-+}
-+
-+
-+/* Internal: Use PUT DATA command to write */
-+static int
-+pgp_put_data_plain(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
-+{
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *affected_blob = NULL;
-- struct do_info *dinfo = NULL;
-+ sc_context_t *ctx = card->ctx;
-+ sc_apdu_t apdu;
- u8 ins = 0xDA;
- u8 p1 = tag >> 8;
- u8 p2 = tag & 0xFF;
- u8 apdu_case = SC_APDU_CASE_3;
- int r;
-
-- LOG_FUNC_CALLED(card->ctx);
--
-- /* Check if the tag is writable */
-- affected_blob = pgp_find_blob(card, tag);
--
-- /* Non-readable DOs have no represented blob, we have to check from pgp_get_info_by_tag */
-- if (affected_blob == NULL)
-- dinfo = pgp_get_info_by_tag(card, tag);
-- else
-- dinfo = affected_blob->info;
--
-- if (dinfo == NULL) {
-- sc_log(card->ctx, "The DO %04X does not exist.", tag);
-- LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
-- }
-- else if ((dinfo->access & WRITE_MASK) == WRITE_NEVER) {
-- sc_log(card->ctx, "DO %04X is not writable.", tag);
-- LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_ALLOWED);
-- }
--
-- /* Check data size.
-- * We won't check other DOs than 7F21 (certificate), because their capacity
-- * is hard-codded and may change in various version of the card. If we check here,
-- * the driver may be sticked to a limit version number of card.
-- * 7F21 size is soft-coded, so we can check it. */
-- if (tag == DO_CERT && buf_len > priv->max_cert_size) {
-- sc_log(card->ctx, "Data size %ld exceeds DO size limit %ld.", buf_len, priv->max_cert_size);
-- LOG_FUNC_RETURN(card->ctx, SC_ERROR_WRONG_LENGTH);
-- }
-+ LOG_FUNC_CALLED(ctx);
-
- /* Extended Header list (004D DO) needs a variant of PUT DATA command */
- if (tag == 0x004D) {
-@@ -1268,15 +1301,70 @@ pgp_put_data(sc_card_t *card, unsigned i
- apdu.lc = buf_len;
- }
- else {
-+ /* This case is to empty DO */
- sc_format_apdu(card, &apdu, SC_APDU_CASE_1, ins, p1, p2);
- }
-
- /* Send APDU to card */
- r = sc_transmit_apdu(card, &apdu);
-- LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
-+ LOG_TEST_RET(ctx, r, "APDU transmit failed");
- /* Check response */
- r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-
-+ if (r < 0)
-+ LOG_FUNC_RETURN(ctx, r);
-+
-+ LOG_FUNC_RETURN(ctx, buf_len);
-+}
-+
-+/* ABI: PUT DATA */
-+static int
-+pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
-+{
-+ struct pgp_priv_data *priv = DRVDATA(card);
-+ struct blob *affected_blob = NULL;
-+ struct do_info *dinfo = NULL;
-+ int r;
-+
-+ LOG_FUNC_CALLED(card->ctx);
-+
-+ /* Check if the tag is writable */
-+ if (priv->current->id != tag)
-+ affected_blob = pgp_find_blob(card, tag);
-+
-+ /* Non-readable DOs have no represented blob, we have to check from pgp_get_info_by_tag */
-+ if (affected_blob == NULL)
-+ dinfo = pgp_get_info_by_tag(card, tag);
-+ else
-+ dinfo = affected_blob->info;
-+
-+ if (dinfo == NULL) {
-+ sc_log(card->ctx, "The DO %04X does not exist.", tag);
-+ LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
-+ }
-+ else if ((dinfo->access & WRITE_MASK) == WRITE_NEVER) {
-+ sc_log(card->ctx, "DO %04X is not writable.", tag);
-+ LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_ALLOWED);
-+ }
-+
-+ /* Check data size.
-+ * We won't check other DOs than 7F21 (certificate), because their capacity
-+ * is hard-codded and may change in various version of the card. If we check here,
-+ * the driver may be sticked to a limit version number of card.
-+ * 7F21 size is soft-coded, so we can check it. */
-+ if (tag == DO_CERT && buf_len > priv->max_cert_size) {
-+ sc_log(card->ctx, "Data size %ld exceeds DO size limit %ld.", buf_len, priv->max_cert_size);
-+ LOG_FUNC_RETURN(card->ctx, SC_ERROR_WRONG_LENGTH);
-+ }
-+
-+ if (tag == DO_CERT && card->type == SC_CARD_TYPE_OPENPGP_GNUK) {
-+ /* Gnuk need a special way to write certificate. */
-+ r = gnuk_write_certificate(card, buf, buf_len);
-+ }
-+ else {
-+ r = pgp_put_data_plain(card, tag, buf, buf_len);
-+ }
-+
- /* Instruct more in case of error */
- if (r == SC_ERROR_SECURITY_STATUS_NOT_SATISFIED) {
- sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Please verify PIN first.");
+++ /dev/null
-From 7823e836e8279c8d77786d8f10ffaa83cf50bf1d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Wed, 10 Apr 2013 18:35:58 +0700
-Subject: [PATCH 13/26] pkcs15-openpgp: Change to sc_put_data instead of
- sc_update_binary when writing certificate.
-
----
- src/pkcs15init/pkcs15-openpgp.c | 5 ++---
- 1 file changed, 2 insertions(+), 3 deletions(-)
-
-Index: opensc-20150513/src/pkcs15init/pkcs15-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/pkcs15init/pkcs15-openpgp.c
-+++ opensc-20150513/src/pkcs15init/pkcs15-openpgp.c
-@@ -279,10 +279,9 @@ static int openpgp_store_data(struct sc_
- r = sc_select_file(card, path, &file);
- LOG_TEST_RET(card->ctx, r, "Cannot select cert file");
- r = sc_pkcs15init_authenticate(profile, p15card, file, SC_AC_OP_UPDATE);
-+ sc_log(card->ctx, "Data to write is %d long", content->len);
- if (r >= 0 && content->len)
-- r = sc_update_binary(p15card->card, 0,
-- (const unsigned char *) content->value,
-- content->len, 0);
-+ r = sc_put_data(p15card->card, 0x7F21, (const unsigned char *) content->value, content->len);
- break;
-
- case SC_PKCS15_TYPE_DATA_OBJECT:
+++ /dev/null
-From 3ff1f7234abb4c42273adedbe06d9e7f9f3a5f9d Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Thu, 11 Apr 2013 16:18:31 +0700
-Subject: [PATCH 14/26] OpenPGP: Overcome the restriction of even data length
- of Gnuk.
-
-When write certificate with odd length to Gnuk, we add zero padding to make it even.
----
- src/libopensc/card-openpgp.c | 20 ++++++++++++++++++--
- 1 file changed, 18 insertions(+), 2 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -1216,6 +1216,10 @@ static int gnuk_write_certificate(sc_car
- sc_apdu_t apdu;
- u8 *part;
- size_t plen;
-+ /* Two round_ variables below are to build APDU data
-+ * with even length for Gnuk */
-+ u8 roundbuf[256];
-+ size_t roundlen = 0;
- int r = SC_SUCCESS;
-
- LOG_FUNC_CALLED(ctx);
-@@ -1246,8 +1250,20 @@ static int gnuk_write_certificate(sc_car
- sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xD6, i, 0);
- }
- apdu.flags |= SC_APDU_FLAGS_CHAINING;
-- apdu.data = part;
-- apdu.datalen = apdu.lc = plen;
-+
-+ /* If the last part has odd length, we add zero padding to make it even.
-+ * Gnuk does not allow data with odd length */
-+ if (plen < 256 && (plen % 2) != 0) {
-+ roundlen = plen + 1;
-+ memset(roundbuf, 0, roundlen);
-+ memcpy(roundbuf, part, plen);
-+ apdu.data = roundbuf;
-+ apdu.datalen = apdu.lc = roundlen;
-+ }
-+ else {
-+ apdu.data = part;
-+ apdu.datalen = apdu.lc = plen;
-+ }
-
- r = sc_transmit_apdu(card, &apdu);
- LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
+++ /dev/null
-From 9af45c4cf052e3a6059a3004082f9ee3d2b3b2bf Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Fri, 12 Apr 2013 15:33:31 +0700
-Subject: [PATCH 15/26] OpenPGP: Delete key as file, for Gnuk.
-
----
- src/libopensc/card-openpgp.c | 51 +++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 50 insertions(+), 1 deletion(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -2448,6 +2448,44 @@ static int pgp_card_ctl(sc_card_t *card,
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
- }
-
-+
-+/* Internal: Delete key */
-+static int
-+gnuk_delete_key(sc_card_t *card, u8 key_id)
-+{
-+ sc_context_t *ctx = card->ctx;
-+ int r = SC_SUCCESS;
-+ u8 *data = NULL;
-+
-+ LOG_FUNC_CALLED(ctx);
-+
-+ /* Delete fingerprint */
-+ sc_log(ctx, "Delete fingerprints");
-+ r = pgp_put_data(card, 0xC6 + key_id, NULL, 0);
-+ LOG_TEST_RET(ctx, r, "Failed to delete fingerprints");
-+ /* Delete creation time */
-+ sc_log(ctx, "Delete creation time");
-+ r = pgp_put_data(card, 0xCD + key_id, NULL, 0);
-+ LOG_TEST_RET(ctx, r, "Failed to delete creation time");
-+
-+ /* Rewrite Extended Header List */
-+ sc_log(ctx, "Rewrite Extended Header List");
-+
-+ if (key_id == 1)
-+ data = "\x4D\x02\xB6";
-+ else if (key_id == 2)
-+ data = "\x4D\x02\xB8";
-+ else if (key_id == 3)
-+ data = "\x4D\x02\xA4";
-+ else
-+ LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
-+
-+ r = pgp_put_data(card, 0x4D, data, strlen(data) + 1);
-+
-+ LOG_FUNC_RETURN(ctx, r);
-+}
-+
-+
- /* ABI: DELETE FILE */
- static int
- pgp_delete_file(sc_card_t *card, const sc_path_t *path)
-@@ -2455,6 +2493,7 @@ pgp_delete_file(sc_card_t *card, const s
- struct pgp_priv_data *priv = DRVDATA(card);
- struct blob *blob;
- sc_file_t *file;
-+ u8 key_id;
- int r;
-
- LOG_FUNC_CALLED(card->ctx);
-@@ -2470,10 +2509,20 @@ pgp_delete_file(sc_card_t *card, const s
- if (blob == priv->mf)
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
-
-- if (file->id == 0xB601 || file->id == 0xB801 || file->id == 0xA401) {
-+ if (card->type != SC_CARD_TYPE_OPENPGP_GNUK &&
-+ (file->id == 0xB601 || file->id == 0xB801 || file->id == 0xA401)) {
- /* These tags are just symbolic. We don't really delete it. */
- r = SC_SUCCESS;
- }
-+ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB601) {
-+ r = gnuk_delete_key(card, 1);
-+ }
-+ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB801) {
-+ r = gnuk_delete_key(card, 2);
-+ }
-+ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xA401) {
-+ r = gnuk_delete_key(card, 3);
-+ }
- else {
- /* call pgp_put_data() with zero-sized NULL-buffer to zap the DO contents */
- r = pgp_put_data(card, file->id, NULL, 0);
+++ /dev/null
-From ee23d262768e7e54ed0fc554bc0b869c65868ace Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Tue, 16 Apr 2013 10:19:34 +0700
-Subject: [PATCH 16/26] OpenPGP: Correct parameter checking.
-
----
- src/libopensc/card-openpgp.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -1231,6 +1231,8 @@ static int gnuk_write_certificate(sc_car
- LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
- /* Check response */
- r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-+ if (r < 0)
-+ LOG_FUNC_RETURN(card->ctx, r);
- LOG_FUNC_RETURN(card->ctx, length);
- }
-
-@@ -2459,6 +2461,11 @@ gnuk_delete_key(sc_card_t *card, u8 key_
-
- LOG_FUNC_CALLED(ctx);
-
-+ if (key_id < 1 || key_id > 3) {
-+ sc_log(ctx, "Key ID %d is invalid. Should be 1, 2 or 3.", key_id);
-+ LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
-+ }
-+
- /* Delete fingerprint */
- sc_log(ctx, "Delete fingerprints");
- r = pgp_put_data(card, 0xC6 + key_id, NULL, 0);
-@@ -2477,8 +2484,6 @@ gnuk_delete_key(sc_card_t *card, u8 key_
- data = "\x4D\x02\xB8";
- else if (key_id == 3)
- data = "\x4D\x02\xA4";
-- else
-- LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
-
- r = pgp_put_data(card, 0x4D, data, strlen(data) + 1);
-
+++ /dev/null
-From f4aec38233010953cea72c367bccc71c3687b2f1 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Tue, 16 Apr 2013 16:02:17 +0700
-Subject: [PATCH 17/26] OpenPGP: Make code neater
-
----
- src/libopensc/card-openpgp.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -1230,10 +1230,7 @@ static int gnuk_write_certificate(sc_car
- r = sc_transmit_apdu(card, &apdu);
- LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
- /* Check response */
-- r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-- if (r < 0)
-- LOG_FUNC_RETURN(card->ctx, r);
-- LOG_FUNC_RETURN(card->ctx, length);
-+ LOG_TEST_RET(card->ctx, sc_check_sw(card, apdu.sw1, apdu.sw2), "Certificate writing failed");
- }
-
- /* Ref: gnuk_put_binary_libusb.py and gnuk_token.py in Gnuk source tree */
-@@ -1270,8 +1267,7 @@ static int gnuk_write_certificate(sc_car
- r = sc_transmit_apdu(card, &apdu);
- LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
- /* Check response */
-- r = sc_check_sw(card, apdu.sw1, apdu.sw2);
-- LOG_TEST_RET(card->ctx, r, "UPDATE BINARY returned error");
-+ LOG_TEST_RET(card->ctx, sc_check_sw(card, apdu.sw1, apdu.sw2), "UPDATE BINARY returned error");
-
- /* To next part */
- i++;
+++ /dev/null
-From c84c84169f7a73eab27f6a9b13b77432baa5c3f8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Wed, 8 May 2013 16:51:21 +0700
-Subject: [PATCH 18/26] Move declaration to top of block.
-
----
- src/libopensc/card-openpgp.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -746,6 +746,7 @@ pgp_read_blob(sc_card_t *card, struct bl
- u8 buffer[2048];
- size_t buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
- ? sizeof(buffer) : 256;
-+ int r = SC_SUCCESS;
-
- /* Buffer length for certificate */
- if (blob->id == DO_CERT && priv->max_cert_size > 0) {
-@@ -759,7 +760,7 @@ pgp_read_blob(sc_card_t *card, struct bl
- buf_len = MAXLEN_RESP_PUBKEY_GNUK;
- }
-
-- int r = blob->info->get_fn(card, blob->id, buffer, buf_len);
-+ r = blob->info->get_fn(card, blob->id, buffer, buf_len);
-
- if (r < 0) { /* an error occurred */
- blob->status = r;
+++ /dev/null
-From c6abf7976f64be5191dc80fecdbcb07daab7a2e0 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Sun, 3 Nov 2013 01:45:56 +0800
-Subject: [PATCH 19/26] OpenPGP: Make indentation consistent (space -> tab).
-
----
- src/libopensc/card-openpgp.c | 22 ++++++++---------
- src/tools/openpgp-tool.c | 56 ++++++++++++++++++++++----------------------
- 2 files changed, 39 insertions(+), 39 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -194,12 +194,12 @@ static struct do_info pgp1_objects[] =
- { 0x5f35, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
- { 0x5f50, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
- { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
-- { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
- { 0, 0, 0, NULL, NULL },
- };
-
-@@ -255,11 +255,11 @@ static struct do_info pgp2_objects[] =
- /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
- * However, their R/W access condition may block the process of importing key in pkcs15init.
- * So we set their accesses condition as WRITE_PIN3 (writable). */
-- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
- { 0, 0, 0, NULL, NULL },
- };
-
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -37,11 +37,11 @@
- #include "util.h"
- #include "libopensc/log.h"
-
--#define OPT_RAW 256
--#define OPT_PRETTY 257
--#define OPT_VERIFY 258
--#define OPT_PIN 259
--#define OPT_DELKEY 260
-+#define OPT_RAW 256
-+#define OPT_PRETTY 257
-+#define OPT_VERIFY 258
-+#define OPT_PIN 259
-+#define OPT_DELKEY 260
-
- /* define structures */
- struct ef_name_map {
-@@ -142,10 +142,10 @@ static const struct ef_name_map openpgp_
- static void show_version(void)
- {
- fprintf(stderr,
-- "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
-- "\n"
-- "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
-- "Licensed under LGPL v2\n");
-+ "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
-+ "\n"
-+ "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
-+ "Licensed under LGPL v2\n");
- }
-
-
-@@ -176,16 +176,16 @@ static char *prettify_language(char *str
- {
- if (str != NULL) {
- switch (strlen(str)) {
-- case 8: memmove(str+7, str+6, 1+strlen(str+6));
-+ case 8: memmove(str+7, str+6, 1+strlen(str+6));
- str[6] = ',';
- /* fall through */
-- case 6: memmove(str+5, str+4, 1+strlen(str+4));
-+ case 6: memmove(str+5, str+4, 1+strlen(str+4));
- str[4] = ',';
- /* fall through */
-- case 4: memmove(str+3, str+2, 1+strlen(str+2));
-+ case 4: memmove(str+3, str+2, 1+strlen(str+2));
- str[2] = ',';
- /* fall through */
-- case 2: return str;
-+ case 2: return str;
- }
- }
- return NULL;
-@@ -197,10 +197,10 @@ static char *prettify_gender(char *str)
- {
- if (str != NULL) {
- switch (*str) {
-- case '0': return "unknown";
-- case '1': return "male";
-- case '2': return "female";
-- case '9': return "not applicable";
-+ case '0': return "unknown";
-+ case '1': return "male";
-+ case '2': return "female";
-+ case '9': return "not applicable";
- }
- }
- return NULL;
-@@ -218,7 +218,7 @@ static void display_data(const struct ef
- char *envvar;
-
- envvar = malloc(strlen(mapping->env_name) +
-- strlen(value) + 2);
-+ strlen(value) + 2);
- if (envvar != NULL) {
- strcpy(envvar, mapping->env_name);
- strcat(envvar, "=");
-@@ -344,20 +344,20 @@ static int do_userinfo(sc_card_t *card)
- if (!count)
- continue;
-
-- if (count > (int)sizeof(buf) - 1) {
-+ if (count > (int)sizeof(buf) - 1) {
- fprintf(stderr, "Too small buffer to read the OpenPGP data\n");
- return EXIT_FAILURE;
- }
--
-- r = sc_read_binary(card, 0, buf, count, 0);
-- if (r < 0) {
-+
-+ r = sc_read_binary(card, 0, buf, count, 0);
-+ if (r < 0) {
- fprintf(stderr, "%s: read failed - %s\n", openpgp_data[i].ef, sc_strerror(r));
- return EXIT_FAILURE;
-- }
-- if (r != count) {
-- fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
-+ }
-+ if (r != count) {
-+ fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
- return EXIT_FAILURE;
-- }
-+ }
-
- buf[count] = '\0';
-
-@@ -628,7 +628,7 @@ int main(int argc, char **argv)
- r = sc_context_create(&ctx, &ctx_param);
- if (r) {
- util_fatal("failed to establish context: %s\n",
-- sc_strerror(r));
-+ sc_strerror(r));
- return EXIT_FAILURE;
- }
-
-@@ -640,7 +640,7 @@ int main(int argc, char **argv)
- r = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose);
- if (r) {
- util_fatal("failed to connect to card: %s\n",
-- sc_strerror(r));
-+ sc_strerror(r));
- return EXIT_FAILURE;
- }
-
+++ /dev/null
-From 9acf5c1ad7d8a32b472203d3bd8860ea2cbde0e7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Sun, 3 Nov 2013 02:53:35 +0800
-Subject: [PATCH 20/26] OpenPGP: Don't use sc_log in openpgp-tool.
-
----
- src/tools/openpgp-tool.c | 21 +++++++++++----------
- 1 file changed, 11 insertions(+), 10 deletions(-)
-
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -414,8 +414,6 @@ int do_genkey(sc_card_t *card, u8 key_id
- sc_path_t path;
- sc_file_t *file;
-
-- LOG_FUNC_CALLED(card->ctx);
--
- if (key_id < 1 || key_id > 3) {
- printf("Unknown key ID %d.\n", key_id);
- return 1;
-@@ -479,14 +477,14 @@ int delete_key_gnuk(sc_card_t *card, u8
- u8 *data = NULL;
-
- /* Delete fingerprint */
-- sc_log(ctx, "Delete fingerprints");
-+ fprintf(stdout, "Delete fingerprints");
- r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
- /* Delete creation time */
-- sc_log(ctx, "Delete creation time");
-+ fprintf(stdout, "Delete creation time");
- r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
-
- /* Rewrite Extended Header List */
-- sc_log(ctx, "Rewrite Extended Header List");
-+ fprintf(stdout, "Rewrite Extended Header List");
-
- if (key_id == 1)
- data = "\x4D\x02\xB6";
-@@ -534,15 +532,18 @@ int delete_key_openpgp(sc_card_t *card,
- /* Build APDU from binary array */
- r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
- if (r) {
-- sc_log(ctx, "Failed to build APDU");
-- LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
-+ fprintf(stderr, "Failed to build APDU: %s\n", sc_strerror(r));
-+ return r;
- }
- apdu.resp = rbuf;
- apdu.resplen = sizeof(rbuf);
-
- /* Send APDU to card */
- r = sc_transmit_apdu(card, &apdu);
-- LOG_TEST_RET(ctx, r, "Transmiting APDU failed");
-+ if (r) {
-+ fprintf(stderr, "Transmiting APDU failed: %s\n", sc_strerror(r));
-+ return r;
-+ }
- }
- /* TODO: Rewrite Extended Header List.
- * Not support by OpenGPG v2 yet */
-@@ -557,7 +558,7 @@ int delete_key(sc_card_t *card, u8 key_i
- LOG_FUNC_CALLED(ctx);
- /* Check key ID */
- if (key_id < 1 || key_id > 3) {
-- sc_log(ctx, "Invalid key ID %d", key_id);
-+ fprintf(stderr, "Invalid key ID %d", key_id);
- LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
- }
-
-@@ -649,7 +650,7 @@ int main(int argc, char **argv)
- (card->type != SC_CARD_TYPE_OPENPGP_V2) &&
- (card->type != SC_CARD_TYPE_OPENPGP_GNUK)) {
- util_error("not an OpenPGP card");
-- sc_log(card->ctx, "Card type %X", card->type);
-+ fprintf(stderr, "Card type %X\n", card->type);
- exit_status = EXIT_FAILURE;
- goto out;
- }
+++ /dev/null
-From 0fdbf868976172486af210accafbab163452ff78 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Sun, 3 Nov 2013 11:26:25 +0800
-Subject: [PATCH 21/26] OpenPGP: Don't reimplement gnuk_delete_key in
- openpgp-tool.
-
----
- src/tools/openpgp-tool.c | 64 ++++++------------------------------------------
- 1 file changed, 8 insertions(+), 56 deletions(-)
-
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -468,38 +468,6 @@ int do_verify(sc_card_t *card, char *typ
- }
-
- /**
-- * Delete key, for Gnuk.
-- **/
--int delete_key_gnuk(sc_card_t *card, u8 key_id)
--{
-- sc_context_t *ctx = card->ctx;
-- int r = SC_SUCCESS;
-- u8 *data = NULL;
--
-- /* Delete fingerprint */
-- fprintf(stdout, "Delete fingerprints");
-- r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
-- /* Delete creation time */
-- fprintf(stdout, "Delete creation time");
-- r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
--
-- /* Rewrite Extended Header List */
-- fprintf(stdout, "Rewrite Extended Header List");
--
-- if (key_id == 1)
-- data = "\x4D\x02\xB6";
-- else if (key_id == 2)
-- data = "\x4D\x02\xB8";
-- else if (key_id == 3)
-- data = "\x4D\x02\xA4";
-- else
-- return SC_ERROR_INVALID_ARGUMENTS;
--
-- r |= sc_put_data(card, 0x4D, data, strlen(data) + 1);
-- return r;
--}
--
--/**
- * Delete key, for OpenPGP card.
- * This function is not complete and is reserved for future version (> 2) of OpenPGP card.
- **/
-@@ -547,32 +515,13 @@ int delete_key_openpgp(sc_card_t *card,
- }
- /* TODO: Rewrite Extended Header List.
- * Not support by OpenGPG v2 yet */
-- LOG_FUNC_RETURN(ctx, r);
--}
--
--int delete_key(sc_card_t *card, u8 key_id)
--{
-- sc_context_t *ctx = card->ctx;
-- int r;
--
-- LOG_FUNC_CALLED(ctx);
-- /* Check key ID */
-- if (key_id < 1 || key_id > 3) {
-- fprintf(stderr, "Invalid key ID %d", key_id);
-- LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
-- }
--
-- if (card->type == SC_CARD_TYPE_OPENPGP_GNUK)
-- r = delete_key_gnuk(card, key_id);
-- else
-- r = delete_key_openpgp(card, key_id);
--
-- LOG_FUNC_RETURN(ctx, r);
-+ return r;
- }
-
- int do_delete_key(sc_card_t *card, u8 key_id)
- {
- sc_context_t *ctx = card->ctx;
-+ sc_path_t path;
- int r = SC_SUCCESS;
-
- /* Currently, only Gnuk supports deleting keys */
-@@ -586,13 +535,16 @@ int do_delete_key(sc_card_t *card, u8 ke
- return SC_ERROR_INVALID_ARGUMENTS;
- }
- if (key_id == 1 || key_id == 'a') {
-- r |= delete_key(card, 1);
-+ sc_format_path("B601", &path);
-+ r |= sc_delete_file(card, &path);
- }
- if (key_id == 2 || key_id == 'a') {
-- r |= delete_key(card, 2);
-+ sc_format_path("B801", &path);
-+ r |= sc_delete_file(card, &path);
- }
- if (key_id == 3 || key_id == 'a') {
-- r |= delete_key(card, 3);
-+ sc_format_path("A401", &path);
-+ r |= sc_delete_file(card, &path);
- }
- return r;
- }
+++ /dev/null
-From 0cd2a488d86006bb2740a4e73e7a0d859e1bf33c Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Sun, 13 Jul 2014 17:37:59 +0800
-Subject: [PATCH 22/26] OpenPGP: Use directly binary array of APDUs for ERASE
- command.
-
-I used a string presentation before and it needed an extra conversion step.
----
- src/libopensc/card-openpgp.c | 47 +++++++++++++++++++++++---------------------
- 1 file changed, 25 insertions(+), 22 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -2358,24 +2358,27 @@ out:
- static int pgp_erase_card(sc_card_t *card)
- {
- sc_context_t *ctx = card->ctx;
-- u8 *apdustring[10] = {
-- "00:20:00:81:08:40:40:40:40:40:40:40:40",
-- "00:20:00:81:08:40:40:40:40:40:40:40:40",
-- "00:20:00:81:08:40:40:40:40:40:40:40:40",
-- "00:20:00:81:08:40:40:40:40:40:40:40:40",
-- "00:20:00:83:08:40:40:40:40:40:40:40:40",
-- "00:20:00:83:08:40:40:40:40:40:40:40:40",
-- "00:20:00:83:08:40:40:40:40:40:40:40:40",
-- "00:20:00:83:08:40:40:40:40:40:40:40:40",
-- "00:e6:00:00",
-- "00:44:00:00"
-+ /* Special series of commands to erase OpenPGP card,
-+ * according to https://www.crypto-stick.com/en/faq
-+ * (How to reset a Crypto Stick? question).
-+ * Gnuk is known not to support this feature. */
-+ u8 apdu_binaries[10][13] = {
-+ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
-+ {0, 0xe6, 0, 0},
-+ {0, 0x44, 0, 0}
- };
-+ u8 apdu_lens[10] = {13, 13, 13, 13, 13, 13, 13, 13, 4, 4};
- u8 buf[SC_MAX_APDU_BUFFER_SIZE];
- u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
- sc_apdu_t apdu;
-- size_t len0;
-- int commandsnum = 10;
-- int i, r;
-+ int i, l, r;
-
- LOG_FUNC_CALLED(ctx);
-
-@@ -2387,17 +2390,17 @@ static int pgp_erase_card(sc_card_t *car
- sc_log(ctx, "Card is OpenPGP v2. Erase card.");
-
- /* Iterate over 10 commands above */
-- for (i = 0; i < commandsnum; i++) {
-- /* Convert the string to binary array */
-- len0 = sizeof(buf);
-- sc_hex_to_bin(apdustring[i], buf, &len0);
-- printf("Sending: ");
-- for (r = 0; r < len0; r++)
-- printf("%02X ", buf[r]);
-+ for (i = 0; i < sizeof(apdu_lens); i++) {
-+ /* Length of the binary array of the current command */
-+ l = apdu_lens[i];
-+ /* Print the command to console */
-+ printf("Sending %d: ", i);
-+ for (r = 0; r < l; r++)
-+ printf("%02X ", apdu_binaries[i][r]);
- printf("\n");
-
- /* Build APDU from binary array */
-- r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
-+ r = sc_bytes2apdu(card->ctx, apdu_binaries[i], l, &apdu);
- if (r) {
- sc_log(ctx, "Failed to build APDU");
- LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
+++ /dev/null
-From 6f56ea4cfc52323002d818731a50a31e863b6843 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Sun, 13 Jul 2014 19:41:36 +0800
-Subject: [PATCH 23/26] OpenPGP: Rename private "blob" type to avoid confusing
- with variable name.
-
-This name has been used for both data type and variable name of that
-type.
----
- src/libopensc/card-openpgp.c | 96 ++++++++++++++++++++++----------------------
- 1 file changed, 49 insertions(+), 47 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -113,9 +113,9 @@ enum _card_state {
- CARD_STATE_ACTIVATED = 0x05
- };
-
--struct blob {
-- struct blob * next; /* pointer to next sibling */
-- struct blob * parent; /* pointer to parent */
-+typedef struct pgp_blob {
-+ struct pgp_blob * next; /* pointer to next sibling */
-+ struct pgp_blob * parent; /* pointer to parent */
- struct do_info *info;
-
- sc_file_t * file;
-@@ -124,8 +124,8 @@ struct blob {
-
- unsigned char * data;
- unsigned int len;
-- struct blob * files; /* pointer to 1st child */
--};
-+ struct pgp_blob * files; /* pointer to 1st child */
-+} pgp_blob_t;
-
- struct do_info {
- unsigned int id; /* ID of the DO in question */
-@@ -143,12 +143,12 @@ struct do_info {
-
- static int pgp_get_card_features(sc_card_t *card);
- static int pgp_finish(sc_card_t *card);
--static void pgp_iterate_blobs(struct blob *, int, void (*func)());
-+static void pgp_iterate_blobs(pgp_blob_t *, int, void (*func)());
-
--static int pgp_get_blob(sc_card_t *card, struct blob *blob,
-- unsigned int id, struct blob **ret);
--static struct blob * pgp_new_blob(sc_card_t *, struct blob *, unsigned int, sc_file_t *);
--static void pgp_free_blob(struct blob *);
-+static int pgp_get_blob(sc_card_t *card, pgp_blob_t *blob,
-+ unsigned int id, pgp_blob_t **ret);
-+static pgp_blob_t * pgp_new_blob(sc_card_t *, pgp_blob_t *, unsigned int, sc_file_t *);
-+static void pgp_free_blob(pgp_blob_t *);
- static int pgp_get_pubkey(sc_card_t *, unsigned int,
- u8 *, size_t);
- static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
-@@ -274,8 +274,8 @@ static struct do_info pgp2_objects[] =
-
- #define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
- struct pgp_priv_data {
-- struct blob * mf;
-- struct blob * current; /* currently selected file */
-+ pgp_blob_t * mf;
-+ pgp_blob_t * current; /* currently selected file */
-
- enum _version bcd_version;
- struct do_info *pgp_objects;
-@@ -313,7 +313,7 @@ pgp_init(sc_card_t *card)
- sc_file_t *file = NULL;
- struct do_info *info;
- int r;
-- struct blob *child = NULL;
-+ pgp_blob_t *child = NULL;
-
- LOG_FUNC_CALLED(card->ctx);
-
-@@ -397,7 +397,7 @@ pgp_get_card_features(sc_card_t *card)
- unsigned char *hist_bytes = card->atr.value;
- size_t atr_len = card->atr.len;
- size_t i = 0;
-- struct blob *blob, *blob6e, *blob73;
-+ pgp_blob_t *blob, *blob6e, *blob73;
-
- /* parse card capabilities from historical bytes */
- while ((i < atr_len) && (hist_bytes[i] != 0x73))
-@@ -534,7 +534,7 @@ pgp_finish(sc_card_t *card)
-
- /* internal: fill a blob's data */
- static int
--pgp_set_blob(struct blob *blob, const u8 *data, size_t len)
-+pgp_set_blob(pgp_blob_t *blob, const u8 *data, size_t len)
- {
- if (blob->data)
- free(blob->data);
-@@ -628,16 +628,16 @@ pgp_attach_acl(sc_card_t *card, sc_file_
- }
-
- /* internal: append a blob to the list of children of a given parent blob */
--static struct blob *
--pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
-+static pgp_blob_t *
-+pgp_new_blob(sc_card_t *card, pgp_blob_t *parent, unsigned int file_id,
- sc_file_t *file)
- {
-- struct blob *blob = NULL;
-+ pgp_blob_t *blob = NULL;
-
- if (file == NULL)
- return NULL;
-
-- if ((blob = calloc(1, sizeof(struct blob))) != NULL) {
-+ if ((blob = calloc(1, sizeof(pgp_blob_t))) != NULL) {
- struct pgp_priv_data *priv = DRVDATA (card);
- struct do_info *info;
-
-@@ -651,7 +651,7 @@ pgp_new_blob(sc_card_t *card, struct blo
- blob->parent = parent;
-
- if (parent != NULL) {
-- struct blob **p;
-+ pgp_blob_t **p;
-
- /* set file's path = parent's path + file's id */
- blob->file->path = parent->file->path;
-@@ -689,11 +689,11 @@ pgp_new_blob(sc_card_t *card, struct blo
-
- /* internal: free a blob including its content */
- static void
--pgp_free_blob(struct blob *blob)
-+pgp_free_blob(pgp_blob_t *blob)
- {
- if (blob) {
- if (blob->parent) {
-- struct blob **p;
-+ pgp_blob_t **p;
-
- /* remove blob from list of parent's children */
- for (p = &blob->parent->files; *p != NULL && *p != blob; p = &(*p)->next)
-@@ -713,14 +713,14 @@ pgp_free_blob(struct blob *blob)
-
- /* internal: iterate through the blob tree, calling a function for each blob */
- static void
--pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
-+pgp_iterate_blobs(pgp_blob_t *blob, int level, void (*func)())
- {
- if (blob) {
- if (level > 0) {
-- struct blob *child = blob->files;
-+ pgp_blob_t *child = blob->files;
-
- while (child != NULL) {
-- struct blob *next = child->next;
-+ pgp_blob_t *next = child->next;
-
- pgp_iterate_blobs(child, level-1, func);
- child = next;
-@@ -733,7 +733,7 @@ pgp_iterate_blobs(struct blob *blob, int
-
- /* internal: read a blob's contents from card */
- static int
--pgp_read_blob(sc_card_t *card, struct blob *blob)
-+pgp_read_blob(sc_card_t *card, pgp_blob_t *blob)
- {
- struct pgp_priv_data *priv = DRVDATA (card);
-
-@@ -780,7 +780,7 @@ pgp_read_blob(sc_card_t *card, struct bl
- * The OpenPGP card has a TLV encoding according ASN.1 BER-encoding rules.
- */
- static int
--pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
-+pgp_enumerate_blob(sc_card_t *card, pgp_blob_t *blob)
- {
- const u8 *in;
- int r;
-@@ -797,7 +797,7 @@ pgp_enumerate_blob(sc_card_t *card, stru
- unsigned int cla, tag, tmptag;
- size_t len;
- const u8 *data = in;
-- struct blob *new;
-+ pgp_blob_t *new;
-
- r = sc_asn1_read_tag(&data, blob->len - (in - blob->data),
- &cla, &tag, &len);
-@@ -827,10 +827,10 @@ pgp_enumerate_blob(sc_card_t *card, stru
-
- /* internal: find a blob by ID below a given parent, filling its contents when necessary */
- static int
--pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
-- struct blob **ret)
-+pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, unsigned int id,
-+ pgp_blob_t **ret)
- {
-- struct blob *child;
-+ pgp_blob_t *child;
- int r;
-
- if ((r = pgp_enumerate_blob(card, blob)) < 0)
-@@ -866,10 +866,10 @@ pgp_get_blob(sc_card_t *card, struct blo
-
- /* Internal: search recursively for a blob by ID below a given root */
- static int
--pgp_seek_blob(sc_card_t *card, struct blob *root, unsigned int id,
-- struct blob **ret)
-+pgp_seek_blob(sc_card_t *card, pgp_blob_t *root, unsigned int id,
-+ pgp_blob_t **ret)
- {
-- struct blob *child;
-+ pgp_blob_t *child;
- int r;
-
- if ((r = pgp_get_blob(card, root, id, ret)) == 0)
-@@ -891,11 +891,11 @@ pgp_seek_blob(sc_card_t *card, struct bl
- }
-
- /* internal: find a blob by tag - pgp_seek_blob with optimizations */
--static struct blob *
-+static pgp_blob_t *
- pgp_find_blob(sc_card_t *card, unsigned int tag)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob = NULL;
-+ pgp_blob_t *blob = NULL;
- int r;
-
- /* Check if current selected blob is which we want to test*/
-@@ -949,7 +949,7 @@ static int
- pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob;
-+ pgp_blob_t *blob;
- unsigned int path_start = 0;
- unsigned int n;
- sc_path_t dummy_path;
-@@ -1030,7 +1030,7 @@ static int
- pgp_list_files(sc_card_t *card, u8 *buf, size_t buflen)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob;
-+ pgp_blob_t *blob;
- unsigned int k;
- int r;
-
-@@ -1066,7 +1066,7 @@ pgp_read_binary(sc_card_t *card, unsigne
- u8 *buf, size_t count, unsigned long flags)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob;
-+ pgp_blob_t *blob;
- int r;
-
- LOG_FUNC_CALLED(card->ctx);
-@@ -1142,7 +1142,7 @@ static int
- pgp_get_pubkey_pem(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob, *mod_blob, *exp_blob;
-+ pgp_blob_t *blob, *mod_blob, *exp_blob;
- sc_pkcs15_pubkey_t pubkey;
- u8 *data;
- size_t len;
-@@ -1337,7 +1337,7 @@ static int
- pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *affected_blob = NULL;
-+ pgp_blob_t *affected_blob = NULL;
- struct do_info *dinfo = NULL;
- int r;
-
-@@ -1611,7 +1611,7 @@ static int
- pgp_update_new_algo_attr(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *algo_blob;
-+ pgp_blob_t *algo_blob;
- unsigned int old_modulus_len; /* Measured in bit */
- unsigned int old_exponent_len;
- const unsigned int tag = 0x00C0 | key_info->keytype;
-@@ -1716,7 +1716,7 @@ pgp_calculate_and_store_fingerprint(sc_c
- u8 *p; /* Use this pointer to set fp_buffer content */
- size_t pk_packet_len;
- unsigned int tag;
-- struct blob *fpseq_blob;
-+ pgp_blob_t *fpseq_blob;
- u8 *newdata;
- int r;
-
-@@ -1805,7 +1805,7 @@ pgp_update_pubkey_blob(sc_card_t *card,
- u8* exponent, size_t exponent_len, u8 key_id)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *pk_blob;
-+ pgp_blob_t *pk_blob;
- unsigned int blob_id;
- sc_pkcs15_pubkey_t pubkey;
- u8 *data = NULL;
-@@ -1947,6 +1947,8 @@ static int pgp_update_card_algorithms(sc
- **/
- static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
- {
-+ struct pgp_priv_data *priv = DRVDATA(card);
-+ pgp_blob_t *algo_blob;
- sc_apdu_t apdu;
- /* Temporary variables to hold APDU params */
- u8 apdu_case;
-@@ -2143,7 +2145,7 @@ pgp_build_extended_header_list(sc_card_t
- };
- size_t comp_to_add = 3;
- size_t req_e_len = 0; /* The exponent length specified in Algorithm Attributes */
-- struct blob *alat_blob;
-+ pgp_blob_t *alat_blob;
- u8 i;
- int r;
-
-@@ -2496,7 +2498,7 @@ static int
- pgp_delete_file(sc_card_t *card, const sc_path_t *path)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob;
-+ pgp_blob_t *blob;
- sc_file_t *file;
- u8 key_id;
- int r;
-@@ -2546,7 +2548,7 @@ pgp_update_binary(sc_card_t *card, unsig
- const u8 *buf, size_t count, unsigned long flags)
- {
- struct pgp_priv_data *priv = DRVDATA(card);
-- struct blob *blob = priv->current;
-+ pgp_blob_t *blob = priv->current;
- int r = SC_SUCCESS;
-
- LOG_FUNC_CALLED(card->ctx);
+++ /dev/null
-From 8a87a4ee9107f250254d5c93c6fd62224c400ce7 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Mon, 14 Jul 2014 01:30:28 +0800
-Subject: [PATCH 24/26] OpenPGP: Fix crash after accessing inexistent file.
-
----
- src/libopensc/card-openpgp.c | 3 ---
- 1 file changed, 3 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -981,7 +981,6 @@ pgp_select_file(sc_card_t *card, const s
- * So we set its size to be the same as max certificate size the card supports. */
- (*ret)->size = priv->max_cert_size;
- }
-- priv->current = NULL;
- LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
- }
-
-@@ -998,7 +997,6 @@ pgp_select_file(sc_card_t *card, const s
- /* This file ID is referred when importing key&certificate via pkcs15init, like above.
- * We pretend to successfully find this inexistent file. */
- if (id == 0x4402 || id == 0x5f48) {
-- priv->current = NULL;
- if (ret == NULL)
- /* No need to return file */
- LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
-@@ -1010,7 +1008,6 @@ pgp_select_file(sc_card_t *card, const s
- }
-
- if (r < 0) { /* failure */
-- priv->current = NULL;
- LOG_FUNC_RETURN(card->ctx, r);
- }
- }
+++ /dev/null
-From da70a41383e2ab81fbcc89fb1067f5a189e0fb97 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Sun, 9 Nov 2014 15:58:40 +0700
-Subject: [PATCH 25/26] Replace hardcode.
-
----
- src/libopensc/card-openpgp.c | 72 +++++++++++++++++++++++++-------------------
- 1 file changed, 41 insertions(+), 31 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -154,6 +154,24 @@ static int pgp_get_pubkey(sc_card_t *,
- static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
- u8 *, size_t);
-
-+/* The DO holding X.509 certificate is constructed but does not contain child DO.
-+ * We should notice this when building fake file system later. */
-+#define DO_CERT 0x7f21
-+/* Control Reference Template of private keys. Ref: Section 4.3.3.7 of OpenPGP card v2 spec.
-+ * Here we seen it as DO just for convenient */
-+#define DO_SIGN 0xb600
-+#define DO_ENCR 0xb800
-+#define DO_AUTH 0xa400
-+/* These DO does not exist. They are defined and used just for ease of implementation */
-+#define DO_SIGN_SYM 0xb601
-+#define DO_ENCR_SYM 0xb801
-+#define DO_AUTH_SYM 0xa401
-+/* Maximum length for response buffer when reading pubkey. This value is calculated with
-+ * 4096-bit key length */
-+#define MAXLEN_RESP_PUBKEY 527
-+/* Gnuk only support 1 key length (2048 bit) */
-+#define MAXLEN_RESP_PUBKEY_GNUK 271
-+
- static struct do_info pgp1_objects[] = { /* OpenPGP card spec 1.1 */
- { 0x004f, SIMPLE, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
- { 0x005b, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
-@@ -194,12 +212,12 @@ static struct do_info pgp1_objects[] =
- { 0x5f35, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
- { 0x5f50, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
- { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
-- { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { DO_AUTH, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { DO_AUTH_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { DO_SIGN, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { DO_SIGN_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { DO_ENCR, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { DO_ENCR_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
- { 0, 0, 0, NULL, NULL },
- };
-
-@@ -248,30 +266,21 @@ static struct do_info pgp2_objects[] =
- { 0x5f52, SIMPLE, READ_ALWAYS | WRITE_NEVER, sc_get_data, NULL },
- /* The 7F21 is constructed DO in spec, but in practice, its content can be retrieved
- * as simple DO (no need to parse TLV). */
-- { 0x7f21, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
-+ { DO_CERT, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
- { 0x7f48, CONSTRUCTED, READ_NEVER | WRITE_NEVER, NULL, NULL },
- { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
-- { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { DO_AUTH, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
- /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
- * However, their R/W access condition may block the process of importing key in pkcs15init.
- * So we set their accesses condition as WRITE_PIN3 (writable). */
-- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { DO_AUTH_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { DO_SIGN, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { DO_SIGN_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
-+ { DO_ENCR, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
-+ { DO_ENCR_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
- { 0, 0, 0, NULL, NULL },
- };
-
--/* The DO holding X.509 certificate is constructed but does not contain child DO.
-- * We should notice this when building fake file system later. */
--#define DO_CERT 0x7f21
--/* Maximum length for response buffer when reading pubkey. This value is calculated with
-- * 4096-bit key length */
--#define MAXLEN_RESP_PUBKEY 527
--/* Gnuk only support 1 key length (2048 bit) */
--#define MAXLEN_RESP_PUBKEY_GNUK 271
--
- #define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
- struct pgp_priv_data {
- pgp_blob_t * mf;
-@@ -755,8 +764,9 @@ pgp_read_blob(sc_card_t *card, pgp_blob_
-
- /* Buffer length for Gnuk pubkey */
- if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
-- (blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
-- || blob->id == 0xa401 || blob->id == 0xb601 || blob->id == 0xb801)) {
-+ (blob->id == DO_AUTH || blob->id == DO_SIGN || blob->id == DO_ENCR
-+ || blob->id == DO_AUTH_SYM || blob->id == DO_SIGN_SYM
-+ || blob->id == DO_ENCR_SYM)) {
- buf_len = MAXLEN_RESP_PUBKEY_GNUK;
- }
-
-@@ -1812,11 +1822,11 @@ pgp_update_pubkey_blob(sc_card_t *card,
- LOG_FUNC_CALLED(card->ctx);
-
- if (key_id == SC_OPENPGP_KEY_SIGN)
-- blob_id = 0xB601;
-+ blob_id = DO_SIGN_SYM;
- else if (key_id == SC_OPENPGP_KEY_ENCR)
-- blob_id = 0xB801;
-+ blob_id = DO_ENCR_SYM;
- else if (key_id == SC_OPENPGP_KEY_AUTH)
-- blob_id = 0xA401;
-+ blob_id = DO_AUTH_SYM;
- else {
- sc_log(card->ctx, "Unknown key id %X.", key_id);
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
-@@ -2514,17 +2524,17 @@ pgp_delete_file(sc_card_t *card, const s
- LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
-
- if (card->type != SC_CARD_TYPE_OPENPGP_GNUK &&
-- (file->id == 0xB601 || file->id == 0xB801 || file->id == 0xA401)) {
-+ (file->id == DO_SIGN_SYM || file->id == DO_ENCR_SYM || file->id == DO_AUTH_SYM)) {
- /* These tags are just symbolic. We don't really delete it. */
- r = SC_SUCCESS;
- }
-- else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB601) {
-+ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_SIGN_SYM) {
- r = gnuk_delete_key(card, 1);
- }
-- else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB801) {
-+ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_ENCR_SYM) {
- r = gnuk_delete_key(card, 2);
- }
-- else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xA401) {
-+ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_AUTH_SYM) {
- r = gnuk_delete_key(card, 3);
- }
- else {
+++ /dev/null
-From b9dae832db54b206a15bcc12e290cef50f31c3d0 Mon Sep 17 00:00:00 2001
-From: george <ggkitsas@yahoo.com>
-Date: Tue, 11 Nov 2014 16:16:15 +0100
-Subject: [PATCH 26/26] hardcode->defines for DO's
-
----
- src/libopensc/card-openpgp.c | 16 ++++++++++++++--
- 1 file changed, 14 insertions(+), 2 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -166,6 +166,18 @@ static int pgp_get_pubkey_pem(sc_card_t
- #define DO_SIGN_SYM 0xb601
- #define DO_ENCR_SYM 0xb801
- #define DO_AUTH_SYM 0xa401
-+/* Private DO's */
-+#define DO_PRIV1 0x0101
-+#define DO_PRIV2 0x0102
-+#define DO_PRIV3 0x0103
-+#define DO_PRIV4 0x0104
-+/* Cardholder information DO's */
-+#define DO_CARDHOLDER 0x65
-+#define DO_NAME 0x5b
-+#define DO_LANG_PREF 0x5f2d
-+#define DO_SEX 0x5f35
-+
-+
- /* Maximum length for response buffer when reading pubkey. This value is calculated with
- * 4096-bit key length */
- #define MAXLEN_RESP_PUBKEY 527
-@@ -859,7 +871,7 @@ pgp_get_blob(sc_card_t *card, pgp_blob_t
- /* Special case:
- * Gnuk does not have default value for children of DO 65 (DOs 5B, 5F2D, 5F35)
- * So, if these blob was not found, we create it. */
-- if (blob->id == 0x65 && (id == 0x5B || id == 0x5F2D || id == 0x5F35)) {
-+ if (blob->id == DO_CARDHOLDER && (id == DO_NAME || id == DO_LANG_PREF || id == DO_SEX)) {
- sc_log(card->ctx, "Create blob %X under %X", id, blob->id);
- child = pgp_new_blob(card, blob, id, sc_file_new());
- if (child) {
-@@ -1206,7 +1218,7 @@ pgp_get_data(sc_card_t *card, unsigned i
- /* For Gnuk card, if there is no certificate, it returns error instead of empty data.
- * So, for this case, we ignore error and consider success */
- if (r == SC_ERROR_DATA_OBJECT_NOT_FOUND && card->type == SC_CARD_TYPE_OPENPGP_GNUK
-- && (tag == DO_CERT || tag == 0x0101 || tag == 0x0102 || tag == 0x0103 || tag == 0x0104)) {
-+ && (tag == DO_CERT || tag == DO_PRIV1 || tag == DO_PRIV2 || tag == DO_PRIV3 || tag == DO_PRIV4)) {
- r = SC_SUCCESS;
- apdu.resplen = 0;
- }
+++ /dev/null
-From 99b5cb53e1da2f0d7692f28dceff8485d4b74daf Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Wed, 10 Dec 2014 03:59:54 +0800
-Subject: [PATCH 1/2] OpenPGP: Remove unused variables and fix type cast.
-
----
- src/libopensc/card-openpgp.c | 10 +++-------
- src/tools/openpgp-tool.c | 4 +---
- 2 files changed, 4 insertions(+), 10 deletions(-)
-
-Index: opensc-20150513/src/libopensc/card-openpgp.c
-===================================================================
---- opensc-20150513.orig/src/libopensc/card-openpgp.c
-+++ opensc-20150513/src/libopensc/card-openpgp.c
-@@ -1966,8 +1966,6 @@ static int pgp_update_card_algorithms(sc
- **/
- static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
- {
-- struct pgp_priv_data *priv = DRVDATA(card);
-- pgp_blob_t *algo_blob;
- sc_apdu_t apdu;
- /* Temporary variables to hold APDU params */
- u8 apdu_case;
-@@ -2396,10 +2394,9 @@ static int pgp_erase_card(sc_card_t *car
- {0, 0x44, 0, 0}
- };
- u8 apdu_lens[10] = {13, 13, 13, 13, 13, 13, 13, 13, 4, 4};
-- u8 buf[SC_MAX_APDU_BUFFER_SIZE];
- u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
- sc_apdu_t apdu;
-- int i, l, r;
-+ u8 i, l, r;
-
- LOG_FUNC_CALLED(ctx);
-
-@@ -2478,7 +2475,7 @@ gnuk_delete_key(sc_card_t *card, u8 key_
- {
- sc_context_t *ctx = card->ctx;
- int r = SC_SUCCESS;
-- u8 *data = NULL;
-+ char *data = NULL;
-
- LOG_FUNC_CALLED(ctx);
-
-@@ -2506,7 +2503,7 @@ gnuk_delete_key(sc_card_t *card, u8 key_
- else if (key_id == 3)
- data = "\x4D\x02\xA4";
-
-- r = pgp_put_data(card, 0x4D, data, strlen(data) + 1);
-+ r = pgp_put_data(card, 0x4D, (const u8 *)data, strlen((const char *)data) + 1);
-
- LOG_FUNC_RETURN(ctx, r);
- }
-@@ -2519,7 +2516,6 @@ pgp_delete_file(sc_card_t *card, const s
- struct pgp_priv_data *priv = DRVDATA(card);
- pgp_blob_t *blob;
- sc_file_t *file;
-- u8 key_id;
- int r;
-
- LOG_FUNC_CALLED(card->ctx);
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -473,7 +473,6 @@ int do_verify(sc_card_t *card, char *typ
- **/
- int delete_key_openpgp(sc_card_t *card, u8 key_id)
- {
-- sc_context_t *ctx = card->ctx;
- char *del_fingerprint = "00:DA:00:C6:14:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00";
- char *del_creationtime = "00:DA:00:CD:04:00:00:00:00";
- /* We need to replace the 4th byte later */
-@@ -520,7 +519,6 @@ int delete_key_openpgp(sc_card_t *card,
-
- int do_delete_key(sc_card_t *card, u8 key_id)
- {
-- sc_context_t *ctx = card->ctx;
- sc_path_t path;
- int r = SC_SUCCESS;
-
+++ /dev/null
-From c71a453ff1e19721a9245b8a2d637eabd9f12e54 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
- <ng.hong.quan@gmail.com>
-Date: Thu, 11 Dec 2014 12:51:15 +0800
-Subject: [PATCH 2/2] openpgp-tool: Fix wrong operator
-
-Used "!=" instead of "|="
----
- src/tools/openpgp-tool.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-Index: opensc-20150513/src/tools/openpgp-tool.c
-===================================================================
---- opensc-20150513.orig/src/tools/openpgp-tool.c
-+++ opensc-20150513/src/tools/openpgp-tool.c
-@@ -639,10 +639,10 @@ int main(int argc, char **argv)
- }
-
- if (opt_delkey)
-- exit_status != do_delete_key(card, key_id);
-+ exit_status |= do_delete_key(card, key_id);
-
- if (opt_erase)
-- exit_status != do_erase(card);
-+ exit_status |= do_erase(card);
-
- out:
- sc_unlock(card);
include $(TOPDIR)/rules.mk
PKG_NAME:=pciutils
-PKG_VERSION:=3.5.1
+PKG_VERSION:=3.5.2
PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
-PKG_MD5SUM:=979e4b1c17e9be83c00113f0f99a8a7b
+PKG_MD5SUM:=3a99141a9f40528d0a0035665a06dc37ddb1ae341658e51b50a76ecf86235efc
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
include $(TOPDIR)/rules.mk
PKG_NAME:=pcsc-lite
-PKG_VERSION:=1.8.16
+PKG_VERSION:=1.8.18
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4164
-PKG_MD5SUM:=14a8ab01c225ba90f03d0720ad714c12
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4179
+PKG_MD5SUM:=b22d32b018f6a1016adba91abfcc63876cca999daa472dd86e953ddd41d00905
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
#!/bin/sh /etc/rc.common
-# Copyright (C) 2009-2011 OpenWrt.org
START=50
-SERVICE_PID_FILE=/var/run/pcscd/pcscd.pid
+USE_PROCD=1
-start() {
- service_start /usr/sbin/pcscd
+start_service() {
+ procd_open_instance
+ procd_set_param command /usr/sbin/pcscd --foreground
+ procd_close_instance
}
-stop() {
- service_stop /usr/sbin/pcscd
+reload_service() {
+ /usr/sbin/pcscd --hotplug
}
--disable-nls \
, $(CONFIGURE_ARGS))
-# Building qemu-ga alone does not require zlib
-CONFIGURE_ARGS+= \
+# Building qemu-ga alone does not require zlib, pixman
+#
+# --disable-tools to disable building pixman which will fail at the moment on
+# octeon mips64 target.
+CONFIGURE_ARGS += \
--cross-prefix=$(TARGET_CROSS) \
- --host-cc=$(HOSTCC) \
+ --host-cc="$(HOSTCC)" \
--target-list='' \
--disable-zlib-test \
- --enable-guest-agent
+ --disable-tools \
+ --without-pixman
+
+ifneq ($(CONFIG_PACKAGE_qemu-ga),)
+CONFIGURE_ARGS += --enable-guest-agent
+endif
+
+MAKE_VARS += V=s
+
+define Build/Compile
+ $(if $(CONFIG_PACKAGE_qemu-ga),$(call Build/Compile/Default,qemu-ga))
+endef
define Package/qemu-ga/install
$(INSTALL_DIR) $(1)/usr/bin
PKG_NAME:=relayctl
PKG_VERSION:=0.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/relayctl/relayctl-$(PKG_VERSION)
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
PKG_NAME:=rng-tools
PKG_VERSION:=5
-PKG_RELEASE:=2
+PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/gkernel/rng-tools/$(PKG_VERSION)/
PKG_MD5SUM:=6726cdc6fae1f5122463f24ae980dd68
PKG_LICENSE:=GPLv2
-PKG_MAINTAINER:=Hannu Nyman <hannu.nyman@iki.fi>
+PKG_MAINTAINER:=Nathaniel Wesley Filardo <nwfilardo@gmail.com>
PKG_FIXUP:=autoreconf
URL:=http://sourceforge.net/projects/gkernel/
endef
+define Package/rng-tools/description
+Daemon for adding entropy to kernel entropy pool. By default it uses
+/dev/urandom as the source but the init script can be modified
+to use a hardware source like /dev/hwrng if present
+endef
+
ifdef CONFIG_USE_UCLIBC
CONFIGURE_VARS += \
LIBS="-largp"
define Package/rng-tools/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/rngd.init $(1)/etc/init.d/rngd
+ $(INSTALL_DIR) $(1)/etc/uci_defaults
+ $(INSTALL_BIN) ./files/rngd.uci_defaults $(1)/etc/uci_defaults/rngd
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/rngtest $(1)/usr/bin/
$(INSTALL_DIR) $(1)/sbin
START=98
-RNGD_INTERVAL=30
-RNGD_AMOUNT=4000
-RNGD_DEVICE="/dev/urandom"
+RNGD_FILLWATER=$(uci -q get system.@rngd[0].fill_watermark)
+RNGD_DEVICE=$(uci -q get system.@rngd[0].device)
+RNGD_ENABLED=$(uci -q get system.@rngd[0].enabled)
+RNGD_PRECMD=$(uci -q get system.@rngd[0].precmd)
+
+: ${RNGD_FILLWATER:=4000}
+
+echo PRECMD=\'$RNGD_PRECMD\'
start() {
- service_start /sbin/rngd -r $RNGD_DEVICE -W $RNGD_AMOUNT
+ [ 1 -eq "$RNGD_ENABLED" ] && {
+ [ -z "${RNGD_PRECMD}" ] || ${RNGD_PRECMD} ${RNGD_DEVICE}
+ service_start /sbin/rngd -r ${RNGD_DEVICE} -W ${RNGD_FILLWATER}
+ }
}
stop() {
--- /dev/null
+#!/bin/sh
+
+uci -q show system.@rngd[0] || {
+ uci add system rngd
+ uci set system.@rngd[0].enabled=0
+ uci set system.@rngd[0].device=/dev/urandom
+ uci commit
+}
$(call Package/rrdtool1/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=database
DEPENDS:=+librrd1
TITLE+= CGI graphing tool
endef
$(call Package/rrdtool1/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=database
DEPENDS:=+librrd1
TITLE+= management tools
endef
#
-# Copyright (C) 2014-2015 OpenWrt.org
+# Copyright (C) 2014-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=rtklib
-PKG_VERSION:=2.4.2_p11
+PKG_VERSION:=2.4.3_b24
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=git://github.com/nunojpg/RTKLIB.git
-PKG_SOURCE_VERSION:=df578f4d6708ae0b648c254d168882285d0053cc
+PKG_SOURCE_URL:=git://github.com/tomojitakasu/RTKLIB.git
+PKG_SOURCE_VERSION:=1cec90a9ffa424908ad1a4ca3d52f33f9b94d1f7
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=BSD-2-Clause
define Package/screen
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Terminal
DEPENDS:=+libncurses
TITLE:=Full-screen terminal window manager
URL:=http://www.gnu.org/software/screen/
define Package/serialconsole
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Terminal
TITLE:=Serial Console - minimal terminal program
URL:=http://sourceforge.net/projects/serialconsole/
endef
--- /dev/null
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=slide-switch
+PKG_VERSION:=0.9.0
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/jefferyto/openwrt-slide-switch.git
+PKG_SOURCE_VERSION:=9171c2ea9cc9cbfb6f27b7bc25a535c8c35ee534
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+PKG_INSTALL:=1
+
+PKG_LICENSE:=GPL-2.0
+PKG_LICENSE_FILES:=COPYING
+PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/slide-switch
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+jshn +jsonfilter
+ TITLE:=Translate switch position changes into normal button presses
+ URL:=https://github.com/jefferyto/openwrt-slide-switch
+endef
+
+define Package/slide-switch/description
+slide-switch translates slide switch position changes into normal button
+presses and releases for OpenWrt / LEDE devices.
+endef
+
+CONFIGURE_ARGS += --with-platform=$(BOARD)
+
+define Package/slide-switch/install
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/button
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/hotplug.d/button/50-slide-switch $(1)/etc/hotplug.d/button
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/init.d/zzz-slide-switch $(1)/etc/init.d
+ if [ -d $(PKG_INSTALL_DIR)/usr/lib/slide-switch ]; then \
+ $(INSTALL_DIR) $(1)/usr/lib/slide-switch; \
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/slide-switch/* $(1)/usr/lib/slide-switch; \
+ fi
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/slide-switch $(1)/usr/sbin
+ $(INSTALL_DIR) $(1)/usr/share/slide-switch
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/slide-switch/functions.sh $(1)/usr/share/slide-switch
+endef
+
+$(eval $(call BuildPackage,slide-switch))
define Package/squashfs-tools/Default
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Filesystem
TITLE:=squashfs-tools
URL:=https://github.com/plougher/squashfs-tools
DEPENDS += +libpthread +zlib \
$(call Package/stoken/Default)
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Encryption
DEPENDS:=+libstoken
MENU:=1
endef
include $(TOPDIR)/rules.mk
PKG_NAME:=sumo
-PKG_VERSION:=0.26.0
+PKG_VERSION:=0.27.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-src-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/sumo
-PKG_MD5SUM:=a3a9c5c5260bad87d1736cc7cda1cbca
+PKG_MD5SUM:=0bb98ab7339aea15b14b633e1b74691f
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-3.0
--- a/configure.ac
+++ b/configure.ac
-@@ -13,11 +13,6 @@ AC_LANG([C++])
+@@ -117,11 +117,6 @@ dnl - - - - - - - - - - - - - - - - - -
case "$host" in
x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux*)
dnl Make sure we are on architecture that supports SIMD
PKG_NAME:=swig
PKG_VERSION:=3.0.7
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
#
-# Copyright (C) 2011-2015 OpenWrt.org
+# Copyright (C) 2011-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/rules.mk
PKG_NAME:=tcsh
-PKG_VERSION:=6.19.00
-PKG_RELEASE:=4
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:= \
- http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/ \
- http://ftp.funet.fi/pub/mirrors/ftp.astron.com/pub/tcsh/old/ \
- ftp://ftp.astron.com/pub/tcsh/ \
- ftp://ftp.astron.com/pub/tcsh/old
-PKG_MD5SUM:=f5f854833578647795bc906dd4bcb5d5
-PKG_LICENSE:=BSD-4-Clause-UC
+PKG_VERSION:=6.19.01
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/tcsh-org/tcsh
+PKG_SOURCE_VERSION:=26ef8ea3dd79fbe5311d80a69d490c0d46151543
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=Copyright
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
define Package/tcsh
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Shells
TITLE:=Enhanced Berkeley UNIX C shell
DEPENDS:=+libncurses
URL:=http://www.tcsh.org/
+++ /dev/null
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -449,7 +449,7 @@ pure:$(P) ${OBJS}
-
- gethost: gethost.c sh.err.h tc.const.h sh.h
- rm -f gethost
-- ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} ${CFLAGS} $(srcdir)/gethost.c
-+ ${CC_FOR_GETHOST} -o gethost ${CPPFLAGS} $(srcdir)/gethost.c
-
- tc.defs.c: gethost host.defs
- @rm -f $@.tmp
+++ /dev/null
---- a/config_f.h
-+++ b/config_f.h
-@@ -135,11 +135,7 @@
- * This can be much slower and no memory statistics will be
- * provided.
- */
--#if defined(__MACHTEN__) || defined(PURIFY) || defined(MALLOC_TRACE) || defined(_OSD_POSIX) || defined(__MVS__) || defined (__CYGWIN__) || defined(__GLIBC__) || defined(__OpenBSD__) || defined(__APPLE__)
- # define SYSMALLOC
--#else
--# undef SYSMALLOC
--#endif
-
- /*
- * USE_ACCESS Use access(2) rather than stat(2) when POSIX is defined.
+++ /dev/null
---- a/sh.proc.c
-+++ b/sh.proc.c
-@@ -48,7 +48,7 @@ RCSID("$tcsh: sh.proc.c,v 3.127 2015/02/
- #endif /* aiws */
-
- #if defined(_BSD) || (defined(IRIS4D) && __STDC__) || defined(__lucid) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
--# if !defined(__ANDROID__)
-+# if !(defined(__ANDROID__) || (defined(__linux__) && !defined(__GLIBC__)))
- # define BSDWAIT
- # endif
- #endif /* _BSD || (IRIS4D && __STDC__) || __lucid || glibc */
define Package/tmux
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Terminal
TITLE:=Terminal multiplexer
DEPENDS:=+libncurses +libevent2 +libpthread +librt
URL:=http://tmux.sourceforge.net/
--- /dev/null
+#
+# Copyright (C) 2016 Shuanglei Tao <tsl0922@gmail.com>
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ttyd
+PKG_VERSION:=1.1.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=https://github.com/tsl0922/ttyd.git
+PKG_SOURCE_VERSION:=$(PKG_VERSION)
+
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+CMAKE_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/ttyd
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Command-line tool for sharing terminal over the web
+ DEPENDS:=+libopenssl +libjson-c +libpthread +libwebsockets-openssl
+ URL:=https://github.com/tsl0922/ttyd
+ SUBMENU:=Terminal
+ MAINTAINER:=Shuanglei Tao <tsl0922@gmail.com>
+endef
+
+define Package/ttyd/description
+ttyd is a command-line tool for sharing terminal over the web.
+endef
+
+define Package/ttyd/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ttyd $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,ttyd))
include $(TOPDIR)/rules.mk
PKG_NAME:=unrar
-PKG_VERSION:=5.4.2
+PKG_VERSION:=5.4.5
PKG_RELEASE:=1
PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rarlab.com/rar
-PKG_MD5SUM:=fb77bcbeac6953f563230634d74a87d7
+PKG_MD5SUM:=588b3fadc04eea7372cbfe98e4709aee
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=UnRAR
PKG_NAME:=watchcat
PKG_VERSION:=1
-PKG_RELEASE:=5
+PKG_RELEASE:=6
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
PKG_LICENSE:=GPL-2.0
pingperiod="$seconds"
if [ "$pingperiod" -ge 0 ]
then
- [ "$pingperiod" -le "$period" ] \
+ [ "$pingperiod" -lt "$period" ] \
|| append_string "error" "pingperiod must be less than period" "; "
else
append_string "error" 'pingperiod is not a valid time value (ex: "30"; "4m"; "6h"; "2d")' "; "
pingperiod="$((period/20))"
fi
}
- [ "$pingperiod" -lt "$period" -o "$mode" = "always" ] \
- || append_string "error" "pingperiod is not recognized" "; "
[ "$forcedelay" -ge 0 ] \
|| append_string "error" "forcedelay must be a integer greater or equal than 0, where 0 means disabled" "; "
include $(TOPDIR)/rules.mk
PKG_NAME:=zoneinfo
-PKG_VERSION:=2016f
-PKG_VERSION_CODE:=2016f
+PKG_VERSION:=2016h
+PKG_VERSION_CODE:=2016h
PKG_RELEASE:=1
#As i couldn't find real license used "Public Domain"
PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz
PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
-PKG_MD5SUM:=b20b3c1618db1984aac685e763de001d
+PKG_MD5SUM:=878f0ec3fd9e4026ea11dd1b649a315a
include $(INCLUDE_DIR)/package.mk
define Download/tzcode
FILE=$(PKG_SOURCE_CODE)
URL=$(PKG_SOURCE_URL)
- MD5SUM:=b93618bb84e38dee102e0e41ec9d13e2
+ MD5SUM:=00c20689d996dea4cf5b45504724ce8f
endef
$(eval $(call Download,tzcode))
define Package/zoneinfo/Default
- SUBMENU:=zoneinfo
+ SUBMENU:=Zoneinfo
TITLE:=Zone Information
SECTION:=utils
CATEGORY:=Utilities
define Package/zsh
SECTION:=utils
CATEGORY:=Utilities
+ SUBMENU:=Shells
TITLE:=The Z shell
DEPENDS:=+libncurses +libncursesw +libpcre +librt
URL:=http://www.zsh.org/