+++ /dev/null
-#
-# 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:=automake
-PKG_VERSION:=1.15
-PKG_RELEASE:=4
-
-PKG_SOURCE_URL:=@GNU/automake
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_MD5SUM:=9a1ddb0e053474d9d1105cfe39b0c48d
-PKG_MAINTAINER:=Heinrich Schuchardt <xypron.glpk@gmx.de>
-PKG_LICENSE:=GPL-3.0+
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/automake
- SECTION:=devel
- CATEGORY:=Development
- TITLE:=automake
- URL:=https://www.gnu.org/software/automake/
- DEPENDS:=+autoconf +perlbase-thread +perlbase-attributes
-endef
-
-define Package/automake/description
- Automake is a tool for automatically generating Makefile.in files compliant
- 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) \
- $(1)/usr/bin/automake-$(PKG_VERSION)
- $(LN) automake-$(PKG_VERSION) $(1)/usr/bin/automake
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/aclocal-$(PKG_VERSION) \
- $(1)/usr/bin/aclocal-$(PKG_VERSION)
- $(LN) aclocal-$(PKG_VERSION) $(1)/usr/bin/aclocal
- $(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 \
- automake-$(PKG_VERSION) automake-$(PKG_VERSION)/Automake \
- automake-$(PKG_VERSION)/am aclocal \
- aclocal-$(PKG_VERSION) aclocal-$(PKG_VERSION)/internal \
- ; do \
- $(INSTALL_DIR) $(1)/usr/share/$$$$dir; \
- for file in $$$$(cd $(PKG_INSTALL_DIR) && \
- find usr/share/$$$$dir -maxdepth 1 -type f); do \
- $(INSTALL_DATA) $$(PKG_INSTALL_DIR)/$$$$file \
- $(1)/$$$$file; \
- done; \
- done
-endef
-
-$(eval $(call BuildPackage,automake))
--- /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:=libpam
+PKG_VERSION:=1.2.0
+PKG_RELEASE:=2
+
+PKG_SOURCE:=Linux-PAM-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://www.linux-pam.org/library/
+PKG_MD5SUM:=ee4a480d77b341c99e8b1375f8f180c0
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+PKG_MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/Linux-PAM-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libpam
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=the Linux-PAM libraries and modules.
+ URL:=http://www.kernel.org/pub/linux/libs/pam
+endef
+
+define Package/libpam/description
+ The Linux-PAM Pluggable Authentication Modules.
+endef
+
+TARGET_CFLAGS += $(FPIC)
+
+define Build/Configure
+ $(call Build/Configure/Default, \
+ --enable-shared \
+ --enable-static \
+ --enable-pamlocking \
+ --disable-prelude \
+ --disable-lckpwdf \
+ --disable-selinux \
+ --disable-nls \
+ --disable-rpath \
+ --disable-nis \
+ --disable-regenerate-docu \
+ --enable-db=no \
+ )
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/lib
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/lib/* $(1)/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include
+endef
+
+define Package/libpam/install
+ $(INSTALL_DIR) $(1)/lib $(1)/lib/security $(1)/lib/security/pam_filter
+ $(INSTALL_DIR) $(1)/etc $(1)/etc/pam.d
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(CP) $(PKG_INSTALL_DIR)/lib/*.so* $(1)/lib/
+ $(CP) $(PKG_INSTALL_DIR)/lib/security/*.so* $(1)/lib/security/
+ $(CP) $(PKG_INSTALL_DIR)/lib/security/pam_filter/* $(1)/lib/security/pam_filter/
+ $(CP) $(PKG_INSTALL_DIR)/etc/* $(1)/etc/
+ $(CP) ./files/* $(1)/etc/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/usr/sbin/
+endef
+
+$(eval $(call BuildPackage,libpam))
--- /dev/null
+# ---------------------------------------------------------------------------#
+# /etc/pam.conf #
+# ---------------------------------------------------------------------------#
+#
+# NOTE
+# ----
+#
+# NOTE: Most program use a file under the /etc/pam.d/ directory to setup their
+# PAM service modules. This file is used only if that directory does not exist.
+# ---------------------------------------------------------------------------#
+
+# Format:
+# serv. module ctrl module [path] ...[args..] #
+# name type flag #
+
--- /dev/null
+#
+# /etc/pam.d/common-account - authorization settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authorization modules that define
+# the central access policy for use on the system. The default is to
+# only deny service to users whose accounts are expired in /etc/shadow.
+#
+
+# here are the per-package modules (the "Primary" block)
+account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
+# here's the fallback if no module succeeds
+account requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+account required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+
+# end of pam-auth-update config
--- /dev/null
+#
+# /etc/pam.d/common-auth - authentication settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authentication modules that define
+# the central authentication scheme for use on the system
+# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
+# traditional Unix authentication mechanisms.
+#
+
+# here are the per-package modules (the "Primary" block)
+auth [success=1 default=ignore] pam_unix.so nullok_secure
+# here's the fallback if no module succeeds
+auth requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+auth required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+
+# end of pam-auth-update config
--- /dev/null
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords. The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords. Without this option,
+# the default is Unix crypt. Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# here are the per-package modules (the "Primary" block)
+password [success=1 default=ignore] pam_unix.so obscure sha512
+# here's the fallback if no module succeeds
+password requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password required pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+
+# end of pam-auth-update config
--- /dev/null
+#
+# /etc/pam.d/common-session - session-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of sessions of *any* kind (both interactive and
+# non-interactive).
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# The pam_umask module will set the umask according to the system default in
+# /etc/login.defs and user settings, solving the problem of different
+# umask settings with different shells, display managers, remote sessions etc.
+# See "man pam_umask".
+session optional pam_umask.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
+# end of pam-auth-update config
--- /dev/null
+#
+# /etc/pam.d/common-session-noninteractive - session-related modules
+# common to all non-interactive services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of all non-interactive sessions.
+#
+
+# here are the per-package modules (the "Primary" block)
+session [default=1] pam_permit.so
+# here's the fallback if no module succeeds
+session requisite pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session required pam_permit.so
+# The pam_umask module will set the umask according to the system default in
+# /etc/login.defs and user settings, solving the problem of different
+# umask settings with different shells, display managers, remote sessions etc.
+# See "man pam_umask".
+session optional pam_umask.so
+# and here are more per-package modules (the "Additional" block)
+session required pam_unix.so
+# end of pam-auth-update config
--- /dev/null
+#
+# /etc/pam.d/other - specify the PAM fallback behaviour
+#
+# Note that this file is used for any unspecified service; for example
+#if /etc/pam.d/cron specifies no session modules but cron calls
+#pam_open_session, the session module out of /etc/pam.d/other is
+#used. If you really want nothing to happen then use pam_permit.so or
+#pam_deny.so as appropriate.
+
+# We fall back to the system default in /etc/pam.d/common-*
+#
+
+auth include common-auth
+account include common-account
+password include common-password
+session include common-session
--- /dev/null
+From 1948dd03d69c1a50e92d7e8868b7d6eabd4873c1 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 16:11:31 +0800
+Subject: [PATCH 1/7] build: always use /lib instead of /lib64.
+
+* configure.ac: OpenWrt does not use /lib64.
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ configure.ac | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fd0e310..306b6e2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -25,15 +25,7 @@ dnl If we use /usr as prefix, use /etc for config files
+ then
+ sysconfdir="/etc"
+ fi
+- if test ${libdir} = '${exec_prefix}/lib'
+- then
+- case "`uname -m`" in
+- x86_64|ppc64|s390x|sparc64)
+- libdir="/lib64" ;;
+- *)
+- libdir="/lib" ;;
+- esac
+- fi
++ libdir="/lib"
+ if test ${sbindir} = '${exec_prefix}/sbin'
+ then
+ sbindir="/sbin"
+--
+1.7.10.4
+
--- /dev/null
+From 1a2e6c979118dce5e79604e88c008c7879d1e4e6 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 18:19:23 +0800
+Subject: [PATCH 2/7] build: ignore pam_rhosts if neither ruserok nor
+ ruserok_af is available.
+
+* configure.ac: check for ruserok and ruserok_af
+* modules/Makefile.am: ignore pam_rhosts/ if it's disabled
+* modules/pam_rhosts/pam_rhosts.c: include stdlib.h for malloc and free
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ configure.ac | 5 ++++-
+ modules/Makefile.am | 11 ++++++++---
+ modules/pam_rhosts/pam_rhosts.c | 1 +
+ 3 files changed, 13 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 306b6e2..084071a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -534,7 +534,10 @@ AC_CHECK_FUNCS(fseeko getdomainname gethostname gettimeofday lckpwdf mkdir selec
+ AC_CHECK_FUNCS(strcspn strdup strspn strstr strtol uname)
+ AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r)
+ AC_CHECK_FUNCS(getgrouplist getline getdelim)
+-AC_CHECK_FUNCS(inet_ntop inet_pton innetgr ruserok_af)
++AC_CHECK_FUNCS(inet_ntop inet_pton innetgr)
++AC_CHECK_FUNCS([ruserok_af ruserok], [break])
++
++AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes -o "$ac_cv_func_ruserok" = yes])
+
+ AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
+ AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
+diff --git a/modules/Makefile.am b/modules/Makefile.am
+index 0c80cea..9ad26a9 100644
+--- a/modules/Makefile.am
++++ b/modules/Makefile.am
+@@ -2,16 +2,21 @@
+ # Copyright (c) 2005, 2006, 2008 Thorsten Kukuk <kukuk@thkukuk.de>
+ #
+
+-SUBDIRS = pam_access pam_cracklib pam_debug pam_deny pam_echo \
++if COND_BUILD_PAM_RHOSTS
++ MAYBE_PAM_RHOSTS = pam_rhosts
++endif
++
++SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \
+ pam_env pam_exec pam_faildelay pam_filter pam_ftp \
+ pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
+ pam_listfile pam_localuser pam_loginuid pam_mail \
+ pam_mkhomedir pam_motd pam_namespace pam_nologin \
+- pam_permit pam_pwhistory pam_rhosts pam_rootok pam_securetty \
++ pam_permit pam_pwhistory pam_rootok pam_securetty \
+ pam_selinux pam_sepermit pam_shells pam_stress \
+ pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
+ pam_tty_audit pam_umask \
+- pam_unix pam_userdb pam_warn pam_wheel pam_xauth
++ pam_unix pam_userdb pam_warn pam_wheel pam_xauth \
++ $(MAYBE_PAM_RHOSTS)
+
+ CLEANFILES = *~
+
+diff --git a/modules/pam_rhosts/pam_rhosts.c b/modules/pam_rhosts/pam_rhosts.c
+index bc9e76f..51ef13e 100644
+--- a/modules/pam_rhosts/pam_rhosts.c
++++ b/modules/pam_rhosts/pam_rhosts.c
+@@ -35,6 +35,7 @@
+ #include <pwd.h>
+ #include <netdb.h>
+ #include <string.h>
++#include <stdlib.h>
+ #include <syslog.h>
+
+ #define PAM_SM_AUTH /* only defines this management group */
+--
+1.7.10.4
+
--- /dev/null
+From bac1ee3033cf22e31730fe3e77ca82bd5ebba692 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 21:18:05 +0800
+Subject: [PATCH 3/7] build: ignore pam_lastlog when logwtmp is not available.
+
+* configure.ac: check logwtmp and set COND_BUILD_PAM_LASTLOG
+* modules/pam_lastlog/Makefile.am: check COND_BUILD_PAM_LASTLOG
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ configure.ac | 2 ++
+ modules/Makefile.am | 8 ++++++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 084071a..ca4bf5b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -536,8 +536,10 @@ AC_CHECK_FUNCS(getutent_r getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r
+ AC_CHECK_FUNCS(getgrouplist getline getdelim)
+ AC_CHECK_FUNCS(inet_ntop inet_pton innetgr)
+ AC_CHECK_FUNCS([ruserok_af ruserok], [break])
++AC_CHECK_FUNCS([logwtmp])
+
+ AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes -o "$ac_cv_func_ruserok" = yes])
++AM_CONDITIONAL([COND_BUILD_PAM_LASTLOG], [test "$ac_cv_func_logwtmp" = yes])
+
+ AC_CHECK_FUNCS(unshare, [UNSHARE=yes], [UNSHARE=no])
+ AM_CONDITIONAL([HAVE_UNSHARE], [test "$UNSHARE" = yes])
+diff --git a/modules/Makefile.am b/modules/Makefile.am
+index 9ad26a9..b98dc5c 100644
+--- a/modules/Makefile.am
++++ b/modules/Makefile.am
+@@ -6,9 +6,13 @@ if COND_BUILD_PAM_RHOSTS
+ MAYBE_PAM_RHOSTS = pam_rhosts
+ endif
+
++if COND_BUILD_PAM_LASTLOG
++ MAYBE_PAM_LASTLOG = pam_lastlog
++endif
++
+ SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \
+ pam_env pam_exec pam_faildelay pam_filter pam_ftp \
+- pam_group pam_issue pam_keyinit pam_lastlog pam_limits \
++ pam_group pam_issue pam_keyinit pam_limits \
+ pam_listfile pam_localuser pam_loginuid pam_mail \
+ pam_mkhomedir pam_motd pam_namespace pam_nologin \
+ pam_permit pam_pwhistory pam_rootok pam_securetty \
+@@ -16,7 +20,7 @@ SUBDIRS := pam_access pam_cracklib pam_debug pam_deny pam_echo \
+ pam_succeed_if pam_tally pam_tally2 pam_time pam_timestamp \
+ pam_tty_audit pam_umask \
+ pam_unix pam_userdb pam_warn pam_wheel pam_xauth \
+- $(MAYBE_PAM_RHOSTS)
++ $(MAYBE_PAM_RHOSTS) $(MAYBE_PAM_LASTLOG)
+
+ CLEANFILES = *~
+
+--
+1.7.10.4
+
--- /dev/null
+From a35daea1b8be768d1b0be6eae157fbf3e5380f92 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 18:22:31 +0800
+Subject: [PATCH 4/7] build: fix build when crypt() is not part of crypt_libs.
+
+* configure.ac: ditto.
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index ca4bf5b..6553c78 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -408,7 +408,7 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" = "xyes"],
+ [crypt_libs="crypt"])
+
+ BACKUP_LIBS=$LIBS
+-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
++AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="${ac_lib:+-l$ac_lib}", LIBCRYPT="")
+ AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
+ LIBS=$BACKUP_LIBS
+ AC_SUBST(LIBCRYPT)
+--
+1.7.10.4
+
--- /dev/null
+From 1563e57ea8ab9d123f765129a6840929ef58ff7a Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 20:38:41 +0800
+Subject: [PATCH 5/7] build: fix doc build.
+
+* Makefile.am: ignore doc/ directory if not ENABLE_REGENERATE_MAN
+* doc/adg/Makefile.am: remove check on ENABLE_REGENERATE_MAN
+* doc/man/Makefile.am: ditto
+* doc/mwg/Makefile.am: ditto
+* doc/sag/Makefile.am: ditto
+* doc/specs/Makefile.am: ignore CC from command line
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ Makefile.am | 5 ++++-
+ doc/adg/Makefile.am | 3 ---
+ doc/man/Makefile.am | 2 --
+ doc/mwg/Makefile.am | 3 ---
+ doc/sag/Makefile.am | 2 --
+ doc/specs/Makefile.am | 2 +-
+ 6 files changed, 5 insertions(+), 12 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3db4e37..5e6592a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -4,7 +4,10 @@
+
+ AUTOMAKE_OPTIONS = 1.9 gnu dist-bzip2 check-news
+
+-SUBDIRS = libpam tests libpamc libpam_misc modules po conf doc examples xtests
++if ENABLE_REGENERATE_MAN
++ MAYBE_DOC = doc
++endif
++SUBDIRS = libpam tests libpamc libpam_misc modules po conf examples xtests $(MAYBE_DOC)
+
+ CLEANFILES = *~
+
+diff --git a/doc/adg/Makefile.am b/doc/adg/Makefile.am
+index 77bd7a9..bec5edc 100644
+--- a/doc/adg/Makefile.am
++++ b/doc/adg/Makefile.am
+@@ -9,7 +9,6 @@ EXTRA_DIST = $(XMLS)
+ XMLS = Linux-PAM_ADG.xml $(shell ls $(srcdir)/pam_*.xml)
+ DEP_XMLS = $(shell ls $(top_srcdir)/doc/man/pam_*.xml)
+
+-if ENABLE_REGENERATE_MAN
+ MAINTAINERCLEANFILES = Linux-PAM_ADG.txt Linux-PAM_ADG.pdf html/*.html
+
+ all: Linux-PAM_ADG.txt html/Linux-PAM_ADG.html Linux-PAM_ADG.pdf
+@@ -51,8 +50,6 @@ html/Linux-PAM_ADG.html: $(XMLS) $(DEP_XMLS)
+ distclean-local:
+ -rm -rf html Linux-PAM_ADG.txt Linux-PAM_ADG.pdf
+
+-endif
+-
+ install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ $(mkinstalldirs) $(DESTDIR)$(pdfdir)
+diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
+index 78c891d..b1dc421 100644
+--- a/doc/man/Makefile.am
++++ b/doc/man/Makefile.am
+@@ -45,7 +45,6 @@ XMLS = pam.3.xml pam.8.xml \
+ misc_conv.3.xml pam_misc_paste_env.3.xml pam_misc_drop_env.3.xml \
+ pam_misc_setenv.3.xml
+
+-if ENABLE_REGENERATE_MAN
+ PAM.8: pam.8
+ pam_get_authtok_noverify.3: pam_get_authtok.3
+ pam_get_authtok_verify.3: pam_get_authtok.3
+@@ -60,4 +59,3 @@ pam_get_item.3: pam_item_types_std.inc.xml pam_item_types_ext.inc.xml
+ pam_set_data.3: pam_item_types_std.inc.xml pam_item_types_ext.inc.xml
+ pam.conf.5: pam.conf-desc.xml pam.conf-dir.xml pam.conf-syntax.xml
+ -include $(top_srcdir)/Make.xml.rules
+-endif
+diff --git a/doc/mwg/Makefile.am b/doc/mwg/Makefile.am
+index 2bbb2d0..f57e297 100644
+--- a/doc/mwg/Makefile.am
++++ b/doc/mwg/Makefile.am
+@@ -9,7 +9,6 @@ EXTRA_DIST = $(XMLS)
+ XMLS = Linux-PAM_MWG.xml $(shell ls $(srcdir)/pam_*.xml)
+ DEP_XMLS = $(shell ls $(top_srcdir)/doc/man/pam_*.xml)
+
+-if ENABLE_REGENERATE_MAN
+ MAINTAINERCLEANFILES = Linux-PAM_MWG.txt Linux-PAM_MWG.pdf html/*.html
+
+ all: Linux-PAM_MWG.txt html/Linux-PAM_MWG.html Linux-PAM_MWG.pdf
+@@ -51,8 +50,6 @@ html/Linux-PAM_MWG.html: $(XMLS) $(DEP_XMLS)
+ distclean-local:
+ -rm -rf html Linux-PAM_MWG.txt Linux-PAM_MWG.pdf
+
+-endif
+-
+ install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+ $(mkinstalldirs) $(DESTDIR)$(pdfdir)
+diff --git a/doc/sag/Makefile.am b/doc/sag/Makefile.am
+index 31816aa..a8b655f 100644
+--- a/doc/sag/Makefile.am
++++ b/doc/sag/Makefile.am
+@@ -10,7 +10,6 @@ XMLS = Linux-PAM_SAG.xml $(shell ls $(srcdir)/pam_*.xml)
+
+ DEP_XMLS = $(shell ls $(top_srcdir)/modules/pam_*/pam_*.xml)
+
+-if ENABLE_REGENERATE_MAN
+ MAINTAINERCLEANFILES = Linux-PAM_SAG.txt Linux-PAM_SAG.pdf html/*.html
+
+ all: Linux-PAM_SAG.txt html/Linux-PAM_SAG.html Linux-PAM_SAG.pdf
+@@ -51,7 +50,6 @@ html/Linux-PAM_SAG.html: $(XMLS) $(DEP_XMLS)
+
+ distclean-local:
+ -rm -rf html Linux-PAM_SAG.txt Linux-PAM_SAG.pdf
+-endif
+
+ install-data-local:
+ $(mkinstalldirs) $(DESTDIR)$(docdir)
+diff --git a/doc/specs/Makefile.am b/doc/specs/Makefile.am
+index 99ecc70..39c850f 100644
+--- a/doc/specs/Makefile.am
++++ b/doc/specs/Makefile.am
+@@ -11,7 +11,7 @@ draft-morgan-pam-current.txt: padout draft-morgan-pam.raw
+
+ AM_YFLAGS = -d
+
+-CC = @CC_FOR_BUILD@
++override CC = @CC_FOR_BUILD@
+ CPPFLAGS = @BUILD_CPPFLAGS@
+ CFLAGS = @BUILD_CFLAGS@
+ LDFLAGS = @BUILD_LDFLAGS@
+--
+1.7.10.4
+
--- /dev/null
+From 2e3ed4c6fb09f84fede589047d37d11783202d34 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 18:16:18 +0800
+Subject: [PATCH 6/7] pam_unix: fix compilation in case rpc/rpc.h is missing.
+
+* modules/pam_unix/pam_unix_passwd.c: conditional compile on the
+ availability of rpc/rpc.h
+
+Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
+---
+ modules/pam_unix/pam_unix_passwd.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c
+index 2d330e5..970724a 100644
+--- a/modules/pam_unix/pam_unix_passwd.c
++++ b/modules/pam_unix/pam_unix_passwd.c
+@@ -336,7 +336,7 @@ static int _do_setpass(pam_handle_t* pamh, const char *forwho,
+ }
+
+ if (on(UNIX_NIS, ctrl) && _unix_comesfromsource(pamh, forwho, 0, 1)) {
+-#ifdef HAVE_NIS
++#if defined(HAVE_NIS) && defined(HAVE_RPC_RPC_H)
+ if ((master=getNISserver(pamh, ctrl)) != NULL) {
+ struct timeval timeout;
+ struct yppasswd yppwd;
+--
+1.7.10.4
+
--- /dev/null
+From c681bd104627139eac2f40fe303e1f67676233e8 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <yszhou4tech@gmail.com>
+Date: Wed, 17 Jun 2015 15:33:43 +0800
+Subject: [PATCH 7/7] Check if innetgr is available at compile time.
+
+innetgr may not be there so make sure that when innetgr is not present
+then we inform about it and not use it.
+
+* modules/pam_group/pam_group.c: ditto
+* modules/pam_succeed_if/pam_succeed_if.c: ditto
+* modules/pam_time/pam_time.c: ditto
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
+---
+ modules/pam_group/pam_group.c | 4 ++++
+ modules/pam_succeed_if/pam_succeed_if.c | 17 +++++++++++++----
+ modules/pam_time/pam_time.c | 4 ++++
+ 3 files changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/modules/pam_group/pam_group.c b/modules/pam_group/pam_group.c
+index be5f20f..6a065ca 100644
+--- a/modules/pam_group/pam_group.c
++++ b/modules/pam_group/pam_group.c
+@@ -656,7 +656,11 @@ static int check_account(pam_handle_t *pamh, const char *service,
+ }
+ /* If buffer starts with @, we are using netgroups */
+ if (buffer[0] == '@')
++#ifdef HAVE_INNETGR
+ good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support");
++#endif
+ /* otherwise, if the buffer starts with %, it's a UNIX group */
+ else if (buffer[0] == '%')
+ good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
+diff --git a/modules/pam_succeed_if/pam_succeed_if.c b/modules/pam_succeed_if/pam_succeed_if.c
+index aa828fc..c0c68a0 100644
+--- a/modules/pam_succeed_if/pam_succeed_if.c
++++ b/modules/pam_succeed_if/pam_succeed_if.c
+@@ -231,18 +231,27 @@ evaluate_notingroup(pam_handle_t *pamh, const char *user, const char *group)
+ }
+ /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */
+ static int
+-evaluate_innetgr(const char *host, const char *user, const char *group)
++evaluate_innetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 1)
+ return PAM_SUCCESS;
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
++
+ return PAM_AUTH_ERR;
+ }
+ /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
+ static int
+-evaluate_notinnetgr(const char *host, const char *user, const char *group)
++evaluate_notinnetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ if (innetgr(group, host, user, NULL) == 0)
+ return PAM_SUCCESS;
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
+ return PAM_AUTH_ERR;
+ }
+
+@@ -387,14 +396,14 @@ evaluate(pam_handle_t *pamh, int debug,
+ const void *rhost;
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ rhost = NULL;
+- return evaluate_innetgr(rhost, user, right);
++ return evaluate_innetgr(pamh, rhost, user, right);
+ }
+ /* (Rhost, user) is not in this group. */
+ if (strcasecmp(qual, "notinnetgr") == 0) {
+ const void *rhost;
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ rhost = NULL;
+- return evaluate_notinnetgr(rhost, user, right);
++ return evaluate_notinnetgr(pamh, rhost, user, right);
+ }
+ /* Fail closed. */
+ return PAM_SERVICE_ERR;
+diff --git a/modules/pam_time/pam_time.c b/modules/pam_time/pam_time.c
+index c94737c..0b34a14 100644
+--- a/modules/pam_time/pam_time.c
++++ b/modules/pam_time/pam_time.c
+@@ -555,7 +555,11 @@ check_account(pam_handle_t *pamh, const char *service,
+ }
+ /* If buffer starts with @, we are using netgroups */
+ if (buffer[0] == '@')
++#ifdef HAVE_INNETGR
+ good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++ pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support");
++#endif
+ else
+ good &= logic_field(pamh, user, buffer, count, is_same);
+ D(("with user: %s", good ? "passes":"fails" ));
+--
+1.7.10.4
+
--- /dev/null
+#
+# 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:=libsodium
+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:=b58928d035064b2a46fb564937b83540
+
+PKG_FIXUP:=libtool autoreconf
+PKG_USE_MIPS16:=0
+PKG_INSTALL:=1
+
+PKG_MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
+PKG_LICENSE:=ISC
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libsodium
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=P(ortable|ackageable) NaCl-based crypto library
+ URL:=https://github.com/jedisct1/libsodium
+ MAINTAINER:=Damiano Renfer <damiano.renfer@gmail.com>
+endef
+
+define Package/libsodium/description
+ NaCl (pronounced "salt") is a new easy-to-use high-speed software library for network communication, encryption, decryption, signatures, etc.
+ NaCl's goal is to provide all of the core operations needed to build higher-level cryptographic tools.
+ Sodium is a portable, cross-compilable, installable, packageable fork of NaCl (based on the latest released upstream version nacl-20110221), with a compatible API.
+ The design choices, particularly in regard to the Curve25519 Diffie-Hellman function, emphasize security (whereas NIST curves emphasize "performance" at the cost of security), and "magic constants" in NaCl/Sodium have clear rationales.
+ The same cannot be said of NIST curves, where the specific origins of certain constants are not described by the standards.
+ And despite the emphasis on higher security, primitives are faster across-the-board than most implementations of the NIST standards.
+endef
+
+define Package/libsodium/config
+menu "Configuration"
+ depends on PACKAGE_libsodium
+ config LIBSODIUM_MINIMAL
+ bool "Compile only what is required for the high-level API (no aes128ctr), should be fine in most cases."
+ default y
+endmenu
+endef
+
+CONFIGURE_ARGS+= \
+ --disable-ssp \
+ $(if $(CONFIG_LIBSODIUM_MINIMAL),--enable-minimal=yes,--enable-minimal=no)
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/sodium
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium.h $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/sodium/*.h $(1)/usr/include/sodium
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.{a,so*} $(1)/usr/lib
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsodium.pc $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libsodium/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsodium.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libsodium))
+++ /dev/null
-#
-# Copyright (C) 2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=bogofilter
-PKG_VERSION:=1.2.4
-PKG_RELEASE:=4
-
-PKG_LICENSE:=GPLv2
-PKG_LICENSE_FILES:=COPYING
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@SF/bogofilter
-PKG_MD5SUM:=d0a5eebb3274b23ceabe766a6443a1c5
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bogofilter
- SECTION:=mail
- CATEGORY:=Mail
- DEPENDS:=+libdb47
- TITLE:=bogofilter
- MAINTAINER:=W. Michael Petullo <mike@flyn.org>
- URL:=http://bogofilter.sourceforge.net/
-endef
-
-define Package/bogofilter/description
- Bogofilter is a fast Bayesian spam filter
-endef
-
-CONFIGURE_ARGS += \
- --disable-unicode \
- --with-libdb-prefix=$(STAGING_DIR) \
- --with-included-gsl
-
-define Package/bogofilter/install
- $(INSTALL_DIR) $(1)/etc/ \
- $(1)/usr/bin \
- $(1)/usr/sbin
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/bogofilter.cf.example $(1)/etc/bogofilter.cf
- $(INSTALL_BIN) ./files/postfix-bogofilter $(1)/usr/sbin/postfix-bogofilter
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_compact $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_copy $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bf_tar $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogofilter $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogolexer $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogotune $(1)/usr/bin/
- $(CP) $(PKG_INSTALL_DIR)/usr/bin/bogoutil $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,bogofilter))
+++ /dev/null
-#!/bin/sh
-
-FILTER=/usr/bin/bogofilter
-
-# Attempt to read from bogofilter configuration.
-FILTER_DIR=$(cat /etc/bogofilter.cf | sed 's/#.*//g' | grep ^bogofilter_dir | awk -F = '{ print $2 }')
-
-# WARNING! The -i is crucial, else you may see
-# messages truncated at the first period that is alone on a line
-# (which can happen with several kinds of messages, particularly
-# quoted-printable)
-# -G is ignored before Postfix 2.3 and tells it that the message
-# does not originate on the local system (Gateway submission),
-# so Postfix avoids some of the local expansions that can leave
-# misleading traces in headers, such as local address
-# canonicalizations.
-POSTFIX="/usr/sbin/sendmail -G -i"
-
-# No bogofilter_dir set in /etc/bogofilter.cf; fall back on directory
-# which persists across reboots.
-if [ -z "$FILTER_DIR" ]; then
- FILTER_DIR=/etc/bogofilter
- export BOGOFILTER_DIR=$FILTER_DIR
-fi
-
-# Exit codes from <sysexits.h>
-EX_TEMPFAIL=75
-EX_UNAVAILABLE=69
-
-cd $FILTER_DIR || \
- { echo $FILTER_DIR does not exist; exit $EX_TEMPFAIL; }
-
-# Clean up when done or when aborting.
-trap "rm -f msg.$$ ; exit $EX_TEMPFAIL" 0 1 2 3 15
-
-# bogofilter -e returns: 0 for OK, nonzero for error
-rm -f msg.$$ || exit $EX_TEMPFAIL
-$FILTER -p -e > msg.$$ || exit $EX_TEMPFAIL
-
-exec <msg.$$ || exit $EX_TEMPFAIL
-rm -f msg.$$ # safe, we hold the file descriptor
-exec $POSTFIX "$@"
-exit $EX_TEMPFAIL
+++ /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:=apache
-PKG_VERSION:=2.4.25
-PKG_RELEASE:=1
-PKG_SOURCE_NAME:=httpd
-PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
-PKG_LICENSE:=Apache License
-
-PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=@APACHE/httpd/
-PKG_MD5SUM:=2826f49619112ad5813c0be5afcc7ddb
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/apache/Default
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=Web Servers/Proxies
- TITLE:=The Apache Web Server
- URL:=http://httpd.apache.org/
-endef
-
-define Package/apache/Default/description
- The Apache Web Server is a powerful and flexible HTTP/1.1 compliant
- web server. Originally designed as a replacement for the NCSA HTTP
- Server, it has grown to be the most popular web server on the Internet.
-endef
-
-define Package/apache
-$(call Package/apache/Default)
- DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc
-endef
-
-define Package/apache/description
-$(call Package/apache/Default/description)
- .
- This package contains the Apache web server and utility programs.
- .
- Take care that you don't include apache at the moment into your image
- please select it only as module because busybox will override
- /usr/sbin/httpd. It'll be solved soon. If you need to include this
- package in the image anyway, remove httpd from busybox
- (Base system --> Configuration --> Networking Utilities --> httpd).
- Also you should take care for the initscripts, apache's httpd isn't
- compatible with the one from busybox, so if you want to use apache
- for running your webif, you'll need to change the parameters in the
- scripts and configure the rest in /etc/httpd.conf.
-endef
-
-define Package/apache/conffiles
-/etc/apache/httpd.conf
-/etc/apache/extra/httpd-autoindex.conf
-/etc/apache/extra/httpd-dav.conf
-/etc/apache/extra/httpd-default.conf
-/etc/apache/extra/httpd-info.conf
-/etc/apache/extra/httpd-languages.conf
-/etc/apache/extra/httpd-manual.conf
-/etc/apache/extra/httpd-mpm.conf
-/etc/apache/extra/httpd-multilang-errordoc.conf
-/etc/apache/extra/httpd-ssl.conf
-/etc/apache/extra/httpd-userdir.conf
-/etc/apache/extra/httpd-vhosts.conf
-/etc/apache/magic
-/etc/apache/mime.types
-endef
-
-define Package/apache-icons
-$(call Package/apache/Default)
- TITLE:=Icons from Apache
- DEPENDS:=apache
-endef
-
-define Package/apache-icons/description
-$(call Package/apache/Default/description)
- .
- This package contains the icons from Apache.
-endef
-
-TARGET_CFLAGS += $(FPIC)
-TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-TARGET_LDFLAGS += -lpthread
-
-define Build/Configure
- $(call Build/Configure/Default, \
- --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
- --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
- --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
- --enable-http \
- --with-crypto \
- --with-sqlit3="$(STAGING_DIR)/usr" \
- --with-openssl="$(STAGING_DIR)/usr" \
- --enable-ssl \
- --enable-proxy \
- --disable-disk-cache \
- --enable-maintainer-mode \
- --with-mpm=prefork \
- --with-mpm=worker \
- --enable-mime-magic \
- --without-suexec-bin \
- --sysconfdir=/etc/apache \
- ap_cv_void_ptr_lt_long=no \
- logfiledir="/var/log" \
- runtimedir="/var/run" \
- EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
- )
-endef
-
-define Build/InstallDev
- rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
- $(PKG_INSTALL_DIR)/usr/share/manual/
- # if you need docs take a look into the build-dir :)
- $(INSTALL_DIR) $(1)/etc
- $(CP) $(PKG_INSTALL_DIR)/etc/* \
- $(1)/etc
- $(INSTALL_DIR) $(1)/usr/include/apache
- $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
- $(1)/usr/include/apache
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
- $(1)/usr/lib
- $(INSTALL_DIR) $(1)/usr/sbin
- $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
- $(1)/usr/sbin
- $(INSTALL_DIR) $(1)/usr/share
- $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
- $(1)/usr/share
-endef
-
-define Package/apache/preinst
- rm /usr/sbin/httpd
- echo -e "You should take a look in the initscripts, busybox's httpd \n\
- uses some parameters which are maybe unsupported by apache."
-endef
-
-define Package/apache/install
- $(INSTALL_DIR) $(1)/usr/sbin
- # we don't need apxs on the router, it's just for building apache modules.
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
- $(INSTALL_DIR) $(1)/usr/share
- $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
- $(INSTALL_DIR) $(1)/etc/apache
- $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
-endef
-
-define Package/apache/postrm
- rm -rf /usr/sbin/httpd
- ln -s /bin/busybox /usr/sbin/httpd
- echo -e "You may need to change your initscripts back for the use \n\
- with busybox's httpd."
-endef
-
-define Package/apache-icons/install
- $(INSTALL_DIR) $(1)/usr/share
- $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
-endef
-
-$(eval $(call BuildPackage,apache))
-$(eval $(call BuildPackage,apache-icons))
+++ /dev/null
---- a/server/Makefile.in
-+++ b/server/Makefile.in
-@@ -26,7 +26,10 @@ gen_test_char: $(gen_test_char_OBJECTS)
- $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
-
- test_char.h: gen_test_char
-- ./gen_test_char > test_char.h
-+ true
-+# ./gen_test_char > test_char.h
-+# doesn't matter if you run it on the buildhost or on an wl500gd,
-+# same output on both, so i just patched in the test_char.h :).
-
- util.lo: test_char.h
-
+++ /dev/null
-Index: httpd-2.4.25/server/test_char.h
-===================================================================
---- /dev/null
-+++ httpd-2.4.25/server/test_char.h
-@@ -0,0 +1,23 @@
-+/* this file is automatically generated by gen_test_char, do not edit */
-+#define T_ESCAPE_SHELL_CMD (1)
-+#define T_ESCAPE_PATH_SEGMENT (2)
-+#define T_OS_ESCAPE_PATH (4)
-+#define T_HTTP_TOKEN_STOP (8)
-+#define T_ESCAPE_LOGITEM (16)
-+#define T_ESCAPE_FORENSIC (32)
-+
-+static const unsigned char test_char_table[256] = {
-+ 32,62,62,62,62,62,62,62,62,62,63,62,62,62,62,62,62,62,62,62,
-+ 62,62,62,62,62,62,62,62,62,62,62,62,14,0,23,6,1,38,1,1,
-+ 9,9,1,0,8,0,0,10,0,0,0,0,0,0,0,0,0,0,40,15,
-+ 15,8,15,15,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-+ 0,0,0,0,0,0,0,0,0,0,0,15,31,15,7,0,7,0,0,0,
-+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-+ 0,0,0,15,39,15,1,62,54,54,54,54,54,54,54,54,54,54,54,54,
-+ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
-+ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
-+ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
-+ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
-+ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,
-+ 54,54,54,54,54,54,54,54,54,54,54,54,54,54,54,54
-+};
-Index: httpd-2.4.25/server/util.c
-===================================================================
---- httpd-2.4.25.orig/server/util.c
-+++ httpd-2.4.25/server/util.c
-@@ -96,6 +96,16 @@
- #undef APLOG_MODULE_INDEX
- #define APLOG_MODULE_INDEX AP_CORE_MODULE_INDEX
-
-+#define T_ESCAPE_SHELL_CMD (0x01)
-+#define T_ESCAPE_PATH_SEGMENT (0x02)
-+#define T_OS_ESCAPE_PATH (0x04)
-+#define T_HTTP_TOKEN_STOP (0x08)
-+#define T_ESCAPE_LOGITEM (0x10)
-+#define T_ESCAPE_FORENSIC (0x20)
-+#define T_ESCAPE_URLENCODED (0x40)
-+#define T_HTTP_CTRLS (0x80)
-+#define T_VCHAR_OBSTEXT (0x100)
-+
- /*
- * Examine a field value (such as a media-/content-type) string and return
- * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
+++ /dev/null
-Index: httpd-2.4.25/build/mkconfNW.awk
-===================================================================
---- httpd-2.4.25.orig/build/mkconfNW.awk
-+++ httpd-2.4.25/build/mkconfNW.awk
-@@ -23,7 +23,7 @@ BEGIN {
- A["sysconfdir"] = "conf"
- A["iconsdir"] = "icons"
- A["manualdir"] = "manual"
-- A["runtimedir"] = "logs"
-+ A["runtimedir"] = "log"
- A["errordir"] = "error"
- A["proxycachedir"] = "proxy"
-
-Index: httpd-2.4.25/config.layout
-===================================================================
---- httpd-2.4.25.orig/config.layout
-+++ httpd-2.4.25/config.layout
-@@ -28,8 +28,8 @@
- cgidir: ${datadir}/cgi-bin
- includedir: ${prefix}/include
- localstatedir: ${prefix}
-- runtimedir: ${localstatedir}/logs
-- logfiledir: ${localstatedir}/logs
-+ runtimedir: ${localstatedir}/log
-+ logfiledir: ${localstatedir}/log
- proxycachedir: ${localstatedir}/proxy
- </Layout>
-
-@@ -150,7 +150,7 @@
- includedir: ${prefix}/include
- localstatedir: /var${prefix}
- runtimedir: ${localstatedir}/run
-- logfiledir: ${localstatedir}/logs
-+ logfiledir: ${localstatedir}/log
- proxycachedir: ${localstatedir}/proxy
- </Layout>
-
+++ /dev/null
-Index: httpd-2.4.25/include/scoreboard.h
-===================================================================
---- httpd-2.4.25.orig/include/scoreboard.h
-+++ httpd-2.4.25/include/scoreboard.h
-@@ -40,7 +40,7 @@ extern "C" {
-
- /* Scoreboard file, if there is one */
- #ifndef DEFAULT_SCOREBOARD
--#define DEFAULT_SCOREBOARD "logs/apache_runtime_status"
-+#define DEFAULT_SCOREBOARD "log/apache_runtime_status"
- #endif
-
- /* Scoreboard info on a process is, for now, kept very brief ---
+++ /dev/null
-Index: httpd-2.4.25/docs/conf/httpd.conf.in
-===================================================================
---- httpd-2.4.25.orig/docs/conf/httpd.conf.in
-+++ httpd-2.4.25/docs/conf/httpd.conf.in
-@@ -63,7 +63,6 @@ Listen @@Port@@
- # Example:
- # LoadModule foo_module modules/mod_foo.so
- #
--@@LoadModule@@
-
- <IfModule unixd_module>
- #
-@@ -74,8 +73,8 @@ Listen @@Port@@
- # It is usually good practice to create a dedicated user and group for
- # running httpd, as with most system services.
- #
--User daemon
--Group daemon
-+User nobody
-+Group nogroup
-
- </IfModule>
-
-@@ -188,7 +187,7 @@ ErrorLog "@rel_logfiledir@/error_log"
- # Possible values include: debug, info, notice, warn, error, crit,
- # alert, emerg.
- #
--LogLevel warn
-+LogLevel debug
-
- <IfModule log_config_module>
- #
-@@ -330,7 +329,7 @@ LogLevel warn
- # contents of the file itself to determine its type. The MIMEMagicFile
- # directive tells the module where the hint definitions are located.
- #
--#MIMEMagicFile @rel_sysconfdir@/magic
-+MIMEMagicFile @rel_sysconfdir@/magic
-
- #
- # Customizable error responses come in three flavors:
-@@ -360,7 +359,7 @@ LogLevel warn
- # Defaults: EnableMMAP On, EnableSendfile Off
- #
- #EnableMMAP off
--#EnableSendfile on
-+EnableSendfile off
-
- # Supplemental configuration
- #
-@@ -411,8 +410,8 @@ Include @rel_sysconfdir@/extra/proxy-htm
- # starting without SSL on platforms with no /dev/random equivalent
- # but a statically compiled-in mod_ssl.
- #
--<IfModule ssl_module>
--SSLRandomSeed startup builtin
--SSLRandomSeed connect builtin
--</IfModule>
-+#<IfModule ssl_module>
-+#SSLRandomSeed startup builtin
-+#SSLRandomSeed connect builtin
-+#</IfModule>
-
+++ /dev/null
-#
-# Copyright (C) 2007-2014 OpenWrt.org
-# Copyright (C) 2014-2016 Baptiste Jonglez
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=bmon
-PKG_VERSION:=4.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://github.com/tgraf/bmon/releases/download/v$(PKG_VERSION)/
-PKG_MD5SUM:=02fdc312b8ceeb5786b28bf905f54328f414040ff42f45c83007f24b76cc9f7a
-PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org>
-PKG_LICENSE:=MIT
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bmon
- SECTION:=net
- CATEGORY:=Network
- DEPENDS:=+libncursesw +libnl-core +libnl-route +confuse +terminfo
- TITLE:=bmon is a portable bandwidth monitor
- URL:=https://github.com/tgraf/bmon/
-endef
-
-define Package/bmon/description
- bmon is a portable bandwidth monitor
- and rate estimator running on various
- operating systems. It supports various
- input methods for different architectures.
-endef
-
-CONFIGURE_ARGS += \
- --disable-cnt-workaround \
-
-CONFIGURE_VARS += \
- ac_cv_lib_nl_nl_connect=no \
-
-# Needed to compile some objects
-TARGET_CFLAGS+= -std=gnu99
-
-define Package/bmon/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bmon $(1)/usr/sbin/
-endef
-
-$(eval $(call BuildPackage,bmon))
+++ /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:=daemonlogger
-PKG_VERSION:=1.2.1
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=@SF/daemonlogger
-PKG_MD5SUM:=acb64aa6cd5777e297569f100b5c39ee
-
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=COPYING
-
-PKG_MAINTAINER:=Mirko Vogt <mirko@openwrt.org>
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/daemonlogger
- SECTION:=net
- CATEGORY:=Network
- DEPENDS:=+libpcap +libdnet
- TITLE:=Software Network Tap
- URL:=http://www.snort.org/snort-downloads/additional-downloads
-endef
-
-CONFIGURE_VARS += \
- BUILD_CC="$(TARGET_CC)" \
- HOSTCC="$(HOSTCC)"
-
-MAKE_FLAGS := CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"
-
-define Package/daemonlogger/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/daemonlogger $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,daemonlogger))
+++ /dev/null
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=davfs2
-PKG_VERSION:=1.5.4
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://download.savannah.gnu.org/releases/davfs2/
-PKG_MD5SUM:=c9f0b557275b7ec88fec751bf22f30cf
-
-PKG_FIXUP:=gettext-version autoreconf
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/davfs2
- SECTION:=net
- CATEGORY:=Network
- SUBMENU:=Filesystem
- DEPENDS=+libneon +kmod-fuse +libfuse
- TITLE:=Mount a WebDAV resource as a regular file system.
- URL:=http://savannah.nongnu.org/projects/davfs2/
- MAINTAINER:=Federico Di Marco <fededim@gmail.com>
-endef
-
-define Package/davfs2/description
- Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-protocol,
- allows authoring of resources on a remote web server.davfs2 provides the ability to
- access such resources like a typical filesystem, allowing for use by standard
- applications with no built-in support for WebDAV.
-
- davfs2 is designed to fully integrate into the filesystem semantics of Unix-like
- systems (mount, umount, etc.). davfs2 makes mounting by unprivileged users as easy
- and secure as possible.
-
- davfs2 does extensive caching to make the file system responsive, to avoid
- unnecessary network traffic and to prevent data loss, and to cope for slow or
- unreliable connections.
-
- davfs2 will work with most WebDAV servers needing little or no configuration.
-endef
-
-define Package/davfs2/conffiles
-/etc/davfs2/davfs2.conf
-endef
-
-TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
-
-TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-
-CONFIGURE_VARS += \
- LDFLAGS="$(TARGET_LDFLAGS) -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib"
-
-CONFIGURE_ARGS += --with-neon="$(STAGING_DIR)/usr"
-
-define Package/davfs2/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mount.davfs $(1)/usr/sbin/
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/umount.davfs $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc
- $(INSTALL_DIR) $(1)/etc/davfs2
- $(INSTALL_DATA) files/$(PKG_NAME).conf $(1)/etc/davfs2
-endef
-
-$(eval $(call BuildPackage,davfs2))
+++ /dev/null
-#
-# davfs2 configuration file
-# please see http://linux.die.net/man/5/davfs2.conf for details
-#
-
-dav_user nobody
-dav_group nogroup
-cache_dir /tmp/davfs2
-cache_size 4
+++ /dev/null
---- a/src/cache.c
-+++ b/src/cache.c
-@@ -58,7 +58,7 @@
- #ifdef HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
--#include <sys/xattr.h>
-+#include <linux/xattr.h>
-
- #include <ne_alloc.h>
- #include <ne_string.h>
---- a/src/webdav.c
-+++ b/src/webdav.c
-@@ -2033,7 +2033,7 @@ ssl_verify(void *userdata, int failures,
- len = getline(&s, &n, stdin);
- if (len < 0)
- abort();
-- if (rpmatch(s) > 0)
-+ if ((s[0]=='y' || s[0]=='Y') > 0)
- ret = 0;
- free(s);
- }
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -42,7 +42,7 @@ DAV_CHECK_NEON
- # Checks for header files.
- AC_HEADER_DIRENT
- AC_HEADER_STDC
--AC_CHECK_HEADERS([fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h syslog.h termios.h unistd.h utime.h])
-+AC_CHECK_HEADERS([error.h fcntl.h libintl.h langinfo.h limits.h locale.h mntent.h stddef.h stdint.h stdlib.h string.h sys/file.h sys/mount.h sys/time.h sys/select.h sys/types.h syslog.h termios.h unistd.h utime.h])
-
- # Checks for typedefs, structures, and compiler characteristics.
- AC_C_CONST
-@@ -78,7 +78,7 @@ AC_FUNC_SELECT_ARGTYPES
- AC_FUNC_STRFTIME
- AC_FUNC_STAT
- AC_FUNC_UTIME_NULL
--AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime])
-+AC_CHECK_FUNCS([endpwent ftruncate getmntent memset mkdir nl_langinfo rpmatch select setlocale strcasecmp strchr strdup strerror strpbrk strrchr strstr strtol strtoull utime canonicalize_file_name fopencookie])
-
- # Misc.
- DAV_DEFAULTS
---- a/src/cache.c
-+++ b/src/cache.c
-@@ -19,12 +19,12 @@
-
-
- #include "config.h"
-+#include "compat.h"
-
- #ifdef HAVE_DIRENT_H
- #include <dirent.h>
- #endif
- #include <errno.h>
--#include <error.h>
- #ifdef HAVE_FCNTL_H
- #include <fcntl.h>
- #endif
---- a/src/dav_fuse.c
-+++ b/src/dav_fuse.c
-@@ -47,6 +47,9 @@
- #ifdef HAVE_SYS_STAT_H
- #include <sys/stat.h>
- #endif
-+#ifdef HAVE_SYS_SELECT_H
-+#include <sys/select.h>
-+#endif
-
- #include "defaults.h"
- #include "mount_davfs.h"
---- a/src/kernel_interface.c
-+++ b/src/kernel_interface.c
-@@ -19,8 +19,8 @@
-
-
- #include "config.h"
-+#include "compat.h"
-
--#include <error.h>
- #ifdef HAVE_FCNTL_H
- #include <fcntl.h>
- #endif
-@@ -51,6 +51,9 @@
- #ifdef HAVE_SYS_STAT_H
- #include <sys/stat.h>
- #endif
-+#ifdef HAVE_SYS_TYPES_H
-+#include <sys/types.h>
-+#endif
- #include <sys/wait.h>
-
- #include "defaults.h"
---- a/src/mount_davfs.c
-+++ b/src/mount_davfs.c
-@@ -19,10 +19,10 @@
-
-
- #include "config.h"
-+#include "compat.h"
-
- #include <ctype.h>
- #include <errno.h>
--#include <error.h>
- #ifdef HAVE_FCNTL_H
- #include <fcntl.h>
- #endif
---- a/src/umount_davfs.c
-+++ b/src/umount_davfs.c
-@@ -19,8 +19,8 @@
-
-
- #include "config.h"
-+#include "compat.h"
-
--#include <error.h>
- #include <errno.h>
- #include <getopt.h>
- #ifdef HAVE_LIBINTL_H
---- a/src/webdav.c
-+++ b/src/webdav.c
-@@ -19,9 +19,9 @@
-
-
- #include "config.h"
-+#include "compat.h"
-
- #include <errno.h>
--#include <error.h>
- #ifdef HAVE_FCNTL_H
- #include <fcntl.h>
- #endif
-@@ -368,6 +368,7 @@ dav_init_webdav(const dav_args *args)
- error(EXIT_FAILURE, errno, _("socket library initialization failed"));
-
- if (args->neon_debug & ~NE_DBG_HTTPPLAIN) {
-+#ifdef HAVE_FOPENCOOKIE
- char *buf = malloc(log_bufsize);
- cookie_io_functions_t *log_func = malloc(sizeof(cookie_io_functions_t));
- if (!log_func) abort();
-@@ -380,6 +381,9 @@ dav_init_webdav(const dav_args *args)
- error(EXIT_FAILURE, errno,
- _("can't open stream to log neon-messages"));
- ne_debug_init(log_stream, args->neon_debug);
-+#else
-+ error(EXIT_FAILURE, 0, "neon debugging unsupported");
-+#endif
- }
-
- session = ne_session_create(args->scheme, args->host, args->port);
---- /dev/null
-+++ b/src/compat.h
-@@ -0,0 +1,64 @@
-+#ifndef _COMPAT_H
-+#define _COMPAT_H
-+
-+#ifndef _PATH_MOUNTED
-+# define _PATH_MOUNTED "/proc/mounts"
-+#endif
-+
-+#ifndef _PATH_MNTTAB
-+# define _PATH_MNTTAB "/etc/fstab"
-+#endif
-+
-+#ifdef HAVE_ERROR_H
-+# include <error.h>
-+#else
-+# include <stdio.h>
-+# include <stdarg.h>
-+# include <stdlib.h>
-+# include <string.h>
-+static void error_at_line(int status, int errnum, const char *filename,
-+ unsigned int linenum, const char *format, ...)
-+{
-+ va_list ap;
-+
-+ fflush(stdout);
-+
-+ if (filename != NULL)
-+ fprintf(stderr, "%s:%u: ", filename, linenum);
-+
-+ va_start(ap, format);
-+ vfprintf(stderr, format, ap);
-+ va_end(ap);
-+
-+ if (errnum != 0)
-+ fprintf(stderr, ": %s", strerror(errnum));
-+
-+ fprintf(stderr, "\n");
-+
-+ if (status != 0)
-+ exit(status);
-+}
-+
-+#define error(status, errnum, format...) \
-+ error_at_line(status, errnum, NULL, 0, format)
-+
-+#endif /* HAVE_ERROR_H */
-+
-+#ifndef HAVE_CANONICALIZE_FILE_NAME
-+#include <limits.h>
-+#include <string.h>
-+#include <stdlib.h>
-+static char * canonicalize_file_name(const char *path)
-+{
-+ char buf[PATH_MAX] = { };
-+
-+ snprintf(buf, sizeof(buf) - 1, "%s", path);
-+
-+ if (!realpath(path, buf))
-+ return NULL;
-+
-+ return strdup(buf);
-+}
-+#endif
-+
-+#endif /* _COMPAT_H */
+++ /dev/null
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -32,8 +32,7 @@ mount_davfs_SOURCES = cache.c dav_coda.c
- kernel_interface.h mount_davfs.h webdav.h
- umount_davfs_SOURCES = umount_davfs.c defaults.h
-
--AM_CFLAGS = -Wall -Werror=format-security \
-- -fstack-protector-strong --param=ssp-buffer-size=4
-+AM_CFLAGS = -Wall -Werror=format-security
- DEFS = -DPROGRAM_NAME=\"mount.davfs\" \
- -DDAV_SYS_CONF_DIR=\"$(pkgsysconfdir)\" \
- -DDAV_LOCALSTATE_DIR=\"$(dav_localstatedir)\" \
+++ /dev/null
-#
-# Copyright (C) 2012-2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=bluelog
-PKG_VERSION:=1.1.2
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=ftp://ftp.digifail.com/software/bluelog
-PKG_MD5SUM:=614d0fe65bae68acff1d33d9f86e4805
-
-OUI_SOURCE:=oui-2016-05-30.txt.gz
-OUI_URL:=http://sources.lede-project.org/
-OUI_MD5SUM:=38048729fdb5a7a7e0c5db6a51dc2dd1
-
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=COPYING
-PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/bluelog/Default
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=Bluetooth scanner and logger
- URL:=http://www.digifail.com/software/bluelog.shtml
- DEPENDS:=+bluez-libs +kmod-bluetooth
-endef
-
-define Package/bluelog/Default/description
- Bluelog is a simple Bluetooth scanner designed to tell you how many
- discoverable devices there are in an area as quickly as possible. It is
- intended to be used as a site survey tool, identifying the number of possible
- Bluetooth targets there are in the surrounding environment.
-endef
-
-define Package/bluelog
- $(call Package/bluelog/Default)
-endef
-
-define Package/bluelog/description
- $(call Package/bluelog/Default/description)
-endef
-
-define Package/bluelog-live
- $(call Package/bluelog/Default)
- TITLE+= (live output)
- DEPENDS+= bluelog
-endef
-
-define Package/bluelog-live/description
- $(call Package/bluelog/Default/description)
- This package contains the files for "Bluelog Live", an optional mode of
- Bluelog which creates a real-time webpage of discovered Bluetooth devices.
-endef
-
-define Download/oui.txt
- FILE:=$(OUI_SOURCE)
- URL:=$(OUI_URL)
- MD5SUM:=$(OUI_MD5SUM)
-endef
-
-TARGET_CFLAGS += -DOPENWRT
-
-MAKE_FLAGS += \
- LIBS="$(TARGET_LDFLAGS) -lbluetooth -lm"
-
-define Build/Prepare
- $(eval $(call Download,oui.txt))
- $(Build/Prepare/Default)
- zcat $(DL_DIR)/$(OUI_SOURCE) > $(PKG_BUILD_DIR)/oui.tmp
-endef
-
-define Package/bluelog/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/bluelog $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/bluelog.init $(1)/etc/init.d/bluelog
-endef
-
-define Package/bluelog-live/install
- $(INSTALL_DIR) $(1)/www/bluelog
- $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/*.html $(1)/www/bluelog/
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/share/bluelog/openwrt.css \
- $(1)/www/bluelog/style.css
- $(INSTALL_DIR) $(1)/www/bluelog/images
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/share/bluelog/images/digifail_logo.png \
- $(PKG_INSTALL_DIR)/usr/share/bluelog/images/email.png \
- $(PKG_INSTALL_DIR)/usr/share/bluelog/images/favicon.png \
- $(PKG_INSTALL_DIR)/usr/share/bluelog/images/openwrt_logo.png \
- $(PKG_INSTALL_DIR)/usr/share/bluelog/images/qrcontact.png \
- $(1)/www/bluelog/images/
- $(INSTALL_DIR) $(1)/www/cgi-bin
- $(CP) $(PKG_INSTALL_DIR)/usr/share/bluelog/cgi-bin/* $(1)/www/cgi-bin/
-endef
-
-$(eval $(call BuildPackage,bluelog))
-$(eval $(call BuildPackage,bluelog-live))
+++ /dev/null
-#!/bin/sh /etc/rc.common
-
-START=65
-
-SERVICE_DAEMONIZE=1
-
-start() {
- service_start /usr/bin/bluelog
-}
-
-stop() {
- service_stop /usr/bin/bluelog
-}
+++ /dev/null
---- a/gen_oui.sh
-+++ b/gen_oui.sh
-@@ -3,7 +3,7 @@
- VER="1.2"
-
- # Location of tmp file
--TMPFILE="/tmp/oui.tmp"
-+TMPFILE="./oui.tmp"
-
- # File to write
- OUIFILE="oui.txt"
-@@ -22,10 +22,7 @@ exit 1
-
- get_oui ()
- {
--echo -n "Downloading OUI file from IEEE..."
--wget --quiet -O $TMPFILE http://standards.ieee.org/develop/regauth/oui/oui.txt || \
-- ErrorMsg ERR "Unable to contact IEEE server!"
--
-+[ -f "$TMPFILE" ] || ErrorMsg ERR "Unable to find $TMPFILE"
- echo "OK"
- }
-
-@@ -44,7 +41,6 @@ echo "OK"
- clean_all ()
- {
- echo -n "Removing files..."
--rm -f $TMPFILE
- rm -f $OUIFILE
- echo "OK"
- }
+++ /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:=collectd
-PKG_VERSION:=5.5.3
-PKG_RELEASE:=4
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://collectd.org/files/
-PKG_MD5SUM:=6f10633d0f73f99ef61472a8e377d4a058de161e80f3353b4b17d394c68f2f44
-
-PKG_FIXUP:=autoreconf
-PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4
-PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>, Hannu Nyman <hannu.nyman@iki.fi>
-
-PKG_INSTALL:=1
-PKG_BUILD_PARALLEL:=1
-PKG_USE_MIPS16:=0
-
-COLLECTD_PLUGINS_DISABLED:= \
- amqp \
- apple_sensors \
- aquaero \
- barometer \
- battery \
- ceph \
- cgroups \
- curl_json \
- curl_xml \
- dbi \
- drbd \
- ethstat \
- fhcount \
- genericjmx \
- gmond \
- hddtemp \
- ipc \
- ipmi \
- ipvs \
- java \
- log_logstash \
- lvm \
- lpar \
- mbmon \
- md \
- memcachec \
- memcached \
- mic \
- monitorus \
- multimeter \
- netapp \
- nfs \
- notify_desktop \
- notify_email \
- numa \
- openldap \
- openvz \
- oracle \
- perl \
- pf \
- pinba \
- python \
- redis \
- routeros \
- rrdcached \
- serial \
- sigrok \
- smart \
- statsd \
- swap \
- tape \
- tokyotyrant \
- turbostat \
- uuid \
- varnish \
- virt \
- vserver \
- write_kafka \
- write_log \
- write_mongodb \
- write_redis \
- write_riemann \
- write_sensu \
- write_tsdb \
- xmms \
- zfs_arc \
- zookeeper
-
-COLLECTD_PLUGINS_SELECTED:= \
- apache \
- apcups \
- ascent \
- bind \
- conntrack \
- contextswitch \
- cpu \
- cpufreq \
- csv \
- curl \
- df \
- disk \
- dns \
- email \
- entropy \
- exec \
- filecount \
- fscache \
- interface \
- iptables \
- irq \
- iwinfo \
- load \
- logfile \
- madwifi \
- memory \
- modbus \
- mysql \
- netlink \
- network \
- nginx \
- ntpd \
- nut \
- olsrd \
- onewire \
- openvpn \
- ping \
- postgresql \
- powerdns \
- processes \
- protocols \
- rrdtool \
- sensors \
- snmp \
- syslog \
- table \
- tail \
- tail_csv \
- tcpconns \
- teamspeak2 \
- ted \
- thermal \
- unixsock \
- uptime \
- users \
- vmem \
- wireless \
- write_graphite \
- write_http \
-
-PKG_CONFIG_DEPENDS:= \
- $(patsubst %,CONFIG_PACKAGE_collectd-mod-%,$(subst _,-,$(COLLECTD_PLUGINS_SELECTED))) \
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-define Package/collectd/Default
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=Lightweight system statistics collection daemon
- URL:=http://verplant.org/collectd/
-endef
-
-define Package/collectd
-$(call Package/collectd/Default)
- DEPENDS:= +libpthread +zlib +libltdl +libip4tc
- MENU:=1
-endef
-
-define Package/collectd/description
- collectd is a small daemon which collects system information periodically
- and provides mechanismns to store the values in a variety of ways.
-endef
-
-define Package/collectd/config
- config PACKAGE_COLLECTD_ENCRYPTED_NETWORK
- bool "Enable ability to use encrypted networking"
- default n
- depends on PACKAGE_collectd
- select PACKAGE_collectd-mod-network
-endef
-
-ifneq ($(CONFIG_avr32),)
- TARGET_CFLAGS += -fsigned-char
-endif
-
-# common configure args
-CONFIGURE_ARGS+= \
- --disable-debug \
- --enable-daemon \
- --with-nan-emulation \
- --without-perl-bindings \
- --without-libudev
-
-ifneq ($(CONFIG_PACKAGE_COLLECTD_ENCRYPTED_NETWORK),)
-CONFIGURE_ARGS+= \
- --with-libgcrypt=$(STAGING_DIR)/usr/include
-else
-CONFIGURE_ARGS+= \
- --without-libgcrypt
-endif
-
-CONFIGURE_VARS+= \
- CFLAGS="$$$$CFLAGS $(FPIC)" \
- LDFLAGS="$$$$LDFLAGS -lm -lz" \
- KERNEL_DIR="$(LINUX_DIR)" \
-
-CONFIGURE_PLUGIN= \
- $(foreach m, $(1), \
- $(if $(CONFIG_PACKAGE_collectd-mod-$(subst _,-,$(m))),--enable-$(m),--disable-$(m)) \
- )
-
-CONFIGURE_ARGS+= \
- $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_SELECTED)) \
- $(call CONFIGURE_PLUGIN,$(COLLECTD_PLUGINS_DISABLED)) \
-
-# exception: mod-ascent needs libxml2
-ifneq ($(CONFIG_PACKAGE_collectd-mod-ascent),)
- CONFIGURE_VARS+= \
- CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/include/libxml2"
-endif
-
-ifneq ($(CONFIG_BIG_ENDIAN),)
- CONFIGURE_ARGS+= --with-fp-layout=endianflip
-else
- CONFIGURE_ARGS+= --with-fp-layout=nothing
-endif
-
-ifneq ($(CONFIG_PACKAGE_collectd-mod-postgresql),)
- CONFIGURE_ARGS+= --with-libpq="$(STAGING_DIR)/usr/"
-endif
-
-ifneq ($(CONFIG_PACKAGE_collectd-mod-mysql),)
- CONFIGURE_ARGS+= --with-libmysql="$(STAGING_DIR)/usr/"
-endif
-
-# exception: mod-netlink needs libnetlink from iproute
-ifneq ($(CONFIG_PACKAGE_collectd-mod-netlink),)
- CONFIGURE_ARGS+= --with-libnetlink="$(STAGING_DIR)/usr"
-endif
-
-# exception: mod-modbus needs libmodbus
-ifneq ($(CONFIG_PACKAGE_collectd-mod-modbus),)
- CONFIGURE_ARGS+= --with-libmodbus="$(STAGING_DIR)/usr"
-endif
-
-# exception: mod-onewire needs libow-capi
-ifneq ($(CONFIG_PACKAGE_collectd-mod-onewire),)
- CONFIGURE_ARGS+= --with-libowcapi="$(STAGING_DIR)/usr"
-endif
-
-# exception: mod-rrdtool needs rrdtool-1.0.x
-ifneq ($(CONFIG_PACKAGE_collectd-mod-rrdtool),)
- CONFIGURE_ARGS+= --with-librrd="$(STAGING_DIR)/usr/lib/rrdtool-1.0"
-endif
-
-define Package/collectd/conffiles
-/etc/collectd.conf
-endef
-
-define Package/collectd/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/collectd $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/usr/share/collectd
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/collectd/types.db $(1)/usr/share/collectd/
- $(INSTALL_DIR) $(1)/etc
- $(INSTALL_CONF) ./files/collectd.conf $(1)/etc/
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/collectd.init $(1)/etc/init.d/collectd
- $(INSTALL_DIR) $(1)/etc/collectd/conf.d
-endef
-
-# 1: plugin name
-# 2: plugin title/description
-# 3: files
-# 4: extra dependency
-define BuildPlugin
-
- PKG_CONFIG_DEPENDS+= CONFIG_PACKAGE_collectd-mod-$(1)
-
- define Package/collectd-mod-$(1)
- $$(call Package/collectd/Default)
- TITLE:=$(2) plugin
- DEPENDS:= collectd $(4)
- endef
-
- define Package/collectd-mod-$(1)/install
- $(INSTALL_DIR) $$(1)/usr/lib/collectd
- for m in $(3); do \
- $(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/collectd/$$$$$$$${m}.so \
- $$(1)/usr/lib/collectd/ ; \
- done
- endef
-
- $$(eval $$(call BuildPackage,collectd-mod-$(1)))
-
-endef
-
-$(eval $(call BuildPackage,collectd))
-
-#$(eval $(call BuildPlugin,NAME,DESCRIPTION,FILES,DEPENDENCIES))
-$(eval $(call BuildPlugin,apache,apache status input,apache,+PACKAGE_collectd-mod-apache:libcurl))
-$(eval $(call BuildPlugin,apcups,apcups status input,apcups,))
-$(eval $(call BuildPlugin,ascent,ascent status input,ascent,+PACKAGE_collectd-mod-ascent:libcurl +PACKAGE_collectd-mod-ascent:libxml2))
-$(eval $(call BuildPlugin,bind,BIND server/zone input,bind,+PACKAGE_collectd-mod-bind:libcurl +PACKAGE_collectd-mod-bind:libxml2))
-$(eval $(call BuildPlugin,conntrack,connection tracking table size input,conntrack,))
-$(eval $(call BuildPlugin,contextswitch,context switch input,contextswitch,))
-$(eval $(call BuildPlugin,cpu,CPU input,cpu,))
-$(eval $(call BuildPlugin,cpufreq,CPU Freq input,cpufreq,@(TARGET_x86||TARGET_x86_64||TARGET_mvebu||TARGET_ipq806x||TARGET_armvirt))) # Only enable on x86 mvebu ipq806x armvirt
-$(eval $(call BuildPlugin,csv,CSV output,csv,))
-$(eval $(call BuildPlugin,curl,cURL input,curl,+PACKAGE_collectd-mod-curl:libcurl))
-#$(eval $(call BuildPlugin,dbi,relational database input,dbi,+PACKAGE_collectd-mod-dbi:libdbi))
-$(eval $(call BuildPlugin,df,disk space input,df,))
-$(eval $(call BuildPlugin,disk,disk usage/timing input,disk,))
-$(eval $(call BuildPlugin,dns,DNS traffic input,dns,+PACKAGE_collectd-mod-dns:libpcap))
-$(eval $(call BuildPlugin,email,email output,email,))
-$(eval $(call BuildPlugin,entropy,Entropy amount input,entropy,))
-$(eval $(call BuildPlugin,exec,process exec input,exec,))
-$(eval $(call BuildPlugin,filecount,file count input,filecount,))
-$(eval $(call BuildPlugin,fscache,file-system based caching framework input,fscache,))
-$(eval $(call BuildPlugin,interface,network interfaces input,interface,))
-$(eval $(call BuildPlugin,iptables,iptables status input,iptables,+PACKAGE_collectd-mod-iptables:iptables +libiptc))
-$(eval $(call BuildPlugin,irq,interrupt usage input,irq,))
-$(eval $(call BuildPlugin,iwinfo,libiwinfo wireless statistics,iwinfo,+PACKAGE_collectd-mod-iwinfo:libiwinfo))
-$(eval $(call BuildPlugin,load,system load input,load,))
-$(eval $(call BuildPlugin,logfile,log files output,logfile,))
-$(eval $(call BuildPlugin,madwifi,MadWifi status input,madwifi,))
-#$(eval $(call BuildPlugin,mysql,MySQL status input,mysql,+PACKAGE_collectd-mod-mysql:libmysqlclient-r))
-$(eval $(call BuildPlugin,memory,physical memory usage input,memory,))
-$(eval $(call BuildPlugin,modbus,read variables through libmodbus,modbus,+PACKAGE_collectd-mod-modbus:libmodbus))
-$(eval $(call BuildPlugin,netlink,netlink input,netlink,+PACKAGE_collectd-mod-netlink:libmnl))
-$(eval $(call BuildPlugin,network,network input/output,network,+PACKAGE_COLLECTD_ENCRYPTED_NETWORK:libgcrypt))
-$(eval $(call BuildPlugin,nginx,nginx status input,nginx,+PACKAGE_collectd-mod-nginx:libcurl))
-$(eval $(call BuildPlugin,ntpd,NTP daemon status input,ntpd,))
-$(eval $(call BuildPlugin,nut,UPS monitoring input,nut,+PACKAGE_collectd-mod-nut:nut))
-$(eval $(call BuildPlugin,olsrd,OLSRd status input,olsrd,))
-$(eval $(call BuildPlugin,onewire,onewire sensor input,onewire,+PACKAGE_collectd-mod-onewire:libow-capi @BROKEN))
-$(eval $(call BuildPlugin,openvpn,OpenVPN traffic/compression input,openvpn,))
-$(eval $(call BuildPlugin,ping,ping status input,ping,+PACKAGE_collectd-mod-ping:liboping))
-$(eval $(call BuildPlugin,postgresql,PostgreSQL status input,postgresql,+PACKAGE_collectd-mod-postgresql:libpq))
-$(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,))
-$(eval $(call BuildPlugin,processes,process status input,processes,))
-$(eval $(call BuildPlugin,protocols,network protocols input,protocols,))
-$(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1))
-$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors))
-$(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp))
-$(eval $(call BuildPlugin,syslog,syslog output,syslog,))
-$(eval $(call BuildPlugin,tail,tail input,tail,))
-$(eval $(call BuildPlugin,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
-$(eval $(call BuildPlugin,tcpconns,TCP connection tracking input,tcpconns,))
-$(eval $(call BuildPlugin,thermal,system temperatures input,thermal,))
-$(eval $(call BuildPlugin,unixsock,unix socket output,unixsock,))
-$(eval $(call BuildPlugin,uptime,uptime status input,uptime,))
-$(eval $(call BuildPlugin,users,user logged in status input,users,))
-$(eval $(call BuildPlugin,vmem,virtual memory usage input,vmem,))
-$(eval $(call BuildPlugin,wireless,wireless status input,wireless,))
-$(eval $(call BuildPlugin,write-graphite,Carbon/Graphite output,write_graphite,+PACKAGE_collectd-mod-write-graphite:libpthread))
-$(eval $(call BuildPlugin,write-http,HTTP POST output,write_http,+PACKAGE_collectd-mod-write-http:libcurl))
+++ /dev/null
-# Config file for collectd. More info: https://collectd.org/
-# Note: Luci statistics will generate a new config and overwrite this file.
-
-#Hostname "localhost"
-#FQDNLookup true
-BaseDir "/var/run/collectd"
-Include "/etc/collectd/conf.d"
-PIDFile "/var/run/collectd.pid"
-PluginDir "/usr/lib/collectd"
-TypesDB "/usr/share/collectd/types.db"
-Interval 30
-ReadThreads 2
-
-LoadPlugin interface
-LoadPlugin load
-#LoadPlugin ping
-LoadPlugin rrdtool
-
-<Plugin rrdtool>
- DataDir "/tmp/rrd"
- RRARows 100
- RRASingle true
- RRATimespan 3600
- RRATimespan 86400
- RRATimespan 604800
- RRATimespan 2678400
- RRATimespan 31622400
-</Plugin>
-
-<Plugin interface>
- IgnoreSelected false
- Interface "br-lan"
-</Plugin>
-
-#<Plugin ping>
-# Host "host.foo.bar"
-# Interval 30
-# TTL 127
-#</Plugin>
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006-2016 OpenWrt.org
-
-START=80
-STOP=10
-
-USE_PROCD=1
-
-start_service() {
- mkdir -m 0755 -p /var/lib/collectd
- procd_open_instance
- procd_set_param command /usr/sbin/collectd -f
- procd_close_instance
-}
-
+++ /dev/null
---- /dev/null
-+++ b/fake-am_path_libgcrypt.m4
-@@ -0,0 +1 @@
-+AC_DEFUN([AM_PATH_LIBGCRYPT],[:])
+++ /dev/null
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -7,7 +7,7 @@ SUBDIRS += daemon
- PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\<module_register\>'
-
- if COMPILER_IS_GCC
--AM_CFLAGS = -Wall -Werror
-+AM_CFLAGS = -Wall
- endif
-
- AM_CPPFLAGS = -I$(srcdir)/daemon
---- a/src/libcollectdclient/Makefile.am
-+++ b/src/libcollectdclient/Makefile.am
-@@ -1,7 +1,7 @@
- AUTOMAKE_OPTIONS = foreign no-dependencies
-
- if COMPILER_IS_GCC
--AM_CFLAGS = -Wall -Werror
-+AM_CFLAGS = -Wall
- endif
-
- pkginclude_HEADERS = collectd/client.h collectd/network.h collectd/network_buffer.h collectd/lcc_features.h
+++ /dev/null
-From f6be4f9b49b949b379326c3d7002476e6ce4f211 Mon Sep 17 00:00:00 2001
-From: Pavel Rochnyack <pavel2000@ngs.ru>
-Date: Mon, 3 Apr 2017 11:57:09 +0600
-Subject: [PATCH] network plugin: Fix endless loop DOS in parse_packet()
-
-When correct 'Signature part' is received by Collectd, configured without
-AuthFile option, condition for endless loop occurs due to missing increase
-of pointer to next unprocessed part.
-
-Fixes: CVE-2017-7401
-
-Signed-off-by: Florian Forster <octo@collectd.org>
-
-
---- a/src/network.c
-+++ b/src/network.c
-@@ -1066,14 +1066,6 @@ static int parse_part_sign_sha256 (socke
- buffer_len = *ret_buffer_len;
- buffer_offset = 0;
-
-- if (se->data.server.userdb == NULL)
-- {
-- c_complain (LOG_NOTICE, &complain_no_users,
-- "network plugin: Received signed network packet but can't verify it "
-- "because no user DB has been configured. Will accept it.");
-- return (0);
-- }
--
- /* Check if the buffer has enough data for this structure. */
- if (buffer_len <= PART_SIGNATURE_SHA256_SIZE)
- return (-ENOMEM);
-@@ -1091,6 +1083,18 @@ static int parse_part_sign_sha256 (socke
- return (-1);
- }
-
-+ if (se->data.server.userdb == NULL) {
-+ c_complain(
-+ LOG_NOTICE, &complain_no_users,
-+ "network plugin: Received signed network packet but can't verify it "
-+ "because no user DB has been configured. Will accept it.");
-+
-+ *ret_buffer = buffer + pss_head_length;
-+ *ret_buffer_len -= pss_head_length;
-+
-+ return (0);
-+ }
-+
- /* Copy the hash. */
- BUFFER_READ (pss.hash, sizeof (pss.hash));
-
+++ /dev/null
---- a/src/rrdtool.c
-+++ b/src/rrdtool.c
-@@ -82,6 +82,7 @@ static const char *config_keys[] =
- "HeartBeat",
- "RRARows",
- "RRATimespan",
-+ "RRASingle",
- "XFF",
- "WritesPerSecond",
- "RandomTimeout"
-@@ -103,6 +104,8 @@ static rrdcreate_config_t rrdcreate_conf
- /* timespans = */ NULL,
- /* timespans_num = */ 0,
-
-+ /* rrasingle = */ 0,
-+
- /* consolidation_functions = */ NULL,
- /* consolidation_functions_num = */ 0,
-
-@@ -1110,6 +1113,14 @@ static int rrd_config (const char *key,
-
- free (value_copy);
- }
-+ else if (strcasecmp ("RRASingle", key) == 0)
-+ {
-+ if (IS_TRUE (value))
-+ {
-+ rrdcreate_config.rrasingle = 1;
-+ NOTICE ("rrdtool plugin: RRASingle = true: creating only AVERAGE RRAs");
-+ }
-+ }
- else if (strcasecmp ("XFF", key) == 0)
- {
- double tmp = atof (value);
---- a/src/utils_rrdcreate.c
-+++ b/src/utils_rrdcreate.c
-@@ -213,6 +213,9 @@ static int rra_get (char ***ret, const v
- rts_num = rra_timespans_num;
- }
-
-+ if (cfg->rrasingle)
-+ rra_types_num = 1;
-+
- rra_max = rts_num * rra_types_num;
- assert (rra_max > 0);
-
---- a/src/utils_rrdcreate.h
-+++ b/src/utils_rrdcreate.h
-@@ -41,6 +41,8 @@ struct rrdcreate_config_s
- int *timespans;
- size_t timespans_num;
-
-+ int rrasingle;
-+
- char **consolidation_functions;
- size_t consolidation_functions_num;
-
+++ /dev/null
---- a/src/daemon/configfile.c
-+++ b/src/daemon/configfile.c
-@@ -111,7 +111,7 @@ static cf_global_option_t cf_global_opti
- {"BaseDir", NULL, PKGLOCALSTATEDIR},
- {"PIDFile", NULL, PIDFILE},
- {"Hostname", NULL, NULL},
-- {"FQDNLookup", NULL, "true"},
-+ {"FQDNLookup", NULL, "false"},
- {"Interval", NULL, NULL},
- {"ReadThreads", NULL, "5"},
- {"WriteThreads", NULL, "5"},
+++ /dev/null
---- a/version-gen.sh
-+++ b/version-gen.sh
-@@ -2,7 +2,7 @@
-
- DEFAULT_VERSION="5.5.3.git"
-
--VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
-+#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
-
- if test -z "$VERSION"; then
- VERSION="$DEFAULT_VERSION"
+++ /dev/null
---- a/src/daemon/plugin.c
-+++ b/src/daemon/plugin.c
-@@ -1149,7 +1149,7 @@ static int plugin_insert_read (read_func
- int status;
- llentry_t *le;
-
-- rf->rf_next_read = cdtime ();
-+ rf->rf_next_read = cdtime () + (cdtime_t) 1073741824; //delay first read 1s
- rf->rf_effective_interval = rf->rf_interval;
-
- pthread_mutex_lock (&read_lock);
+++ /dev/null
---- a/src/olsrd.c
-+++ b/src/olsrd.c
-@@ -658,7 +658,7 @@ static int olsrd_read (void) /* {{{ */
- if (fh == NULL)
- return (-1);
-
-- fputs ("\r\n", fh);
-+ fputs ("/all \r\n", fh);
- fflush (fh);
-
- while (fgets (buffer, sizeof (buffer), fh) != NULL)
+++ /dev/null
-From af01dd6fa3eb458e2fbb272703b0cae37ea54a9b Mon Sep 17 00:00:00 2001
-From: Marcin Jurkowski <marcin1j@gmail.com>
-Date: Tue, 11 Jul 2017 15:00:25 +0200
-Subject: [PATCH] uptime plugin: don't cache boot time and simplify Linux code
-
-Caching boottime on startup yields incorrect uptime values if system
-date changes after the daemon is started.
-This is almost certain to happen on embedded systems without RTC, where
-clock is set from NTP server at some point after boot process.
-
-On Linux, we can retrieve uptime directly by either reading /proc/uptime
-(it's sufficient to read a few bytes) or calling sysinfo() function.
-Use the latter since it's the most efficient way in speed, memory
-requirements and code simplicity terms.
-
---- a/src/uptime.c
-+++ b/src/uptime.c
-@@ -24,8 +24,7 @@
- #include "plugin.h"
-
- #if KERNEL_LINUX
--# define STAT_FILE "/proc/stat"
--/* Using /proc filesystem to retrieve the boot time, Linux only. */
-+#include <sys/sysinfo.h>
- /* #endif KERNEL_LINUX */
-
- #elif HAVE_LIBKSTAT
-@@ -50,8 +49,6 @@
- /*
- * Global variables
- */
--/* boottime always used, no OS distinction */
--static time_t boottime;
-
- #if HAVE_LIBKSTAT
- extern kstat_ctl_t *kc;
-@@ -74,8 +71,6 @@ static void uptime_submit (gauge_t uptim
- plugin_dispatch_values (&vl);
- }
-
--static int uptime_init (void) /* {{{ */
--{
- /*
- * On most unix systems the uptime is calculated by looking at the boot
- * time (stored in unix time, since epoch) and the current one. We are
-@@ -86,52 +81,21 @@ static int uptime_init (void) /* {{{ */
- * the boot time, the plugin is unregistered and there is no chance to
- * try again later. Nevertheless, this is very unlikely to happen.
- */
--
-+static time_t uptime_get_sys(void) { /* {{{ */
-+ time_t result;
- #if KERNEL_LINUX
-- unsigned long starttime;
-- char buffer[1024];
-- int ret;
-- FILE *fh;
--
-- ret = 0;
--
-- fh = fopen (STAT_FILE, "r");
-+ struct sysinfo info;
-+ int status;
-
-- if (fh == NULL)
-- {
-+ status = sysinfo(&info);
-+ if (status != 0) {
- char errbuf[1024];
-- ERROR ("uptime plugin: Cannot open "STAT_FILE": %s",
-+ ERROR ("uptime plugin: Error calling sysinfo: %s",
- sstrerror (errno, errbuf, sizeof (errbuf)));
- return (-1);
- }
-
-- while (fgets (buffer, 1024, fh) != NULL)
-- {
-- /* look for the btime string and read the value */
-- ret = sscanf (buffer, "btime %lu", &starttime);
-- /* avoid further loops if btime has been found and read
-- * correctly (hopefully) */
-- if (ret == 1)
-- break;
-- }
--
-- fclose (fh);
--
-- /* loop done, check if no value has been found/read */
-- if (ret != 1)
-- {
-- ERROR ("uptime plugin: No value read from "STAT_FILE"");
-- return (-1);
-- }
--
-- boottime = (time_t) starttime;
--
-- if (boottime == 0)
-- {
-- ERROR ("uptime plugin: btime read from "STAT_FILE", "
-- "but `boottime' is zero!");
-- return (-1);
-- }
-+ result = (time_t)info.uptime;
- /* #endif KERNEL_LINUX */
-
- #elif HAVE_LIBKSTAT
-@@ -168,14 +132,13 @@ static int uptime_init (void) /* {{{ */
- return (-1);
- }
-
-- boottime = (time_t) knp->value.ui32;
--
-- if (boottime == 0)
-- {
-+ if (knp->value.ui32 == 0) {
- ERROR ("uptime plugin: kstat_data_lookup returned success, "
- "but `boottime' is zero!");
- return (-1);
- }
-+
-+ result = time(NULL) - (time_t)knp->value.ui32;
- /* #endif HAVE_LIBKSTAT */
-
- # elif HAVE_SYS_SYSCTL_H
-@@ -201,14 +164,13 @@ static int uptime_init (void) /* {{{ */
- return (-1);
- }
-
-- boottime = boottv.tv_sec;
--
-- if (boottime == 0)
-- {
-+ if (boottv.tv_sec == 0) {
- ERROR ("uptime plugin: sysctl(3) returned success, "
- "but `boottime' is zero!");
- return (-1);
- }
-+
-+ result = time(NULL) - boottv.tv_sec;
- /* #endif HAVE_SYS_SYSCTL_H */
-
- #elif HAVE_PERFSTAT
-@@ -230,11 +192,11 @@ static int uptime_init (void) /* {{{ */
- if (hertz <= 0)
- hertz = HZ;
-
-- boottime = time(NULL) - cputotal.lbolt / hertz;
-+ result = cputotal.lbolt / hertz;
- #endif /* HAVE_PERFSTAT */
-
-- return (0);
--} /* }}} int uptime_init */
-+ return result;
-+} /* }}} int uptime_get_sys */
-
- static int uptime_read (void)
- {
-@@ -242,7 +204,7 @@ static int uptime_read (void)
- time_t elapsed;
-
- /* calculate the amount of time elapsed since boot, AKA uptime */
-- elapsed = time (NULL) - boottime;
-+ elapsed = uptime_get_sys();
-
- uptime = (gauge_t) elapsed;
-
-@@ -253,6 +215,5 @@ static int uptime_read (void)
-
- void module_register (void)
- {
-- plugin_register_init ("uptime", uptime_init);
- plugin_register_read ("uptime", uptime_read);
- } /* void module_register */
+++ /dev/null
-Patch reverts upstream commit:
-https://github.com/collectd/collectd/commit/6124da7a48f28f54fc09ebeb942d1037516fe6ab
-
-The commit changed the detection path due to FreeBSD issues,
-but apparently affects also Openwrt buildroot negatively.
-
-Original explanation:
- From 6124da7a48f28f54fc09ebeb942d1037516fe6ab Mon Sep 17 00:00:00 2001
- Subject: [PATCH] Fix libmodbus detection on FreeBSD
-
- We look for modbus/modbus.h in /usr/local/include/modbus
- but we should look for modbus.h
-
- This is only an issue on FreeBSD since /usr/local/include is not
- in the default search path.
-
-Reversed patch to be applied:
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -2627,7 +2627,7 @@ then
- SAVE_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags"
-
-- AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"])
-+ AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"])
-
- CPPFLAGS="$SAVE_CPPFLAGS"
- fi
---- a/src/modbus.c
-+++ b/src/modbus.c
-@@ -26,7 +26,7 @@
- #include "configfile.h"
- #include "plugin.h"
-
--#include <modbus.h>
-+#include <modbus/modbus.h>
- #include <netdb.h>
- #include <sys/socket.h>
-
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -705,6 +705,9 @@ AC_CHECK_HEADERS(net/pfvar.h,
- have_termios_h="no"
- AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"])
-
-+# For the iwinfo plugin
-+AC_CHECK_LIB(iwinfo, iwinfo_backend, [with_iwinfo="yes"], [with_iwinfo="no (libiwinfo not found)"], [])
-+
- # For the turbostat plugin
- have_asm_msrindex_h="no"
- AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"])
-@@ -5310,6 +5313,7 @@ plugin_interface="no"
- plugin_ipmi="no"
- plugin_ipvs="no"
- plugin_irq="no"
-+plugin_iwinfo="no"
- plugin_load="no"
- plugin_log_logstash="no"
- plugin_memory="no"
-@@ -5713,6 +5717,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi],
- AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters])
- AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics])
- AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics])
-+AC_PLUGIN([iwinfo], [$with_iwinfo], [Common iwinfo wireless statistics])
- AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine])
- AC_PLUGIN([load], [$plugin_load], [System load])
- AC_PLUGIN([logfile], [yes], [File logging plugin])
-@@ -6042,6 +6047,7 @@ Configuration:
- oracle . . . . . . . $with_oracle
- protobuf-c . . . . . $have_protoc_c
- python . . . . . . . $with_python
-+ iwinfo . . . . . . . $with_iwinfo
-
- Features:
- daemon mode . . . . . $enable_daemon
-@@ -6091,6 +6097,7 @@ Configuration:
- iptables . . . . . . $enable_iptables
- ipvs . . . . . . . . $enable_ipvs
- irq . . . . . . . . . $enable_irq
-+ iwinfo . . . . . . . $enable_iwinfo
- java . . . . . . . . $enable_java
- load . . . . . . . . $enable_load
- logfile . . . . . . . $enable_logfile
---- a/src/collectd.conf.in
-+++ b/src/collectd.conf.in
-@@ -128,6 +128,7 @@
- #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables
- #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs
- #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq
-+#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo
- #@BUILD_PLUGIN_JAVA_TRUE@LoadPlugin java
- @BUILD_PLUGIN_LOAD_TRUE@@BUILD_PLUGIN_LOAD_TRUE@LoadPlugin load
- #@BUILD_PLUGIN_LPAR_TRUE@LoadPlugin lpar
-@@ -582,6 +583,12 @@
- # IgnoreSelected true
- #</Plugin>
-
-+#<Plugin iwinfo>
-+# Interface "ath0"
-+# Interface "ra0"
-+# Interface "wlan0"
-+#</Plugin>
-+
- #<Plugin java>
- # JVMArg "-verbose:jni"
- # JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar"
---- a/src/collectd.conf.pod
-+++ b/src/collectd.conf.pod
-@@ -2612,6 +2612,27 @@ and all other interrupts are collected.
-
- =back
-
-+=head2 Plugin C<iwinfo>
-+
-+=over 4
-+
-+=item B<Interface> I<Interface>
-+
-+Select this interface. By default all detected wireless interfaces will be
-+collected. For a more detailed description see B<IgnoreSelected> below.
-+
-+=item B<IgnoreSelected> I<true>|I<false>
-+
-+If no configuration if given, the B<iwinfo>-plugin will collect data from all
-+detected wireless interfaces. You can use the B<Interface>-option to pick the
-+interfaces you're interested in. Sometimes, however, it's easier/preferred to
-+collect all interfaces I<except> a few ones. This option enables you to do
-+that: By setting B<IgnoreSelected> to I<true> the effect of B<Interface> is
-+inverted: All selected interfaces are ignored and all other interfaces are
-+collected.
-+
-+=back
-+
- =head2 Plugin C<java>
-
- The I<Java> plugin makes it possible to write extensions for collectd in Java.
---- /dev/null
-+++ b/src/iwinfo.c
-@@ -0,0 +1,150 @@
-+/**
-+ * collectd - src/iwinfo.c
-+ * Copyright (C) 2011 Jo-Philipp Wich
-+ *
-+ * This program is free software; you can redistribute it and/or modify it
-+ * under the terms of the GNU General Public License as published by the
-+ * Free Software Foundation; only version 2 of the License is applicable.
-+ *
-+ * This program is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License along
-+ * with this program; if not, write to the Free Software Foundation, Inc.,
-+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-+ **/
-+
-+#include "collectd.h"
-+#include "common.h"
-+#include "plugin.h"
-+#include "utils_ignorelist.h"
-+
-+#include <stdint.h>
-+#include <iwinfo.h>
-+
-+#define PROCNETDEV "/proc/net/dev"
-+
-+static const char *config_keys[] = {
-+ "Interface",
-+ "IgnoreSelected"
-+};
-+static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
-+
-+static ignorelist_t *ignorelist = NULL;
-+
-+static int iwinfo_config(const char *key, const char *value)
-+{
-+ if (ignorelist == NULL)
-+ ignorelist = ignorelist_create(1);
-+
-+ if (ignorelist == NULL)
-+ return 1;
-+
-+ if (strcasecmp(key, "Interface") == 0)
-+ ignorelist_add(ignorelist, value);
-+ else if (strcasecmp(key, "IgnoreSelected") == 0)
-+ ignorelist_set_invert(ignorelist, IS_TRUE(value) ? 0 : 1);
-+ else
-+ return -1;
-+
-+ return 0;
-+}
-+
-+static void iwinfo_submit(const char *ifname, const char *type, int value)
-+{
-+ value_t values[1];
-+ value_list_t vl = VALUE_LIST_INIT;
-+
-+ values[0].gauge = value;
-+
-+ vl.values = values;
-+ vl.values_len = 1;
-+
-+ sstrncpy(vl.host, hostname_g, sizeof(vl.host));
-+ sstrncpy(vl.plugin, "iwinfo", sizeof(vl.plugin));
-+ sstrncpy(vl.plugin_instance, ifname, sizeof(vl.plugin_instance));
-+ sstrncpy(vl.type, type, sizeof(vl.type));
-+ /*sstrncpy(vl.type_instance, "", sizeof(vl.type_instance));*/
-+
-+ plugin_dispatch_values(&vl);
-+}
-+
-+static void iwinfo_process(const char *ifname)
-+{
-+ int val;
-+ char buf[IWINFO_BUFSIZE];
-+ const struct iwinfo_ops *iw = iwinfo_backend(ifname);
-+
-+ /* does appear to be a wifi iface */
-+ if (iw)
-+ {
-+ if (iw->bitrate(ifname, &val))
-+ val = 0;
-+ iwinfo_submit(ifname, "bitrate", val * 1000);
-+
-+ if (iw->signal(ifname, &val))
-+ val = 0;
-+ iwinfo_submit(ifname, "signal_power", val);
-+
-+ if (iw->noise(ifname, &val))
-+ val = 0;
-+ iwinfo_submit(ifname, "signal_noise", val);
-+
-+ if (iw->quality(ifname, &val))
-+ val = 0;
-+ iwinfo_submit(ifname, "signal_quality", val);
-+
-+ if (iw->assoclist(ifname, buf, &val))
-+ val = 0;
-+ iwinfo_submit(ifname, "stations",
-+ val / sizeof(struct iwinfo_assoclist_entry));
-+ }
-+
-+ iwinfo_finish();
-+}
-+
-+static int iwinfo_read(void)
-+{
-+ char line[1024];
-+ char ifname[128];
-+ FILE *f;
-+
-+ f = fopen(PROCNETDEV, "r");
-+ if (f == NULL)
-+ {
-+ char err[1024];
-+ WARNING("iwinfo: Unable to open " PROCNETDEV ": %s",
-+ sstrerror(errno, err, sizeof(err)));
-+ return -1;
-+ }
-+
-+ while (fgets(line, sizeof(line), f))
-+ {
-+ if (!strchr(line, ':'))
-+ continue;
-+
-+ if (!sscanf(line, " %127[^:]", ifname))
-+ continue;
-+
-+ if (ignorelist_match(ignorelist, ifname))
-+ continue;
-+
-+ if (strstr(ifname, "mon.") || strstr(ifname, ".sta") ||
-+ strstr(ifname, "tmp.") || strstr(ifname, "wifi"))
-+ continue;
-+
-+ iwinfo_process(ifname);
-+ }
-+
-+ fclose(f);
-+
-+ return 0;
-+}
-+
-+void module_register(void)
-+{
-+ plugin_register_config("iwinfo", iwinfo_config, config_keys, config_keys_num);
-+ plugin_register_read("iwinfo", iwinfo_read);
-+}
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -457,6 +457,13 @@ irq_la_SOURCES = irq.c
- irq_la_LDFLAGS = $(PLUGIN_LDFLAGS)
- endif
-
-+if BUILD_PLUGIN_IWINFO
-+pkglib_LTLIBRARIES += iwinfo.la
-+iwinfo_la_SOURCES = iwinfo.c
-+iwinfo_la_LDFLAGS = -module -avoid-version
-+iwinfo_la_LIBADD = -liwinfo
-+endif
-+
- if BUILD_PLUGIN_JAVA
- pkglib_LTLIBRARIES += java.la
- java_la_SOURCES = java.c
---- a/src/types.db
-+++ b/src/types.db
-@@ -228,6 +228,7 @@ voltage value:GAUGE:U:U
- vs_memory value:GAUGE:0:9223372036854775807
- vs_processes value:GAUGE:0:65535
- vs_threads value:GAUGE:0:65535
-+stations value:GAUGE:0:256
-
- #
- # Legacy types
+++ /dev/null
---- a/src/ping.c
-+++ b/src/ping.c
-@@ -655,7 +655,7 @@ static int ping_read (void) /* {{{ */
- / ((double) (pkg_recv * (pkg_recv - 1))));
-
- /* Calculate drop rate. */
-- droprate = ((double) (pkg_sent - pkg_recv)) / ((double) pkg_sent);
-+ droprate = ((double) (pkg_sent - pkg_recv)) * 100 / ((double) pkg_sent);
-
- submit (hl->host, "ping", latency_average);
- submit (hl->host, "ping_stddev", latency_stddev);
+++ /dev/null
-#
-# Copyright (C) 2015-2016 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=crelay
-PKG_VERSION:=0.10.1
-PKG_RELEASE:=1
-
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=https://github.com/ondrej1024/crelay
-PKG_SOURCE_VERSION:=V$(PKG_VERSION)
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-
-PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
-PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILES:=LICENSE
-
-include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/nls.mk
-
-define Package/crelay
- SECTION:=utils
- CATEGORY:=Utilities
- TITLE:=USB relay remote control daemon
- URL:=http://github.com/ondrej1024/crelay
- DEPENDS:=+libftdi1 +hidapi +libusb-1.0
-endef
-
-define Package/crelay/description
- crelay is used to control different relay cards in a unified manner. It provides
- several interfaces for controlling the relays locally or remotely by a web browser
- or a smartphone. The card which is detected first will be used. A WebUI control is
- available on port 8000 (default)
- .
- Currently supported relay cards:
- - Conrad USB 4-channel relay card
- - Sainsmart USB 4/8-channel relay board
- - Sainsmart USB 16-channel relay control module
- - Generic GPIO relays
- - HID API compatible relay card
-endef
-
-define Build/Configure
-endef
-
-TARGET_CFLAGS+= \
- -D_GNU_SOURCE \
- -I$(STAGING_DIR)/usr/include/libftdi1 \
- -I$(STAGING_DIR)/usr/include/hidapi
-
-TARGET_LDFLAGS+= $(if $(ICONV_FULL),-liconv)
-
-define Build/Compile
- $(MAKE) -C $(PKG_BUILD_DIR)/src \
- CC="$(TARGET_CC)" \
- CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
-endef
-
-define Package/crelay/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/crelay $(1)/usr/bin/
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/crelay.init $(1)/etc/init.d/crelay
- $(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/crelay.conf $(1)/etc
-endef
-
-$(eval $(call BuildPackage,crelay))
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2016 OpenWrt.org
-
-NAME=crelay
-START=93
-
-PROG=/usr/bin/${NAME}
-
-USE_PROCD=1
-
-# Custom relay labels (for Web GUI) are defined in /etc/crelay.conf
-
-start_service() {
- procd_open_instance
-
- # restart if it croaks
- procd_set_param respawn
-
- procd_set_param command "$PROG"
- # daemon mode in foreground - starts HTTP server
- procd_append_param command -d
-
- procd_close_instance
-}
+++ /dev/null
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -44,7 +44,7 @@ OPTS += -DDRV_CONRAD
- endif
- ifeq ($(DRV_SAINSMART), y)
- SRC += relay_drv_sainsmart.c
--LIBS += -lftdi
-+LIBS += -lftdi1
- OPTS += -DDRV_SAINSMART
- endif
- ifeq ($(DRV_SAINSMART16), y)