(E.g.: PKG_MAINTAINER:= Joe D. Hacker `<jdh@jdhs-email-provider.org`>)
* A PKG_LICENSE tag declaring the main license of the package.
(E.g.: PKG_LICENSE:=GPL-2.0+) Please use SPDX identifiers if possible (see list at the bottom).
-* An optional PKG_LICENSE_FILE including the filename of the license-file in the source-package.
- (E.g.: PKG_LICENSE_FILE:=COPYING)
+* An optional PKG_LICENSE_FILES including the filename of the license-file in the source-package.
+ (E.g.: PKG_LICENSE_FILES:=COPYING)
Commits and pull-requests:
include $(TOPDIR)/rules.mk
PKG_NAME:=debootstrap
-PKG_VERSION:=1.0.63
+PKG_VERSION:=1.0.66
PKG_RELEASE:=1
PKG_MAINTAINER=Daniel Golle <daniel@makrotopia.org>
PKG_SOURCE:=$(PKG_NAME)-udeb_$(PKG_VERSION)_all.udeb
PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/d/debootstrap
-PKG_MD5SUM:=7bd6a1ad6721cc7d8c9ac637ae478df4
+PKG_MD5SUM:=bf6370ea0aa80308dfb03a4a35e33ad1
PKG_LICENSE:=Unique
PKG_LICENSE_FILES:=debian/copyright
include $(TOPDIR)/rules.mk
PKG_NAME:=monit
-PKG_VERSION:=5.9
+PKG_VERSION:=5.10
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://mmonit.com/monit/dist
-PKG_MD5SUM:=808473ebbacda0c5085d7399e507bfda
+PKG_MD5SUM:=5b5b5cc7939b975bbbef73bd6426750a
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILES:=COPYING
include $(TOPDIR)/rules.mk
PKG_NAME:=zabbix
-PKG_VERSION:=2.4.0
+PKG_VERSION:=2.4.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/zabbix
-PKG_MD5SUM:=57d9bf72bf0732971e4540a402bfc6c6
+PKG_MD5SUM:=50530e52c08d4a81f9e6e781f1a170ca
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -824,25 +824,8 @@ dnl ************************************
-
- dnl Check for %qu format (FreeBSD 4.x)
- dnl FreeBSD 4.x does not support %llu
--AC_MSG_CHECKING(for long long format)
--AC_TRY_RUN(
--[
--#include <sys/types.h>
--int main()
--{
-- uint64_t i;
--
-- sscanf("200000000010020", "%qu", &i);
--
-- if (i == 200000000010020) return 0;
-- else return -1;
--}
--],
--AC_DEFINE(HAVE_LONG_LONG_QU, 1 ,[Define to 1 if format '%qu' exists.])
--AC_MSG_RESULT(yes),
--AC_MSG_RESULT(no))
--
- dnl option -rdynamic is needed for readable backtraces
-+
- AC_MSG_CHECKING(for -rdynamic linking option)
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="-rdynamic $LDFLAGS"
include $(TOPDIR)/rules.mk
PKG_NAME:=erlang
-PKG_VERSION:=17.1
+PKG_VERSION:=17.3
PKG_RELEASE:=1
PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:= http://www.erlang.org/download/ \
http://erlang.mirror.su.se/
-PKG_MD5SUM:=9c90706ce70e01651adde34a2b79bf4c
+PKG_MD5SUM:=1d0bb2d54dfe1bb6844756b99902ba20
PKG_LICENSE:=ErlPL-1.1
-PKG_LICENSE_FILE:=EPLICENCE
+PKG_LICENSE_FILES:=EPLICENCE
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_BUILD_DEPENDS:=erlang/host openssl
PKG_MD5SUM:=af9f0f3a2313a1fcf88c40700092048d
PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=docs/us/license.html
+PKG_LICENSE_FILES:=docs/us/license.html
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-compress-bzip2
-PKG_VERSION:=2.18
+PKG_VERSION:=2.19
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/R/RU/RURBAN/
PKG_SOURCE:=Compress-Bzip2-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=c4a1995df9443cb97c28593cbbb23304
+PKG_MD5SUM:=dd4ebb4e88a50cc9a85e282618fdf88f
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-dbi
-PKG_VERSION:=1.631
-PKG_RELEASE:=2
+PKG_VERSION:=1.632
+PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TI/TIMB/
PKG_SOURCE:=DBI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=444d3c305e86597e11092b517794a840
+PKG_MD5SUM:=285fc34c1ee20125aabbd50bc3e587fb
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-test-harness
-PKG_VERSION:=3.33
+PKG_VERSION:=3.34
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/L/LE/LEONT/
PKG_SOURCE:=Test-Harness-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=7a72849ee1e67184db098146cc7c8855
+PKG_MD5SUM:=aa0175e8fef92c19f06128810f1a2921
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-uri
-PKG_VERSION:=1.64
+PKG_VERSION:=1.65
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/E/ET/ETHER/
PKG_SOURCE:=URI-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=975b2282bc8f0fd72a6dae5cefc33824
+PKG_MD5SUM:=12c5d612a20ddd42041a5aa426f66269
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
--- /dev/null
+menu "Configuration"
+ depends on PACKAGE_perl
+
+config PERL_TESTS
+ bool "Include perl tests"
+ default n
+ help
+ Include test suites for all perl packages.
+ This will make perl related packages much bigger, so
+ use with care.
+
+ Note: Test support is still in development. Some tests
+ still fail, others are just missing completely.
+
+endmenu
include $(TOPDIR)/rules.mk
PKG_NAME:=perl
-PKG_VERSION:=5.20.0
-PKG_RELEASE:=6
+PKG_VERSION:=5.20.1
+PKG_RELEASE:=1
PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \
ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 \
http://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_MD5SUM:=406ec049ebe3afcc80d9c76ec78ca4f8
+PKG_MD5SUM:=7a195abb7d6769f751e90c7d30dcf2e0
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_LICENSE_FILES:=Copying Artistic README
TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
+# A list of disabled testss
+# ExtUtils tests are disabled for now as we don't support building
+# native extensions on the target machine at the moment
+PERL_DISABLEDTESTS:=cpan/ExtUtils-Constant cpan/ExtUtils-MakeMaker
+# We're on Linux, so don't even package those
+PERL_DISABLEDTESTS+=cpan/Win32API-File cpan/Win32 ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE
+# NDBM and ODBM not supported
+PERL_DISABLEDTESTS+=ext/NDBM_File ext/ODBM_File
+
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include perlmod.mk
and is widely used to program web applications of all needs.
endef
+define Package/perl/config
+ source "$(SOURCE)/Config.in"
+endef
+
# Static host perl
define Host/Configure
( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) )
$(eval $(call HostBuild))
-include perlbase.mk
+
+# A helper package that includes all sort of supplementary files for tests
+define Package/perl-tests-common
+$(call Package/perlbase-template)
+TITLE:=Common test support files
+DEPENDS:=@PERL_TESTS
+endef
+
+define Package/perl-tests-common/install
+ $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)
+ $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting
+ $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen
+ $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/XS
+ $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/auto/XS
+ $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/unicore
+
+ $(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/5.20/
+ $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/5.20/auto
+ $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/5.20/
+ $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/5.20/unicore
+ $(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh
+ sed -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' -i $(1)/$(PERL_TESTSDIR)/run_tests.sh
+ $(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR)
+ $(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR)
+endef
+
+$(eval $(call BuildPackage,perl-tests-common))
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
ansi2knr=''
aphostname='/bin/hostname'
api_revision='5'
-api_subversion='0'
ar='ar'
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=0
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+api_subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
shrpenv=''
shsharp='true'
sig_count='64'
-sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS RTMIN NUM33 NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED '
-sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "RTMIN", "NUM33", "NUM34", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
+sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 RTMAX IOT CLD POLL UNUSED '
+sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "RTMIN", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 6 17 29 31 '
sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 6, 17, 29, 31, 0'
sig_size='68'
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
PERL_PATCHLEVEL=
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
PERL_PATCHLEVEL=
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='2147483647'
sGMTIME_min='-2147483648'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
strerror_r_proto='0'
#strings='/usr/include/string.h'
submit=''
-subversion='0'
sysman='/usr/share/man/man1'
tail=''
tar=''
config_argc=1
config_arg1='-der'
PERL_REVISION=5
-PERL_SUBVERSION=0
PERL_API_REVISION=5
PERL_API_SUBVERSION=0
PERL_PATCHLEVEL=
#incpth='/usr/lib/gcc/i486-slackware-linux/4.8.2/include /usr/local/include /usr/lib/gcc/i486-slackware-linux/4.8.2/include-fixed /usr/include'
ld_can_script='define'
#libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so'
-nv_overflows_integers_at='0'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
perl_static_inline='static __inline__'
sGMTIME_max='67768036191676799'
sGMTIME_min='-62167219200'
privlibexp='/usr/lib/perl5/5.20'
archlib='/usr/lib/perl5/5.20'
archlibexp='/usr/lib/perl5/5.20'
-version='5.20.0'
-version_patchlevel_string='version 20 subversion 0'
+version='5.20.1'
+version_patchlevel_string='version 20 subversion 1'
PERL_VERSION=20
PERL_API_VERSION=20
+PERL_SUBVERSION=1
patchlevel='20'
ccdlflags='-fPIC -Wl,-rpath,/usr/lib/perl5/5.20/CORE'
+subversion='1'
# Make perl use these tools instead of the target binaries during build.
hostgenerate='%%HOSTGENERATE%%'
--- /dev/null
+#!/bin/sh
+
+PERL_TESTSDIR="/usr/share/perl/perl-tests"
+PERL_LIBDIR="/usr/lib/perl5/5.20/"
+PERL_DISABLEDTESTS="%%PERL_DISABLEDTESTS%%"
+
+if [ ! -f "$PERL_TESTSDIR/__prepared" ]; then
+ ln -s "$PERL_LIBDIR" "$PERL_TESTSDIR/lib"
+ ln -s /usr/bin/perl "$PERL_TESTSDIR/perl"
+ ln -s /usr/bin/perl "$PERL_TESTSDIR/t/perl"
+ touch "$PERL_TESTSDIR/__prepared"
+
+ for i in $PERL_DISABLEDTESTS; do
+ echo "Disabling $i tests"
+ sed 's!^'$i'.*$!!' -i $PERL_TESTSDIR/MANIFEST
+ done
+
+ cat $PERL_TESTSDIR/MANIFEST | grep -v '^$' > $PERL_TESTSDIR/MANIFEST_NEW
+ rm $PERL_TESTSDIR/MANIFEST
+ mv $PERL_TESTSDIR/MANIFEST_NEW $PERL_TESTSDIR/MANIFEST
+fi
+
+cd "$PERL_TESTSDIR/t"
+./perl TEST
$(eval $(call BuildPackage,perlbase-anydbm-file))
+define Package/perlbase-app
+$(call Package/perlbase-template)
+TITLE:=app perl module
+DEPENDS+=+perlbase-autouse +perlbase-base +perlbase-config +perlbase-cpan +perlbase-essential +perlbase-file +perlbase-getopt +perlbase-if +perlbase-tap +perlbase-text
+endef
+
+define Package/perlbase-app/install
+$(call perlmod/Install,$(1),App,)
+endef
+
+$(eval $(call BuildPackage,perlbase-app))
+
+
define Package/perlbase-archive
$(call Package/perlbase-template)
TITLE:=Archive perl module
define Package/perlbase-archive/install
$(call perlmod/Install,$(1),Archive,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Archive-Tar/t)
endef
$(eval $(call BuildPackage,perlbase-archive))
+define Package/perlbase-arybase
+$(call Package/perlbase-template)
+TITLE:=arybase perl module
+endef
+
+define Package/perlbase-arybase/install
+$(call perlmod/Install,$(1),arybase.pm auto/arybase,)
+$(call perlmod/InstallBaseTests,$(1),ext/arybase/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-arybase))
+
+
define Package/perlbase-attribute
$(call Package/perlbase-template)
TITLE:=Attribute perl module
define Package/perlbase-attribute/install
$(call perlmod/Install,$(1),Attribute,)
+$(call perlmod/InstallBaseTests,$(1),dist/Attribute-Handlers/t)
endef
$(eval $(call BuildPackage,perlbase-attribute))
endef
define Package/perlbase-attributes/install
-$(call perlmod/Install,$(1),attributes.pm,)
+$(call perlmod/Install,$(1),attributes.pm auto/attributes,)
endef
$(eval $(call BuildPackage,perlbase-attributes))
+define Package/perlbase-autodie
+$(call Package/perlbase-template)
+TITLE:=autodie perl module
+DEPENDS+=+perlbase-base +perlbase-essential +perlbase-fatal +perlbase-if
+endef
+
+define Package/perlbase-autodie/install
+$(call perlmod/Install,$(1),autodie autodie.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/autodie/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-autodie))
+
+
define Package/perlbase-autoloader
$(call Package/perlbase-template)
TITLE:=AutoLoader perl module
define Package/perlbase-autoloader/install
$(call perlmod/Install,$(1),AutoLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/AutoLoader/t)
endef
$(eval $(call BuildPackage,perlbase-autoloader))
endef
define Package/perlbase-autosplit/install
-$(call perlmod/Install,$(1),AutoSplit.pm,)
+$(call perlmod/Install/NoStrip,$(1),AutoSplit.pm,)
endef
$(eval $(call BuildPackage,perlbase-autosplit))
define Package/perlbase-autouse/install
$(call perlmod/Install,$(1),autouse.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/autouse/t)
endef
$(eval $(call BuildPackage,perlbase-autouse))
define Package/perlbase-b/install
$(call perlmod/Install,$(1),B B.pm auto/B,)
+$(call perlmod/InstallBaseTests,$(1),cpan/B-Debug/t ext/B/t)
endef
$(eval $(call BuildPackage,perlbase-b))
define Package/perlbase-base/install
$(call perlmod/Install,$(1),base.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/base/t)
endef
$(eval $(call BuildPackage,perlbase-base))
endef
define Package/perlbase-bignum/install
-$(call perlmod/Install,$(1),bignum.pm,)
+$(call perlmod/Install,$(1),bignum.pm bigrat.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/bignum/t)
endef
$(eval $(call BuildPackage,perlbase-bignum))
define Package/perlbase-cgi/install
$(call perlmod/Install,$(1),CGI CGI.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/CGI/t)
endef
$(eval $(call BuildPackage,perlbase-cgi))
define Package/perlbase-charnames
$(call Package/perlbase-template)
TITLE:=charnames perl module
-DEPENDS+=+perlbase-bytes +perlbase-essential +perlbase-re +perlbase-unicore
+DEPENDS+=+perlbase-bytes +perlbase-essential +perlbase-file +perlbase-re +perlbase-unicore
endef
define Package/perlbase-charnames/install
-$(call perlmod/Install,$(1),charnames.pm,)
+$(call perlmod/Install,$(1),_charnames.pm charnames.pm,)
endef
$(eval $(call BuildPackage,perlbase-charnames))
define Package/perlbase-compress/install
$(call perlmod/Install,$(1),Compress auto/Compress,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Compress-Raw-Bzip2/t cpan/Compress-Raw-Zlib/t)
endef
$(eval $(call BuildPackage,perlbase-compress))
define Package/perlbase-config
$(call Package/perlbase-template)
TITLE:=Config perl module
+DEPENDS+=+perlbase-essential
endef
define Package/perlbase-config/install
-$(call perlmod/Install,$(1),Config Config.pm Config_heavy.pl,)
+$(call perlmod/Install,$(1),Config Config.pm Config_git.pl Config_heavy.pl,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Config-Perl-V/t)
endef
$(eval $(call BuildPackage,perlbase-config))
define Package/perlbase-cpan
$(call Package/perlbase-template)
TITLE:=CPAN perl module
-DEPENDS+=+perlbase-b +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-extutils +perlbase-fcntl +perlbase-file +perlbase-filehandle +perlbase-list +perlbase-net +perlbase-safe +perlbase-scalar +perlbase-sys +perlbase-text +perlbase-version
+DEPENDS+=+perlbase-b +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-extutils +perlbase-fcntl +perlbase-file +perlbase-filehandle +perlbase-http-tiny +perlbase-list +perlbase-net +perlbase-safe +perlbase-scalar +perlbase-sys +perlbase-text +perlbase-version
endef
define Package/perlbase-cpan/install
-$(call perlmod/Install,$(1),CPAN CPAN.pm,)
+$(call perlmod/Install,$(1),CPAN CPAN.pm Parse/CPAN/Meta.pm,CPAN/FirstTime.pm)
+$(call perlmod/Install/NoStrip,$(1),CPAN/FirstTime.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/CPAN-Meta-Requirements/t cpan/CPAN-Meta-YAML/t cpan/CPAN-Meta/t cpan/CPAN/t cpan/Parse-CPAN-Meta/t)
endef
$(eval $(call BuildPackage,perlbase-cpan))
define Package/perlbase-data/install
$(call perlmod/Install,$(1),Data auto/Data,)
+$(call perlmod/InstallBaseTests,$(1),dist/Data-Dumper/t)
endef
$(eval $(call BuildPackage,perlbase-data))
define Package/perlbase-db-file/install
$(call perlmod/Install,$(1),DB_File.pm auto/DB_File,)
+$(call perlmod/InstallBaseTests,$(1),cpan/DB_File/t)
endef
$(eval $(call BuildPackage,perlbase-db-file))
endef
define Package/perlbase-devel/install
-$(call perlmod/Install,$(1),Devel auto/Devel,)
+$(call perlmod/Install,$(1),Devel auto/Devel,Devel/PPPort.pm)
+$(call perlmod/Install/NoStrip,$(1),Devel/PPPort.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Devel-PPPort/t dist/Devel-SelfStubber/t ext/Devel-Peek/t)
endef
$(eval $(call BuildPackage,perlbase-devel))
define Package/perlbase-digest/install
$(call perlmod/Install,$(1),Digest Digest.pm auto/Digest,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Digest-MD5/MD5.xs cpan/Digest-MD5/t cpan/Digest-SHA/t cpan/Digest/t)
+ $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Digest-SHA/src
endef
$(eval $(call BuildPackage,perlbase-digest))
define Package/perlbase-dumpvalue/install
$(call perlmod/Install,$(1),Dumpvalue.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Dumpvalue/t)
endef
$(eval $(call BuildPackage,perlbase-dumpvalue))
define Package/perlbase-dynaloader/install
$(call perlmod/Install,$(1),DynaLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/DynaLoader/t)
endef
$(eval $(call BuildPackage,perlbase-dynaloader))
define Package/perlbase-encode/install
$(call perlmod/Install,$(1),Encode Encode.pm auto/Encode,Encode/PerlIO.pod Encode/Supported.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Encode/t)
endef
$(eval $(call BuildPackage,perlbase-encode))
define Package/perlbase-encoding/install
$(call perlmod/Install,$(1),encoding encoding.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/encoding-warnings/t)
endef
$(eval $(call BuildPackage,perlbase-encoding))
define Package/perlbase-env/install
$(call perlmod/Install,$(1),Env.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Env/t)
endef
$(eval $(call BuildPackage,perlbase-env))
define Package/perlbase-errno/install
$(call perlmod/Install,$(1),Errno.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/Errno/t)
endef
$(eval $(call BuildPackage,perlbase-errno))
define Package/perlbase-essential
$(call Package/perlbase-template)
TITLE:=essential perl module
-DEPENDS+=+perlbase-config
endef
define Package/perlbase-essential/install
-$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,)
+$(call perlmod/Install,$(1),Carp Carp.pm Exporter Exporter.pm constant.pm deprecate.pm lib.pm locale.pm overload.pm overloading.pm parent.pm strict.pm subs.pm vars.pm warnings warnings.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/parent/t dist/Carp/t dist/Exporter/t dist/constant/t dist/lib/t)
endef
$(eval $(call BuildPackage,perlbase-essential))
+define Package/perlbase-experimental
+$(call Package/perlbase-template)
+TITLE:=perl module to enable/disable experimental features
+DEPENDS+=+perlbase-essential +perlbase-feature
+endef
+
+define Package/perlbase-experimental/install
+$(call perlmod/Install,$(1),experimental.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/experimental/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-experimental))
+
+
define Package/perlbase-extutils
$(call Package/perlbase-template)
TITLE:=ExtUtils perl module
-DEPENDS+=+perlbase-autosplit +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-file +perlbase-io +perlbase-ipc +perlbase-symbol +perlbase-text
+DEPENDS+=+perlbase-autosplit +perlbase-config +perlbase-cwd +perlbase-dirhandle +perlbase-essential +perlbase-file +perlbase-io +perlbase-ipc +perlbase-ostype +perlbase-symbol +perlbase-text
endef
define Package/perlbase-extutils/install
-$(call perlmod/Install,$(1),ExtUtils,ExtUtils/MakeMaker/FAQ.pod ExtUtils/MakeMaker/Tutorial.pod)
+$(call perlmod/Install,$(1),ExtUtils,ExtUtils/MakeMaker/FAQ.pod ExtUtils/MakeMaker/Tutorial.pod ExtUtils/ParseXS.pm ExtUtils/ParseXS/Utilities.pm)
+$(call perlmod/Install/NoStrip,$(1),ExtUtils/ParseXS.pm ExtUtils/ParseXS/Utilities.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/ExtUtils-Constant/t cpan/ExtUtils-MakeMaker/t dist/ExtUtils-CBuilder/t dist/ExtUtils-Command/t dist/ExtUtils-Install/t dist/ExtUtils-Manifest/t dist/ExtUtils-ParseXS/t)
endef
$(eval $(call BuildPackage,perlbase-extutils))
define Package/perlbase-fcntl/install
$(call perlmod/Install,$(1),Fcntl.pm auto/Fcntl,)
+$(call perlmod/InstallBaseTests,$(1),ext/Fcntl/t)
endef
$(eval $(call BuildPackage,perlbase-fcntl))
endef
define Package/perlbase-file/install
-$(call perlmod/Install,$(1),File auto/File,)
+$(call perlmod/Install,$(1),File auto/File,File/Find.pm)
+$(call perlmod/Install/NoStrip,$(1),File/Find.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/File-Fetch/t cpan/File-Path/t cpan/File-Temp/t dist/PathTools/t ext/File-DosGlob/t ext/File-Find/t ext/File-Glob/t)
endef
$(eval $(call BuildPackage,perlbase-file))
define Package/perlbase-filecache/install
$(call perlmod/Install,$(1),FileCache.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/FileCache/t)
endef
$(eval $(call BuildPackage,perlbase-filecache))
define Package/perlbase-filter/install
$(call perlmod/Install,$(1),Filter auto/Filter,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Filter-Util-Call/filter-util.pl cpan/Filter-Util-Call/t dist/Filter-Simple/t)
endef
$(eval $(call BuildPackage,perlbase-filter))
define Package/perlbase-gdbm-file/install
$(call perlmod/Install,$(1),GDBM_File.pm auto/GDBM_File,)
+$(call perlmod/InstallBaseTests,$(1),ext/GDBM_File/t)
endef
$(eval $(call BuildPackage,perlbase-gdbm-file))
define Package/perlbase-getopt/install
$(call perlmod/Install,$(1),Getopt,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Getopt-Long/t)
endef
$(eval $(call BuildPackage,perlbase-getopt))
define Package/perlbase-hash/install
$(call perlmod/Install,$(1),Hash auto/Hash,)
+$(call perlmod/InstallBaseTests,$(1),ext/Hash-Util-FieldHash/t ext/Hash-Util/t)
endef
$(eval $(call BuildPackage,perlbase-hash))
+define Package/perlbase-http-tiny
+$(call Package/perlbase-template)
+TITLE:=http-tiny perl module
+DEPENDS+=+perlbase-errno +perlbase-essential +perlbase-io
+endef
+
+define Package/perlbase-http-tiny/install
+$(call perlmod/Install,$(1),HTTP/Tiny.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/HTTP-Tiny/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-http-tiny))
+
+
define Package/perlbase-i18n
$(call Package/perlbase-template)
TITLE:=I18N perl module
endef
define Package/perlbase-i18n/install
-$(call perlmod/Install,$(1),I18N auto/I18N,)
+$(call perlmod/Install,$(1),I18N auto/I18N,I18N/LangTags/List.pm)
+$(call perlmod/InstallBaseTests,$(1),dist/I18N-Collate/t dist/I18N-LangTags/t ext/I18N-Langinfo/t)
+$(call perlmod/Install/NoStrip,$(1),I18N/LangTags/List.pm)
endef
$(eval $(call BuildPackage,perlbase-i18n))
define Package/perlbase-if/install
$(call perlmod/Install,$(1),if.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/if/t)
endef
$(eval $(call BuildPackage,perlbase-if))
define Package/perlbase-io/install
$(call perlmod/Install,$(1),IO IO.pm auto/IO,)
+$(call perlmod/InstallBaseTests,$(1),cpan/IO-Compress/t cpan/IO-Socket-IP/t cpan/IO-Zlib/t dist/IO/Makefile.PL dist/IO/t)
endef
$(eval $(call BuildPackage,perlbase-io))
define Package/perlbase-ipc/install
$(call perlmod/Install,$(1),IPC auto/IPC,)
+$(call perlmod/InstallBaseTests,$(1),cpan/IPC-Cmd/t cpan/IPC-SysV/t ext/IPC-Open3/t)
endef
$(eval $(call BuildPackage,perlbase-ipc))
+define Package/perlbase-json-pp
+$(call Package/perlbase-template)
+TITLE:=json-pp perl module
+DEPENDS+=+perlbase-b +perlbase-base +perlbase-essential
+endef
+
+define Package/perlbase-json-pp/install
+$(call perlmod/Install,$(1),JSON/PP JSON/PP.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/JSON-PP/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-json-pp))
+
+
define Package/perlbase-less
$(call Package/perlbase-template)
TITLE:=less perl module
define Package/perlbase-locale/install
$(call perlmod/Install,$(1),Locale,Locale/Constants.pod Locale/Country.pod Locale/Currency.pod Locale/Language.pod Locale/Maketext.pod Locale/Maketext/TPJ13.pod Locale/Script.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Locale-Codes/t cpan/Locale-Maketext-Simple/t dist/Locale-Maketext/t)
endef
$(eval $(call BuildPackage,perlbase-locale))
define Package/perlbase-math/install
$(call perlmod/Install,$(1),Math auto/Math,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Math-Complex/t dist/Math-BigInt-FastCalc/t dist/Math-BigInt/t dist/Math-BigRat/t)
endef
$(eval $(call BuildPackage,perlbase-math))
define Package/perlbase-memoize/install
$(call perlmod/Install,$(1),Memoize Memoize.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Memoize/t)
endef
$(eval $(call BuildPackage,perlbase-memoize))
define Package/perlbase-mime/install
$(call perlmod/Install,$(1),MIME auto/MIME,)
+$(call perlmod/InstallBaseTests,$(1),cpan/MIME-Base64/t)
endef
$(eval $(call BuildPackage,perlbase-mime))
define Package/perlbase-module
$(call Package/perlbase-template)
TITLE:=Module perl module
-DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-filehandle +perlbase-if +perlbase-io +perlbase-locale +perlbase-params +perlbase-text +perlbase-version
+DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-data +perlbase-essential +perlbase-extutils +perlbase-file +perlbase-filehandle +perlbase-if +perlbase-io +perlbase-locale +perlbase-ostype +perlbase-params +perlbase-text +perlbase-version
endef
define Package/perlbase-module/install
-$(call perlmod/Install,$(1),Module,Module/Build/API.pod Module/Build/Authoring.pod)
+$(call perlmod/Install,$(1),Module,Module/Build Module/Build.pm Module/Build/API.pod Module/Build/Authoring.pod)
+$(call perlmod/Install/NoStrip,$(1),Module/Build Module/Build.pm,Module/Build/API.pod Module/Build/Authoring.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/Module-Build/lib cpan/Module-Build/t cpan/Module-Load-Conditional/t cpan/Module-Load/t cpan/Module-Loaded/t cpan/Module-Metadata/lib cpan/Module-Metadata/t dist/Module-CoreList/t)
endef
$(eval $(call BuildPackage,perlbase-module))
endef
define Package/perlbase-mro/install
-$(call perlmod/Install,$(1),mro.pm,)
+$(call perlmod/Install,$(1),auto/mro mro.pm,)
endef
$(eval $(call BuildPackage,perlbase-mro))
define Package/perlbase-net/install
$(call perlmod/Install,$(1),Net,Net/libnetFAQ.pod)
+$(call perlmod/InstallBaseTests,$(1),cpan/libnet/t dist/Net-Ping/t)
endef
$(eval $(call BuildPackage,perlbase-net))
define Package/perlbase-next/install
$(call perlmod/Install,$(1),NEXT.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/NEXT/t)
endef
$(eval $(call BuildPackage,perlbase-next))
endef
define Package/perlbase-opcode/install
-$(call perlmod/Install,$(1),Opcode.pm auto/Opcode,)
+$(call perlmod/Install,$(1),auto/Opcode,)
+$(call perlmod/Install/NoStrip,$(1),Opcode.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/Opcode/t)
endef
$(eval $(call BuildPackage,perlbase-opcode))
$(eval $(call BuildPackage,perlbase-ops))
+define Package/perlbase-ostype
+$(call Package/perlbase-template)
+TITLE:=OSType perl module
+DEPENDS+=+perlbase-essential
+endef
+
+define Package/perlbase-ostype/install
+$(call perlmod/Install,$(1),Perl/OSType.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Perl-OSType/t)
+endef
+
+$(eval $(call BuildPackage,perlbase-ostype))
+
+
define Package/perlbase-package
$(call Package/perlbase-template)
TITLE:=Package perl module
define Package/perlbase-package/install
$(call perlmod/Install,$(1),Package,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Package-Constants/t)
endef
$(eval $(call BuildPackage,perlbase-package))
define Package/perlbase-params/install
$(call perlmod/Install,$(1),Params,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Params-Check/t)
endef
$(eval $(call BuildPackage,perlbase-params))
define Package/perlbase-perlio/install
$(call perlmod/Install,$(1),PerlIO PerlIO.pm auto/PerlIO,)
+$(call perlmod/InstallBaseTests,$(1),cpan/PerlIO-via-QuotedPrint/t ext/PerlIO-encoding/t ext/PerlIO-scalar/t ext/PerlIO-via/t)
endef
$(eval $(call BuildPackage,perlbase-perlio))
endef
define Package/perlbase-pod/install
-$(call perlmod/Install,$(1),Pod,)
+$(call perlmod/Install,$(1),Pod,Pod/Usage.pm)
+$(call perlmod/Install/NoStrip,$(1),Pod/Usage.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Pod-Checker/t cpan/Pod-Escapes/t cpan/Pod-Parser/lib cpan/Pod-Parser/scripts cpan/Pod-Parser/t cpan/Pod-Perldoc/t cpan/Pod-Simple/t cpan/Pod-Usage/scripts cpan/Pod-Usage/t cpan/podlators/t ext/Pod-Functions/Functions.pm ext/Pod-Functions/t ext/Pod-Html/t)
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2man $(1)/usr/bin/
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/pod2text $(1)/usr/bin/
endef
$(eval $(call BuildPackage,perlbase-pod))
define Package/perlbase-posix/install
$(call perlmod/Install,$(1),POSIX.pm auto/POSIX,)
+$(call perlmod/InstallBaseTests,$(1),ext/POSIX/Makefile.PL ext/POSIX/POSIX.xs ext/POSIX/t)
endef
$(eval $(call BuildPackage,perlbase-posix))
define Package/perlbase-re/install
$(call perlmod/Install,$(1),auto/re re.pm,)
+$(call perlmod/InstallBaseTests,$(1),ext/re/t)
endef
$(eval $(call BuildPackage,perlbase-re))
define Package/perlbase-safe/install
$(call perlmod/Install,$(1),Safe.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Safe/t)
endef
$(eval $(call BuildPackage,perlbase-safe))
define Package/perlbase-scalar/install
$(call perlmod/Install,$(1),Scalar,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Scalar-List-Utils/t)
+ $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/cpan/Scalar-List-Utils/blib
endef
$(eval $(call BuildPackage,perlbase-scalar))
define Package/perlbase-sdbm-file/install
$(call perlmod/Install,$(1),SDBM_File.pm auto/SDBM_File,)
+$(call perlmod/InstallBaseTests,$(1),ext/SDBM_File/t)
endef
$(eval $(call BuildPackage,perlbase-sdbm-file))
define Package/perlbase-search/install
$(call perlmod/Install,$(1),Search,)
+$(call perlmod/InstallBaseTests,$(1),dist/Search-Dict/t)
endef
$(eval $(call BuildPackage,perlbase-search))
define Package/perlbase-selfloader/install
$(call perlmod/Install,$(1),SelfLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/SelfLoader/t)
endef
$(eval $(call BuildPackage,perlbase-selfloader))
define Package/perlbase-socket/install
$(call perlmod/Install,$(1),Socket.pm auto/Socket,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Socket/t)
endef
$(eval $(call BuildPackage,perlbase-socket))
define Package/perlbase-storable/install
$(call perlmod/Install,$(1),Storable.pm auto/Storable,)
+$(call perlmod/InstallBaseTests,$(1),dist/Storable/t)
endef
$(eval $(call BuildPackage,perlbase-storable))
define Package/perlbase-sys/install
$(call perlmod/Install,$(1),Sys auto/Sys,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Sys-Syslog/t ext/Sys-Hostname/t)
endef
$(eval $(call BuildPackage,perlbase-sys))
+define Package/perlbase-tap
+$(call Package/perlbase-template)
+TITLE:=TAP perl module
+DEPENDS+=+perlbase-base +perlbase-benchmark +perlbase-config +perlbase-essential +perlbase-file +perlbase-io +perlbase-posix +perlbase-text
+endef
+
+define Package/perlbase-tap/install
+$(call perlmod/Install,$(1),TAP,)
+endef
+
+$(eval $(call BuildPackage,perlbase-tap))
+
+
define Package/perlbase-term
$(call Package/perlbase-template)
TITLE:=Term perl module
define Package/perlbase-term/install
$(call perlmod/Install,$(1),Term,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Term-ANSIColor/t cpan/Term-Cap/test.pl dist/Term-Complete/t dist/Term-ReadLine/t)
endef
$(eval $(call BuildPackage,perlbase-term))
define Package/perlbase-test
$(call Package/perlbase-template)
TITLE:=Test perl module
-DEPENDS+=+perlbase-base +perlbase-config +perlbase-essential +perlbase-symbol +perlbase-text
+DEPENDS+=+perlbase-base +perlbase-config +perlbase-essential +perlbase-symbol +perlbase-tap +perlbase-text
endef
define Package/perlbase-test/install
-$(call perlmod/Install,$(1),Test Test.pm,Test/Harness/TAP.pod Test/Tutorial.pod)
+$(call perlmod/Install,$(1),Test Test.pm,Test/Builder.pm Test/Harness/TAP.pod Test/More.pm Test/Tutorial.pod)
+$(call perlmod/Install/NoStrip,$(1),Test/Builder.pm Test/More.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Test-Harness/t cpan/Test-Simple/t cpan/Test/t)
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/prove $(1)/usr/bin
endef
define Package/perlbase-text
$(call Package/perlbase-template)
TITLE:=Text perl module
-DEPENDS+=+perlbase-essential
+DEPENDS+=+perlbase-essential +perlbase-selfloader
endef
define Package/perlbase-text/install
$(call perlmod/Install,$(1),Text,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Text-Balanced/t cpan/Text-ParseWords/t cpan/Text-Tabs/t dist/Text-Abbrev/t)
endef
$(eval $(call BuildPackage,perlbase-text))
define Package/perlbase-thread/install
$(call perlmod/Install,$(1),Thread Thread.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/Thread-Queue/t dist/Thread-Semaphore/t)
endef
$(eval $(call BuildPackage,perlbase-thread))
define Package/perlbase-threads/install
$(call perlmod/Install,$(1),auto/threads threads threads.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/threads-shared/t dist/threads/t)
endef
$(eval $(call BuildPackage,perlbase-threads))
endef
define Package/perlbase-tie/install
-$(call perlmod/Install,$(1),Tie,)
+$(call perlmod/Install,$(1),Tie auto/Tie,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Tie-RefHash/t dist/Tie-File/t ext/Tie-Hash-NamedCapture/t ext/Tie-Memoize/lib/Tie/Memoize.pm ext/Tie-Memoize/t)
endef
$(eval $(call BuildPackage,perlbase-tie))
define Package/perlbase-time/install
$(call perlmod/Install,$(1),Time auto/Time,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Time-HiRes/t cpan/Time-Local/t cpan/Time-Piece/t)
endef
$(eval $(call BuildPackage,perlbase-time))
define Package/perlbase-unicode/install
$(call perlmod/Install,$(1),Unicode auto/Unicode,)
+$(call perlmod/InstallBaseTests,$(1),cpan/Unicode-Collate/t cpan/Unicode-Normalize/t)
endef
$(eval $(call BuildPackage,perlbase-unicode))
define Package/perlbase-version
$(call Package/perlbase-template)
TITLE:=version perl module
-DEPENDS+=+perlbase-essential
+DEPENDS+=+perlbase-config +perlbase-essential
endef
define Package/perlbase-version/install
-$(call perlmod/Install,$(1),version.pm,)
+$(call perlmod/Install,$(1),version version.pm,)
+$(call perlmod/InstallBaseTests,$(1),cpan/version/t)
endef
$(eval $(call BuildPackage,perlbase-version))
define Package/perlbase-xsloader/install
$(call perlmod/Install,$(1),XSLoader.pm,)
+$(call perlmod/InstallBaseTests,$(1),dist/XSLoader/t ext/XS-APItest/t ext/XS-Typemap/t)
endef
$(eval $(call BuildPackage,perlbase-xsloader))
+
+
+# Generated Mon Oct 13 10:06:15 2014
# Module install prefix
PERL_SITELIB:=/usr/lib/perl5/5.20
+PERL_TESTSDIR:=/usr/share/perl/perl-tests
+PERLBASE_TESTSDIR:=/usr/share/perl/perlbase-tests
+PERLMOD_TESTSDIR:=/usr/share/perl/perlmod-tests
define perlmod/host/relink
rm -f $(1)/Makefile.aperl
install
endef
-define perlmod/Install
+define perlmod/Install/NoStrip
$(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
(cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
rsync --relative -rlHp --itemize-changes \
$(strip $(2)) $(strip $(1))$(PERL_SITELIB))
chmod -R u+w $(strip $(1))$(PERL_SITELIB)
+endef
+
+
+define perlmod/Install
+ $(call perlmod/Install/NoStrip,$(1),$(2),$(3))
@echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
xargs -r sed -i \
- -e '/^=\(head\|pod\|item\|over\|back\|encoding\)/,/^=cut/d' \
- -e '/^=\(head\|pod\|item\|over\|back\|encoding\)/,$$$$d' \
+ -e '/^=\(head\|pod\|item\|over\|back\|encoding\|begin\|end\|for\)/,/^=cut/d' \
+ -e '/^=\(head\|pod\|item\|over\|back\|encoding\|begin\|end\|for\)/,$$$$d' \
-e '/^#$$$$/d' \
-e '/^#[^!"'"'"']/d'
endef
+
+# You probably don't want to use this directly. Look at perlmod/InstallTests
+define perlmod/_InstallTests
+ $(INSTALL_DIR) $(strip $(1))
+ (cd $(PKG_BUILD_DIR)/$(2) && \
+ rsync --relative -rlHp --itemize-changes \
+ --exclude=.packlist \
+ --prune-empty-dirs \
+ $(strip $(3)) $(strip $(1)))
+
+ chmod -R u+w $(strip $(1))
+endef
+
+define perlmod/InstallBaseTests
+ $(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),,$(2)))
+endef
+
+define perlmod/InstallTests
+ $(if $(CONFIG_PERL_TESTS),$(call perlmod/_InstallTests,$(1)$(PERL_TESTSDIR),$(2),$(3)))
+endef
include $(TOPDIR)/rules.mk
PKG_NAME:=php
-PKG_VERSION:=5.4.33
+PKG_VERSION:=5.4.35
PKG_RELEASE:=1
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.php.net/distributions/
-PKG_MD5SUM:=c6878bb1cdb46bfc1e1a5cd67a024737
+PKG_MD5SUM:=489cc8336488fb2e722ffa3c08f9c864
PKG_FIXUP:=libtool no-autoreconf
PKG_BUILD_PARALLEL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=ISC
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
--- /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:=python-pip
+PKG_VERSION:=1.5.6
+PKG_RELEASE:=1
+
+PKG_SOURCE:=pip-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/p/pip/
+PKG_MD5SUM:=01026f87978932060cc86c1dc527903e
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/pip-$(PKG_VERSION)
+PKG_USE_MIPS16:=0
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-pip
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Tool for installing Python packages.
+ URL:=https://pip.pypa.io
+ DEPENDS:=+python +python-setuptools
+endef
+
+define Package/python-pip/description
+ A tool for installing and managing Python packages.
+endef
+
+PYTHONPATH:=$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+define Build/Compile
+ $(INSTALL_DIR) $(PYTHONPATH)
+ $(call Build/Compile/PyMod,,\
+ install --prefix="$(PKG_INSTALL_DIR)/usr" \
+ )
+endef
+
+define PyPackage/python-pip/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+endef
+
+define PyPackage/python-pip/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
+endef
+
+$(eval $(call PyPackage,python-pip))
+$(eval $(call BuildPackage,python-pip))
+
--- /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:=python-setuptools
+PKG_VERSION:=7.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=setuptools-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://pypi.python.org/packages/source/s/setuptools/
+PKG_MD5SUM:=6245d6752e2ef803c365f560f7f2f940
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/setuptools-$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+$(call include_mk, python-package.mk)
+
+define Package/python-setuptools
+ SUBMENU:=Python
+ SECTION:=lang
+ CATEGORY:=Languages
+ TITLE:=Tool for installing Python packages.
+ URL:=https://bitbucket.org/pypa/setuptools
+ DEPENDS:=+python
+endef
+
+define Package/python-setuptools/description
+ Easily download, build, install, upgrade, and uninstall Python packages
+endef
+
+PYTHONPATH:=$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
+define Build/Compile
+ $(INSTALL_DIR) $(PYTHONPATH)
+ $(call Build/Compile/PyMod,,\
+ install --prefix="$(PKG_INSTALL_DIR)/usr" \
+ )
+endef
+
+define PyPackage/python-setuptools/filespec
++|/usr/lib/python$(PYTHON_VERSION)/site-packages
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(2)/lib/python$(PYTHON_VERSION)/site-packages
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
+ $(HOST_PYTHON_LIB_DIR)/site-packages
+endef
+
+define PyPackage/python-setuptools/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call PyPackage,python-setuptools))
+$(eval $(call BuildPackage,python-setuptools))
+
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python/host
+PKG_BUILD_DEPENDS:=libffi/host python/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
the development of higher quality, more maintainable code.
endef
-define Package/python
-$(call Package/python/Default)
- DEPENDS:=+libpthread +zlib +libffi +libopenssl +libcrypto
-endef
-
-define Package/python/description
-$(call Package/python/Default/description)
- .
- This package contains only a minimal Python install.
-endef
-
-define Package/python-full
-$(call Package/python/Default)
- TITLE+= (full)
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python
-endef
-
-define Package/python-full/description
-$(call Package/python/Default/description)
- .
- This package contains the full Python install.
-endef
-
-define Package/python-doc
-$(call Package/python/Default)
- TITLE:=Python interactive documentation
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python
-endef
-
-define Package/python-bzip2
-$(call Package/python/Default)
- TITLE:=Python support for Bzip2
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libbz2
-endef
-
-define Package/python-expat
-$(call Package/python/Default)
- TITLE:=Python support for expat
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libexpat
-endef
-
-define Package/python-gzip
-$(call Package/python/Default)
- TITLE:=Python support for gzip
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python
-endef
-
-define Package/python-openssl
-$(call Package/python/Default)
- TITLE:=Python support for OpenSSL
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libopenssl
-endef
-
-define Package/python-shutil
-$(call Package/python/Default)
- TITLE:=Python support for shutil
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python
-endef
-
-# Needs datetime
-define Package/python-sqlite3
+define Package/python-base
$(call Package/python/Default)
- TITLE:=Python support for sqlite3
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libsqlite3
+ TITLE:=Python $(PYTHON_VERSION) interpreter
+ DEPENDS:=+libpthread +zlib +libffi +libopenssl
endef
-define Package/python-gdbm
-$(call Package/python/Default)
- TITLE:=Python support for gdbm
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libgdbm
+define Package/python-base/description
+ This package contains only the interpreter and the bare minimum
+ for the interpreter to start.
endef
-define Package/python-readline
+define Package/python
$(call Package/python/Default)
- TITLE:=Python support for readline
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libreadline +libncursesw @BROKEN
+ DEPENDS:=+python-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libexpat +libdb47
endef
-define Package/python-ncurses
-$(call Package/python/Default)
- TITLE:=Python support for readline
- DEPENDS:=@PACKAGE_python +PACKAGE_python:python +libncursesw
+define Package/python/description
+ This package contains the (almost) full Python install.
endef
-MAKE_FLAGS:=\
- $(TARGET_CONFIGURE_OPTS) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
+MAKE_FLAGS+=\
CROSS_COMPILE=yes \
- CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
- LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)" \
LD="$(TARGET_CC)" \
PGEN=pgen2
+EXTRA_CFLAGS+= \
+ -DNDEBUG -fno-inline
+EXTRA_LDFLAGS+= \
+ -L$(PKG_BUILD_DIR)
+
ENABLE_IPV6:=
ifeq ($(CONFIG_IPV6),y)
ENABLE_IPV6 += --enable-ipv6
endif
-define Build/Configure
- -$(MAKE) -C $(PKG_BUILD_DIR) distclean
- (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0)
- $(CP) ./files/config.site $(PKG_BUILD_DIR)
- $(call Build/Configure/Default, \
- --sysconfdir=/etc \
- --enable-shared \
- --without-cxx-main \
- --with-threads \
- --with-system-ffi="$(STAGING_DIR)/usr" \
- --without-ensurepip \
- --without-pymalloc \
- $(ENABLE_IPV6) \
- CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
- OPT="$(TARGET_CFLAGS)" \
- )
+CONFIGURE_ARGS+= \
+ --sysconfdir=/etc \
+ --enable-shared \
+ --without-cxx-main \
+ --with-threads \
+ --with-system-ffi="$(STAGING_DIR)/usr" \
+ --without-pymalloc \
+ $(ENABLE_IPV6) \
+ CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
+ OPT="$(TARGET_CFLAGS)"
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
endef
define Build/InstallDev
- $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR)/mk/
+ $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
$(INSTALL_DATA) ./files/python-package.mk $(STAGING_DIR)/mk/
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
$(1)/usr/lib/python$(PYTHON_VERSION)/
-
- $(CP) \
- $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \
- $(2)/bin/
- $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config
-endef
-
-define PyPackage/python-full/filespec
-+|/usr/lib/python$(PYTHON_VERSION)
--|/usr/lib/python$(PYTHON_VERSION)/bsddb/test
--|/usr/lib/python$(PYTHON_VERSION)/config
--|/usr/lib/python$(PYTHON_VERSION)/ctypes/test
--|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst-*.exe
--|/usr/lib/python$(PYTHON_VERSION)/distutils/tests
--|/usr/lib/python$(PYTHON_VERSION)/email/test
--|/usr/lib/python$(PYTHON_VERSION)/idlelib
--|/usr/lib/python$(PYTHON_VERSION)/json/tests
--|/usr/lib/python$(PYTHON_VERSION)/lib-tk
--|/usr/lib/python$(PYTHON_VERSION)/sqlite3
--|/usr/lib/python$(PYTHON_VERSION)/test
--|/usr/lib/python$(PYTHON_VERSION)/lib2to3
--|/usr/lib/python$(PYTHON_VERSION)/lib-old
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so
--|/usr/lib/python$(PYTHON_VERSION)/pydoc_data
--|/usr/lib/python$(PYTHON_VERSION)/pydoc.py
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ctypes_test.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so
--|/usr/lib/python$(PYTHON_VERSION)/__future__.py
--|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py
--|/usr/lib/python$(PYTHON_VERSION)/abc.py
--|/usr/lib/python$(PYTHON_VERSION)/codecs.py
--|/usr/lib/python$(PYTHON_VERSION)/compileall.py
--|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py
--|/usr/lib/python$(PYTHON_VERSION)/copy.py
--|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py
--|/usr/lib/python$(PYTHON_VERSION)/dis.py
--|/usr/lib/python$(PYTHON_VERSION)/encodings
--|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py
--|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
--|/usr/lib/python$(PYTHON_VERSION)/getopt.py
--|/usr/lib/python$(PYTHON_VERSION)/glob.py
--|/usr/lib/python$(PYTHON_VERSION)/hashlib.py
--|/usr/lib/python$(PYTHON_VERSION)/inspect.py
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/dbm.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bsddb.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_hashlib.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so
--|/usr/lib/python$(PYTHON_VERSION)/linecache.py
--|/usr/lib/python$(PYTHON_VERSION)/md5.py
--|/usr/lib/python$(PYTHON_VERSION)/new.py
--|/usr/lib/python$(PYTHON_VERSION)/opcode.py
--|/usr/lib/python$(PYTHON_VERSION)/optparse.py
--|/usr/lib/python$(PYTHON_VERSION)/os.py
--|/usr/lib/python$(PYTHON_VERSION)/pickle.py
--|/usr/lib/python$(PYTHON_VERSION)/pickle.py
--|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py
--|/usr/lib/python$(PYTHON_VERSION)/popen2.py
--|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
--|/usr/lib/python$(PYTHON_VERSION)/py_compile.py
--|/usr/lib/python$(PYTHON_VERSION)/random.py
--|/usr/lib/python$(PYTHON_VERSION)/repr.py
--|/usr/lib/python$(PYTHON_VERSION)/re.py
--|/usr/lib/python$(PYTHON_VERSION)/sha.py
--|/usr/lib/python$(PYTHON_VERSION)/site.py
--|/usr/lib/python$(PYTHON_VERSION)/socket.py
--|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py
--|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py
--|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py
--|/usr/lib/python$(PYTHON_VERSION)/sre.py
--|/usr/lib/python$(PYTHON_VERSION)/stat.py
--|/usr/lib/python$(PYTHON_VERSION)/StringIO.py
--|/usr/lib/python$(PYTHON_VERSION)/stringprep.py
--|/usr/lib/python$(PYTHON_VERSION)/string.py
--|/usr/lib/python$(PYTHON_VERSION)/struct.py
--|/usr/lib/python$(PYTHON_VERSION)/subprocess.py
--|/usr/lib/python$(PYTHON_VERSION)/tempfile.py
--|/usr/lib/python$(PYTHON_VERSION)/textwrap.py
--|/usr/lib/python$(PYTHON_VERSION)/tokenize.py
--|/usr/lib/python$(PYTHON_VERSION)/token.py
--|/usr/lib/python$(PYTHON_VERSION)/traceback.py
--|/usr/lib/python$(PYTHON_VERSION)/types.py
--|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
--|/usr/lib/python$(PYTHON_VERSION)/warnings.py
--|/usr/lib/python$(PYTHON_VERSION)/weakref.py
--|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
--|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
--|/usr/lib/python$(PYTHON_VERSION)/functools.py
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so
--|/usr/lib/python$(PYTHON_VERSION)/collections.py
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so
--|/usr/lib/python$(PYTHON_VERSION)/keyword.py
--|/usr/lib/python$(PYTHON_VERSION)/heapq.py
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
--|/usr/lib/python$(PYTHON_VERSION)/bisect.py
--|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
endef
-define PyPackage/python/filespec
+define PyPackage/python-base/filespec
+|/usr/bin/python$(PYTHON_VERSION)
-+|/usr/lib/python$(PYTHON_VERSION)/__future__.py
+|/usr/lib/python$(PYTHON_VERSION)/_abcoll.py
++|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py
++|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
+|/usr/lib/python$(PYTHON_VERSION)/abc.py
-+|/usr/lib/python$(PYTHON_VERSION)/codecs.py
-+|/usr/lib/python$(PYTHON_VERSION)/compileall.py
-+|/usr/lib/python$(PYTHON_VERSION)/ConfigParser.py
-+|/usr/lib/python$(PYTHON_VERSION)/copy.py
+|/usr/lib/python$(PYTHON_VERSION)/copy_reg.py
-+|/usr/lib/python$(PYTHON_VERSION)/dis.py
-+|/usr/lib/python$(PYTHON_VERSION)/encodings
-+|/usr/lib/python$(PYTHON_VERSION)/fnmatch.py
+|/usr/lib/python$(PYTHON_VERSION)/genericpath.py
-+|/usr/lib/python$(PYTHON_VERSION)/getopt.py
-+|/usr/lib/python$(PYTHON_VERSION)/glob.py
-+|/usr/lib/python$(PYTHON_VERSION)/hashlib.py
-+|/usr/lib/python$(PYTHON_VERSION)/inspect.py
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/array.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/binascii.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/cStringIO.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/fcntl.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/grp.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/itertools.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/math.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_hashlib.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/operator.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_random.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/select.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_socket.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/strop.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_struct.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/syslog.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/time.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/unicodedata.so
+|/usr/lib/python$(PYTHON_VERSION)/linecache.py
-+|/usr/lib/python$(PYTHON_VERSION)/md5.py
-+|/usr/lib/python$(PYTHON_VERSION)/new.py
-+|/usr/lib/python$(PYTHON_VERSION)/opcode.py
-+|/usr/lib/python$(PYTHON_VERSION)/optparse.py
-+|/usr/lib/python$(PYTHON_VERSION)/os.py
-+|/usr/lib/python$(PYTHON_VERSION)/pickle.py
-+|/usr/lib/python$(PYTHON_VERSION)/pickle.py
-+|/usr/lib/python$(PYTHON_VERSION)/pkgutil.py
-+|/usr/lib/python$(PYTHON_VERSION)/popen2.py
+|/usr/lib/python$(PYTHON_VERSION)/posixpath.py
-+|/usr/lib/python$(PYTHON_VERSION)/py_compile.py
-+|/usr/lib/python$(PYTHON_VERSION)/random.py
-+|/usr/lib/python$(PYTHON_VERSION)/repr.py
++|/usr/lib/python$(PYTHON_VERSION)/os.py
+|/usr/lib/python$(PYTHON_VERSION)/re.py
-+|/usr/lib/python$(PYTHON_VERSION)/sha.py
+|/usr/lib/python$(PYTHON_VERSION)/site.py
-+|/usr/lib/python$(PYTHON_VERSION)/socket.py
+|/usr/lib/python$(PYTHON_VERSION)/sre_compile.py
+|/usr/lib/python$(PYTHON_VERSION)/sre_constants.py
+|/usr/lib/python$(PYTHON_VERSION)/sre_parse.py
-+|/usr/lib/python$(PYTHON_VERSION)/sre.py
++|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
+|/usr/lib/python$(PYTHON_VERSION)/stat.py
-+|/usr/lib/python$(PYTHON_VERSION)/StringIO.py
-+|/usr/lib/python$(PYTHON_VERSION)/stringprep.py
-+|/usr/lib/python$(PYTHON_VERSION)/string.py
-+|/usr/lib/python$(PYTHON_VERSION)/struct.py
-+|/usr/lib/python$(PYTHON_VERSION)/subprocess.py
-+|/usr/lib/python$(PYTHON_VERSION)/tempfile.py
-+|/usr/lib/python$(PYTHON_VERSION)/textwrap.py
-+|/usr/lib/python$(PYTHON_VERSION)/tokenize.py
-+|/usr/lib/python$(PYTHON_VERSION)/token.py
+|/usr/lib/python$(PYTHON_VERSION)/traceback.py
+|/usr/lib/python$(PYTHON_VERSION)/types.py
+|/usr/lib/python$(PYTHON_VERSION)/UserDict.py
+|/usr/lib/python$(PYTHON_VERSION)/warnings.py
-+|/usr/lib/python$(PYTHON_VERSION)/weakref.py
-+|/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py
-+|/usr/lib/python$(PYTHON_VERSION)/config/Makefile
-+|/usr/lib/python$(PYTHON_VERSION)/sysconfig.py
-+|/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py
-+|/usr/lib/python$(PYTHON_VERSION)/functools.py
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_functools.so
-+|/usr/lib/python$(PYTHON_VERSION)/collections.py
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_collections.so
-+|/usr/lib/python$(PYTHON_VERSION)/keyword.py
-+|/usr/lib/python$(PYTHON_VERSION)/heapq.py
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_heapq.so
-+|/usr/lib/python$(PYTHON_VERSION)/bisect.py
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_bisect.so
endef
-define PyPackage/python/install
+define PyPackage/python/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/config
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
+-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
+-|/usr/lib/python$(PYTHON_VERSION)/lib-tk
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_testcapi.so
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
+-|/usr/lib/python$(PYTHON_VERSION)/test
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
+endef
+
+define PyPackage/python-base/install
$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python
$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python2
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
endef
-define PyPackage/python-doc/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/pydoc_data
-+|/usr/lib/python$(PYTHON_VERSION)/pydoc.py
-endef
-
-define PyPackage/python-bzip2/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/bz2.so
-endef
-
-define PyPackage/python-expat/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/pyexpat.so
-endef
-
-define PyPackage/python-gzip/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/gzip.py
-endef
-
-define PyPackage/python-openssl/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_ssl.so
-endef
-
-define PyPackage/python-shutil/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/shutil.py
-endef
-
-define PyPackage/python-sqlite3/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/sqlite3
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_sqlite3.so
-endef
-
-define PyPackage/python-gdbm/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/gdbm.so
-endef
-
-define PyPackage/python-readline/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline.so
-endef
-
-define PyPackage/python-ncurses/filespec
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses.so
-+|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_curses_panel.so
-endef
-
-define Host/Configure
- -$(MAKE) -C $(HOST_BUILD_DIR) distclean
- (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0)
- (cd $(HOST_BUILD_DIR); \
- rm -rf config.cache; \
- CONFIG_SITE= \
- OPT="$(HOST_CFLAGS)" \
- ./configure \
- --without-cxx-main \
- --without-ensurepip \
- --without-pymalloc \
- --with-threads \
- --prefix=$(STAGING_DIR_HOST); \
- )
-endef
-
-define Host/Compile
- +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
- python Parser/pgen
- +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
- sharedmods
-endef
+HOST_CONFIGURE_ARGS+= \
+ --without-cxx-main \
+ --without-pymalloc \
+ --with-threads \
+ --prefix=$(STAGING_DIR_HOST) \
+ CONFIG_SITE= \
+ OPT="$(HOST_CFLAGS)"
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
- $(MAKE) -C $(HOST_BUILD_DIR) \
- install
+ $(MAKE) -C $(HOST_BUILD_DIR) install
$(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen2
endef
-
$(eval $(call HostBuild))
+$(eval $(call PyPackage,python-base))
$(eval $(call PyPackage,python))
-$(eval $(call PyPackage,python-full))
-$(eval $(call PyPackage,python-doc))
-$(eval $(call PyPackage,python-bzip2))
-$(eval $(call PyPackage,python-expat))
-$(eval $(call PyPackage,python-gzip))
-$(eval $(call PyPackage,python-openssl))
-$(eval $(call PyPackage,python-shutil))
-$(eval $(call PyPackage,python-sqlite3))
-$(eval $(call PyPackage,python-gdbm))
-$(eval $(call PyPackage,python-readline))
-$(eval $(call PyPackage,python-ncurses))
+$(eval $(call BuildPackage,python-base))
$(eval $(call BuildPackage,python))
-$(eval $(call BuildPackage,python-full))
-$(eval $(call BuildPackage,python-doc))
-$(eval $(call BuildPackage,python-bzip2))
-$(eval $(call BuildPackage,python-expat))
-$(eval $(call BuildPackage,python-gzip))
-$(eval $(call BuildPackage,python-openssl))
-$(eval $(call BuildPackage,python-shutil))
-$(eval $(call BuildPackage,python-sqlite3))
-$(eval $(call BuildPackage,python-gdbm))
-$(eval $(call BuildPackage,python-readline))
-$(eval $(call BuildPackage,python-ncurses))
PYTHON:=python$(PYTHON_VERSION)
+HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION)
HOST_PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/python2
+PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)
define HostPython
- ( export PYTHONPATH="$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)"; \
+ ( export PYTHONPATH="$(PYTHONPATH)"; \
export PYTHONOPTIMIZE=""; \
export PYTHONDONTWRITEBYTECODE=1; \
$(1) \
)
endef
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+ TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
define PyPackage
$(call shexport,PyPackage/$(1)/filespec)
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON_VERSION)" \
_PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
+ __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON)" \
$(3) \
, \
./setup.py $(2) \
--- /dev/null
+diff --git a/Python/pythonrun.c b/Python/pythonrun.c
+index 748a63b..cb6e291 100644
+--- a/Python/pythonrun.c
++++ b/Python/pythonrun.c
+@@ -79,7 +79,7 @@ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */
+ int Py_InspectFlag; /* Needed to determine whether to exit at SystemExit */
+ int Py_NoSiteFlag; /* Suppress 'import site' */
+ int Py_BytesWarningFlag; /* Warn on str(bytes) and str(buffer) */
+-int Py_DontWriteBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */
++int Py_DontWriteBytecodeFlag = 1; /* Suppress writing bytecode files (*.py[co]) */
+ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */
+ int Py_FrozenFlag; /* Needed by getpath.c */
+ int Py_UnicodeFlag = 0; /* Needed by compile.c */
+@@ -174,7 +174,7 @@ Py_InitializeEx(int install_sigs)
+ if ((p = Py_GETENV("PYTHONOPTIMIZE")) && *p != '\0')
+ Py_OptimizeFlag = add_flag(Py_OptimizeFlag, p);
+ if ((p = Py_GETENV("PYTHONDONTWRITEBYTECODE")) && *p != '\0')
+- Py_DontWriteBytecodeFlag = add_flag(Py_DontWriteBytecodeFlag, p);
++ Py_DontWriteBytecodeFlag = atoi(p);
+ /* The variable is only tested for existence here; _PyRandom_Init will
+ check its value further. */
+ if ((p = Py_GETENV("PYTHONHASHSEED")) && *p != '\0')
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)
-PKG_MD5SUM:=6cafc183b4106476dd73d5738d7f616a
+PKG_MD5SUM:=36fc7327c02c6f12fa24fc9ba78039e3
PKG_LICENSE:=PSF
PKG_LICENSE_FILES:=LICENSE Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/darwin/LICENSE Modules/_ctypes/libffi/LICENSE Modules/_ctypes/libffi_osx/LICENSE Tools/pybench/LICENSE
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python3/host
+PKG_BUILD_DEPENDS:=libffi/host python3/host
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
the development of higher quality, more maintainable code.
endef
-define Package/python3
+define Package/python3-base
$(call Package/python3/Default)
+ TITLE:=Python $(PYTHON_VERSION) interpreter
DEPENDS:=+libpthread +zlib +libffi
endef
+define Package/python3-base/description
+ This package contains only the interpreter and the bare minimum
+ for the interpreter to start.
+endef
+
+define Package/python3
+$(call Package/python3/Default)
+ DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47 +libopenssl
+endef
+
define Package/python3/description
-$(call Package/python3/Default/description)
- .
- This package contains only the interpreter and the bare minimum for the interpreter to start.
+ This package contains the (almost) full Python install.
endef
-MAKE_FLAGS:=\
- $(TARGET_CONFIGURE_OPTS) \
- DESTDIR="$(PKG_INSTALL_DIR)" \
+MAKE_FLAGS+=\
CROSS_COMPILE=yes \
- CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \
- LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)" \
- LD="$(TARGET_CC)"
+ LD="$(TARGET_CC)" \
+ PGEN=pgen3
+
+EXTRA_CFLAGS+= \
+ -DNDEBUG -fno-inline
+EXTRA_LDFLAGS+= \
+ -L$(PKG_BUILD_DIR)
ENABLE_IPV6:=
ifeq ($(CONFIG_IPV6),y)
ENABLE_IPV6 += --enable-ipv6
endif
-#=======================================================================
-# Notes: adding these so that I don't forget, and can track why stuff
-# was did as was did
-# - Arguments below were moved to ./files/config.site file, and disabled
-# ac_cv_have_chflags=no \
-# ac_cv_have_lchflags=no \
-# ac_cv_py_format_size_t=no \
-# ac_cv_have_long_long_format=yes \
-# ac_cv_buggy_getaddrinfo=no \
-# - --without-ensurepip added, because the build wants to ensure that
-# it works; that's a good idea, but for now, it requires special
-# setup, and we can do that later
-# - --without-pymalloc added, becase in Python 3, modules are suffixed
-# with m; e.g. so some paths are python3.4m instead of python3.4
-# all this is detailed here:
-# http://legacy.python.org/dev/peps/pep-3149/
-#=======================================================================
-
-define Build/Configure
- -$(MAKE) -C $(PKG_BUILD_DIR) distclean
- (cd $(PKG_BUILD_DIR); autoreconf --force --install || exit 0)
- $(CP) ./files/config.site $(PKG_BUILD_DIR)
- $(call Build/Configure/Default, \
- --sysconfdir=/etc \
- --enable-shared \
- --without-cxx-main \
- --with-threads \
- --with-system-ffi="$(STAGING_DIR)/usr" \
- --without-ensurepip \
- --without-pymalloc \
- $(ENABLE_IPV6) \
- CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
- OPT="$(TARGET_CFLAGS)" \
- )
+CONFIGURE_ARGS+= \
+ --sysconfdir=/etc \
+ --enable-shared \
+ --without-cxx-main \
+ --with-threads \
+ --with-system-ffi="$(STAGING_DIR)/usr" \
+ --without-pymalloc \
+ --without-ensurepip \
+ $(ENABLE_IPV6) \
+ CONFIG_SITE="$(PKG_BUILD_DIR)/config.site" \
+ OPT="$(TARGET_CFLAGS)"
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site
endef
define Build/InstallDev
- $(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
$(INSTALL_DIR) $(STAGING_DIR)/mk/
+ $(INSTALL_DIR) $(1)/usr/include/ $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/
$(INSTALL_DATA) ./files/python3-package.mk $(STAGING_DIR)/mk/
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
$(1)/usr/lib/python$(PYTHON_VERSION)/
-
- $(CP) \
- $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION)-config \
- $(2)/bin/
- $(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config
endef
-define Py3Package/python3/filespec
+define Py3Package/python3-base/filespec
+|/usr/bin/python$(PYTHON_VERSION)
+|/usr/lib/python$(PYTHON_VERSION)/encodings
+|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py
+|/usr/lib/python$(PYTHON_VERSION)/stat.py
endef
-define Py3Package/python3/install
+define Py3Package/python3/filespec
++|/usr/lib/python$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
+-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
+-|/usr/lib/python$(PYTHON_VERSION)/idlelib
+-|/usr/lib/python$(PYTHON_VERSION)/lib2to3
+-|/usr/lib/python$(PYTHON_VERSION)/tkinter
+-|/usr/lib/python$(PYTHON_VERSION)/turtledemo
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
+-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.so
+-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
+-|/usr/lib/python$(PYTHON_VERSION)/test
+-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
+-|/usr/lib/python$(PYTHON_VERSION)/*/test
+-|/usr/lib/python$(PYTHON_VERSION)/*/tests
+endef
+
+define Py3Package/python3-base/install
# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
$(INSTALL_DIR) $(1)/usr/bin
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
endef
-define Host/Configure
- -$(MAKE) -C $(HOST_BUILD_DIR) distclean
- (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0)
- (cd $(HOST_BUILD_DIR); \
- rm -rf config.cache; \
- CONFIG_SITE= \
- OPT="$(HOST_CFLAGS)" \
- ./configure \
- --without-cxx-main \
- --without-ensurepip \
- --without-pymalloc \
- --with-threads \
- --prefix=$(STAGING_DIR_HOST); \
- )
-endef
+HOST_CONFIGURE_ARGS+= \
+ --without-cxx-main \
+ --without-pymalloc \
+ --without-ensurepip \
+ --with-threads \
+ --prefix=$(STAGING_DIR_HOST) \
+ CONFIG_SITE= \
+ OPT="$(HOST_CFLAGS)"
define Host/Compile
- +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
- python Parser/pgen
- +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \
- sharedmods
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) python Parser/pgen
+ +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) sharedmods
endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
- $(MAKE) -C $(HOST_BUILD_DIR) \
- install
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/
+ $(MAKE) -C $(HOST_BUILD_DIR) install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/Parser/pgen $(STAGING_DIR_HOST)/bin/pgen3
endef
-
$(eval $(call HostBuild))
+$(eval $(call Py3Package,python3-base))
$(eval $(call Py3Package,python3))
+$(eval $(call BuildPackage,python3-base))
$(eval $(call BuildPackage,python3))
#
PYTHON3_VERSION:=3.4
-PYTHON3_VERSION_MICRO:=1
+PYTHON3_VERSION_MICRO:=2
PYTHON3_DIR:=$(STAGING_DIR)/usr
PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
PYTHON3:=python$(PYTHON3_VERSION)
+HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON3_VERSION)
HOST_PYTHON3_BIN:=$(STAGING_DIR_HOST)/bin/python3
+PYTHON3PATH="$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)"
define HostPython3
- ( export PYTHONPATH="$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)"; \
+ ( export PYTHONPATH="$(PYTHON3PATH)"; \
export PYTHONOPTIMIZE=""; \
export PYTHONDONTWRITEBYTECODE=1; \
$(1) \
)
endef
+PKG_USE_MIPS16:=0
+# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
+# flags are inherited from the Python base package (via sysconfig module)
+ifdef CONFIG_USE_MIPS16
+ TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
+endif
+
define Py3Package
$(call shexport,Py3Package/$(1)/filespec)
define Package/$(1)/install
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
- @echo "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" | ( \
+ @echo "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" | ( \
IFS='|'; \
while read fop fspec fperm; do \
if [ "$$$$$$$$fop" = "+" ]; then \
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
_PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
+ __PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
$(3) \
, \
./setup.py $(2) \
include $(TOPDIR)/rules.mk
PKG_NAME:=ruby
-PKG_VERSION:=2.1.3
-PKG_RELEASE:=2
+PKG_VERSION:=2.1.4
+PKG_RELEASE:=1
PKG_LIBVER:=2.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://cache.ruby-lang.org/pub/ruby/$(PKG_LIBVER)/
-PKG_MD5SUM:=02b7da3bb06037c777ca52e1194efccb
+PKG_MD5SUM:=f4136e781d261e3cc20748005e1740b7
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <luizluca@gmail.com>
PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DEPENDS:=ruby/host
PKG_INSTALL:=1
define Package/ruby-bigdecimal
$(call Package/ruby/Default)
- TITLE:=Arbitrary-precision decimal floating-point library for Ruby
+ TITLE:=Arbitrary-precision decimal floating-point lib for Ruby
DEPENDS:=ruby
endef
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=LGPLv2.1 GPLv2
-PKG_LICENSE_FILE:=COPYING aserver/COPYING
+PKG_LICENSE_FILES:=COPYING aserver/COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=gnutls
-PKG_VERSION:=3.3.9
+PKG_VERSION:=3.3.10
PKG_RELEASE:=1
PKG_USE_MIPS16:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=ftp://ftp.gnutls.org/gcrypt/gnutls/v3.3
-PKG_MD5SUM:=ff61b77e39d09f1140ab5a9cf52c58b6
+PKG_MD5SUM:=c0a72b2c0553fe1c4992e30835808012
PKG_MAINTAINER:=Nikos Mavrogiannopoulos <nmav@gnutls.org>
PKG_INSTALL:=1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_MD5SUM:=9f47b960e225eede2cdeaabf7d22f59f
PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_FIXUP:=autoreconf
PKG_MD5SUM:=05e2ceeac4bc85fbe40de8b4b22d9ab3
PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_FIXUP:=autoreconf
include $(TOPDIR)/rules.mk
PKG_NAME:=libftdi1
-PKG_VERSION:=1.1
+PKG_VERSION:=1.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.intra2net.com/en/developer/libftdi/download/
-PKG_MD5SUM:=b79a6356978aa8e69f8eecc3a720ff79
+PKG_MD5SUM:=89dff802d89c4c0d55d8b4665fd52d0b
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=LGPL-2.0
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -43,7 +43,7 @@ IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
+@@ -55,7 +55,7 @@ if ( NOT DEFINED LIB_SUFFIX )
AND NOT EXISTS "/etc/debian_version"
AND NOT EXISTS "/etc/arch-release" )
if ( "${CMAKE_SIZEOF_VOID_P}" EQUAL "8" )
--- /dev/null
+#
+# Copyright (C) 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:=libhttp-parser
+PKG_VERSION:=2.3.0
+PKG_RELEASE=1
+PKG_MAINTAINER:=Ramanathan Sivagurunathan <ramzthecoder@gmail.com>
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILE:=LICENSE-MIT
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://github.com/joyent/http-parser.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=56f7ad0e2e5a80f79d214015c91e1f17d11d109f
+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libhttp-parser
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=A library to parse http request and response
+ URL:=https://github.com/joyent/http-parser
+endef
+
+define Package/libhttp-parser/description
+ A parser for HTTP messages written in C. It parses both requests and responses.
+ The parser is designed to be used in performance HTTP applications.
+ It does not make any syscalls nor allocations, it does not buffer data,
+ it can be interrupted at anytime. Depending on your architecture,
+ it only requires about 40 bytes of data per message stream
+ (in a web server that is per connection).
+endef
+
+define Build/Compile
+ $(call Build/Compile/Default, library)
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/http_parser.h $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
+ ( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
+endef
+
+define Package/libhttp-parser/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_BUILD_DIR)/libhttp_parser.so.* $(1)/usr/lib/
+ ( cd $(1)/usr/lib ; ln -s libhttp_parser.so.* libhttp_parser.so )
+endef
+
+$(eval $(call BuildPackage,libhttp-parser))
PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING.LESSER
+PKG_LICENSE_FILES:=COPYING.LESSER
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/libimobiledevice/libimobiledevice.git
PKG_MD5SUM:=e2a4391a08b49bb316c03e2034e06fa2
PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_INSTALL:=1
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=LGPLv2.1
-PKG_LICENSE_FILE:=COPYING.LIB
+PKG_LICENSE_FILES:=COPYING.LIB
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/mcrypt
--- /dev/null
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libmicrohttpd
+PKG_VERSION:=0.9.38
+PKG_RELEASE:=1.1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/libmicrohttpd
+PKG_MD5SUM:=b72efbfe7f290846015d460aea7091fe
+
+PKG_MAINTAINER:=Martijn Zilverschoon <martijn@friedzombie.com>
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE_FILES:=COPYING
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/libmicrohttpd
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=GNU libmicrohttpd is a library that runs an HTTP server.
+ URL:=http://www.gnu.org/software/libmicrohttpd/
+ DEPENDS:=+libpthread +libgcrypt +libgnutls +libgpg-error +libcrypto +libopenssl
+endef
+
+define Package/libmicrohttpd/description
+ GNU libmicrohttpd is a small C library that is supposed to make it easy
+ to run an HTTP server as part of another application.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include/
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
+endef
+
+define Package/libmicrohttpd/install
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libmicrohttpd))
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
PKG_MD5SUM:=7c9a7c76e200ead4e6447fe4b105f676
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
PKG_LICENSE:=BSD-3c
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
PKG_INSTALL:=1
PKG_MD5SUM:=2118d9514c079839ebd9cb3144ad2ad7
PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_FIXUP:=autoreconf
PKG_MD5SUM:=2a4bb0654ae675a52d2e8d1c06090b94
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_FIXUP:=autoreconf
PKG_MD5SUM:=df09befac35cb215865b39a36c96a3fa
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_FIXUP:=autoreconf
PKG_MD5SUM:=47dc734f82faeb2964d97771cfd2e701
PKG_LICENSE:=FREE
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
-LOWFAT_VERSION=0.28
+LOWFAT_VERSION=0.29
PKG_NAME:=libowfat
PKG_VERSION:=$(LOWFAT_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://dl.fefe.de
-PKG_MD5SUM:=6bbee9a86506419657d87123b7a6f2c1
+PKG_MD5SUM:=1187c6acf11429e7adb9ebe180f644bb
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING.LESSER
+PKG_LICENSE_FILES:=COPYING.LESSER
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/libimobiledevice/libplist.git
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=libsodium
-PKG_VERSION:=1.0.0
+PKG_VERSION:=1.0.1
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://download.libsodium.org/libsodium/releases
-PKG_MD5SUM:=3093dabe4e038d09f0d150cef064b2f7
+PKG_MD5SUM:=9a221b49fba7281ceaaf5e278d0f4430
PKG_CAT:=zcat
PKG_FIXUP:=libtool autoreconf
$(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
PKG_MD5SUM:=92aa3667357157e8f3489bcca287f2fa
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_LICENSE:=LGPL-2.1
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
PKG_FIXUP:=libtool
PKG_REMOVE_FILES:=autogen.sh
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://downloads.xiph.org/releases/theora/
PKG_MD5SUM:=292ab65cedd5021d6b7ddd117e07cd8e
-PKG_FIXUP:=autoreconf
+PKG_LICENSE:=BSD-3-Clause
+PKG_LICENSE_FILES:=COPYING LICENSE
+
+PKG_FIXUP:=autoreconf
PKG_BUILD_DEPENDS:=libvorbis
include $(INCLUDE_DIR)/package.mk
PKG_MD5SUM:=7f44df5dc69cb8686947562e2a11eea9
PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYRIGHT
+PKG_LICENSE_FILES:=COPYRIGHT
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
PKG_LICENSE:=LGPL-2.1+
-PKG_LICENSE_FILE:=COPYING.LGPLv2.1
+PKG_LICENSE_FILES:=COPYING.LGPLv2.1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/libimobiledevice/libusbmuxd.git
PKG_NAME:=v4l-utils
PKG_VERSION:=1.2.1
PKG_RELEASE:=2
+PKG_USE_MIPS16:=0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.linuxtv.org/downloads/v4l-utils
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0 LGPL-2.1
-PKG_LICENSE_FILE:=COPYING COPYING.libv4l
+PKG_LICENSE_FILES:=COPYING COPYING.libv4l
PKG_BUILD_DEPENDS:=argp-standalone
PKG_NAME:=libxml2
PKG_VERSION:=2.9.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/libxml2
endef
TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -lz
CONFIGURE_ARGS += \
--enable-shared \
--with-zlib \
--without-lzma
+HOST_CONFIGURE_ARGS += \
+ --enable-shared \
+ --enable-static \
+ --with-c14n \
+ --without-catalog \
+ --with-debug \
+ --without-docbook \
+ --with-html \
+ --without-ftp \
+ --without-http \
+ --without-iconv \
+ --without-iso8859x \
+ --without-legacy \
+ --with-output \
+ --without-pattern \
+ --without-push \
+ --without-python \
+ --with-reader \
+ --without-readline \
+ --without-regexps \
+ --with-sax1 \
+ --with-schemas \
+ --with-threads \
+ --with-tree \
+ --with-valid \
+ --with-writer \
+ --with-xinclude \
+ --with-xpath \
+ --with-xptr \
+ --with-zlib \
+ --without-lzma
+
define Build/InstallDev
$(INSTALL_DIR) $(2)/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xml2-config $(2)/bin/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxml2.so* $(1)/usr/lib/
endef
+$(eval $(call HostBuild))
$(eval $(call BuildPackage,libxml2))
PKG_MD5SUM:=c5a8cf7c0b066759542bc4ca46817ac6
PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_INSTALL:=1
endef
define Host/Install
+ $(MAKE) -C $(HOST_BUILD_DIR) install
endef
CONFIGURE_ARGS += --with-protoc=$(HOST_BUILD_DIR)/src/protoc
include $(TOPDIR)/rules.mk
PKG_NAME:=sqlite
-PKG_VERSION:=3080600
+PKG_VERSION:=3080701
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-autoconf-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.sqlite.org/2014/
-PKG_MD5SUM:=f7e4a156b583abeba349629e2364224b
+PKG_MD5SUM:=8ee4541ebb3e5739e7ef5e9046e30063
PKG_LICENSE:=PUBLICDOMAIN
PKG_LICENSE_FILES:=
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=tdb
+PKG_VERSION:=1.0.6
+PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/tdb
+PKG_MD5SUM:=6b643fdeb48304010dcd5f675e458b58
+
+PKG_INSTALL:=1
+PKG_BUILD_DEPENDS:=+libgdbm
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/tdb
+ SUBMENU:=database
+ SECTION:=libs
+ CATEGORY:=Libraries
+ TITLE:=Trivial Database
+ URL:=http://sourceforge.net/projects/tdb/
+ MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+# DEPENDS:=+libgdbm
+endef
+
+define Package/tdb/description
+ TDB is a Trivial Database. In concept, it is very much like GDBM,
+ and BSD's DB except that it allows multiple simultaneous writers
+ and uses locking internally to keep writers from trampling on
+ each other. TDB is also extremely small.
+endef
+
+define Build/InstallDev
+ $(INSTALL_DIR) $(1)/usr/include
+ $(CP) $(PKG_INSTALL_DIR)/usr/include/tdb.h $(1)/usr/include/
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+endef
+
+define Package/tdb/install
+ $(INSTALL_DIR) $(1)/usr/lib
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,tdb))
+
--- /dev/null
+--- a/tdbtool.c 2001-12-11 06:45:47.000000000 +0300
++++ b/tdbtool.c 2014-11-14 15:14:00.401164300 +0300
+@@ -169,23 +169,21 @@ static void print_data(unsigned char *bu
+
+ static void help(void)
+ {
+- printf("
+-tdbtool:
+- create dbname : create a database
+- open dbname : open an existing database
+- erase : erase the database
+- dump dumpname : dump the database as strings
+- insert key data : insert a record
+- store key data : store a record (replace)
+- show key : show a record by key
+- delete key : delete a record by key
+- list : print the database hash table and freelist
+- free : print the database freelist
+- 1 | first : print the first record
+- n | next : print the next record
+- q | quit : terminate
+- \\n : repeat 'next' command
+-");
++ printf("tdbtool:\n");
++ printf(" create dbname : create a database\n");
++ printf(" open dbname : open an existing database\n");
++ printf(" erase : erase the database\n");
++ printf(" dump dumpname : dump the database as strings\n");
++ printf(" insert key data : insert a record\n");
++ printf(" store key data : store a record (replace)\n");
++ printf(" show key : show a record by key\n");
++ printf(" delete key : delete a record by key\n");
++ printf(" list : print the database hash table and freelist\n");
++ printf(" free : print the database freelist\n");
++ printf(" 1 | first : print the first record\n");
++ printf(" n | next : print the next record\n");
++ printf(" q | quit : terminate\n");
++ printf(" \\n : repeat 'next' command\n\n");
+ }
+
+ static void terror(char *why)
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=VARIOUS
-PKG_LICENSE_FILE:=doc/COPYING
+PKG_LICENSE_FILES:=doc/COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_RELEASE:=3
PKG_LICENSE:=GPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@SF/bogofilter
include $(TOPDIR)/rules.mk
PKG_NAME:=dovecot
-PKG_VERSION:=2.2.14
+PKG_VERSION:=2.2.15
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.dovecot.org/releases/2.2
-PKG_MD5SUM:=03315255920ee1c4b11039945246a8af
+PKG_MD5SUM:=c6c176943bd832c780fbb5d2f8850952
PKG_LICENSE:=LGPL-2.1 MIT BSD-3-Clause Unique
PKG_LICENSE_FILES:=COPYING COPYING.LGPL COPYING.MIT
--- /dev/null
+menu "Configuration"
+ depends on PACKAGE_fdm
+
+config FDM_WITH_PCRE
+ bool
+ default y
+ select libpcre
+ prompt "Enable PCRE support (elsewhere POSIX regex)"
+
+endmenu
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fdm
+PKG_VERSION:=1.7
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/fdm
+PKG_MD5SUM:=aea0421571e8f3ec8f747a5d72c84348
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fdm
+ SECTION:=mail
+ CATEGORY:=Mail
+ TITLE:=fetch mail and deliver
+ URL:=http://fdm.sourceforge.net/
+ MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+ MENU:=1
+ DEPENDS:=+tdb +zlib +libopenssl +FDM_WITH_PCRE:libpcre
+ USERID:=_fdm=99:_fdm=99
+endef
+
+define Package/fdm/description
+ fdm is a simple, lightweight replacement for mail fetch, filter
+ and delivery programs such as fetchmail and procmail. It can
+ fetch using POP3 or IMAP (with SSL) or from stdin, and deliver
+ to a pipe, file, maildir, mbox or SMTP server, based on $(if $(CONFIG_FDM_WITH_PCRE),PCRE,POSIX regexp)
+endef
+
+MAKE_FLAGS += \
+ PREFIX="/usr"\
+ $(if $(CONFIG_FDM_WITH_PCRE),PCRE=1)
+
+define Build/Prepare
+ $(call Build/Prepare/Default)
+ $(CP) ./src/compat/* $(PKG_BUILD_DIR)/
+endef
+
+define Package/fdm/config
+ source "$(SOURCE)/Config.in
+endef
+
+define Package/fdm/conffiles
+/etc/fdm.conf
+endef
+
+define Package/fdm/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) ./files/etc/* $(1)/etc/
+ $(INSTALL_DIR) $(1)/opt/fdm
+ chmod a+rwx $(1)/opt/fdm
+endef
+
+define Package/fdm/postinst
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ echo "Creating cron job template for user _fdm..."
+ (crontab -l -u _fdm 2>/dev/null; echo "# */13 * * * * fdm -q fetch") | crontab -u _fdm -
+ echo "Please, edit file /etc/fdm.conf and enable cron job!"
+fi
+exit 0
+endef
+
+define Package/fdm/prerm
+#!/bin/sh
+if [ -z "$${IPKG_INSTROOT}" ]; then
+ echo "Don't forget disable cron job!"
+ echo "# crontab -r -u _fdm"
+fi
+exit 0
+endef
+
+$(eval $(call BuildPackage,fdm))
--- /dev/null
+# /etc/fdm.conf example file
+# 1. Edit this file
+# 2. Test: fdm -vv fetch
+# 3. Enable cron job: crontab -e -u _fdm
+
+set maximum-size 3M
+set delete-oversized
+set queue-high 1
+set queue-low 0
+set purge-after 5
+set unmatched-mail keep
+
+action "drop" drop
+action "keep" keep
+
+action "wakeup" exec "wol -h 192.168.0.255 -p 9 00:11:22:33:44:55"
+action "my-test-action" exec "echo \"OK\" > /tmp/fdm.ok"
+
+# This action extract *.torrent files from incoming email and put it
+# to watch-dir your torrect client application
+
+action "torrent-add" pipe "munpack -f -q -C /your-path/watch-dir/ ; for i in /your-path/watch-dir/*.torrent ; do chmod a+r \$i ; done"
+
+account "xbmc" disabled
+ pop3s
+ server "pop.yandex.ru"
+ port 995
+ user "username-enter-here"
+ pass "password-enter-here"
+ new-only
+ cache "/opt/fdm/cache"
+
+match "^Subject:[ \t]+openwrt:[ \t]*wakeup[ \t]*$" in headers actions { "wakeup" "drop" }
+match "^Subject:[ \t]+openwrt:[ \t]*torrent[ \t]+add[ \t]*\$" in headers actions { "torrent-add" "drop" }
+match "^Subject:[ \t]+openwrt:[ \t]*test[ \t]*$" in headers actions { "my-test-action" "drop" }
+match all action "keep"
--- /dev/null
+--- a/fdm.h 2011-10-10 17:36:29.000000000 +0400
++++ b/fdm.h 2014-11-13 12:56:59.217083683 +0300
+@@ -719,6 +719,11 @@
+ size_t strlcat(char *, const char *, size_t);
+ #endif
+
++int local_b64_ntop(uint8_t const *src, size_t srclength, char *target,
++ size_t targsize);
++
++int local_b64_pton(char const *src, uint8_t *target, size_t targsize);
++
+ /* shm.c */
+ char *shm_path(struct shm *);
+ void *shm_create(struct shm *, size_t);
--- /dev/null
+--- a/imap-common.c 2011-12-20 00:19:03.000000000 +0400
++++ b/imap-common.c 2014-11-13 12:56:06.930418446 +0300
+@@ -206,7 +206,7 @@
+
+ size = (strlen(in) * 2) + 1;
+ out = xcalloc(1, size);
+- if (b64_ntop(in, strlen(in), out, size) < 0) {
++ if (local_b64_ntop(in, strlen(in), out, size) < 0) {
+ xfree(out);
+ return (NULL);
+ }
+@@ -222,7 +222,7 @@
+
+ size = (strlen(in) * 4) + 1;
+ out = xcalloc(1, size);
+- if (b64_pton(in, out, size) < 0) {
++ if (local_b64_pton(in, out, size) < 0) {
+ xfree(out);
+ return (NULL);
+ }
--- /dev/null
+/*
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+//#include <config.h>
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "fdm.h"
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+ The following encoding technique is taken from RFC 1521 by Borenstein
+ and Freed. It is reproduced here in a slightly edited form for
+ convenience.
+
+ A 65-character subset of US-ASCII is used, enabling 6 bits to be
+ represented per printable character. (The extra 65th character, "=",
+ is used to signify a special processing function.)
+
+ The encoding process represents 24-bit groups of input bits as output
+ strings of 4 encoded characters. Proceeding from left to right, a
+ 24-bit input group is formed by concatenating 3 8-bit input groups.
+ These 24 bits are then treated as 4 concatenated 6-bit groups, each
+ of which is translated into a single digit in the base64 alphabet.
+
+ Each 6-bit group is used as an index into an array of 64 printable
+ characters. The character referenced by the index is placed in the
+ output string.
+
+ Table 1: The Base64 Alphabet
+
+ Value Encoding Value Encoding Value Encoding Value Encoding
+ 0 A 17 R 34 i 51 z
+ 1 B 18 S 35 j 52 0
+ 2 C 19 T 36 k 53 1
+ 3 D 20 U 37 l 54 2
+ 4 E 21 V 38 m 55 3
+ 5 F 22 W 39 n 56 4
+ 6 G 23 X 40 o 57 5
+ 7 H 24 Y 41 p 58 6
+ 8 I 25 Z 42 q 59 7
+ 9 J 26 a 43 r 60 8
+ 10 K 27 b 44 s 61 9
+ 11 L 28 c 45 t 62 +
+ 12 M 29 d 46 u 63 /
+ 13 N 30 e 47 v
+ 14 O 31 f 48 w (pad) =
+ 15 P 32 g 49 x
+ 16 Q 33 h 50 y
+
+ Special processing is performed if fewer than 24 bits are available
+ at the end of the data being encoded. A full encoding quantum is
+ always completed at the end of a quantity. When fewer than 24 input
+ bits are available in an input group, zero bits are added (on the
+ right) to form an integral number of 6-bit groups. Padding at the
+ end of the data is performed using the '=' character.
+
+ Since all base64 input is an integral number of octets, only the
+ following cases can arise:
+
+ (1) the final quantum of encoding input is an integral
+ multiple of 24 bits; here, the final unit of encoded
+ output will be an integral multiple of 4 characters
+ with no "=" padding,
+ (2) the final quantum of encoding input is exactly 8 bits;
+ here, the final unit of encoded output will be two
+ characters followed by two "=" padding characters, or
+ (3) the final quantum of encoding input is exactly 16 bits;
+ here, the final unit of encoded output will be three
+ characters followed by one "=" padding character.
+ */
+
+int
+local_b64_ntop(uint8_t const *src, size_t srclength, char *target, size_t targsize) {
+ size_t datalength = 0;
+ uint8_t input[3];
+ uint8_t output[4];
+ size_t i;
+
+ while (2 < srclength) {
+ input[0] = *src++;
+ input[1] = *src++;
+ input[2] = *src++;
+ srclength -= 3;
+
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ output[3] = input[2] & 0x3f;
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+ Assert(output[3] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Base64[output[3]];
+ }
+
+ /* Now we worry about padding. */
+ if (0 != srclength) {
+ /* Get what's left. */
+ input[0] = input[1] = input[2] = '\0';
+ for (i = 0; i < srclength; i++)
+ input[i] = *src++;
+ output[0] = input[0] >> 2;
+ output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4);
+ output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6);
+ Assert(output[0] < 64);
+ Assert(output[1] < 64);
+ Assert(output[2] < 64);
+
+ if (datalength + 4 > targsize)
+ return (-1);
+ target[datalength++] = Base64[output[0]];
+ target[datalength++] = Base64[output[1]];
+ if (srclength == 1)
+ target[datalength++] = Pad64;
+ else
+ target[datalength++] = Base64[output[2]];
+ target[datalength++] = Pad64;
+ }
+ if (datalength >= targsize)
+ return (-1);
+ target[datalength] = '\0'; /* Returned value doesn't count \0. */
+ return (datalength);
+}
--- /dev/null
+/*
+ * Copyright (c) 1996, 1998 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * Portions Copyright (c) 1995 by International Business Machines, Inc.
+ *
+ * International Business Machines, Inc. (hereinafter called IBM) grants
+ * permission under its copyrights to use, copy, modify, and distribute this
+ * Software with or without fee, provided that the above copyright notice and
+ * all paragraphs of this notice appear in all copies, and that the name of IBM
+ * not be used in connection with the marketing of any product incorporating
+ * the Software or modifications thereof, without specific, written prior
+ * permission.
+ *
+ * To the extent it has a right to do so, IBM grants an immunity from suit
+ * under its patents, if any, for the use, sale or manufacture of products to
+ * the extent that such products are used for performing Domain Name System
+ * dynamic updates in TCP/IP networks by means of the Software. No immunity is
+ * granted for any product per se or for any other function of any product.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
+ * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
+ * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ */
+//#include <config.h>
+
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/socket.h>
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "fdm.h"
+
+#define Assert(Cond) if (!(Cond)) abort()
+
+static const char Base64[] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char Pad64 = '=';
+
+/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
+ The following encoding technique is taken from RFC 1521 by Borenstein
+ and Freed. It is reproduced here in a slightly edited form for
+ convenience.
+
+ A 65-character subset of US-ASCII is used, enabling 6 bits to be
+ represented per printable character. (The extra 65th character, "=",
+ is used to signify a special processing function.)
+
+ The encoding process represents 24-bit groups of input bits as output
+ strings of 4 encoded characters. Proceeding from left to right, a
+ 24-bit input group is formed by concatenating 3 8-bit input groups.
+ These 24 bits are then treated as 4 concatenated 6-bit groups, each
+ of which is translated into a single digit in the base64 alphabet.
+
+ Each 6-bit group is used as an index into an array of 64 printable
+ characters. The character referenced by the index is placed in the
+ output string.
+
+ Table 1: The Base64 Alphabet
+
+ Value Encoding Value Encoding Value Encoding Value Encoding
+ 0 A 17 R 34 i 51 z
+ 1 B 18 S 35 j 52 0
+ 2 C 19 T 36 k 53 1
+ 3 D 20 U 37 l 54 2
+ 4 E 21 V 38 m 55 3
+ 5 F 22 W 39 n 56 4
+ 6 G 23 X 40 o 57 5
+ 7 H 24 Y 41 p 58 6
+ 8 I 25 Z 42 q 59 7
+ 9 J 26 a 43 r 60 8
+ 10 K 27 b 44 s 61 9
+ 11 L 28 c 45 t 62 +
+ 12 M 29 d 46 u 63 /
+ 13 N 30 e 47 v
+ 14 O 31 f 48 w (pad) =
+ 15 P 32 g 49 x
+ 16 Q 33 h 50 y
+
+ Special processing is performed if fewer than 24 bits are available
+ at the end of the data being encoded. A full encoding quantum is
+ always completed at the end of a quantity. When fewer than 24 input
+ bits are available in an input group, zero bits are added (on the
+ right) to form an integral number of 6-bit groups. Padding at the
+ end of the data is performed using the '=' character.
+
+ Since all base64 input is an integral number of octets, only the
+ following cases can arise:
+
+ (1) the final quantum of encoding input is an integral
+ multiple of 24 bits; here, the final unit of encoded
+ output will be an integral multiple of 4 characters
+ with no "=" padding,
+ (2) the final quantum of encoding input is exactly 8 bits;
+ here, the final unit of encoded output will be two
+ characters followed by two "=" padding characters, or
+ (3) the final quantum of encoding input is exactly 16 bits;
+ here, the final unit of encoded output will be three
+ characters followed by one "=" padding character.
+ */
+
+/* skips all whitespace anywhere.
+ converts characters, four at a time, starting at (or after)
+ src from base - 64 numbers into three 8 bit bytes in the target area.
+ it returns the number of data bytes stored at the target, or -1 on error.
+ */
+
+static int b64rmap_initialized = 0;
+static uint8_t b64rmap[256];
+
+static const uint8_t b64rmap_special = 0xf0;
+static const uint8_t b64rmap_end = 0xfd;
+static const uint8_t b64rmap_space = 0xfe;
+static const uint8_t b64rmap_invalid = 0xff;
+
+/**
+ * Initializing the reverse map is not thread safe.
+ * Which is fine for NSD. For now...
+ **/
+static void
+b64_initialize_rmap ()
+{
+ int i;
+ char ch;
+
+ /* Null: end of string, stop parsing */
+ b64rmap[0] = b64rmap_end;
+
+ for (i = 1; i < 256; ++i) {
+ ch = (char)i;
+ /* Whitespaces */
+ if (isspace(ch))
+ b64rmap[i] = b64rmap_space;
+ /* Padding: stop parsing */
+ else if (ch == Pad64)
+ b64rmap[i] = b64rmap_end;
+ /* Non-base64 char */
+ else
+ b64rmap[i] = b64rmap_invalid;
+ }
+
+ /* Fill reverse mapping for base64 chars */
+ for (i = 0; Base64[i] != '\0'; ++i)
+ b64rmap[(uint8_t)Base64[i]] = i;
+
+ b64rmap_initialized = 1;
+}
+
+static int
+b64_pton_do(char const *src, uint8_t *target, size_t targsize)
+{
+ int tarindex, state, ch;
+ uint8_t ofs;
+
+ state = 0;
+ tarindex = 0;
+
+ while (1)
+ {
+ ch = *src++;
+ ofs = b64rmap[ch];
+
+ if (ofs >= b64rmap_special) {
+ /* Ignore whitespaces */
+ if (ofs == b64rmap_space)
+ continue;
+ /* End of base64 characters */
+ if (ofs == b64rmap_end)
+ break;
+ /* A non-base64 character. */
+ return (-1);
+ }
+
+ switch (state) {
+ case 0:
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] = ofs << 2;
+ state = 1;
+ break;
+ case 1:
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= ofs >> 4;
+ target[tarindex+1] = (ofs & 0x0f)
+ << 4 ;
+ tarindex++;
+ state = 2;
+ break;
+ case 2:
+ if ((size_t)tarindex + 1 >= targsize)
+ return (-1);
+ target[tarindex] |= ofs >> 2;
+ target[tarindex+1] = (ofs & 0x03)
+ << 6;
+ tarindex++;
+ state = 3;
+ break;
+ case 3:
+ if ((size_t)tarindex >= targsize)
+ return (-1);
+ target[tarindex] |= ofs;
+ tarindex++;
+ state = 0;
+ break;
+ default:
+ abort();
+ }
+ }
+
+ /*
+ * We are done decoding Base-64 chars. Let's see if we ended
+ * on a byte boundary, and/or with erroneous trailing characters.
+ */
+
+ if (ch == Pad64) { /* We got a pad char. */
+ ch = *src++; /* Skip it, get next. */
+ switch (state) {
+ case 0: /* Invalid = in first position */
+ case 1: /* Invalid = in second position */
+ return (-1);
+
+ case 2: /* Valid, means one byte of info */
+ /* Skip any number of spaces. */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (b64rmap[ch] != b64rmap_space)
+ break;
+ /* Make sure there is another trailing = sign. */
+ if (ch != Pad64)
+ return (-1);
+ ch = *src++; /* Skip the = */
+ /* Fall through to "single trailing =" case. */
+ /* FALLTHROUGH */
+
+ case 3: /* Valid, means two bytes of info */
+ /*
+ * We know this char is an =. Is there anything but
+ * whitespace after it?
+ */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (b64rmap[ch] != b64rmap_space)
+ return (-1);
+
+ /*
+ * Now make sure for cases 2 and 3 that the "extra"
+ * bits that slopped past the last full byte were
+ * zeros. If we don't check them, they become a
+ * subliminal channel.
+ */
+ if (target[tarindex] != 0)
+ return (-1);
+ }
+ } else {
+ /*
+ * We ended by seeing the end of the string. Make sure we
+ * have no partial bytes lying around.
+ */
+ if (state != 0)
+ return (-1);
+ }
+
+ return (tarindex);
+}
+
+
+static int
+b64_pton_len(char const *src)
+{
+ int tarindex, state, ch;
+ uint8_t ofs;
+
+ state = 0;
+ tarindex = 0;
+
+ while (1)
+ {
+ ch = *src++;
+ ofs = b64rmap[ch];
+
+ if (ofs >= b64rmap_special) {
+ /* Ignore whitespaces */
+ if (ofs == b64rmap_space)
+ continue;
+ /* End of base64 characters */
+ if (ofs == b64rmap_end)
+ break;
+ /* A non-base64 character. */
+ return (-1);
+ }
+
+ switch (state) {
+ case 0:
+ state = 1;
+ break;
+ case 1:
+ tarindex++;
+ state = 2;
+ break;
+ case 2:
+ tarindex++;
+ state = 3;
+ break;
+ case 3:
+ tarindex++;
+ state = 0;
+ break;
+ default:
+ abort();
+ }
+ }
+
+ /*
+ * We are done decoding Base-64 chars. Let's see if we ended
+ * on a byte boundary, and/or with erroneous trailing characters.
+ */
+
+ if (ch == Pad64) { /* We got a pad char. */
+ ch = *src++; /* Skip it, get next. */
+ switch (state) {
+ case 0: /* Invalid = in first position */
+ case 1: /* Invalid = in second position */
+ return (-1);
+
+ case 2: /* Valid, means one byte of info */
+ /* Skip any number of spaces. */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (b64rmap[ch] != b64rmap_space)
+ break;
+ /* Make sure there is another trailing = sign. */
+ if (ch != Pad64)
+ return (-1);
+ ch = *src++; /* Skip the = */
+ /* Fall through to "single trailing =" case. */
+ /* FALLTHROUGH */
+
+ case 3: /* Valid, means two bytes of info */
+ /*
+ * We know this char is an =. Is there anything but
+ * whitespace after it?
+ */
+ for ((void)NULL; ch != '\0'; ch = *src++)
+ if (b64rmap[ch] != b64rmap_space)
+ return (-1);
+
+ }
+ } else {
+ /*
+ * We ended by seeing the end of the string. Make sure we
+ * have no partial bytes lying around.
+ */
+ if (state != 0)
+ return (-1);
+ }
+
+ return (tarindex);
+}
+
+
+int
+local_b64_pton(char const *src, uint8_t *target, size_t targsize)
+{
+ if (!b64rmap_initialized)
+ b64_initialize_rmap ();
+
+ if (target)
+ return b64_pton_do (src, target, targsize);
+ else
+ return b64_pton_len (src);
+}
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILE:=gnu-COPYING-GPL
+PKG_LICENSE_FILES:=gnu-COPYING-GPL
include $(INCLUDE_DIR)/package.mk
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=COPYRIGHT
+PKG_LICENSE_FILES:=COPYRIGHT
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=nail
+PKG_VERSION:=
+PKG_RELEASE:=1
+PKG_LICENSE:=BSD-2-Clause
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=:pserver:anonymous@nail.cvs.sourceforge.net:/cvsroot/nail
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)
+PKG_SOURCE_VERSION:=-D"2014-11-24 00:00"
+PKG_SOURCE_PROTO:=cvs
+
+PKG_INSTALL:=0
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/nail
+ SECTION:=mail
+ CATEGORY:=Mail
+ TITLE:=Heirloom mailx (nail)
+ URL:=http://heirloom.sourceforge.net/mailx.html
+ MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+ DEPENDS:=+libopenssl
+endef
+
+define Package/nail/description
+ Heirloom mailx (formerly known as "nail") is intended provide
+ the functionality of the POSIX mailx command with additional
+ support for MIME messages, IMAP (including caching), POP3,
+ SMTP, S/MIME, message threading/sorting, scoring, and filtering
+endef
+
+define Package/nail/conffiles
+/etc/nail.rc
+endef
+
+define Build/Install
+ $(INSTALL_DIR) $(PKG_INSTALL_DIR)/usr/bin
+ $(CP) $(PKG_BUILD_DIR)/mailx $(PKG_INSTALL_DIR)/usr/bin/
+ $(INSTALL_DIR) $(PKG_INSTALL_DIR)/etc
+ $(CP) $(PKG_BUILD_DIR)/nail.rc $(PKG_INSTALL_DIR)/etc/
+endef
+
+define Package/nail/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/etc/* $(1)/etc/
+endef
+
+$(eval $(call BuildPackage,nail))
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com>
PKG_LICENSE:=IPL-1.0
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=+POSTFIX_CDB:tinycdb
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ssmtp
+PKG_VERSION:=2.64
+PKG_RELEASE:=1.1
+PKG_MAINTAINER:=Dirk Brenken <dibdot@gmail.com>
+PKG_LICENSE:=GPL-2.0+
+
+PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.bz2
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/s/ssmtp
+PKG_MD5SUM:=65b4e0df4934a6cd08c506cabcbe584f
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS += $(TARGET_CPPFLAGS)
+
+define Package/ssmtp
+ SECTION:=mail
+ CATEGORY:=Mail
+ DEPENDS:=+libopenssl
+ TITLE:=A minimal and secure mail sender with ssl support
+ URL:=http://packages.debian.org/ssmtp
+endef
+
+define Package/ssmtp/description
+ A secure, effective and simple way of getting mail off a system to your
+ mail hub. It contains no suid-binaries or other dangerous things - no
+ mail spool to poke around in, and no daemons running in the background.
+ Mail is simply forwarded to the configured mailhost. Extremely easy
+ configuration.
+endef
+
+define Package/ssmtp/conffiles
+/etc/ssmtp/ssmtp.conf
+/etc/ssmtp/revaliases
+endef
+
+CONFIGURE_VARS += \
+ LIBS="$(TARGET_LDFLAGS) -lcrypto -lssl"
+
+CONFIGURE_ARGS += \
+ --enable-ssl
+
+define Package/ssmtp/install
+ $(INSTALL_DIR) $(1)/etc/ssmtp
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/ssmtp.conf $(1)/etc/ssmtp/
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/revaliases $(1)/etc/ssmtp/
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/ssmtp $(1)/usr/sbin/
+endef
+
+define Package/ssmtp/postinst
+#!/bin/sh
+ln -sf ssmtp $${IPKG_INSTROOT}/usr/sbin/sendmail
+endef
+
+$(eval $(call BuildPackage,ssmtp))
--- /dev/null
+--- a/ssmtp.c
++++ b/ssmtp.c
+@@ -55,21 +55,21 @@ bool_t use_oldauth = False; /* use old
+
+ #define ARPADATE_LENGTH 32 /* Current date in RFC format */
+ char arpadate[ARPADATE_LENGTH];
+-char *auth_user = (char)NULL;
+-char *auth_pass = (char)NULL;
+-char *auth_method = (char)NULL; /* Mechanism for SMTP authentication */
+-char *mail_domain = (char)NULL;
+-char *from = (char)NULL; /* Use this as the From: address */
++char *auth_user = NULL;
++char *auth_pass = NULL;
++char *auth_method = NULL; /* Mechanism for SMTP authentication */
++char *mail_domain = NULL;
++char *from = NULL; /* Use this as the From: address */
+ char *hostname;
+ char *mailhost = "mailhub";
+-char *minus_f = (char)NULL;
+-char *minus_F = (char)NULL;
++char *minus_f = NULL;
++char *minus_F = NULL;
+ char *gecos;
+-char *prog = (char)NULL;
++char *prog = NULL;
+ char *root = NULL;
+ char *tls_cert = "/etc/ssl/certs/ssmtp.pem"; /* Default Certificate */
+-char *uad = (char)NULL;
+-char *config_file = (char)NULL; /* alternate configuration file */
++char *uad = NULL;
++char *config_file = NULL; /* alternate configuration file */
+
+ headers_t headers, *ht;
+
+@@ -261,7 +261,7 @@ char *strip_post_ws(char *str)
+
+ p = (str + strlen(str));
+ while(isspace(*--p)) {
+- *p = (char)NULL;
++ *p = '\0';
+ }
+
+ return(p);
+@@ -279,7 +279,7 @@ char *addr_parse(char *str)
+ #endif
+
+ /* Simple case with email address enclosed in <> */
+- if((p = strdup(str)) == (char *)NULL) {
++ if((p = strdup(str)) == NULL) {
+ die("addr_parse(): strdup()");
+ }
+
+@@ -287,7 +287,7 @@ char *addr_parse(char *str)
+ q++;
+
+ if((p = strchr(q, '>'))) {
+- *p = (char)NULL;
++ *p = '\0';
+ }
+
+ #if 0
+@@ -310,7 +310,7 @@ char *addr_parse(char *str)
+ q = strip_post_ws(p);
+ if(*q == ')') {
+ while((*--q != '('));
+- *q = (char)NULL;
++ *q = '\0';
+ }
+ (void)strip_post_ws(p);
+
+@@ -349,7 +349,6 @@ standardise() -- Trim off '\n's and doub
+ */
+ bool_t standardise(char *str, bool_t *linestart)
+ {
+- size_t sl;
+ char *p;
+ bool_t leadingdot = False;
+
+@@ -363,7 +362,7 @@ bool_t standardise(char *str, bool_t *li
+ *linestart = False;
+
+ if((p = strchr(str, '\n'))) {
+- *p = (char)NULL;
++ *p = '\0';
+ *linestart = True;
+ }
+ return(leadingdot);
+@@ -384,7 +383,7 @@ void revaliases(struct passwd *pw)
+ while(fgets(buf, sizeof(buf), fp)) {
+ /* Make comments invisible */
+ if((p = strchr(buf, '#'))) {
+- *p = (char)NULL;
++ *p = '\0';
+ }
+
+ /* Ignore malformed lines and comments */
+@@ -519,11 +518,11 @@ void rcpt_save(char *str)
+ #endif
+
+ /* Ignore missing usernames */
+- if(*str == (char)NULL) {
++ if(*str == '\0') {
+ return;
+ }
+
+- if((rt->string = strdup(str)) == (char *)NULL) {
++ if((rt->string = strdup(str)) == NULL) {
+ die("rcpt_save() -- strdup() failed");
+ }
+
+@@ -548,7 +547,7 @@ void rcpt_parse(char *str)
+ (void)fprintf(stderr, "*** rcpt_parse(): str = [%s]\n", str);
+ #endif
+
+- if((p = strdup(str)) == (char *)NULL) {
++ if((p = strdup(str)) == NULL) {
+ die("rcpt_parse(): strdup() failed");
+ }
+ q = p;
+@@ -576,7 +575,7 @@ void rcpt_parse(char *str)
+ }
+
+ /* End of string? */
+- if(*(q + 1) == (char)NULL) {
++ if(*(q + 1) == '\0') {
+ got_addr = True;
+ }
+
+@@ -584,7 +583,7 @@ void rcpt_parse(char *str)
+ if((*q == ',') && (in_quotes == False)) {
+ got_addr = True;
+
+- *q = (char)NULL;
++ *q = '\0';
+ }
+
+ if(got_addr) {
+@@ -668,7 +667,7 @@ void header_save(char *str)
+ (void)fprintf(stderr, "header_save(): str = [%s]\n", str);
+ #endif
+
+- if((p = strdup(str)) == (char *)NULL) {
++ if((p = strdup(str)) == NULL) {
+ die("header_save() -- strdup() failed");
+ }
+ ht->string = p;
+@@ -676,7 +675,7 @@ void header_save(char *str)
+ if(strncasecmp(ht->string, "From:", 5) == 0) {
+ #if 1
+ /* Hack check for NULL From: line */
+- if(*(p + 6) == (char)NULL) {
++ if(*(p + 6) == '\0') {
+ return;
+ }
+ #endif
+@@ -739,19 +738,19 @@ header_parse() -- Break headers into sep
+ void header_parse(FILE *stream)
+ {
+ size_t size = BUF_SZ, len = 0;
+- char *p = (char *)NULL, *q;
++ char *p = NULL, *q;
+ bool_t in_header = True;
+- char l = (char)NULL;
++ char l = '\0';
+ int c;
+
+ while(in_header && ((c = fgetc(stream)) != EOF)) {
+ /* Must have space for up to two more characters, since we
+ may need to insert a '\r' */
+- if((p == (char *)NULL) || (len >= (size - 1))) {
++ if((p == NULL) || (len >= (size - 1))) {
+ size += BUF_SZ;
+
+ p = (char *)realloc(p, (size * sizeof(char)));
+- if(p == (char *)NULL) {
++ if(p == NULL) {
+ die("header_parse() -- realloc() failed");
+ }
+ q = (p + len);
+@@ -776,9 +775,9 @@ void header_parse(FILE *stream)
+ in_header = False;
+
+ default:
+- *q = (char)NULL;
++ *q = '\0';
+ if((q = strrchr(p, '\n'))) {
+- *q = (char)NULL;
++ *q = '\0';
+ }
+ header_save(p);
+
+@@ -809,9 +808,9 @@ void header_parse(FILE *stream)
+ in_header = False;
+
+ default:
+- *q = (char)NULL;
++ *q = '\0';
+ if((q = strrchr(p, '\n'))) {
+- *q = (char)NULL;
++ *q = '\0';
+ }
+ header_save(p);
+
+@@ -876,11 +875,11 @@ bool_t read_config()
+ char *rightside;
+ /* Make comments invisible */
+ if((p = strchr(buf, '#'))) {
+- *p = (char)NULL;
++ *p = '\0';
+ }
+
+ /* Ignore malformed lines and comments */
+- if(strchr(buf, '=') == (char *)NULL) continue;
++ if(strchr(buf, '=') == NULL) continue;
+
+ /* Parse out keywords */
+ p=firsttok(&begin, "= \t\n");
+@@ -890,7 +889,7 @@ bool_t read_config()
+ }
+ if(p && q) {
+ if(strcasecmp(p, "Root") == 0) {
+- if((root = strdup(q)) == (char *)NULL) {
++ if((root = strdup(q)) == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+
+@@ -904,7 +903,7 @@ bool_t read_config()
+ port = atoi(r);
+ }
+
+- if((mailhost = strdup(q)) == (char *)NULL) {
++ if((mailhost = strdup(q)) == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+
+@@ -949,7 +948,7 @@ bool_t read_config()
+ mail_domain = strdup(q);
+ }
+
+- if(mail_domain == (char *)NULL) {
++ if(mail_domain == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+ rewrite_domain = True;
+@@ -1025,7 +1024,7 @@ bool_t read_config()
+ }
+ }
+ else if(strcasecmp(p, "TLSCert") == 0) {
+- if((tls_cert = strdup(q)) == (char *)NULL) {
++ if((tls_cert = strdup(q)) == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+
+@@ -1036,7 +1035,7 @@ bool_t read_config()
+ #endif
+ /* Command-line overrides these */
+ else if(strcasecmp(p, "AuthUser") == 0 && !auth_user) {
+- if((auth_user = strdup(q)) == (char *)NULL) {
++ if((auth_user = strdup(q)) == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+
+@@ -1045,7 +1044,7 @@ bool_t read_config()
+ }
+ }
+ else if(strcasecmp(p, "AuthPass") == 0 && !auth_pass) {
+- if((auth_pass = strdup(q)) == (char *)NULL) {
++ if((auth_pass = strdup(q)) == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+
+@@ -1054,7 +1053,7 @@ bool_t read_config()
+ }
+ }
+ else if(strcasecmp(p, "AuthMethod") == 0 && !auth_method) {
+- if((auth_method = strdup(q)) == (char *)NULL) {
++ if((auth_method = strdup(q)) == NULL) {
+ die("parse_config() -- strdup() failed");
+ }
+
+@@ -1119,14 +1118,11 @@ int smtp_open(char *host, int port)
+ char buf[(BUF_SZ + 1)];
+
+ /* Init SSL stuff */
+- SSL_CTX *ctx;
+- SSL_METHOD *meth;
++ SSL_CTX *ctx = NULL;
+ X509 *server_cert;
+-
+ SSL_load_error_strings();
+ SSLeay_add_ssl_algorithms();
+- meth=SSLv23_client_method();
+- ctx = SSL_CTX_new(meth);
++ ctx = SSL_CTX_new(SSLv23_client_method());
+ if(!ctx) {
+ log_event(LOG_ERR, "No SSL support initiated\n");
+ return(-1);
+@@ -1310,7 +1306,7 @@ char *fd_gets(char *buf, int size, int f
+ buf[i++] = c;
+ }
+ }
+- buf[i] = (char)NULL;
++ buf[i] = '\0';
+
+ return(buf);
+ }
+@@ -1434,14 +1430,14 @@ int ssmtp(char *argv[])
+ }
+
+ if((p = strtok(pw->pw_gecos, ";,"))) {
+- if((gecos = strdup(p)) == (char *)NULL) {
++ if((gecos = strdup(p)) == NULL) {
+ die("ssmtp() -- strdup() failed");
+ }
+ }
+ revaliases(pw);
+
+ /* revaliases() may have defined this */
+- if(uad == (char *)NULL) {
++ if(uad == NULL) {
+ uad = append_domain(pw->pw_name);
+ }
+
+@@ -1489,7 +1485,7 @@ int ssmtp(char *argv[])
+ /* Try to log in if username was supplied */
+ if(auth_user) {
+ #ifdef MD5AUTH
+- if(auth_pass == (char *)NULL) {
++ if(auth_pass == NULL) {
+ auth_pass = strdup("");
+ }
+
+@@ -1508,7 +1504,7 @@ int ssmtp(char *argv[])
+ else {
+ #endif
+ memset(buf, 0, bufsize);
+- to64frombits(buf, auth_user, strlen(auth_user));
++ to64frombits(buf, (unsigned char *)auth_user, strlen(auth_user));
+ if (use_oldauth) {
+ outbytes += smtp_write(sock, "AUTH LOGIN %s", buf);
+ }
+@@ -1520,7 +1516,7 @@ int ssmtp(char *argv[])
+ }
+ /* we assume server asked us for Username */
+ memset(buf, 0, bufsize);
+- to64frombits(buf, auth_user, strlen(auth_user));
++ to64frombits(buf, (unsigned char *)auth_user, strlen(auth_user));
+ outbytes += smtp_write(sock, buf);
+ }
+
+@@ -1530,7 +1526,7 @@ int ssmtp(char *argv[])
+ }
+ memset(buf, 0, bufsize);
+
+- to64frombits(buf, auth_pass, strlen(auth_pass));
++ to64frombits(buf, (unsigned char *)auth_pass, strlen(auth_pass));
+ #ifdef MD5AUTH
+ }
+ #endif
+@@ -1737,7 +1733,7 @@ char **parse_options(int argc, char *arg
+ j = 0;
+
+ add = 1;
+- while(argv[i][++j] != (char)NULL) {
++ while(argv[i][++j] != '\0') {
+ switch(argv[i][j]) {
+ #ifdef INET6
+ case '6':
+@@ -1755,14 +1751,14 @@ char **parse_options(int argc, char *arg
+ if((!argv[i][(j + 1)])
+ && argv[(i + 1)]) {
+ auth_user = strdup(argv[i+1]);
+- if(auth_user == (char *)NULL) {
++ if(auth_user == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ add++;
+ }
+ else {
+ auth_user = strdup(argv[i]+j+1);
+- if(auth_user == (char *)NULL) {
++ if(auth_user == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ }
+@@ -1772,14 +1768,14 @@ char **parse_options(int argc, char *arg
+ if((!argv[i][(j + 1)])
+ && argv[(i + 1)]) {
+ auth_pass = strdup(argv[i+1]);
+- if(auth_pass == (char *)NULL) {
++ if(auth_pass == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ add++;
+ }
+ else {
+ auth_pass = strdup(argv[i]+j+1);
+- if(auth_pass == (char *)NULL) {
++ if(auth_pass == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ }
+@@ -1870,14 +1866,14 @@ char **parse_options(int argc, char *arg
+ case 'F':
+ if((!argv[i][(j + 1)]) && argv[(i + 1)]) {
+ minus_F = strdup(argv[(i + 1)]);
+- if(minus_F == (char *)NULL) {
++ if(minus_F == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ add++;
+ }
+ else {
+ minus_F = strdup(argv[i]+j+1);
+- if(minus_F == (char *)NULL) {
++ if(minus_F == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ }
+@@ -1889,14 +1885,14 @@ char **parse_options(int argc, char *arg
+ case 'r':
+ if((!argv[i][(j + 1)]) && argv[(i + 1)]) {
+ minus_f = strdup(argv[(i + 1)]);
+- if(minus_f == (char *)NULL) {
++ if(minus_f == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ add++;
+ }
+ else {
+ minus_f = strdup(argv[i]+j+1);
+- if(minus_f == (char *)NULL) {
++ if(minus_f == NULL) {
+ die("parse_options() -- strdup() failed");
+ }
+ }
+--- a/base64.c
++++ b/base64.c
+@@ -31,7 +31,7 @@ static const char base64val[] = {
+ };
+ #define DECODE64(c) (isascii(c) ? base64val[c] : BAD)
+
+-void to64frombits(unsigned char *out, const unsigned char *in, int inlen)
++void to64frombits(char *out, const unsigned char *in, int inlen)
+ /* raw bytes in quasi-big-endian order to base 64 string (NUL-terminated) */
+ {
+ for (; inlen >= 3; inlen -= 3)
+@@ -57,7 +57,7 @@ void to64frombits(unsigned char *out, co
+ *out = '\0';
+ }
+
+-int from64tobits(char *out, const char *in)
++int from64tobits(unsigned char *out, const char *in)
+ /* base 64 to raw bytes in quasi-big-endian order, returning count of bytes */
+ {
+ int len = 0;
+--- a/ssmtp.h
++++ b/ssmtp.h
+@@ -41,5 +41,5 @@ typedef struct string_list rcpt_t;
+ void get_arpadate(char *);
+
+ /* base64.c */
+-void to64frombits(unsigned char *, const unsigned char *, int);
+-int from64tobits(char *, const char *);
++void to64frombits(char *, const unsigned char *, int);
++int from64tobits(unsigned char *, const char *);
PKG_MD5SUM:=1bfdb21904e816f100370ec8f4df986b
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_INSTALL:=1
PKG_NAME:=gst1-libav
PKG_VERSION:=1.2.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_MD5SUM:=58c7998a054d8d8ca041fa35738f72b6
PKG_LICENSE:=GPL-2.0 LGPL-2.0
-PKG_LICENSE_FILE:=COPYING COPYING.LIB
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-libav-$(PKG_VERSION)
$(patsubst %,CONFIG_GST1_LIBAV_PARSER_%,$(LIBAV_PARSERS)) \
$(patsubst %,CONFIG_GST1_LIBAV_PROTOCOL_%,$(LIBAV_PROTOCOLS))
-PKG_BUILD_DEPENDS:= libstreamer1 gstreamer1-plugins-base
+PKG_BUILD_DEPENDS:= libgstreamer1 gstreamer1-plugins-base
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=LGPLv2 GPLv2
-PKG_LICENSE_FILE:=COPYING.LIB COPYING
+PKG_LICENSE_FILES:=COPYING.LIB COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-bad-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-bad-$(PKG_VERSION).tar.xz
PKG_NAME:=gst1-plugins-base
PKG_VERSION:=1.2.3
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=LGPLv2 GPLv2
-PKG_LICENSE_FILE:=COPYING.LIB COPYING
+PKG_LICENSE_FILES:=COPYING.LIB COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-base-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-base-$(PKG_VERSION).tar.xz
define Package/gst1-plugins-base/install
- /bin/true
+ true
endef
+define Package/gstreamer1-plugins-base/install
+ true
+endef
# 1: short name
# 2: description
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-good-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-good-$(PKG_VERSION).tar.xz
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gst-plugins-ugly-$(PKG_VERSION)
PKG_SOURCE:=gst-plugins-ugly-$(PKG_VERSION).tar.xz
PKG_NAME:=gstreamer1
PKG_VERSION:=1.2.3
-PKG_RELEASE:=2
+PKG_RELEASE:=4
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=LGPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/gstreamer-$(PKG_VERSION)
PKG_SOURCE:=gstreamer-$(PKG_VERSION).tar.xz
endef
define Package/gstreamer1-libs/install
+ true
endef
define Package/gstreamer1-utils/install
./usr/lib/gstreamer-$(GST_VERSION)/libgst*.so \
$(1)/usr/lib/gstreamer-$(GST_VERSION)/ \
)
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gstreamer-$(GST_VERSION)/gst-plugin-scanner \
+ $(1)/usr/lib/gstreamer-$(GST_VERSION)
endef
PKG_NAME:=icecast
PKG_VERSION:=2.4.0
PKG_RELEASE:=1
+PKG_LICENSE:=GPL-2.0
PKG_MAINTAINER:=André Gaul <gaul@web-yard.de>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
include $(TOPDIR)/rules.mk
PKG_NAME:=minidlna
-PKG_VERSION:=1.1.3
+PKG_VERSION:=1.1.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/minidlna
-PKG_MD5SUM:=879027192c89e5376cdd2ae2d1aa33b4
+PKG_MD5SUM:=67c9e91285bc3801fd91a5d26ea775d7
PKG_LICENSE:=GPL-2.0 BSD-3-Clause
PKG_LICENSE_FILES:=COPYING LICENCE.miniupnpd
define Package/minidlna/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlna $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/minidlnad $(1)/usr/bin/minidlna
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/minidlna.init $(1)/etc/init.d/minidlna
$(INSTALL_DIR) $(1)/etc/config
+++ /dev/null
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -19,9 +19,9 @@
-
- SUBDIRS=po
-
--sbin_PROGRAMS = minidlnad
-+sbin_PROGRAMS = minidlna
- check_PROGRAMS = testupnpdescgen
--minidlnad_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
-+minidlna_SOURCES = minidlna.c upnphttp.c upnpdescgen.c upnpsoap.c \
- upnpreplyparse.c minixml.c clients.c \
- getifaddr.c process.c upnpglobalvars.c \
- options.c minissdp.c uuid.c upnpevents.c \
-@@ -38,7 +38,7 @@
- flacoggflag = -logg
- #endif
-
--minidlnad_LDADD = \
-+minidlna_LDADD = \
- @LIBJPEG_LIBS@ \
- @LIBID3TAG_LIBS@ \
- @LIBSQLITE3_LIBS@ \
-@@ -49,7 +49,7 @@
- @LIBICONV@ \
- -lFLAC $(flacoggflag) $(vorbisflag)
-
--minidlnad_LDFLAGS = @STATIC_LDFLAGS@
-+minidlna_LDFLAGS = @STATIC_LDFLAGS@
-
- testupnpdescgen_SOURCES = testupnpdescgen.c upnpdescgen.c
- testupnpdescgen_LDADD = \
+++ /dev/null
---- a/upnphttp.c
-+++ b/upnphttp.c
-@@ -1259,7 +1259,7 @@
- int try_sendfile = 1;
- #endif
-
-- while( offset < end_offset )
-+ while( offset <= end_offset )
- {
- #if HAVE_SENDFILE
- if( try_sendfile )
-
PKG_SOURCE_PROTO:=svn
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=motion
-PKG_VERSION:=20110826-051001
-PKG_RELEASE:=2
+PKG_VERSION=3.4.0-20141018-$(PKG_SOURCE_VERSION)
+PKG_RELEASE:=1
+
PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
+PKG_LICENSE:=GPLv2
+PKG_LICENSE_FILES:=COPYING
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.lavrsen.dk/sources/motion-daily \
- @SF/motion
-PKG_MD5SUM:=e703fce57ae2215cb05f25e3027f5818
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/Mr-Dave/motion.git
+PKG_SOURCE_VERSION:=9479d910f2149b5558788bb86f97f26522794212
-PKG_INSTALL:=1
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
+PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
endef
define Package/motion/conffiles
-/etc/motion.conf
+ /etc/motion.conf
endef
CONFIGURE_ARGS+= \
define Package/motion/install
$(INSTALL_DIR) $(1)/etc
- $(CP) $(PKG_INSTALL_DIR)/etc/motion-dist.conf $(1)/etc/motion.conf
+ $(CP) $(PKG_BUILD_DIR)/motion-dist.conf $(1)/etc/motion.conf
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/motion $(1)/usr/bin/
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/motion $(1)/usr/bin/
endef
+++ /dev/null
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -31,6 +31,7 @@ examplesdir = $(datadir)/@PACKAGE_NAME@-
- # install. #
- ################################################################################
- CFLAGS = @CFLAGS@ -Wall -DVERSION=\"@PACKAGE_VERSION@\" -Dsysconfdir=\"$(sysconfdir)\"
-+CPPFLAGS = @CPPFLAGS@
- LDFLAGS = @LDFLAGS@
- LIBS = @LIBS@
- VIDEO_OBJ = @VIDEO@
-@@ -118,7 +119,7 @@ endif
- ################################################################################
- $(DEPEND_FILE): *.h $(SRC)
- @echo "Generating dependencies, please wait..."
-- @$(CC) $(CFLAGS) -M $(SRC) > .tmp
-+ @$(CC) $(CFLAGS) $(CPPFLAGS) -M $(SRC) > .tmp
- @mv -f .tmp $(DEPEND_FILE)
- @echo
-
--- /dev/null
+#
+# Copyright (C) 2014 Openwrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=bcp38
+PKG_VERSION:=4
+PKG_RELEASE:=1
+PKG_LICENCE:=GPL-3.0+
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bcp38
+ SECTION:=net
+ CATEGORY:=Network
+ SUBMENU:=Routing and Redirection
+ TITLE:=BCP38 compliance
+ URL:=https://github.com/dtaht/ceropackages-3.10
+ MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+ DEPENDS:=+ipset
+endef
+
+define Package/bcp38/description
+ bcp38 implements IETF BCP38 for home routers. See https://tools.ietf.org/html/bcp38.
+endef
+
+define Package/bcp38/conffiles
+/etc/config/bcp38
+endef
+
+define Build/Prepare
+endef
+
+define Build/Configure
+endef
+
+define Build/Compile
+endef
+
+define Package/bcp38/install
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_CONF) ./files/bcp38.config $(1)/etc/config/bcp38
+ $(INSTALL_DIR) $(1)/usr/lib/bcp38
+ $(INSTALL_BIN) ./files/run.sh $(1)/usr/lib/bcp38/run.sh
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/bcp38.defaults $(1)/etc/uci-defaults/bcp38
+endef
+
+define Package/bcp38/postinst
+#!/bin/sh
+[ -x /etc/uci-defaults/bcp38 ] && /etc/uci-defaults/bcp38 || exit 0
+endef
+
+define Package/bcp38/postrm
+#!/bin/sh
+uci delete firewall.bcp38
+uci commit
+endef
+
+$(eval $(call BuildPackage,bcp38))
--- /dev/null
+config bcp38
+ option enabled 0
+ option interface 'eth1'
+ option detect_upstream 1
+ list match '127.0.0.0/8'
+ list match '0.0.0.0/8' # RFC 1700
+ list match '240.0.0.0/4' # RFC 5745
+ list match '192.0.2.0/24' # RFC 5737
+ list match '198.51.100.0/24' # RFC 5737
+ list match '203.0.113.0/24' # RFC 5737
+ list match '192.168.0.0/16' # RFC 1918
+ list match '10.0.0.0/8' # RFC 1918
+ list match '172.16.0.0/12' # RFC 1918
+ list match '169.254.0.0/16' # RFC 3927
+
+# list nomatch '172.26.0.0/21' # Example of something not to match
+# There is a dhcp trigger to do this for the netmask of a
+# double natted connection needed
+
+# I will argue that this level of indirection doesn't scale
+# very well - see how to block china as an example
+# http://www.okean.com/china.txt
--- /dev/null
+#!/bin/sh
+
+uci -q batch <<-EOT
+ delete firewall.bcp38
+ set firewall.bcp38=include
+ set firewall.bcp38.type=script
+ set firewall.bcp38.path=/usr/lib/bcp38/run.sh
+ set firewall.bcp38.family=IPv4
+ set firewall.bcp38.reload=1
+ commit firewall
+EOT
+
+exit 0
--- /dev/null
+#!/bin/sh
+# BCP38 filtering implementation for CeroWrt.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3 of the License, or (at your option) any later
+# version.
+#
+# Author: Toke Høiland-Jørgensen <toke@toke.dk>
+
+STOP=$1
+IPSET_NAME=bcp38-ipv4
+IPTABLES_CHAIN=BCP38
+
+. /lib/functions.sh
+
+config_load bcp38
+
+add_bcp38_rule()
+{
+ local subnet="$1"
+ local action="$2"
+
+ if [ "$action" == "nomatch" ]; then
+ ipset add "$IPSET_NAME" "$subnet" nomatch
+ else
+ ipset add "$IPSET_NAME" "$subnet"
+ fi
+}
+
+detect_upstream()
+{
+ local interface="$1"
+
+ subnets=$(ip route show dev "$interface" | grep 'scope link' | awk '{print $1}')
+ for subnet in $subnets; do
+ # ipset test doesn't work for subnets, so strip out the subnet part
+ # and test for that; add as exception if there's a match
+ addr=$(echo $subnet | sed 's|/[0-9]\+$||')
+ ipset test "$IPSET_NAME" $addr 2>/dev/null && add_bcp38_rule $subnet nomatch
+ done
+}
+
+run() {
+ local section="$1"
+ local enabled
+ local interface
+ local detect_upstream
+ config_get_bool enabled "$section" enabled 0
+ config_get interface "$section" interface
+ config_get detect_upstream "$section" detect_upstream
+
+ if [ "$enabled" -eq "1" -a -n "$interface" -a -z "$STOP" ] ; then
+ setup_ipset
+ setup_iptables "$interface"
+ config_list_foreach "$section" match add_bcp38_rule match
+ config_list_foreach "$section" nomatch add_bcp38_rule nomatch
+ [ "$detect_upstream" -eq "1" ] && detect_upstream "$interface"
+ fi
+ exit 0
+}
+
+setup_ipset()
+{
+ ipset create "$IPSET_NAME" hash:net family ipv4
+ ipset flush "$IPSET_NAME"
+}
+
+setup_iptables()
+{
+ local interface="$1"
+ iptables -N "$IPTABLES_CHAIN" 2>/dev/null
+ iptables -F "$IPTABLES_CHAIN" 2>/dev/null
+
+ iptables -I output_rule -j "$IPTABLES_CHAIN"
+ iptables -I input_rule -j "$IPTABLES_CHAIN"
+ iptables -I forwarding_rule -j "$IPTABLES_CHAIN"
+
+ # always accept DHCP traffic
+ iptables -A "$IPTABLES_CHAIN" -p udp --dport 67:68 --sport 67:68 -j RETURN
+ iptables -A "$IPTABLES_CHAIN" -o "$interface" -m set --match-set "$IPSET_NAME" dst -j REJECT --reject-with icmp-net-unreachable
+ iptables -A "$IPTABLES_CHAIN" -i "$interface" -m set --match-set "$IPSET_NAME" src -j DROP
+}
+
+destroy_ipset()
+{
+ ipset flush "$IPSET_NAME" 2>/dev/null
+ ipset destroy "$IPSET_NAME" 2>/dev/null
+}
+
+destroy_iptables()
+{
+ iptables -D output_rule -j "$IPTABLES_CHAIN" 2>/dev/null
+ iptables -D input_rule -j "$IPTABLES_CHAIN" 2>/dev/null
+ iptables -D forwarding_rule -j "$IPTABLES_CHAIN" 2>/dev/null
+ iptables -F "$IPTABLES_CHAIN" 2>/dev/null
+ iptables -X "$IPTABLES_CHAIN" 2>/dev/null
+}
+
+destroy_iptables
+destroy_ipset
+config_foreach run bcp38
+
+exit 0
define Package/bmon
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+libncurses +libnl +confuse
+ DEPENDS:=+PACKAGE_libncursesw:libncursesw +!PACKAGE_libncursesw:libncurses +libnl +confuse
TITLE:=bmon is a portable bandwidth monitor
URL:=https://github.com/tgraf/bmon/
endef
CONFIGURE_ARGS += \
--disable-cnt-workaround \
- --disable-dbi \
- --disable-rrd \
- --disable-asound \
CONFIGURE_VARS += \
ac_cv_lib_nl_nl_connect=no \
--- /dev/null
+# CoovaChilli avanced configuration
+
+menu "Configuration"
+ depends on PACKAGE_coova-chilli
+
+config COOVACHILLI_REDIR
+ bool "Enable support for redir server. Required for uamregex"
+ default n
+
+config COOVACHILLI_MINIPORTAL
+ bool "Enable support Coova miniportal"
+ default n
+
+config COOVACHILLI_USERAGENT
+ bool "Enable recording user-agent"
+ default n
+
+config COOVACHILLI_DNSLOG
+ bool "Enable support to log DNS name queries"
+ default n
+
+config COOVACHILLI_UAMDOMAINFILE
+ bool "Enable loading of mass uamdomains from file"
+ default n
+
+config COOVACHILLI_LARGELIMITS
+ bool "Enable larger limits for use with non-embedded systems"
+ default n
+
+choice
+ prompt "SSL library"
+ default COOVACHILLI_NOSSL
+
+config COOVACHILLI_NOSSL
+ bool "No SSL support"
+
+config COOVACHILLI_MATRIXSSL
+ bool "MatrixSSL"
+
+config COOVACHILLI_CYASSL
+ bool "CyaSSL"
+
+config COOVACHILLI_OPENSSL
+ bool "OpenSSL"
+
+endchoice
+
+endmenu
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=coova-chilli
+PKG_VERSION:=1.3.0+20141128
+PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
+PKG_LICENSE:=GPL-2.0+
+PKG_LICENSE_FILE:=COPYING
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/coova/coova-chilli
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=b93de20a288c01c2ba28e96e31ad6da01627f45f
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_MD5SUM:=2adb27ec56172b18c5beee359dd7898d
+
+PKG_INSTALL:=1
+
+PKG_CONFIG_DEPENDS := \
+ COOVACHILLI_MINIPORTAL \
+ COOVACHILLI_REDIR \
+ COOVACHILLI_USERAGENT \
+ COOVACHILLI_DNSLOG \
+ COOVACHILLI_UAMDOMAINFILE \
+ COOVACHILLI_LARGELIMITS \
+ COOVACHILLI_NOSSL \
+ COOVACHILLI_MATRIXSSL \
+ COOVACHILLI_CYASSL \
+ COOVACHILLI_OPENSSL
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/coova-chilli
+ SUBMENU:=Captive Portals
+ SECTION:=net
+ CATEGORY:=Network
+ DEPENDS:=+kmod-tun +librt +COOVACHILLI_MATRIXSSL:libmatrixssl +COOVACHILLI_CYASSL:libcyassl +COOVACHILLI_OPENSSL:libopenssl
+ TITLE:=Wireless LAN HotSpot controller (Coova Chilli Version)
+ URL:=http://www.coova.org/CoovaChilli
+ MENU:=1
+endef
+
+define Package/coova-chilli/description
+ CoovaChilli is an open source access controller for wireless LAN
+ access points and is based on ChilliSpot. It is used for authenticating
+ users of a wireless (or wired) LAN. It supports web based login (UAM)
+ which is today's standard for public HotSpots and it supports Wireless
+ Protected Access (WPA) which is the standard of the future.
+ Authentication, authorization and accounting (AAA) is handled by your
+ favorite radius server.
+endef
+
+define Package/coova-chilli/config
+ source "$(SOURCE)/Config.in"
+endef
+
+define Build/Prepare
+$(call Build/Prepare/Default)
+ ( cd $(PKG_BUILD_DIR) ; \
+ [ -f ./configure ] || { \
+ ./bootstrap ; \
+ } \
+ )
+endef
+
+define Build/Configure
+ $(call Build/Configure/Default, \
+ $(if $(CONFIG_COOVACHILLI_REDIR),--enable,--disable)-chilliredir \
+ $(if $(CONFIG_COOVACHILLI_DNSLOG),--enable,--disable)-dnslog \
+ $(if $(CONFIG_COOVACHILLI_MINIPORTAL),--enable,--disable)-miniportal \
+ $(if $(CONFIG_COOVACHILLI_USERAGENT),--enable,--disable)-useragent \
+ $(if $(CONFIG_COOVACHILLI_LARGELIMITS),--enable,--disable)-largelimits \
+ $(if $(CONFIG_COOVACHILLI_UAMDOMAINFILE),--enable,--disable)-uamdomainfile \
+ $(if $(CONFIG_COOVACHILLI_MATRIXSSL),--with,--without)-matrixssl \
+ $(if $(CONFIG_COOVACHILLI_CYASSL),--with,--without)-cyaxssl \
+ $(if $(CONFIG_COOVACHILLI_OPENSSL),--with,--without)-openssl \
+ )
+endef
+
+define Package/coova-chilli/conffiles
+/etc/chilli.conf
+endef
+
+define Package/coova-chilli/install
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/chilli.conf $(1)/etc/
+ $(INSTALL_DIR) $(1)/etc/chilli
+ $(CP) $(PKG_INSTALL_DIR)/etc/chilli/* $(1)/etc/chilli/
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
+ $(INSTALL_DATA) ./files/chilli.hotplug $(1)/etc/hotplug.d/iface/30-chilli
+ $(INSTALL_DIR) $(1)/usr/sbin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/chilli* $(1)/usr/sbin/
+ $(INSTALL_DIR) $(1)/usr/lib/
+ $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so.* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,coova-chilli))
--- /dev/null
+#!/bin/sh
+
+[ "$ACTION" == "ifup" ] || exit 0
+
+[ "$INTERFACE" = "wan" ] && {
+ /etc/init.d/chilli restart
+}
--- /dev/null
+--- a/src/system.h
++++ b/src/system.h
+@@ -83,10 +83,6 @@
+ #include <linux/sysinfo.h>
+ #endif
+
+-#ifdef HAVE_SYS_SYSINFO_H
+-#include <sys/sysinfo.h>
+-#endif
+-
+ #ifdef HAVE_TIME_H
+ #include <time.h>
+ #endif
+@@ -139,6 +135,10 @@
+ #include <linux/un.h>
+ #endif
+
++#ifdef HAVE_SYS_SYSINFO_H
++#include <sys/sysinfo.h>
++#endif
++
+ #elif defined (__FreeBSD__) || defined (__APPLE__) || defined (__OpenBSD__) || defined (__NetBSD__)
+ #include <net/if.h>
+ #include <net/bpf.h>
--- /dev/null
+Version 2.1.0-2
+Date 2014-11-15
+
+- moved /usr/lib/ddns/dynamic_dns_lucihelper.sh from luci-app-ddns into this package
+ (Github openwrt/luci issue 251)
+ (OpenWrt Trac tickets 18326 18347)
+- fix: dynamic_dns_update.sh did not loop
+ (OpenWrt Trac ticket 18336)
+- add provider cloudflare.com IPv4 and IPv6 (Thanks to Paul for support and testing)
+ (OpenWrt Trac ticket 12500)
+- modified detection, if dynamic_dns_fuctions are used by dynamic_dns_lucihelper.sh
+- redirect stdout of wget,curl,host,nslookup,nc etc to /tmp/ddns_$$.dat and *.err instead of variables
+- extended error detection in get_local_ip function
+- modified verify of option ip_script to allow parameters, when calling
+- add provider selfhost.de IPv4
+- add provider no-ip.pl (nothing to do with no-ip.com)
+ (Github openwrt/packages issue #542)
+ IPv4 (tested) and also added for
+ IPv6 (NOT tested) because client IP is autodetected be provider
+- add getlocalip_sample.sh as sample script for usage of
+ option ip_source 'script' together with
+ option ip_script '/usr/lib/ddns/getlocalip.sh -4'
+- cleanup whitespaces at line ends
+
+--------------------------------------------------------------------------------
+Version 2.1.0-1
+Date 2014-11-09
+
+- fixed postinst and prerm in Makefile
+- implementation of provider specific update scripts into services and services_ipv6 file.
+ first Provider "no-ip.com" - Thanks to DarkStarXxX for request and testing
+- finished uci/ddns wiki at http://wiki.openwrt.org/doc/uci/ddns
+- rewritten retry management
+- rewritten logging including following Issue 469
+ https://github.com/openwrt/packages/issues/469
+- stop running sections on hotplug ifdown event (like start on ifup)
+- implement trap detection
+ also kill "sleep" child processes
+ SIGHUP to reload configuration (not really reloading, simply starting a new process)
+ /etc/init.d/ddns reload implemented
+- code optimization
+- new provider LoopiaDNS.se Issue 494
+ https://github.com/openwrt/packages/issues/494
+
+--------------------------------------------------------------------------------
+Version 2.0.1-9
+Date 2014-10-11
+
+- add retry loop to verify dns and proxy when script starts
+
+--------------------------------------------------------------------------------
+Version 2.0.1-8
+Date 2014-10-06
+
+- fixes problem CRITICAL ERROR - custom update_script not found
+
+--------------------------------------------------------------------------------
+Version 2.0.1-7
+Date 2014-10-05
+
+- Added support for custom update scripts with new option update_script
+
+--------------------------------------------------------------------------------
+Version 2.0.1-6
+Date 2014-10-01
+
+- url encode USERNAME and PASSWORD in update url
+
+--------------------------------------------------------------------------------
+Version 2.0.1-5
+Date 2014-09-30
+
+- fix send_update() detection of private IPv4
+
+--------------------------------------------------------------------------------
+Version 2.0.1-4
+Date 2014-09-29
+
+- fix ticket #17998: wrongly detect ipv4 start with 10x.x.x.x
+
+--------------------------------------------------------------------------------
+Version 2.0.1-3
+Date 2014-09-28
+
+- add service two-dns.de
+
+--------------------------------------------------------------------------------
+Version 2.0.1-2
+Date 2014-09-22
+
+- fix issue (#337) current/registered ip
+ https://github.com/openwrt/packages/issues/337
+
+--------------------------------------------------------------------------------
+Version 2.0.1-1
+Date 2014-09-20
+
+- 1st published version via github
+
+--------------------------------------------------------------------------------
+Version 2.0.0
+Date 2014-07-16
+
+- published via OpenWrt TRAC system as zip-file for testing
+ - IPv6 address support
+ - log file support
+ - syslog support for various error levels
+ - verify all given parameters before starting main loop
+ - retry max retry_counter times before terminating scripts
include $(TOPDIR)/rules.mk
PKG_NAME:=ddns-scripts
-PKG_VERSION:=2.0.1
-PKG_RELEASE:=9
+PKG_VERSION:=2.1.0
+PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
endef
define Package/ddns-scripts/description
- A highly configurable set of scripts for doing dynamic dns updates.
+ A highly configurable set of scripts for doing dynamic dns updates.
NEW in this version:
- IPv6 support
- force communication to IPv4 or IPv6 only
define Package/ddns-scripts/postinst
#!/bin/sh
# if run within buildroot exit
- [ -n "${IPKG_INSTROOT}" ] && exit 0
+ [ -n "$${IPKG_INSTROOT}" ] && exit 0
+
+ # remove old sed script file
+ [ -f /usr/lib/ddns/url_escape.sed ] && rm -f /usr/lib/ddns/url_escape.sed
+
+ # luci updates are not in sync with ddns-script updates !!!
+ # if old luci-app-ddns then errors during install because exist from differnt package
+ # copy dynamic_dns_helper.tmp.sh -> dynamic_dns_helper.sh
+ cp -f /usr/lib/ddns/dynamic_dns_lucihelper.tmp.sh /usr/lib/ddns/dynamic_dns_lucihelper.sh
# add new section "ddns" "global" if not exists
uci -q get ddns.global > /dev/null || uci -q set ddns.global='ddns'
uci -q get ddns.global.log_lines > /dev/null || uci -q set ddns.global.log_lines='250'
uci -q commit ddns
- # clear LuCI indexcache
+ # clear LuCI indexcache
rm -f /tmp/luci-indexcache >/dev/null 2>&1
exit 0
define Package/ddns-scripts/prerm
#!/bin/sh
# if run within buildroot exit
- [ -n "${IPKG_INSTROOT}" ] && exit 0
+ [ -n "$${IPKG_INSTROOT}" ] && exit 0
# stop running scripts
/etc/init.d/ddns disable
/etc/init.d/ddns stop
- # clear LuCI indexcache
+ # clear LuCI indexcache
rm -f /tmp/luci-indexcache >/dev/null 2>&1
exit 0
#
# Please read ddns.sample
+# or http://wiki.openwrt.org/doc/uci/ddns
#
config ddns "global"
option date_format "%F %R"
config service "myddns_ipv4"
- option service_name "dyndns.org"
- option domain "yourhost.dyndns.org"
+ option service_name "example.org"
+ option domain "yourhost.example.org"
option username "your_username"
option password "your_password"
option interface "wan"
option interface "wan6"
option ip_source "network"
option ip_network "wan6"
-
+
# and used by ddns-scripts and corresponding LuCI application
#
# Inside your ddns configuration file (/etc/config/ddns)
-# you might not find some of below described options.
+# you might not find some of below described options.
# This is because you don't need to define options
# if using there defaults. The LuCI application will delete
# options that configured to there default values.
#
# If you have a working ddns configuration from old ddns-scripts (Version 1.x)
-# everything will function the same with new scripts
+# everything will function the same with new scripts
# without any changes to the configuration.
#
# If you like to use this file for your configuration then
-# use a copy, because the used software to modify the
-# configuration files will throw away all empty lines
+# use a copy, because the used software to modify the
+# configuration files will throw away all empty lines
# and those starting with # (comments).
#
# for each service you want to serve you need a separate configuration
# if you need IPv4 and IPv6 you need to setup 2 separate configurations
# with different names. (i.e. "myddns_ipv4" and "myddns_ipv6")
-# do not use white-spaces or dashes "-" or "@" ":" "!" or
+# do not use white-spaces or dashes "-" or "@" ":" "!" or
# other special characters inside name.
config service "myddns"
-
+
########### Basic settings ########################
###########
###########
# defines the network as defined in /etc/config/network
- # to be monitored for up/down events to start via hotplug
+ # to be monitored for up/down events to start via hotplug
default: "wan" for IPv4
default: "wan6" for IPv6
option interface "wan"
###########
- # Next you need to specify the name of the service you are
+ # Next you need to specify the name of the service you are
# connecting to "eg. dyndns.org". The format of the update
# urls for several different dynamic dns services is specified
- # in the "/usr/lib/ddns/services" file for IPv4 and in
+ # in the "/usr/lib/ddns/services" file for IPv4 and in
# "/usr/lib/ddns/service_ipv6" file. This list is hardly complete
# as there are many, many different dynamic dns services.
- # If your service is on the list you can merely specify it with the
+ # If your service is on the list you can merely specify it with the
# "service_name" option. Otherwise you will need to determine
# the format of the url to update with. You can either add an
- # entry to the "/usr/lib/ddns/services" or "services_ipv6" file
+ # entry to the "/usr/lib/ddns/services" or "services_ipv6" file
# or specify this with the "update_url" option.
# If your ddns provider doesn't work with ddns-scripts because
# there are additional parameters or other special thinks to be done,
# default: none
option service_name "dyndns.org"
- # sample:
+ # sample:
# "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
# option update_url ""
- # sample:
+ # sample:
# "/usr/lib/ddns/update_sample.sh"
# option update_script ""
###########
# You must specify your domain/host name, your username and your password
# as you get from you DDNS provider. Keep an eye on providers help pages.
- #
+ #
# Your DNS name / replace [DOMAIN] in update_url
# default: none
option domain ""
###########
# use HTTPS for secure communication with you DDNS provider
- # personally found some providers having problems when not sending
- # updates via HTTPS. Yyou must not specify "https://" in update_url.
+ # personally found some providers having problems when not sending
+ # updates via HTTPS. You must not specify "https://" in update_url.
# It's modified by the scripts themselves
# Needs GNU Wget (with SSL support) or cURL to be installed.
# default: "0" do not use HTTPS
option use_https "0"
- # if using HTTPS (see above) the transfer program tries to verify
+ # if using HTTPS (see above) the transfer program tries to verify
# the providers server certificate. For verification there needs to be
# the counterpart on this machine. Specify the path or path/file where
# the transfer program can find them. (might need package CA-certificates)
# if you don't want to verify servers certificate (insecure) you should
# this parameter to "IGNORE" (in capital letters)
- # default: "/etc/cacert" path where CA-certificate package is installed
- option cacert "/etc/cacert"
+ # default: (none) path where CA-certificate package is installed
+ option cacert "/etc/ssl/certs"
###########
# for logging and control if everything work fine you can get information inside
option ip_source "network"
option ip_network "wan"
- # ip_source "web" additional uses option ip_url and detects the current
+ # ip_source "web" additional uses option ip_url and detects the current
# local ip from special web sides that response with the ip address of
# calling host. If you are behind a firewall/NAT this is the best option
# since none of the local networks or interfaces will have the external ip.
# option ip_script ""
###########
- # force_ipversion option will set the "-4" respectively "-6" parameter
- # on command line of transfer and DNS lookup program.
+ # force_ipversion option will set the "-4" respectively "-6" parameter
+ # on command line of transfer and DNS lookup program.
# So the whole communication uses the selected IP version between both ends.
# needs GNU Wget or cURL installed for transfer and
# BIND's host for DNS lookup.
option force_ipversion "0"
###########
- # normally the current (in the internet) registered ip is detected using the
+ # Normally the current (in the internet) registered ip is detected using the
# local defined name lookup policies (i.e. /etc/resolve.conf etc.)
# Specify here a DNS server to use instead of the defaults.
# you can use hostname or ip address
- # IPv6 address must be in squared brackets "[...]"
# i.e. "google-public-dns-a.google.com"
# default: none
# option dns_server "google-public-dns-a.google.com"
# If a Proxy is need to access HTTP/HTTPS pages on the WEB
# it can be configured here also for sending updates to the
# DDNS provider. If you configured use_https='1' above, you
- # need to setup your HTTPS proxy here, otherwise your
+ # need to setup your HTTPS proxy here, otherwise your
# HTTP proxy. !!! You should not detect your current IP
- # ip_source='web' (see above) because this request is also
+ # ip_source='web' (see above) because this request is also
# send via the configured proxy !!!
# Syntax: [user:password@]proxy:port !port is required !
+ # IPv6 address must be in squared brackets "[...]"
# default: none
# option proxy ''
# defines the time interval to check if local IP has changed
# After the first start and first update send, the system will
# wait this time before verify if update was successful send.
- # !!! checks below 5 minutes make no sense because the Internet
+ # !!! checks below 5 minutes make no sense because the Internet
# needs about 5-10 minutes to sync an IP-change to all DNS servers !!!
- # accepted unit entry’s: 'seconds' 'minutes' 'hours' 'days'
+ # accepted unit entry’s: 'seconds' 'minutes' 'hours'
# minimum 5 minutes == 300 seconds
# default 10 minutes
option check_interval '10'
###########
# force to send an update to service provider, if no change was detected.
# consult DDNS providers documentation if your DDNS entry might timeout.
- # accepted unit entry’s: 'seconds' 'minutes' 'hours' 'days'
+ # accepted unit entry’s: 'minutes' 'hours' 'days'
# minimum needs to be greater or equal check interval (see above)
# A special setting of '0' is allowed, which forces the script to run once.
- # It sends an update, verify if update was accepted by DNS
- # (retry if not) and finish. Useful if you want to start by your own (i.e. cron)
+ # It sends an update, verify if update was accepted by DNS
+ # (retry if not) and finish. Useful if you want to start by your own (i.e. cron)
# default 3 days == 72 hours
option force_interval '72'
option force_unit 'hours'
# if error happen on detecting, sending or updating the
# script will retry the relevant action.
# here you define the time to wait before retry is started
- # accepted unit entry’s: 'seconds' 'minutes' 'hours' 'days'
+ # accepted unit entry’s: 'seconds' 'minutes'
# default: 60 seconds
option retry_interval '60'
option retry_unit 'seconds'
#!/bin/sh
-if [ "$ACTION" = "ifup" ]; then
- . /usr/lib/ddns/dynamic_dns_functions.sh
- /etc/init.d/ddns enabled && start_daemon_for_all_ddns_sections "$INTERFACE"
-fi
-
-
+# there are other ACTIONs like ifupdate we don't need
+# so parse dynamic_dns_functions.sh only when needed
+case "$ACTION" in
+ ifup)
+ . /usr/lib/ddns/dynamic_dns_functions.sh
+ /etc/init.d/ddns enabled && start_daemon_for_all_ddns_sections "$INTERFACE"
+ ;;
+ ifdown)
+ . /usr/lib/ddns/dynamic_dns_functions.sh
+ stop_daemon_for_all_ddns_sections "$INTERFACE"
+ ;;
+esac
#!/bin/sh /etc/rc.common
START=95
+STOP=10
boot() {
return 0
}
+reload() {
+ killall -1 dynamic_dns_updater.sh 2>/dev/null # send SIGHUP
+}
+
+restart() {
+ stop
+ sleep 1 # give time to shutdown
+ start
+}
+
start() {
. /usr/lib/ddns/dynamic_dns_functions.sh
start_daemon_for_all_ddns_sections
}
stop() {
- killall -9 dynamic_dns_updater.sh
+ killall dynamic_dns_updater.sh 2>/dev/null
}
-
+++ /dev/null
-#!/bin/sh
-#
-#set -vx
-
-[ -d /etc/ssl/certs ] || {
- echo "CA-Certificates not istalled - please install first"
- exit 1
-}
-
-NUMCERT=$(find /etc/ssl/certs -name *.crt 2>/dev/null | wc -l)
-NUMLINK=$(find /etc/ssl/certs -type l 2>/dev/null | wc -l)
-
-[ $NUMLINK -gt 0 ] && {
- echo "File-Links already exist. Exiting"
- exit 0
-}
-
-[ -f /usr/bin/openssl ] && OPENSSL="EXIST"
-[ -z "$OPENSSL" ] && {
- opkg update || exit 1
- opkg install openssl-util 2>/dev/null
-}
-
-for CERTFILE in `ls -1 $(1)/etc/ssl/certs`; do \
- HASH=`openssl x509 -hash -noout -in /etc/ssl/certs/$CERTFILE`
- SUFFIX=0
- while [ -h "/etc/ssl/certs/$HASH.$SUFFIX" ]; do
- let "SUFFIX += 1"
- done
- ln -s "$CERTFILE" "/etc/ssl/certs/$HASH.$SUFFIX"
- echo "link $HASH.$SUFFIX created for $CERTFILE"
-done
-
-[ -z "$OPENSSL" ] && opkg remove --force-remove --autoremove openssl-util 2>/dev/null
# (Loosely) based on the script on the one posted by exobyte in the forums here:
# http://forum.openwrt.org/viewtopic.php?id=14040
#
-# extended and partial rewritten in August 2014
+# extended and partial rewritten in August 2014
# by Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
# to support:
# - IPv6 DDNS services
# - Proxy Server to send out updates or retrieving WEB based IP detection
# - force_interval=0 to run once (usefull for cron jobs etc.)
# - the usage of BIND's host instead of BusyBox's nslookup if installed (DNS via TCP)
-# - extended Verbose Mode and log file support for better error detection
+# - extended Verbose Mode and log file support for better error detection
#
-# function __timeout
+# function timeout
# copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh
# @author Anthony Thyssen 6 April 2011
#
# GLOBAL VARIABLES #
SECTION_ID="" # hold config's section name
VERBOSE_MODE=1 # default mode is log to console, but easily changed with parameter
-LUCI_HELPER="" # set by dynamic_dns_lucihelper.sh, if filled supress all error logging
-PIDFILE="" # pid file
-UPDFILE="" # store UPTIME of last update
-
-# directory to store run information to.
+# directory to store run information to.
RUNDIR=$(uci -q get ddns.global.run_dir) || RUNDIR="/var/run/ddns"
# NEW # directory to store log files
LOGDIR=$(uci -q get ddns.global.log_dir) || LOGDIR="/var/log/ddns"
LOGFILE="" # NEW # logfile can be enabled as new option
+PIDFILE="" # pid file
+UPDFILE="" # store UPTIME of last update
+DATFILE="/tmp/ddns_$$.dat" # save stdout data of WGet and other extern programs called
+ERRFILE="/tmp/ddns_$$.err" # save stderr output of WGet and other extern programs called
+
# number of lines to before rotate logfile
LOGLINES=$(uci -q get ddns.global.log_lines) || LOGLINES=250
+LOGLINES=$((LOGLINES + 1)) # correct sed handling
CHECK_SECONDS=0 # calculated seconds out of given
FORCE_SECONDS=0 # interval and unit
RETRY_SECONDS=0 # in configuration
-OLD_PID=0 # Holds the PID of already running process for the same config section
-
LAST_TIME=0 # holds the uptime of last successful update
CURR_TIME=0 # holds the current uptime
NEXT_TIME=0 # calculated time for next FORCED update
REGISTERED_IP="" # holds the IP read from DNS
LOCAL_IP="" # holds the local IP read from the box
+URL_USER="" # url encoded $username from config file
+URL_PASS="" # url encoded $password from config file
+
ERR_LAST=0 # used to save $? return code of program and function calls
-ERR_LOCAL_IP=0 # error counter on getting local ip
-ERR_REG_IP=0 # error counter on getting DNS registered ip
-ERR_SEND=0 # error counter on sending update to DNS provider
ERR_UPDATE=0 # error counter on different local and registered ip
-ERR_VERIFY=0 # error counter verifying proxy- and dns-servers
+
+PID_SLEEP=0 # ProcessID of current background "sleep"
# format to show date information in log and luci-app-ddns default ISO 8601 format
DATE_FORMAT=$(uci -q get ddns.global.date_format) || DATE_FORMAT="%F %R"
# IPv6 ( ( 0-9a-f 1-4char ":") min 1x) ( ( 0-9a-f 1-4char )optional) ( (":" 0-9a-f 1-4char ) min 1x)
IPV6_REGEX="\(\([0-9A-Fa-f]\{1,4\}:\)\{1,\}\)\(\([0-9A-Fa-f]\{1,4\}\)\{0,1\}\)\(\(:[0-9A-Fa-f]\{1,4\}\)\{1,\}\)"
+# detect if called by dynamic_dns_lucihelper.sh script, disable retrys (empty variable == false)
+[ "$(basename $0)" = "dynamic_dns_lucihelper.sh" ] && LUCI_HELPER="TRUE" || LUCI_HELPER=""
+
# loads all options for a given package and section
# also, sets all_option_variables to a list of the variable names
# $1 = ddns, $2 = SECTION_ID
}
config_load "$__PKGNAME"
-
+
# Given SECTION_ID not found so no data, so return 1
[ -z "$__ALL_OPTION_VARIABLES" ] && return 1
return 0
}
+# read's all service sections from ddns config
+# $1 = Name of variable to store
+load_all_service_sections() {
+ local __DATA=""
+ config_cb()
+ {
+ # only look for section type "service", ignore everything else
+ [ "$1" = "service" ] && __DATA="$__DATA $2"
+ }
+ config_load "ddns"
+
+ eval "$1=\"$__DATA\""
+ return
+}
+
# starts updater script for all given sections or only for the one given
# $1 = interface (Optional: when given only scripts are started
# configured for that interface)
+# used by /etc/hotplug.d/iface/25-ddns on IFUP
+# and by /etc/init.d/ddns start
start_daemon_for_all_ddns_sections()
{
local __EVENTIF="$1"
local __SECTIONID=""
local __IFACE=""
- config_cb()
- {
- # only look for section type "service", ignore everything else
- [ "$1" = "service" ] && __SECTIONS="$__SECTIONS $2"
+ load_all_service_sections __SECTIONS
+ for __SECTIONID in $__SECTIONS; do
+ config_get __IFACE "$__SECTIONID" interface "wan"
+ [ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
+ /usr/lib/ddns/dynamic_dns_updater.sh $__SECTIONID 0 >/dev/null 2>&1 &
+ done
+}
+
+# stop sections process incl. childs (sleeps)
+# $1 = section
+stop_section_processes() {
+ local __PID=0
+ local __PIDFILE="$RUNDIR/$1.pid"
+ [ $# -ne 1 ] && write_log 12 "Error calling 'stop_section_processes()' - wrong number of parameters"
+
+ [ -e "$__PIDFILE" ] && {
+ __PID=$(cat $__PIDFILE)
+ ps | grep "^[\t ]*$__PID" >/dev/null 2>&1 && kill $__PID || __PID=0 # terminate it
}
- config_load "ddns"
+ [ $__PID -eq 0 ] # report if process was running
+}
- for __SECTIONID in $__SECTIONS
- do
+# stop updater script for all defines sections or only for one given
+# $1 = interface (optional)
+# used by /etc/hotplug.d/iface/25-ddns on 'ifdown'
+# and by /etc/init.d/ddns stop
+# needed because we also need to kill "sleep" child processes
+stop_daemon_for_all_ddns_sections() {
+ local __EVENTIF="$1"
+ local __SECTIONS=""
+ local __SECTIONID=""
+ local __IFACE=""
+
+ load_all_service_sections __SECTIONS
+ for __SECTIONID in $__SECTIONS; do
config_get __IFACE "$__SECTIONID" interface "wan"
[ -z "$__EVENTIF" -o "$__IFACE" = "$__EVENTIF" ] || continue
- /usr/lib/ddns/dynamic_dns_updater.sh $__SECTIONID 0 > /dev/null 2>&1 &
+ stop_section_processes "$__SECTIONID"
done
}
-verbose_echo()
-{
- [ -n "$LUCI_HELPER" ] && return # nothing to report when used by LuCI helper script
- [ $VERBOSE_MODE -gt 0 ] && echo -e " $*"
- if [ ${use_logfile:-0} -eq 1 -o $VERBOSE_MODE -gt 1 ]; then
+# reports to console, logfile, syslog
+# $1 loglevel 7 == Debug to 0 == EMERG
+# value +10 will exit the scripts
+# $2..n text to report
+write_log() {
+ local __LEVEL __EXIT __CMD __MSG
+ local __TIME=$(date +%H%M%S)
+ [ $1 -ge 10 ] && {
+ __LEVEL=$(($1-10))
+ __EXIT=1
+ } || {
+ __LEVEL=$1
+ __EXIT=0
+ }
+ shift # remove loglevel
+ [ $__EXIT -eq 0 ] && __MSG="$*" || __MSG="$* - TERMINATE"
+ case $__LEVEL in # create log message and command depending on loglevel
+ 0) __CMD="logger -p user.emerg -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME EMERG : $__MSG" ;;
+ 1) __CMD="logger -p user.alert -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME ALERT : $__MSG" ;;
+ 2) __CMD="logger -p user.crit -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME CRIT : $__MSG" ;;
+ 3) __CMD="logger -p user.err -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME ERROR : $__MSG" ;;
+ 4) __CMD="logger -p user.warn -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME WARN : $__MSG" ;;
+ 5) __CMD="logger -p user.notice -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME note : $__MSG" ;;
+ 6) __CMD="logger -p user.info -t ddns-scripts[$$] $SECTION_ID: $__MSG"
+ __MSG=" $__TIME info : $__MSG" ;;
+ 7) __MSG=" $__TIME : $__MSG";;
+ *) return;;
+ esac
+
+ # verbose echo
+ [ $VERBOSE_MODE -gt 0 -o $__EXIT -gt 0 ] && echo -e "$__MSG"
+ # write to logfile
+ if [ ${use_logfile:-1} -eq 1 -o $VERBOSE_MODE -gt 1 ]; then
[ -d $LOGDIR ] || mkdir -p -m 755 $LOGDIR
- echo -e " $*" >> $LOGFILE
+ echo -e "$__MSG" >> $LOGFILE
# VERBOSE_MODE > 1 then NO loop so NO truncate log to $LOGLINES lines
[ $VERBOSE_MODE -gt 1 ] || sed -i -e :a -e '$q;N;'$LOGLINES',$D;ba' $LOGFILE
fi
+ [ $LUCI_HELPER ] && return # nothing else todo when running LuCI helper script
+ [ $__LEVEL -eq 7 ] && return # no syslog for debug messages
+ [ $__EXIT -eq 1 ] && {
+ $__CMD # force syslog before exit
+ exit 1
+ }
+ [ $use_syslog -eq 0 ] && return
+ [ $((use_syslog + __LEVEL)) -le 7 ] && $__CMD
return
}
-syslog_info(){
- [ $use_syslog -eq 1 ] && logger -p user.info -t ddns-scripts[$$] "$SECTION_ID: $*"
- return
-}
-syslog_notice(){
- [ $use_syslog -ge 1 -a $use_syslog -le 2 ] && logger -p user.notice -t ddns-scripts[$$] "$SECTION_ID: $*"
- return
-}
-syslog_warn(){
- [ $use_syslog -ge 1 -a $use_syslog -le 3 ] && logger -p user.warn -t ddns-scripts[$$] "$SECTION_ID: $*"
- return
-}
-syslog_err(){
- [ $use_syslog -ge 1 ] && logger -p user.err -t ddns-scripts[$$] "$SECTION_ID: $*"
- return
-}
-
-critical_error() {
- [ -n "$LUCI_HELPER" ] && return # nothing to report when used by LuCI helper script
- verbose_echo "\n CRITICAL ERROR =: $* - EXITING\n"
- [ $VERBOSE_MODE -eq 0 ] && echo -e "\n$SECTION_ID: CRITICAL ERROR - $* - EXITING\n"
- logger -t ddns-scripts[$$] -p user.crit "$SECTION_ID: CRITICAL ERROR - $* - EXITING"
- exit 1 # critical error -> leave here
-}
-
# replace all special chars to their %hex value
# used for USERNAME and PASSWORD in update_url
# unchanged: "-"(minus) "_"(underscore) "."(dot) "~"(tilde)
# "$"(Dollar) # because used as variable output
# tested with the following string stored via Luci Application as password / username
# A B!"#AA$1BB%&'()*+,-./:;<=>?@[\]^_`{|}~ without problems at Dollar or quotes
-__urlencode() {
+urlencode() {
# $1 Name of Variable to store encoded string to
# $2 string to encode
local __STR __LEN __CHAR __OUT
local __ENC=""
local __POS=1
+ [ $# -ne 2 ] && write_log 12 "Error calling 'urlencode()' - wrong number of parameters"
+
__STR="$2" # read string to encode
__LEN=${#__STR} # get string length
__POS=$(( $__POS + 1 )) # increment position
done
- eval "$1='$__ENC'" # transfer back to variable
+ eval "$1=\"$__ENC\"" # transfer back to variable
return 0
}
# extract url or script for given DDNS Provider from
# file /usr/lib/ddns/services for IPv4 or from
# file /usr/lib/ddns/services_ipv6 for IPv6
+# $1 Name of Variable to store url to
+# $2 Name of Variable to store script to
get_service_data() {
- # $1 Name of Variable to store url to
- # $2 Name of Variable to store script to
local __LINE __FILE __NAME __URL __SERVICES __DATA
local __SCRIPT=""
local __OLD_IFS=$IFS
local __NEWLINE_IFS='
' #__NEWLINE_IFS
+ [ $# -ne 2 ] && write_log 12 "Error calling 'get_service_data()' - wrong number of parameters"
__FILE="/usr/lib/ddns/services" # IPv4
[ $use_ipv6 -ne 0 ] && __FILE="/usr/lib/ddns/services_ipv6" # IPv6
# check is URL or SCRIPT is given
__URL=$(echo "$__DATA" | grep "^http:")
[ -z "$__URL" ] && __SCRIPT="/usr/lib/ddns/$__DATA"
-
- eval "$1='$__URL'"
- eval "$2='$__SCRIPT'"
+
+ eval "$1=\"$__URL\""
+ eval "$2=\"$__SCRIPT\""
return 0
}
+# Calculate seconds from interval and unit
+# $1 Name of Variable to store result in
+# $2 Number and
+# $3 Unit of time interval
get_seconds() {
- # $1 Name of Variable to store result in
- # $2 Number and
- # $3 Unit of time interval
+ [ $# -ne 3 ] && write_log 12 "Error calling 'get_seconds()' - wrong number of parameters"
case "$3" in
"days" ) eval "$1=$(( $2 * 86400 ))";;
"hours" ) eval "$1=$(( $2 * 3600 ))";;
return 0
}
-__timeout() {
+timeout() {
# copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh
# only did the folloing changes
# - commented out "#!/bin/bash" and usage section
SIG=-TERM
- while [ $# -gt 0 ]; do
+ while [ $# -gt 0 ]; do
case "$1" in
--)
# forced end of user options
return $status
}
-__verify_host_port() {
- # $1 Host/IP to verify
- # $2 Port to verify
+#verify given host and port is connectable
+# $1 Host/IP to verify
+# $2 Port to verify
+verify_host_port() {
local __HOST=$1
local __PORT=$2
- local __TMP __IP __IPV4 __IPV6 __RUNPROG __ERRPROG __ERR
+ local __IP __IPV4 __IPV6 __RUNPROG __ERR
# return codes
# 1 system specific error
# 2 nslookup error
# 3 nc (netcat) error
# 4 unmatched IP version
- __RUNPROG="nslookup $__HOST 2>/dev/null"
- __ERRPROG="nslookup $__HOST 2>&1"
- verbose_echo " resolver prog =: '$__RUNPROG'"
- __TMP=$(eval $__RUNPROG) # test if nslookup runs without errors
+ [ $# -ne 2 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters"
+
+ __RUNPROG="/usr/bin/nslookup $__HOST >$DATFILE 2>$ERRFILE"
+ write_log 7 "#> $__RUNPROG"
+ eval $__RUNPROG
__ERR=$?
# command error
[ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nslookup Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "DNS Resolver Error - BusyBox nslookup Error '$__ERR'"
+ write_log 3 "DNS Resolver Error - BusyBox nslookup Error '$__ERR'"
+ write_log 7 "Error:\n$(cat $ERRFILE)"
return 2
- } || {
- # we need to run twice because multi-line output needs to be directly piped to grep because
- # pipe returns return code of last prog in pipe but we need errors from nslookup command
- __IPV4=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV4_REGEX\).*$/\\1/p }")
- __IPV6=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($IPv6_REGEX\).*$/\\1/p }")
}
+ # extract IP address
+ __IPV4=$(cat $DATFILE | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV4_REGEX\).*$/\\1/p }")
+ __IPV6=$(cat $DATFILE | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV6_REGEX\).*$/\\1/p }")
# check IP version if forced
if [ $force_ipversion -ne 0 ]; then
__ERR=0
[ $use_ipv6 -eq 0 -a -z "$__IPV4" ] && __ERR=4
[ $use_ipv6 -eq 1 -a -z "$__IPV6" ] && __ERR=6
- [ $__ERR -gt 0 ] && critical_error "Invalid host: Error '4' - Force IP Version IPv$__ERR not supported"
+ [ $__ERR -gt 0 ] && {
+ [ $LUCI_HELPER ] && return 4
+ write_log 14 "Verify host Error '4' - Forced IP Version IPv$__ERR don't match"
+ }
fi
# verify nc command
# busybox nc compiled without -l option "NO OPT l!" -> critical error
- nc --help 2>&1 | grep -iq "NO OPT l!" && \
- critical_error "Busybox nc: netcat compiled without -l option, error 'NO OPT l!'"
+ /usr/bin/nc --help 2>&1 | grep -i "NO OPT l!" >/dev/null 2>&1 && \
+ write_log 12 "Busybox nc (netcat) compiled without '-l' option, error 'NO OPT l!'"
# busybox nc compiled with extensions
- nc --help 2>&1 | grep -q "\-w" && __NCEXT="TRUE"
+ /usr/bin/nc --help 2>&1 | grep "\-w" >/dev/null 2>&1 && __NCEXT="TRUE"
# connectivity test
# run busybox nc to HOST PORT
# busybox might be compiled with "FEATURE_PREFER_IPV4_ADDRESS=n"
- # then nc will try to connect via IPv6 if there is an IPv6 availible for host
- # not worring if there is an IPv6 wan address
- # so if not "forced_ipversion" to use ipv6 then connect test via ipv4 if availible
- [ $force_ipversion -ne 0 -a $use_ipv6 -ne 0 -o -z "$__IPV4" ] && {
- # force IPv6
- __IP=$__IPV6
- } || __IP=$__IPV4
-
- if [ -n "$__NCEXT" ]; then # nc compiled with extensions (timeout support)
- __RUNPROG="nc -w 1 $__IP $__PORT </dev/null >/dev/null 2>&1"
- __ERRPROG="nc -vw 1 $__IP $__PORT </dev/null 2>&1"
- verbose_echo " connect prog =: '$__RUNPROG'"
+ # then nc will try to connect via IPv6 if there is any IPv6 availible on any host interface
+ # not worring, if there is an IPv6 wan address
+ # so if not "force_ipversion" to use_ipv6 then connect test via ipv4, if availible
+ [ $force_ipversion -ne 0 -a $use_ipv6 -ne 0 -o -z "$__IPV4" ] && __IP=$__IPV6 || __IP=$__IPV4
+
+ if [ -n "$__NCEXT" ]; then # BusyBox nc compiled with extensions (timeout support)
+ __RUNPROG="/usr/bin/nc -vw 1 $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
+ write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
__ERR=$?
[ $__ERR -eq 0 ] && return 0
- verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nc Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "host verify Error - BusyBox nc Error '$__ERR'"
+ write_log 3 "Connect error - BusyBox nc (netcat) Error '$__ERR'"
+ write_log 7 "Error:\n$(cat $ERRFILE)"
return 3
else # nc compiled without extensions (no timeout support)
- __RUNPROG="__timeout 2 -- nc $__IP $__PORT </dev/null >/dev/null 2>&1"
- verbose_echo " connect prog =: '$__RUNPROG'"
+ __RUNPROG="timeout 2 -- /usr/bin/nc $__IP $__PORT </dev/null >$DATFILE 2>$ERRFILE"
+ write_log 7 "#> $__RUNPROG"
eval $__RUNPROG
__ERR=$?
[ $__ERR -eq 0 ] && return 0
- verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nc Error '$__ERR' (timeout)"
- syslog_err "host verify Error - BusyBox nc Error '$__ERR' (timeout)"
+ write_log 3 "Connect error - BusyBox nc (netcat) timeout Error '$__ERR'"
return 3
fi
}
+# verfiy given DNS server if connectable
+# $1 DNS server to verify
verify_dns() {
- # $1 DNS server to verify
- # we need DNS server to verify otherwise exit with ERROR 1
- [ -z "$1" ] && return 1
+ local __ERR=255 # last error buffer
+ local __CNT=0 # error counter
+
+ [ $# -ne 1 ] && write_log 12 "Error calling 'verify_dns()' - wrong number of parameters"
+ write_log 7 "Verify DNS server '$1'"
- # DNS uses port 53
- __verify_host_port "$1" "53"
+ while [ $__ERR -ne 0 ]; do
+ # DNS uses port 53
+ verify_host_port "$1" "53"
+ __ERR=$?
+ if [ $LUCI_HELPER ]; then # no retry if called by LuCI helper script
+ return $__ERR
+ elif [ $__ERR -ne 0 -a $VERBOSE_MODE -gt 1 ]; then # VERBOSE_MODE > 1 then NO retry
+ write_log 4 "Verify DNS server '$1' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+ return $__ERR
+ elif [ $__ERR -ne 0 ]; then
+ __CNT=$(( $__CNT + 1 )) # increment error counter
+ # if error count > retry_count leave here
+ [ $__CNT -gt $retry_count ] && \
+ write_log 14 "Verify DNS server '$1' failed after $retry_count retries"
+
+ write_log 4 "Verify DNS server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+ sleep $RETRY_SECONDS &
+ PID_SLEEP=$!
+ wait $PID_SLEEP # enable trap-handler
+ PID_SLEEP=0
+ fi
+ done
+ return 0
}
+# analyse and verfiy given proxy string
+# $1 Proxy-String to verify
verify_proxy() {
- # $1 Proxy-String to verify
- # complete entry user:password@host:port
- # inside user and password NO '@' of ":" allowed
- # host and port only host:port
- # host only host ERROR unsupported
- # IPv4 address instead of host 123.234.234.123
- # IPv6 address instead of host [xxxx:....:xxxx] in square bracket
+ # complete entry user:password@host:port
+ # inside user and password NO '@' of ":" allowed
+ # host and port only host:port
+ # host only host ERROR unsupported
+ # IPv4 address instead of host 123.234.234.123
+ # IPv6 address instead of host [xxxx:....:xxxx] in square bracket
local __TMP __HOST __PORT
+ local __ERR=255 # last error buffer
+ local __CNT=0 # error counter
- # we need Proxy-Sting to verify otherwise exit with ERROR 1
- [ -z "$1" ] && return 1
+ [ $# -ne 1 ] && write_log 12 "Error calling 'verify_proxy()' - wrong number of parameters"
+ write_log 7 "Verify Proxy server 'http://$1'"
# try to split user:password "@" host:port
__TMP=$(echo $1 | awk -F "@" '{print $2}')
__HOST=$(echo $__TMP | awk -F ":" '{print $1}')
__PORT=$(echo $__TMP | awk -F ":" '{print $2}')
fi
- # No Port detected
- [ -z "$__PORT" ] && critical_error "Invalid Proxy server Error '5' - proxy port missing"
+ # No Port detected - EXITING
+ [ -z "$__PORT" ] && {
+ [ $LUCI_HELPER ] && return 5
+ write_log 14 "Invalid Proxy server Error '5' - proxy port missing"
+ }
- __verify_host_port "$__HOST" "$__PORT"
+ while [ $__ERR -gt 0 ]; do
+ verify_host_port "$__HOST" "$__PORT"
+ __ERR=$?
+ if [ $LUCI_HELPER ]; then # no retry if called by LuCI helper script
+ return $__ERR
+ elif [ $__ERR -gt 0 -a $VERBOSE_MODE -gt 1 ]; then # VERBOSE_MODE > 1 then NO retry
+ write_log 4 "Verify Proxy server '$1' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+ return $__ERR
+ elif [ $__ERR -gt 0 ]; then
+ __CNT=$(( $__CNT + 1 )) # increment error counter
+ # if error count > retry_count leave here
+ [ $__CNT -gt $retry_count ] && \
+ write_log 14 "Verify Proxy server '$1' failed after $retry_count retries"
+
+ write_log 4 "Verify Proxy server '$1' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+ sleep $RETRY_SECONDS &
+ PID_SLEEP=$!
+ wait $PID_SLEEP # enable trap-handler
+ PID_SLEEP=0
+ fi
+ done
+ return 0
}
-__do_transfer() {
- # $1 # Variable to store Answer of transfer
- # $2 # URL to use
- local __URL="$2"
+do_transfer() {
+ # $1 # URL to use
+ local __URL="$1"
local __ERR=0
- local __PROG __RUNPROG __ERRPROG __DATA
+ local __CNT=0 # error counter
+ local __PROG __RUNPROG
+
+ [ $# -ne 1 ] && write_log 12 "Error in 'do_transfer()' - wrong number of parameters"
# lets prefer GNU Wget because it does all for us - IPv4/IPv6/HTTPS/PROXY/force IP version
- if /usr/bin/wget --version 2>&1 | grep -q "\+ssl"; then
- __PROG="/usr/bin/wget -t 2 -O -" # standard output only 2 retrys on error
+ if /usr/bin/wget --version 2>&1 | grep "\+ssl" >/dev/null 2>&1 ; then
+ __PROG="/usr/bin/wget -nv -t 1 -O $DATFILE -o $ERRFILE" # non_verbose no_retry outfile errfile
# force ip version to use
- if [ $force_ipversion -eq 1 ]; then
+ if [ $force_ipversion -eq 1 ]; then
[ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6" # force IPv4/IPv6
fi
# set certificate parameters
elif [ -d "$cacert" ]; then
__PROG="$__PROG --ca-directory=${cacert}"
else # exit here because it makes no sense to start loop
- critical_error "Wget: No valid certificate(s) found for running HTTPS"
+ write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication"
fi
fi
# disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set)
[ -z "$proxy" ] && __PROG="$__PROG --no-proxy"
- __RUNPROG="$__PROG -q '$__URL' 2>/dev/null" # do transfer with "-q" to suppress not needed output
- __ERRPROG="$__PROG -d '$__URL' 2>&1" # do transfer with "-d" for debug mode
- verbose_echo " transfer prog =: $__RUNPROG"
- __DATA=$(eval $__RUNPROG)
- __ERR=$?
- [ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: GNU Wget Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "Communication Error - GNU Wget Error: '$__ERR'"
- return 1
- }
+ __RUNPROG="$__PROG $__URL" # build final command
+ __PROG="GNU Wget" # reuse for error logging
# 2nd choice is cURL IPv4/IPv6/HTTPS
# libcurl might be compiled without Proxy Support (default in trunk)
elif [ -x /usr/bin/curl ]; then
- __PROG="/usr/bin/curl"
+ __PROG="/usr/bin/curl -sS -o $DATFILE --stderr $ERRFILE"
# force ip version to use
- if [ $force_ipversion -eq 1 ]; then
+ if [ $force_ipversion -eq 1 ]; then
[ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6" # force IPv4/IPv6
fi
# set certificate parameters
elif [ -d "$cacert" ]; then
__PROG="$__PROG --capath $cacert"
else # exit here because it makes no sense to start loop
- critical_error "cURL: No valid certificate(s) found for running HTTPS"
+ write_log 14 "No valid certificate(s) found at '$cacert' for HTTPS communication"
fi
fi
# disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set)
else
# if libcurl has no proxy support and proxy should be used then force ERROR
# libcurl currently no proxy support by default
- grep -iq all_proxy /usr/lib/libcurl.so* || \
- critical_error "cURL: libcurl compiled without Proxy support"
+ grep -i "all_proxy" /usr/lib/libcurl.so* >/dev/null 2>&1 || \
+ write_log 13 "cURL: libcurl compiled without Proxy support"
fi
- __RUNPROG="$__PROG -q '$__URL' 2>/dev/null" # do transfer with "-s" to suppress not needed output
- __ERRPROG="$__PROG -v '$__URL' 2>&1" # do transfer with "-v" for verbose mode
- verbose_echo " transfer prog =: $__RUNPROG"
- __DATA=$(eval $__RUNPROG)
- __ERR=$?
- [ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: cURL Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "Communication Error - cURL Error: '$__ERR'"
- return 1
- }
+ __RUNPROG="$__PROG $__URL" # build final command
+ __PROG="cURL" # reuse for error logging
# busybox Wget (did not support neither IPv6 nor HTTPS)
elif [ -x /usr/bin/wget ]; then
- __PROG="/usr/bin/wget -O -"
+ __PROG="/usr/bin/wget -q -O $DATFILE"
# force ip version not supported
[ $force_ipversion -eq 1 ] && \
- critical_error "BusyBox Wget: can not force IP version to use"
+ write_log 14 "BusyBox Wget: can not force IP version to use"
# https not supported
[ $use_https -eq 1 ] && \
- critical_error "BusyBox Wget: no HTTPS support"
+ write_log 14 "BusyBox Wget: no HTTPS support"
# disable proxy if no set (there might be .wgetrc or .curlrc or wrong environment set)
[ -z "$proxy" ] && __PROG="$__PROG -Y off"
-
- __RUNPROG="$__PROG -q '$__URL' 2>/dev/null" # do transfer with "-q" to suppress not needed output
- __ERRPROG="$__PROG '$__URL' 2>&1"
- verbose_echo " transfer prog =: $__RUNPROG"
- __DATA=$(eval $__RUNPROG)
- __ERR=$?
- [ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: BusyBox Wget Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "Communication Error - BusyBox Wget Error: '$__ERR'"
- return 1
- }
+
+ __RUNPROG="$__PROG $__URL 2>$ERRFILE" # build final command
+ __PROG="Busybox Wget" # reuse for error logging
else
- critical_error "Program not found - Neither 'Wget' nor 'cURL' installed or executable"
+ write_log 13 "Neither 'Wget' nor 'cURL' installed or executable"
fi
- eval "$1='$__DATA'"
- return 0
+ while : ; do
+ write_log 7 "#> $__RUNPROG"
+ $__RUNPROG # DO transfer
+ __ERR=$? # save error code
+ [ $__ERR -eq 0 ] && return 0 # no error leave
+ [ $LUCI_HELPER ] && return 1 # no retry if called by LuCI helper script
+
+ write_log 3 "$__PROG Error: '$__ERR'"
+ write_log 7 "$(cat $ERRFILE)" # report error
+
+ [ $VERBOSE_MODE -gt 1 ] && {
+ # VERBOSE_MODE > 1 then NO retry
+ write_log 4 "Transfer failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+ return 1
+ }
+
+ __CNT=$(( $__CNT + 1 )) # increment error counter
+ # if error count > retry_count leave here
+ [ $__CNT -gt $retry_count ] && \
+ write_log 14 "Transfer failed after $retry_count retries"
+
+ write_log 4 "Transfer failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+ sleep $RETRY_SECONDS &
+ PID_SLEEP=$!
+ wait $PID_SLEEP # enable trap-handler
+ PID_SLEEP=0
+ done
+ # we should never come here there must be a programming error
+ write_log 12 "Error in 'do_transfer()' - program coding error"
}
send_update() {
# $1 # IP to set at DDNS service provider
local __IP
+ [ $# -ne 1 ] && write_log 12 "Error calling 'send_update()' - wrong number of parameters"
+
# verify given IP / no private IPv4's / no IPv6 addr starting with fxxx of with ":"
[ $use_ipv6 -eq 0 ] && __IP=$(echo $1 | grep -v -E "(^0|^10\.|^127|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-1]\.|^192\.168)")
[ $use_ipv6 -eq 1 ] && __IP=$(echo $1 | grep "^[0-9a-eA-E]")
- [ -z "$__IP" ] && critical_error "Private or invalid or no IP '$1' given"
+ [ -z "$__IP" ] && write_log 4 "Private or invalid or no IP '$1' given"
if [ -n "$update_script" ]; then
- verbose_echo " update =: parsing script '$update_script'"
+ write_log 7 "parsing script '$update_script'"
. $update_script
else
- local __URL __ANSWER __ERR __USER __PASS
+ local __URL __ERR
# do replaces in URL
- __urlencode __USER "$username" # encode username, might be email or something like this
- __urlencode __PASS "$password" # encode password, might have special chars for security reason
- __URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$__USER#g" -e "s#\[PASSWORD\]#$__PASS#g" \
+ __URL=$(echo $update_url | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
-e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
- __do_transfer __ANSWER "$__URL"
- __ERR=$?
- [ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: Error sending update to DDNS Provider\n"
- return 1
- }
- verbose_echo " update send =: DDNS Provider answered\n$__ANSWER"
- return 0
+ do_transfer "$__URL" || return 1
+
+ write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
+
+ # analyse provider answers
+ # "good [IP_ADR]" = successful
+ # "nochg [IP_ADR]" = no change but OK
+ grep -E "good|nochg" $DATFILE >/dev/null 2>&1
+ return $? # "0" if "good" or "nochg" found
fi
}
get_local_ip () {
# $1 Name of Variable to store local IP (LOCAL_IP)
- local __RUNPROG __IP __URL __ANSWER
-
- case $ip_source in
- network )
- # set correct program
- [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
- || __RUNPROG="network_get_ipaddr6"
- $__RUNPROG __IP "$ip_network"
- verbose_echo " local ip =: '$__IP' detected on network '$ip_network'"
- ;;
- interface )
- if [ $use_ipv6 -eq 0 ]; then
- __IP=$(ifconfig $ip_interface | awk '
- /inet addr:/ { # Filter IPv4
- # inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
- $1=""; # remove inet
- $3=""; # remove Bcast: ...
- $4=""; # remove Mask: ...
- FS=":"; # separator ":"
- $0=$0; # reread to activate separator
- $1=""; # remove addr
- FS=" "; # set back separator to default " "
- $0=$0; # reread to activate separator (remove whitespaces)
- print $1; # print IPv4 addr
- }'
- )
- else
- __IP=$(ifconfig $ip_interface | awk '
- /inet6/ && /: [0-9a-eA-E]/ && !/\/128/ { # Filter IPv6 exclude fxxx and /128 prefix
- # inet6 addr: 2001:db8::xxxx:xxxx/32 Scope:Global
- FS="/"; # separator "/"
- $0=$0; # reread to activate separator
- $2=""; # remove everything behind "/"
- FS=" "; # set back separator to default " "
- $0=$0; # reread to activate separator
- print $3; # print IPv6 addr
- }'
- )
- fi
- verbose_echo " local ip =: '$__IP' detected on interface '$ip_interface'"
- ;;
- script )
- # get ip from script
- __IP=$($ip_script)
- verbose_echo " local ip =: '$__IP' detected via script '$ip_script'"
- ;;
- * )
- for __URL in $ip_url; do
- __do_transfer __ANSWER "$__URL"
- [ -n "$__IP" ] && break # Answer detected, leave for loop
- done
- # use correct regular expression
- [ $use_ipv6 -eq 0 ] \
- && __IP=$(echo "$__ANSWER" | grep -m 1 -o "$IPV4_REGEX") \
- || __IP=$(echo "$__ANSWER" | grep -m 1 -o "$IPV6_REGEX")
- verbose_echo " local ip =: '$__IP' detected via web at '$__URL'"
- ;;
- esac
+ local __CNT=0 # error counter
+ local __RUNPROG __DATA __URL __ERR
+
+ [ $# -ne 1 ] && write_log 12 "Error calling 'get_local_ip()' - wrong number of parameters"
+ write_log 7 "Detect local IP"
+
+ while : ; do
+ case $ip_source in
+ network)
+ # set correct program
+ [ $use_ipv6 -eq 0 ] && __RUNPROG="network_get_ipaddr" \
+ || __RUNPROG="network_get_ipaddr6"
+ write_log 7 "#> $__RUNPROG __DATA '$ip_network'"
+ eval "$__RUNPROG __DATA $ip_network" || write_log 3 "$__RUNPROG Error: '$?'"
+ [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on network '$ip_network'"
+ ;;
+ interface)
+ write_log 7 "#> ifconfig $ip_interface >$DATFILE 2>$ERRFILE"
+ ifconfig $ip_interface >$DATFILE 2>$ERRFILE
+ __ERR=$?
+ if [ $__ERR -eq 0 ]; then
+ if [ $use_ipv6 -eq 0 ]; then
+ __DATA=$(awk '
+ /inet addr:/ { # Filter IPv4
+ # inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
+ $1=""; # remove inet
+ $3=""; # remove Bcast: ...
+ $4=""; # remove Mask: ...
+ FS=":"; # separator ":"
+ $0=$0; # reread to activate separator
+ $1=""; # remove addr
+ FS=" "; # set back separator to default " "
+ $0=$0; # reread to activate separator (remove whitespaces)
+ print $1; # print IPv4 addr
+ }' $DATFILE
+ )
+ else
+ __DATA=$(awk '
+ /inet6/ && /: [0-9a-eA-E]/ && !/\/128/ { # Filter IPv6 exclude fxxx and /128 prefix
+ # inet6 addr: 2001:db8::xxxx:xxxx/32 Scope:Global
+ FS="/"; # separator "/"
+ $0=$0; # reread to activate separator
+ $2=""; # remove everything behind "/"
+ FS=" "; # set back separator to default " "
+ $0=$0; # reread to activate separator
+ print $3; # print IPv6 addr
+ }' $DATFILE
+ )
+ fi
+ [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on interface '$ip_interface'"
+ else
+ write_log 3 "ifconfig Error: '$__ERR'"
+ write_log 7 "$(cat $ERRFILE)" # report error
+ fi
+ ;;
+ script)
+ write_log 7 "#> $ip_script >$DATFILE 2>$ERRFILE"
+ eval $ip_script >$DATFILE 2>$ERRFILE
+ __ERR=$?
+ if [ $__ERR -eq 0 ]; then
+ __DATA=$(cat $DATFILE)
+ [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected via script '$ip_script'"
+ else
+ write_log 3 "$ip_script Error: '$__ERR'"
+ write_log 7 "$(cat $ERRFILE)" # report error
+ fi
+ ;;
+ web)
+ do_transfer "$ip_url"
+ # use correct regular expression
+ [ $use_ipv6 -eq 0 ] \
+ && __DATA=$(grep -m 1 -o "$IPV4_REGEX" $DATFILE) \
+ || __DATA=$(grep -m 1 -o "$IPV6_REGEX" $DATFILE)
+ [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on web at '$__URL'"
+ ;;
+ *)
+ write_log 12 "Error in 'get_local_ip()' - unhandled ip_source '$ip_source'"
+ ;;
+ esac
+ # valid data found return here
+ [ -n "$__DATA" ] && {
+ eval "$1=\"$__DATA\""
+ return 0
+ }
- # if NO IP was found
- [ -z "$__IP" ] && return 1
+ [ $LUCI_HELPER ] && return 1 # no retry if called by LuCI helper script
+ [ $VERBOSE_MODE -gt 1 ] && {
+ # VERBOSE_MODE > 1 then NO retry
+ write_log 4 "Get local IP via '$ip_source' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+ return 1
+ }
- eval "$1='$__IP'"
- return 0
+ __CNT=$(( $__CNT + 1 )) # increment error counter
+ # if error count > retry_count leave here
+ [ $__CNT -gt $retry_count ] && \
+ write_log 14 "Get local IP via '$ip_source' failed after $retry_count retries"
+
+ write_log 4 "Get local IP via '$ip_source' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+ sleep $RETRY_SECONDS &
+ PID_SLEEP=$!
+ wait $PID_SLEEP # enable trap-handler
+ PID_SLEEP=0
+ done
+ # we should never come here there must be a programming error
+ write_log 12 "Error in 'get_local_ip()' - program coding error"
}
get_registered_ip() {
# $1 Name of Variable to store public IP (REGISTERED_IP)
- local __IP __REGEX __PROG __RUNPROG __ERRPROG __ERR
+ # $2 (optional) if set, do not retry on error
+ local __CNT=0 # error counter
+ local __ERR=255
+ local __REGEX __PROG __RUNPROG __DATA
# return codes
# 1 no IP detected
+ [ $# -lt 1 -o $# -gt 2 ] && write_log 12 "Error calling 'get_registered_ip()' - wrong number of parameters"
+ write_log 7 "Detect registered/public IP"
+
# set correct regular expression
[ $use_ipv6 -eq 0 ] && __REGEX="$IPV4_REGEX" || __REGEX="$IPV6_REGEX"
- if [ -x /usr/bin/host ]; then # otherwise try to use BIND host
+ if [ -x /usr/bin/host ]; then
__PROG="/usr/bin/host"
[ $use_ipv6 -eq 0 ] && __PROG="$__PROG -t A" || __PROG="$__PROG -t AAAA"
if [ $force_ipversion -eq 1 ]; then # force IP version
[ $use_ipv6 -eq 0 ] && __PROG="$__PROG -4" || __PROG="$__PROG -6"
- fi
+ fi
[ $force_dnstcp -eq 1 ] && __PROG="$__PROG -T" # force TCP
- __RUNPROG="$__PROG $domain $dns_server 2>/dev/null"
- __ERRPROG="$__PROG -v $domain $dns_server 2>&1"
- verbose_echo " resolver prog =: $__RUNPROG"
- __IP=$(eval $__RUNPROG)
- __ERR=$?
- # command error
- [ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: BIND host Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "DNS Resolver Error - BIND host Error: '$__ERR'"
- return 1
- } || {
- # we need to run twice because multi-line output needs to be directly piped to grep because
- # pipe returns return code of last prog in pipe but we need errors from host command
- __IP=$(eval $__RUNPROG | awk -F "address " '/has/ {print $2; exit}' )
- }
-
+ __RUNPROG="$__PROG $domain $dns_server >$DATFILE 2>$ERRFILE"
+ __PROG="BIND host"
elif [ -x /usr/bin/nslookup ]; then # last use BusyBox nslookup
[ $force_ipversion -ne 0 -o $force_dnstcp -ne 0 ] && \
- critical_error "nslookup - no support to 'force IP Version' or 'DNS over TCP'"
+ write_log 14 "Busybox nslookup - no support to 'force IP Version' or 'DNS over TCP'"
- __RUNPROG="nslookup $domain $dns_server 2>/dev/null"
- __ERRPROG="nslookup $domain $dns_server 2>&1"
- verbose_echo " resolver prog =: $__RUNPROG"
- __IP=$(eval $__RUNPROG)
- __ERR=$?
- # command error
- [ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: BusyBox nslookup Error '$__ERR'\n$(eval $__ERRPROG)\n"
- syslog_err "DNS Resolver Error - BusyBox nslookup Error: '$__ERR'"
- return 1
- } || {
- # we need to run twice because multi-line output needs to be directly piped to grep because
- # pipe returns return code of last prog in pipe but we need errors from nslookup command
- __IP=$(eval $__RUNPROG | sed -ne "3,\$ { s/^Address [0-9]*: \($__REGEX\).*$/\\1/p }" )
- }
-
- else # there must be an error
- critical_error "No program found to request public registered IP"
+ __RUNPROG="/usr/bin/nslookup $domain $dns_server >$DATFILE 2>$ERRFILE"
+ __PROG="BusyBox nslookup"
+ else # there must be an error
+ write_log 12 "Error in 'get_registered_ip()' - no supported Name Server lookup software accessible"
fi
- verbose_echo " resolved ip =: '$__IP'"
+ while : ; do
+ write_log 7 "#> $__RUNPROG"
+ eval $__RUNPROG
+ __ERR=$?
+ if [ $__ERR -ne 0 ]; then
+ write_log 3 "$__PROG error: '$__ERR'"
+ write_log 7 "Error:\n$(cat $ERRFILE)"
+ else
+ if [ "$__PROG" = "BIND host" ]; then
+ __DATA=$(cat $DATFILE | awk -F "address " '/has/ {print $2; exit}' )
+ else
+ __DATA=$(cat $DATFILE | sed -ne "3,\$ { s/^Address [0-9]*: \($__REGEX\).*$/\\1/p }" )
+ fi
+ [ -n "$__DATA" ] && {
+ write_log 7 "Registered IP '$__DATA' detected"
+ eval "$1=\"$__DATA\"" # valid data found
+ return 0 # leave here
+ }
+ write_log 4 "NO valid IP found"
+ __ERR=127
+ fi
+
+ [ $LUCI_HELPER ] && return $__ERR # no retry if called by LuCI helper script
+ [ -n "$2" ] && return $__ERR # $2 is given -> no retry
+ [ $VERBOSE_MODE -gt 1 ] && {
+ # VERBOSE_MODE > 1 then NO retry
+ write_log 4 "Get registered/public IP for '$domain' failed - Verbose Mode: $VERBOSE_MODE - NO retry on error"
+ return $__ERR
+ }
- # if NO IP was found
- [ -z "$__IP" ] && return 1
+ __CNT=$(( $__CNT + 1 )) # increment error counter
+ # if error count > retry_count leave here
+ [ $__CNT -gt $retry_count ] && \
+ write_log 14 "Get registered/public IP for '$domain' failed after $retry_count retries"
- eval "$1='$__IP'"
- return 0
+ write_log 4 "Get registered/public IP for '$domain' failed - retry $__CNT/$retry_count in $RETRY_SECONDS seconds"
+ sleep $RETRY_SECONDS &
+ PID_SLEEP=$!
+ wait $PID_SLEEP # enable trap-handler
+ PID_SLEEP=0
+ done
+ # we should never come here there must be a programming error
+ write_log 12 "Error in 'get_registered_ip()' - program coding error"
}
get_uptime() {
# $1 Variable to store result in
+ [ $# -ne 1 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters"
local __UPTIME=$(cat /proc/uptime)
- eval "$1='${__UPTIME%%.*}'"
+ eval "$1=\"${__UPTIME%%.*}\""
+}
+
+trap_handler() {
+ # $1 trap signal
+ # $2 optional (exit status)
+ local __PIDS __PID
+ local __ERR=${2:-0}
+ local __OLD_IFS=$IFS
+ local __NEWLINE_IFS='
+' #__NEWLINE_IFS
+
+ [ $PID_SLEEP -ne 0 ] && kill -$1 $PID_SLEEP 2>/dev/null # kill pending sleep if exist
+
+ case $1 in
+ 0) if [ $__ERR -eq 0 ]; then
+ write_log 5 "PID '$$' exit normal at $(eval $DATE_PROG)\n"
+ else
+ write_log 4 "PID '$$' exit WITH ERROR '$__ERR' at $(eval $DATE_PROG)\n"
+ fi ;;
+ 1) write_log 6 "PID '$$' received 'SIGHUP' at $(eval $DATE_PROG)"
+ eval "$0 $SECTION_ID $VERBOSE_MODE &" # reload config via restarting script
+ exit 0 ;;
+ 2) write_log 5 "PID '$$' terminated by 'SIGINT' at $(eval $DATE_PROG)\n";;
+ 3) write_log 5 "PID '$$' terminated by 'SIGQUIT' at $(eval $DATE_PROG)\n";;
+ 15) write_log 5 "PID '$$' terminated by 'SIGTERM' at $(eval $DATE_PROG)\n";;
+ *) write_log 13 "Unhandled signal '$1' in 'trap_handler()'";;
+ esac
+
+ __PIDS=$(pgrep -P $$) # get my childs (pgrep prints with "newline")
+ IFS=$__NEWLINE_IFS
+ for __PID in $__PIDS; do
+ kill -$1 $__PID # terminate it
+ done
+ IFS=$__OLD_IFS
+
+ # remove out and err file
+ [ -f $DATFILE ] && rm -f $DATFILE
+ [ -f $ERRFILE ] && rm -f $ERRFILE
+
+ # exit with correct handling:
+ # remove trap handling settings and send kill to myself
+ trap - 0 1 2 3 15
+ [ $1 -gt 0 ] && kill -$1 $$
}
--- /dev/null
+#!/bin/sh
+# /usr/lib/ddns/luci_dns_helper.sh
+#
+# Written in August 2014
+# by Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+# This script is used by luci-app-ddns
+# - getting registered IP
+# - check if possible to get local IP
+# - verifing given DNS- or Proxy-Server
+#
+# variables in small chars are read from /etc/config/ddns as parameter given here
+# variables in big chars are defined inside these scripts as gloval vars
+# variables in big chars beginning with "__" are local defined inside functions only
+# set -vx #script debugger
+
+[ $# -lt 2 ] && exit 1
+
+. /usr/lib/ddns/dynamic_dns_functions.sh # global vars are also defined here
+
+# set -vx #script debugger
+
+# preset some variables, wrong or not set in dynamic_dns_functions.sh
+SECTION_ID="lucihelper"
+LOGFILE="$LOGDIR/$SECTION_ID.log"
+VERBOSE_MODE=0 # no console logging
+# global variables normally set by reading DDNS UCI configuration
+use_syslog=0 # no syslog
+use_logfile=0 # by default no logfile, can be changed here
+
+__RET=0
+case "$1" in
+ get_registered_ip)
+ local IP
+ domain=$2 # Hostname/Domain
+ use_ipv6=${3:-"0"} # Use IPv6 - default IPv4
+ force_ipversion=${4:-"0"} # Force IP Version - default 0 - No
+ force_dnstcp=${5:-"0"} # Force TCP on DNS - default 0 - No
+ dns_server=${6:-""} # DNS server - default No DNS
+ write_log 7 "-----> get_registered_ip IP"
+ get_registered_ip IP
+ __RET=$?
+ [ $__RET -ne 0 ] && IP=""
+ echo -n "$IP" # suppress LF
+ ;;
+ verify_dns)
+ # $2 : dns-server to verify # no need for force_dnstcp because
+ # verify with nc (netcat) uses tcp anyway
+ use_ipv6=${3:-"0"} # Use IPv6 - default IPv4
+ force_ipversion=${4:-"0"} # Force IP Version - default 0 - No
+ write_log 7 "-----> verify_dns '$2'"
+ verify_dns "$2"
+ __RET=$?
+ ;;
+ verify_proxy)
+ # $2 : proxy string to verify
+ use_ipv6=${3:-"0"} # Use IPv6 - default IPv4
+ force_ipversion=${4:-"0"} # Force IP Version - default 0 - No
+ write_log 7 "-----> verify_proxy '$2'"
+ verify_proxy "$2"
+ __RET=$?
+ ;;
+ get_local_ip)
+ local IP
+ use_ipv6="$2" # Use IPv6
+ ip_source="$3" # IP source
+ ip_network="$4" # set if source = "network" otherwise "-"
+ ip_url="$5" # set if source = "web" otherwise "-"
+ ip_interface="$6" # set if source = "interface" itherwiase "-"
+ ip_script="$7" # set if source = "script" otherwise "-"
+ proxy="$8" # proxy if set
+ force_ipversion="0" # not needed but must be set
+ use_https="0" # not needed but must be set
+ [ -n "$proxy" -a "$ip_source" = "web" ] && {
+ # proxy defined, used for ip_source=web
+ export HTTP_PROXY="http://$proxy"
+ export HTTPS_PROXY="http://$proxy"
+ export http_proxy="http://$proxy"
+ export https_proxy="http://$proxy"
+ }
+ # don't need IP only the return code
+ [ "$ip_source" = "web" -o "$ip_source" = "script" ] && {
+ # we wait only 3 seconds for an
+ # answer from "web" or "script"
+ write_log 7 "-----> timeout 3 -- get_local_ip IP"
+ timeout 3 -- get_local_ip IP
+ } || {
+ write_log 7 "-----> get_local_ip IP"
+ get_local_ip IP
+ }
+ __RET=$?
+ ;;
+ *)
+ __RET=255
+ ;;
+esac
+
+# remove out and err file
+[ -f $DATFILE ] && rm -f $DATFILE
+[ -f $ERRFILE ] && rm -f $ERRFILE
+return $__RET
\ No newline at end of file
# (Loosely) based on the script on the one posted by exobyte in the forums here:
# http://forum.openwrt.org/viewtopic.php?id=14040
#
-# extended and partial rewritten in August 2014
+# extended and partial rewritten in August 2014
# by Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
# to support:
# - IPv6 DDNS services
-# - DNS Server to retrieve registered IP including TCP transport
+# - DNS Server to retrieve registered IP including TCP transport (Ticket 7820)
# - Proxy Server to send out updates
-# - force_interval=0 to run once
+# - force_interval=0 to run once (Luci Ticket 538)
# - the usage of BIND's host command instead of BusyBox's nslookup if installed
-# - extended Verbose Mode and log file support for better error detection
+# - extended Verbose Mode and log file support for better error detection
+# - wait for interface to fully come up, before the first update is done
#
# variables in small chars are read from /etc/config/ddns
# variables in big chars are defined inside these scripts as global vars
. /usr/lib/ddns/dynamic_dns_functions.sh # global vars are also defined here
SECTION_ID="$1"
-VERBOSE_MODE=${2:-1} #default mode is log to console
+VERBOSE_MODE=${2:-1} # default mode is log to console
# set file names
PIDFILE="$RUNDIR/$SECTION_ID.pid" # Process ID file
# VERBOSE_MODE > 1 delete logfile if exist to create an empty one
# only with this data of this run for easier diagnostic
-# new one created by verbose_echo function
+# new one created by write_log function
[ $VERBOSE_MODE -gt 1 -a -f $LOGFILE ] && rm -f $LOGFILE
+# TRAP handler
+trap "trap_handler 0 \$?" 0 # handle script exit with exit status
+trap "trap_handler 1" 1 # SIGHUP Hangup / reload config
+trap "trap_handler 2" 2 # SIGINT Terminal interrupt
+trap "trap_handler 3" 3 # SIGQUIT Terminal quit
+#trap "trap_handler 9" 9 # SIGKILL no chance to trap
+trap "trap_handler 15" 15 # SIGTERM Termination
+
################################################################################
# Leave this comment here, to clearly document variable names that are expected/possible
# Use load_all_config_options to load config options, which is a much more flexible solution.
#
# config_load "ddns"
-# config_get <variable> $SECTION_ID <option]>
+# config_get <variable> $SECTION_ID <option>
#
# defined options (also used as variable):
-#
+#
# enable self-explanatory
# interface network interface used by hotplug.d i.e. 'wan' or 'wan6'
#
# ip_network local defined network to read IP from i.e. 'wan' or 'wan6'
# ip_url URL to read local address from i.e. http://checkip.dyndns.com/ or http://checkipv6.dyndns.com/
# ip_script full path and name of your script to detect local IP
-# ip_interface physical interface to use for detecting
+# ip_interface physical interface to use for detecting
#
-# check_interval check for changes every !!! checks below 10 minutes make no sense because the Internet
+# check_interval check for changes every !!! checks below 10 minutes make no sense because the Internet
# check_unit 'days' 'hours' 'minutes' !!! needs about 5-10 minutes to sync an IP-change for an DNS entry
#
# force_interval force to send an update to your service if no change was detected
# proxy #NEW# using a proxy for communication !!! ALSO used to detect local IP via web => return proxy's IP !!!
# use_logfile #NEW# self-explanatory "/var/log/ddns/$SECTION_ID.log"
#
-# some functionality needs
+# some functionality needs
# - GNU Wget or cURL installed for sending updates to DDNS service
# - BIND host installed to detect Registered IP
#
[ "$(uci_get ddns $SECTION_ID)" != "service" ] && {
[ $VERBOSE_MODE -le 1 ] && VERBOSE_MODE=2 # force console out and logfile output
[ -f $LOGFILE ] && rm -f $LOGFILE # clear logfile before first entry
- verbose_echo "\n ************** =: ************** ************** **************"
- verbose_echo " STARTED =: PID '$$' at $(eval $DATE_PROG)"
- verbose_echo " UCI CONFIG =:\n$(uci -q show ddns | grep '=service' | sort)"
- critical_error "Service '$SECTION_ID' not defined"
+ write_log 7 "************ ************** ************** **************"
+ write_log 5 "PID '$$' started at $(eval $DATE_PROG)"
+ write_log 7 "uci configuration:\n$(uci -q show ddns | grep '=service' | sort)"
+ write_log 14 "Service section '$SECTION_ID' not defined"
}
load_all_config_options "ddns" "$SECTION_ID"
-verbose_echo "\n ************** =: ************** ************** **************"
-verbose_echo " STARTED =: PID '$$' at $(eval $DATE_PROG)"
+write_log 7 "************ ************** ************** **************"
+write_log 5 "PID '$$' started at $(eval $DATE_PROG)"
+write_log 7 "uci configuraion:\n$(uci -q show ddns.$SECTION_ID | sort)"
case $VERBOSE_MODE in
- 0) verbose_echo " verbose mode =: '0' - run normal, NO console output";;
- 1) verbose_echo " verbose mode =: '1' - run normal, console mode";;
- 2) verbose_echo " verbose mode =: '2' - run once, NO retry on error";;
- 3) verbose_echo " verbose mode =: '3' - run once, NO retry on error, NOT sending update";;
- *) critical_error "ERROR detecting VERBOSE_MODE '$VERBOSE_MODE'"
+ 0) write_log 7 "verbose mode : 0 - run normal, NO console output";;
+ 1) write_log 7 "verbose mode : 1 - run normal, console mode";;
+ 2) write_log 7 "verbose mode : 2 - run once, NO retry on error";;
+ 3) write_log 7 "verbose mode : 3 - run once, NO retry on error, NOT sending update";;
+ *) write_log 14 "error detecting VERBOSE_MODE '$VERBOSE_MODE'";;
esac
-verbose_echo " UCI CONFIG =:\n$(uci -q show ddns.$SECTION_ID | sort)"
# set defaults if not defined
[ -z "$enabled" ] && enabled=0
[ "$ip_source" = "web" -a -z "$ip_url" -a $use_ipv6 -eq 1 ] && ip_url="http://checkipv6.dyndns.com"
[ "$ip_source" = "interface" -a -z "$ip_interface" ] && ip_interface="eth1"
-# check configuration and enabled state
-[ -z "$domain" -o -z "$username" -o -z "$password" ] && critical_error "Service Configuration not correctly configured"
-[ $enabled -eq 0 ] && critical_error "Service Configuration is disabled"
+# check enabled state otherwise we don't need to continue
+[ $enabled -eq 0 ] && write_log 14 "Service section disabled!"
-# verify script if configured and executable
+# without domain or username or password we can do nothing for you
+[ -z "$domain" -o -z "$username" -o -z "$password" ] && write_log 14 "Service section not correctly configured!"
+urlencode URL_USER "$username" # encode username, might be email or something like this
+urlencode URL_PASS "$password" # encode password, might have special chars for security reason
+
+# verify ip_source script if configured and executable
if [ "$ip_source" = "script" ]; then
- [ -z "$ip_script" ] && critical_error "No script defined to detect local IP"
- [ -x "$ip_script" ] || critical_error "Script to detect local IP not found or not executable"
+ set -- $ip_script #handling script with parameters, we need a trick
+ [ -z "$1" ] && write_log 14 "No script defined to detect local IP!"
+ [ -x "$1" ] || write_log 14 "Script to detect local IP not executable!"
fi
# compute update interval in seconds
get_seconds CHECK_SECONDS ${check_interval:-10} ${check_unit:-"minutes"} # default 10 min
get_seconds FORCE_SECONDS ${force_interval:-72} ${force_unit:-"hours"} # default 3 days
get_seconds RETRY_SECONDS ${retry_interval:-60} ${retry_unit:-"seconds"} # default 60 sec
-verbose_echo "check interval =: $CHECK_SECONDS seconds"
-verbose_echo "force interval =: $FORCE_SECONDS seconds"
-verbose_echo "retry interval =: $RETRY_SECONDS seconds"
-verbose_echo " retry counter =: $retry_count times"
+[ $CHECK_SECONDS -lt 300 ] && CHECK_SECONDS=300 # minimum 5 minutes
+[ $FORCE_SECONDS -gt 0 -a $FORCE_SECONDS -lt $CHECK_SECONDS ] && FORCE_SECONDS=$CHECK_SECONDS # FORCE_SECONDS >= CHECK_SECONDS or 0
+write_log 7 "check interval: $CHECK_SECONDS seconds"
+write_log 7 "force interval: $FORCE_SECONDS seconds"
+write_log 7 "retry interval: $RETRY_SECONDS seconds"
+write_log 7 "retry counter : $retry_count times"
# determine what update url we're using if a service_name is supplied
-# otherwise update_url is set inside configuration (custom service)
+# otherwise update_url is set inside configuration (custom update url)
# or update_script is set inside configuration (custom update script)
[ -n "$service_name" ] && get_service_data update_url update_script
-[ -z "$update_url" -a -z "$update_script" ] && critical_error "no update_url found/defined or no update_script found/defined"
-[ -n "$update_script" -a ! -f "$update_script" ] && critical_error "custom update_script not found"
+[ -z "$update_url" -a -z "$update_script" ] && write_log 14 "No update_url found/defined or no update_script found/defined!"
+[ -n "$update_script" -a ! -f "$update_script" ] && write_log 14 "Custom update_script not found!"
#kill old process if it exists & set new pid file
if [ -d $RUNDIR ]; then
- #if process is already running, stop it
- if [ -e "$PIDFILE" ]; then
- OLD_PID=$(cat $PIDFILE)
- ps | grep -q "^[\t ]*$OLD_PID" && {
- verbose_echo " old process =: PID '$OLD_PID'"
- kill $OLD_PID
- } || verbose_echo "old process id =: PID 'none'"
- else
- verbose_echo "old process id =: PID 'none'"
- fi
+ #if process for section is already running, stop it
+ stop_section_processes "$SECTION_ID"
+ [ $? -gt 0 ] && write_log 7 "Send 'SIGTERM' to old process" || write_log 7 "No old process"
else
#make dir since it doesn't exist
mkdir -p $RUNDIR
- verbose_echo "old process id =: PID 'none'"
+ write_log 7 "No old process"
fi
echo $$ > $PIDFILE
# determine when the last update was
-# the following lines should prevent multiple updates if hotplug fires multiple startups
+# the following lines should prevent multiple updates if hotplug fires multiple startups
# as described in Ticket #7820, but did not function if never an update take place
# i.e. after a reboot (/var is linked to /tmp)
-# using uptime as reference because date might not be updated via NTP client
+# using uptime as reference because date might not be updated via NTP client
get_uptime CURR_TIME
[ -e "$UPDFILE" ] && {
LAST_TIME=$(cat $UPDFILE)
[ $LAST_TIME -gt $CURR_TIME ] && LAST_TIME=0
}
if [ $LAST_TIME -eq 0 ]; then
- verbose_echo " last update =: never"
+ write_log 7 "last update: never"
else
EPOCH_TIME=$(( $(date +%s) - CURR_TIME + LAST_TIME ))
EPOCH_TIME="date -d @$EPOCH_TIME +'$DATE_FORMAT'"
- verbose_echo " last update =: $(eval $EPOCH_TIME)"
+ write_log 7 "last update: $(eval $EPOCH_TIME)"
fi
# we need time here because hotplug.d is fired by netifd
# but IP addresses are not set by DHCP/DHCPv6 etc.
-verbose_echo " waiting =: 10 seconds for interfaces to fully come up"
-sleep 10
-
-# verify DNS server:
-# do with retry's because there might be configurations
-# not directly could connect to outside dns when interface is already up
-ERR_VERIFY=0 # reset err counter
-while [ -n "$dns_server" ]; do
- [ $ERR_VERIFY -eq 0 ] && verbose_echo "******* VERIFY =: DNS server '$dns_server'"
- verify_dns "$dns_server"
- ERR_LAST=$? # save return value
- [ $ERR_LAST -eq 0 ] && break # everything ok leave while loop
- ERR_VERIFY=$(( $ERR_VERIFY + 1 ))
- # if error count > retry_count leave here with critical error
- [ $ERR_VERIFY -gt $retry_count ] && {
- case $ERR_LAST in
- 2) critical_error "Invalid DNS server Error: '2' - nslookup can not resolve host";;
- 3) critical_error "Invalid DNS server Error: '3' - nc (netcat) can not connect";;
- *) critical_error "Invalid DNS server Error: '$ERR_LAST' - unspecific error";;
- esac
- }
- case $ERR_LAST in
- 2) syslog_err "Invalid DNS server Error: '2' - nslookup can not resolve host - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
- 3) syslog_err "Invalid DNS server Error: '3' - nc (netcat) can not connect - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
- *) syslog_err "Invalid DNS server Error: '$ERR_LAST' - unspecific error - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
- esac
- [ $VERBOSE_MODE -gt 1 ] && {
- # VERBOSE_MODE > 1 then NO retry
- verbose_echo "\n!!!!!!!!! ERROR =: Verbose Mode - NO retry\n"
- break
- }
- verbose_echo "******** RETRY =: DNS server '$dns_server' - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds"
- sleep $RETRY_SECONDS
-done
+write_log 7 "Waiting 10 seconds for interfaces to fully come up"
+sleep 10 &
+PID_SLEEP=$!
+wait $PID_SLEEP # enable trap-handler
+PID_SLEEP=0
+
+# verify DNS server
+[ -n "$dns_server" ] && verify_dns "$dns_server"
# verify Proxy server and set environment
-# do with retry's because there might be configurations
-# not directly could connect to outside dns when interface is already up
-ERR_VERIFY=0 # reset err counter
[ -n "$proxy" ] && {
- [ $ERR_VERIFY -eq 0 ] && verbose_echo "******* VERIFY =: Proxy server 'http://$proxy'"
- verify_proxy "$proxy"
- ERR_LAST=$? # save return value
- [ $ERR_LAST -eq 0 ] && {
- # everything ok set proxy and leave while loop
+ verify_proxy "$proxy" && {
+ # everything ok set proxy
export HTTP_PROXY="http://$proxy"
export HTTPS_PROXY="http://$proxy"
export http_proxy="http://$proxy"
export https_proxy="http://$proxy"
- break
- }
- ERR_VERIFY=$(( $ERR_VERIFY + 1 ))
- # if error count > retry_count leave here with critical error
- [ $ERR_VERIFY -gt $retry_count ] && {
- case $ERR_LAST in
- 2) critical_error "Invalid Proxy server Error '2' - nslookup can not resolve host";;
- 3) critical_error "Invalid Proxy server Error '3' - nc (netcat) can not connect";;
- *) critical_error "Invalid Proxy server Error '$ERR_LAST' - unspecific error";;
- esac
}
- case $ERR_LAST in
- 2) syslog_err "Invalid Proxy server Error '2' - nslookup can not resolve host - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
- 3) syslog_err "Invalid Proxy server Error '3' - nc (netcat) can not connect - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
- *) syslog_err "Invalid Proxy server Error '$ERR_LAST' - unspecific error - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds\n";;
- esac
- [ $VERBOSE_MODE -gt 1 ] && {
- # VERBOSE_MODE > 1 then NO retry
- verbose_echo "\n!!!!!!!!! ERROR =: Verbose Mode - NO retry\n"
- break
- }
- verbose_echo "******** RETRY =: Proxy server 'http://$proxy' - retry $ERR_VERIFY/$retry_count in $RETRY_SECONDS seconds"
- sleep $RETRY_SECONDS
}
# let's check if there is already an IP registered at the web
# but ignore errors if not
-verbose_echo "******* DETECT =: Registered IP"
-get_registered_ip REGISTERED_IP
+get_registered_ip REGISTERED_IP "NO_RETRY"
# loop endlessly, checking ip every check_interval and forcing an updating once every force_interval
-# NEW: ### Luci Ticket 538
-# a "force_interval" of "0" will run this script only once
-# the update is only done once when an interface goes up
-# or you run /etc/init.d/ddns start or you can use a cron job
-# it will force an update without check when lastupdate happen
-# but it will verify after "check_interval" if update is seen in the web
-# and retries on error retry_count times
-# CHANGES: ### Ticket 16363
-# modified nslookup / sed / grep to detect registered ip
-# NEW: ### Ticket 7820
-# modified nslookup to support non standard dns_server (needs to be defined in /etc/config/ddns)
-# support for BIND host command.
-# Wait for interface to fully come up, before the first update is done
-verbose_echo "*** START LOOP =: $(eval $DATE_PROG)"
-# we run NOT once
-[ $FORCE_SECONDS -gt 0 -o $VERBOSE_MODE -le 1 ] && syslog_info "Starting main loop"
-
+write_log 6 "Starting main loop at $(eval $DATE_PROG)"
while : ; do
- # read local IP
- verbose_echo "******* DETECT =: Local IP"
- get_local_ip LOCAL_IP
- ERR_LAST=$? # save return value
- # Error in function
- [ $ERR_LAST -gt 0 ] && {
- if [ $VERBOSE_MODE -le 1 ]; then # VERBOSE_MODE <= 1 then retry
- # we can't read local IP
- ERR_LOCAL_IP=$(( $ERR_LOCAL_IP + 1 ))
- [ $ERR_LOCAL_IP -gt $retry_count ] && critical_error "Can not detect local IP"
- verbose_echo "\n!!!!!!!!! ERROR =: detecting local IP - retry $ERR_LOCAL_IP/$retry_count in $RETRY_SECONDS seconds\n"
- syslog_err "Error detecting local IP - retry $ERR_LOCAL_IP/$retry_count in $RETRY_SECONDS seconds"
- sleep $RETRY_SECONDS
- continue # jump back to the beginning of while loop
- else
- verbose_echo "\n!!!!!!!!! ERROR =: detecting local IP - NO retry\n"
- fi
- }
- ERR_LOCAL_IP=0 # reset err counter
+ get_local_ip LOCAL_IP # read local IP
# prepare update
- # never updated or forced immediate then NEXT_TIME = 0
+ # never updated or forced immediate then NEXT_TIME = 0
[ $FORCE_SECONDS -eq 0 -o $LAST_TIME -eq 0 ] \
&& NEXT_TIME=0 \
|| NEXT_TIME=$(( $LAST_TIME + $FORCE_SECONDS ))
- # get current uptime
- get_uptime CURR_TIME
-
- # send update when current time > next time or local ip different from registered ip (as loop on error)
- ERR_SEND=0
- while [ $CURR_TIME -ge $NEXT_TIME -o "$LOCAL_IP" != "$REGISTERED_IP" ]; do
+
+ get_uptime CURR_TIME # get current uptime
+
+ # send update when current time > next time or local ip different from registered ip
+ if [ $CURR_TIME -ge $NEXT_TIME -o "$LOCAL_IP" != "$REGISTERED_IP" ]; then
if [ $VERBOSE_MODE -gt 2 ]; then
- verbose_echo " VERBOSE MODE =: NO UPDATE send to DDNS provider"
+ write_log 7 "Verbose Mode: $VERBOSE_MODE - NO UPDATE send"
elif [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then
- verbose_echo "******* UPDATE =: LOCAL: '$LOCAL_IP' <> REGISTERED: '$REGISTERED_IP'"
+ write_log 7 "Update needed - L: '$LOCAL_IP' <> R: '$REGISTERED_IP'"
else
- verbose_echo "******* FORCED =: LOCAL: '$LOCAL_IP' == REGISTERED: '$REGISTERED_IP'"
+ write_log 7 "Forced Update - L: '$LOCAL_IP' == R: '$REGISTERED_IP'"
fi
- # only send if VERBOSE_MODE < 3
+
ERR_LAST=0
[ $VERBOSE_MODE -lt 3 ] && {
- send_update "$LOCAL_IP"
+ # only send if VERBOSE_MODE < 3
+ send_update "$LOCAL_IP"
ERR_LAST=$? # save return value
}
- # Error in function
- if [ $ERR_LAST -gt 0 ]; then
- if [ $VERBOSE_MODE -le 1 ]; then # VERBOSE_MODE <=1 then retry
- # error sending local IP
- ERR_SEND=$(( $ERR_SEND + 1 ))
- [ $ERR_SEND -gt $retry_count ] && critical_error "can not send update to DDNS Provider"
- verbose_echo "\n!!!!!!!!! ERROR =: sending update - retry $ERR_SEND/$retry_count in $RETRY_SECONDS seconds\n"
- syslog_err "Error sending update - retry $ERR_SEND/$retry_count in $RETRY_SECONDS seconds"
- sleep $RETRY_SECONDS
- continue # re-loop
- else
- verbose_echo "\n!!!!!!!!! ERROR =: sending update to DDNS service - NO retry\n"
- break
- fi
- else
- # we send data so save "last time"
- get_uptime LAST_TIME
+ # error sending local IP to provider
+ # we have no communication error (handled inside send_update/do_transfer)
+ # but update was not recognized
+ # do NOT retry after RETRY_SECONDS, do retry after CHECK_SECONDS
+ # to early retrys will block most DDNS provider
+ # providers answer is checked inside send_update() function
+ if [ $ERR_LAST -eq 0 ]; then
+ get_uptime LAST_TIME # we send update, so
echo $LAST_TIME > $UPDFILE # save LASTTIME to file
- [ "$LOCAL_IP" != "$REGISTERED_IP" ] \
- && syslog_notice "Changed IP: '$LOCAL_IP' successfully send" \
- || syslog_notice "Forced Update: IP: '$LOCAL_IP' successfully send"
- break # leave while
+ [ "$LOCAL_IP" != "$REGISTERED_IP" ] && write_log 6 "Update successful - IP '$LOCAL_IP' send"
+ [ "$LOCAL_IP" = "$REGISTERED_IP" ] || write_log 6 "Forced update successful - IP: '$LOCAL_IP' send"
+ else
+ write_log 3 "Can not update IP at DDNS Provider"
fi
- done
+ fi
# now we wait for check interval before testing if update was recognized
- # only sleep if VERBOSE_MODE <= 2 because nothing send so do not wait
+ # only sleep if VERBOSE_MODE <= 2 because otherwise nothing was send
[ $VERBOSE_MODE -le 2 ] && {
- verbose_echo "****** WAITING =: $CHECK_SECONDS seconds (Check Interval) before continue"
- sleep $CHECK_SECONDS
- } || verbose_echo " VERBOSE MODE =: NO WAITING for Check Interval\n"
-
- # read at DDNS service registered IP (in loop on error)
- REGISTERED_IP=""
- ERR_REG_IP=0
- while : ; do
- verbose_echo "******* DETECT =: Registered IP"
- get_registered_ip REGISTERED_IP
- ERR_LAST=$? # save return value
-
- # No Error in function we leave while loop
- [ $ERR_LAST -eq 0 ] && break
-
- # we can't read Registered IP
- if [ $VERBOSE_MODE -le 1 ]; then # VERBOSE_MODE <=1 then retry
- ERR_REG_IP=$(( $ERR_REG_IP + 1 ))
- [ $ERR_REG_IP -gt $retry_count ] && critical_error "can not detect registered local IP"
- verbose_echo "\n!!!!!!!!! ERROR =: detecting Registered IP - retry $ERR_REG_IP/$retry_count in $RETRY_SECONDS seconds\n"
- syslog_err "Error detecting Registered IP - retry $ERR_REG_IP/$retry_count in $RETRY_SECONDS seconds"
- sleep $RETRY_SECONDS
- else
- verbose_echo "\n!!!!!!!!! ERROR =: detecting Registered IP - NO retry\n"
- break # leave while loop
- fi
- done
+ write_log 7 "Waiting $CHECK_SECONDS seconds (Check Interval)"
+ sleep $CHECK_SECONDS &
+ PID_SLEEP=$!
+ wait $PID_SLEEP # enable trap-handler
+ PID_SLEEP=0
+ } || write_log 7 "Verbose Mode: $VERBOSE_MODE - NO Check Interval waiting"
+
+ REGISTERED_IP="" # clear variable
+ get_registered_ip REGISTERED_IP # get registered/public IP
# IP's are still different
if [ "$LOCAL_IP" != "$REGISTERED_IP" ]; then
if [ $VERBOSE_MODE -le 1 ]; then # VERBOSE_MODE <=1 then retry
ERR_UPDATE=$(( $ERR_UPDATE + 1 ))
- [ $ERR_UPDATE -gt $retry_count ] && critical_error "Registered IP <> Local IP - LocalIP: '$LOCAL_IP' - RegisteredIP: '$REGISTERED_IP'"
- verbose_echo "\n!!!!!!!!! ERROR =: Registered IP <> Local IP - starting retry $ERR_UPDATE/$retry_count\n"
- syslog_warn "Warning: Registered IP <> Local IP - starting retry $ERR_UPDATE/$retry_count"
+ [ $ERR_UPDATE -gt $retry_count ] && write_log 14 "Updating IP at DDNS provider failed after $retry_count retries"
+ write_log 4 "Updating IP at DDNS provider failed - starting retry $ERR_UPDATE/$retry_count"
continue # loop to beginning
else
- verbose_echo "\n!!!!!!!!! ERROR =: Registered IP <> Local IP - LocalIP: '$LOCAL_IP' - RegisteredIP: '$REGISTERED_IP' - NO retry\n"
+ write_log 4 "Updating IP at DDNS provider failed"
+ write_log 7 "Verbose Mode: $VERBOSE_MODE - NO retry"; exit 1
fi
- fi
+ else
+ # we checked successful the last update
+ ERR_UPDATE=0 # reset error counter
+ fi
- # we checked successful the last update
- ERR_UPDATE=0 # reset error counter
+ # force_update=0 or VERBOSE_MODE > 1 - leave here
+ [ $VERBOSE_MODE -gt 1 ] && write_log 7 "Verbose Mode: $VERBOSE_MODE - NO reloop"
+ [ $FORCE_SECONDS -eq 0 ] && write_log 6 "Configured to run once"
+ [ $VERBOSE_MODE -gt 1 -o $FORCE_SECONDS -eq 0 ] && exit 0
- # force_update=0 or VERBOSE_MODE > 1 - leave the main loop
- [ $FORCE_SECONDS -eq 0 -o $VERBOSE_MODE -gt 1 ] && {
- verbose_echo "****** LEAVING =: $(eval $DATE_PROG)"
- syslog_info "Leaving"
- break
- }
- verbose_echo "********* LOOP =: $(eval $DATE_PROG)"
- syslog_info "Rerun IP check"
+ write_log 6 "Rerun IP check at $(eval $DATE_PROG)"
done
-
-verbose_echo "****** STOPPED =: PID '$$' at $(eval $DATE_PROG)\n"
-syslog_info "Done"
-
-exit 0
+# we should never come here there must be a programming error
+write_log 12 "Error in 'dynamic_dns_updater.sh - program coding error"
--- /dev/null
+#!/bin/sh
+#
+# sample script for detecting local IP
+# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#
+# activated inside /etc/config/ddns by setting
+#
+# option ip_source 'script'
+# option ip_script '/usr/lib/ddns/getlocalip_sample.sh -6' !!! parameters ALLOWED
+#
+# the script is executed (not parsed) inside get_local_ip() function
+# of /usr/lib/ddns/dynamic_dns_functions.sh
+#
+# This script should
+# - return the IP address via stdout echo -n "...." !!! without line feed
+# - report errors via stderr echo "...." >&2
+# - return an error code ('0' for success) exit 123
+
+case $1 in
+ -4) echo -n "8.8.8.8" # never append linefeed or simular
+ exit 0
+ ;; # IP's of Googles public DNS
+ -6) echo -n "2001:4860:4860::8888"
+ exit 0
+ ;;
+ *) echo "$0 - Invalid or missing parameter" >&2
+ exit 1
+esac
+echo "Should never come here" >&2
+exit 2
-# This file contains the update urls for various dynamic dns services.
-# Column one contains the service name, column two contains the update url.
-# within the update url there are 4 variables you can use: [USERNAME],
-# [PASSWORD], [DOMAIN] and [IP]. These are substituted for the username,
-# password, and domain name specified in the /etc/config/ddns file when an
-# update is performed. The IP is substituted for the current ip address of the
-# router. These variables are case sensitive, while urls generally are not, so
-# if you need to enter the same text in the url (which seems very unlikely) put
-# that text in lowercase, while the variables should remain in uppercase
+#444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
+#4
+#4 This file contains the update urls for various dynamic dns services.
+#4 Column one contains the service name, column two contains the update url.
+#4 within the update url there are 4 variables you can use: [USERNAME],
+#4 [PASSWORD], [DOMAIN] and [IP]. These are substituted for the username,
+#4 password, and domain name specified in the /etc/config/ddns file when an
+#4 update is performed. The IP is substituted for the current ip address of the
+#4 router. These variables are case sensitive, while urls generally are not, so
+#4 if you need to enter the same text in the url (which seems very unlikely) put
+#4 that text in lowercase, while the variables should remain in uppercase
+#4
+#4 There are TONS of dynamic dns services out there. There's a huge list of them at:
+#4 http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/
+#4 If anyone has time they could update this file to be compatible with a bunch of them
+#4
+#4 !!! Since ddns-scripts Version 2.x the update of IPv6 addresses is also supported
+#4 !!! This file is used for update of IPv4 adresses only. For IPv6 use services_ipv6
+#4
+#4 !!! Since ddns-scripts Version 2.x the update via provider specific update scripts is supported.
+#4 !!! This scripts must be located at /usr/lib/ddns directory if defined inside this file.
+#4 !!! Use only the script name (without path). Sample:
+#4 !!! "example.com" "update_sample.sh"
+#4
+#444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444
"dyndns.org" "http://[USERNAME]:[PASSWORD]@members.dyndns.org/nic/update?hostname=[DOMAIN]&myip=[IP]"
"changeip.com" "http://[USERNAME]:[PASSWORD]@nic.changeip.com/nic/update?u=[USERNAME]&p=[PASSWORD]&cmd=update&hostname=[DOMAIN]&ip=[IP]"
"zoneedit.com" "http://[USERNAME]:[PASSWORD]@dynamic.zoneedit.com/auth/dynamic.html?host=[DOMAIN]&dnsto=[IP]"
"free.editdns.net" "http://dyndns-free.editdns.net/api/dynLinux.php?p=[PASSWORD]&r=[DOMAIN]"
-#noip is an alias of no-ip, so allow both names for the same service
-"no-ip.com" "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
-"noip.com" "http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+# noip is an alias of no-ip, so allow both names for the same service
+# use provider specific update script
+"no-ip.com" "update_no-ip.sh"
+"noip.com" "update_no-ip.sh"
#freedns.afraid.org is weird, you just need an update code, for which we use the password variable
"freedns.afraid.org" "http://freedns.afraid.org/dynamic/update.php?[PASSWORD]&address=[IP]"
-#### ADD YOURS HERE! ######################################################################################
-# #
-# There are TONS of dynamic dns services out there. There's a huge list of them at: #
-# http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/ #
-# If anyone has time they could update this file to be compatible with a bunch of them #
-# #
-###########################################################################################################
-
# DNS Max and resellers' update urls
"dnsmax.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=1&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
"thatip.com" "http://update.dnsmax.com/update/?username=[USERNAME]&password=[PASSWORD]&resellerid=2&clientname=openwrt&clientversion=8.09&protocolversion=2.0&updatehostname=[DOMAIN]&ip=[IP]"
# Hurricane Electric Dynamic DNS
-"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
+"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
# DNSdynamic.org
"dnsdynamic.org" "http://[USERNAME]:[PASSWORD]@www.dnsdynamic.org/api/?hostname=[DOMAIN]&myip=[IP]"
# dnsExit.com free dynamic DNS update url
-"dnsexit.com" "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
+"dnsexit.com" "http://www.dnsexit.com/RemoteUpdate.sv?login=[USERNAME]&password=[PASSWORD]&host=[DOMAIN]&myip=[IP]"
# OVH
"ovh.com" "http://[USERNAME]:[PASSWORD]@www.ovh.com/nic/update?system=dyndns&hostname=[DOMAIN]&myip=[IP]"
"namecheap.com" "http://dynamicdns.park-your-domain.com/update?host=[USERNAME]&domain=[DOMAIN]&password=[PASSWORD]&ip=[IP]"
# easydns.com dynamic DNS
-"easydns.com" "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
+"easydns.com" "http://[USERNAME]:[PASSWORD]@api.cp.easydns.com/dyn/tomato.php?hostname=[DOMAIN]&myip=[IP]"
# Winco DDNS
"ddns.com.br" "http://[DOMAIN]:[PASSWORD]@members.ddns.com.br/nic/update?hostname=[DOMAIN]&myip=[IP]"
# MyDNS.JP
"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV4ADDR=[IP]"
+
+# LoopiaDNS
+"loopia.se" "http://[USERNAME]:[PASSWORD]@dns.loopia.se/XDynDNSServer/XDynDNS.php?system=custom&hostname=[DOMAIN]&myip=[IP]"
+
+# Cloudflare
+"cloudflare.com" "update_cloudflare.sh"
+
+# SelfHost.de
+"selfhost.de" "http://carol.selfhost.de/update?username=[USERNAME]&password=[PASSWORD]&myip=[IP]&hostname=1"
+
+# no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
+"no-ip.pl" "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
-# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-# !!!!! IPv6 Version of original services file !!!!!
-# !!!!! funtionally and syntax is the same !!!!!
-# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-# This file contains the update urls for various dynamic dns services.
-# Column one contains the service name, column two contains the update url.
-# within the update url there are 4 variables you can use: [USERNAME],
-# [PASSWORD], [DOMAIN] and [IP]. These are substituted for the username,
-# password, and domain name specified in the /etc/config/ddns file when an
-# update is performed. The IP is substituted for the current ip address of the
-# router. These variables are case sensitive, while urls generally are not, so
-# if you need to enter the same text in the url (which seems very unlikely) put
-# that text in lowercase, while the variables should remain in uppercase
+#666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
+#6
+#6 This file contains the update urls for various dynamic dns services.
+#6 Column one contains the service name, column two contains the update url.
+#6 within the update url there are 4 variables you can use: [USERNAME],
+#6 [PASSWORD], [DOMAIN] and [IP]. These are substituted for the username,
+#6 password, and domain name specified in the /etc/config/ddns file when an
+#6 update is performed. The IP is substituted for the current ip address of the
+#6 router. These variables are case sensitive, while urls generally are not, so
+#6 if you need to enter the same text in the url (which seems very unlikely) put
+#6 that text in lowercase, while the variables should remain in uppercase
+#6
+#6 There are TONS of dynamic dns services out there. There's a huge list of them at:
+#6 http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/
+#6 If anyone has time they could update this file to be compatible with a bunch of them
+#6
+#6 !!! Since ddns-scripts Version 2.x the update of IPv6 addresses is also supported
+#6 !!! This file is used for update of IPv6 adresses only. For IPv4 use services
+#6
+#6 !!! Since ddns-scripts Version 2.x the update via provider specific update scripts is supported.
+#6 !!! This scripts must be located at /usr/lib/ddns directory if defined inside this file.
+#6 !!! Use only the script name (without path). Sample:
+#6 !!! "example.com" "update_sample.sh"
+#6
+#666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666
-# tested with
-
-# Securepoint Dynamic-DNS-Service
+#IPv6 @ Securepoint Dynamic-DNS-Service
"spdns.de" "http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
-# Hurricane Electric Dynamic DNS
-"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
-
-#### ADD YOURS HERE! ######################################################################################
-# #
-# There are TONS of dynamic dns services out there. There's a huge list of them at: #
-# http://www.dmoz.org/Computers/Software/Internet/Servers/Address_Management/Dynamic_DNS_Services/ #
-# If anyone has time they could update this file to be compatible with a bunch of them #
-# #
-###########################################################################################################
+#IPv6 @ Hurricane Electric Dynamic DNS
+"he.net" "http://[DOMAIN]:[PASSWORD]@dyn.dns.he.net/nic/update?hostname=[DOMAIN]&myip=[IP]"
-# MyDNS.JP
+#IPv6 @ MyDNS.JP
"mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV6ADDR=[IP]"
+
+#IPv6 @ Cloudflare
+"cloudflare.com" "update_cloudflare.sh"
+
+#IPv6 @ no-ip.pl nothing to do with no-ip.com (domain registered to www.domeny.tv) (IP autodetected by provider)
+"no-ip.pl" "http://[USERNAME]:[PASSWORD]@update.no-ip.pl/?hostname=[DOMAIN]"
--- /dev/null
+#
+# script for sending updates to cloudflare.com
+# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+# many thanks to Paul for testing and feedback during development
+#
+# This script is parsed by dynamic_dns_functions.sh inside send_update() function
+#
+# using following options from /etc/config/ddns
+# option username - your cloudflare e-mail
+# option password - cloudflare api key, you can get it from cloudflare.com/my-account/
+# option domain - your full hostname to update, in cloudflare its subdomain.domain
+# i.e. myhost.example.com where myhost is the subdomain and example.com is your domain
+#
+# Attention !!! script will only work if there is only one subdomain-level at your domain
+# subdomain2.subdomain1.domain i.e. mail.host.example.com will not work
+#
+# variable __IP already defined with the ip-address to use for update
+#
+[ $use_https -eq 0 ] && write_log 14 "Cloudflare only support updates via Secure HTTP (HTTPS). Please correct configuration!"
+
+local __RECID __URL __KEY __KEYS __FOUND __DOMREC
+local __SUBDOM=$(echo $domain | awk -F "." '{print $1}')
+local __DOMAIN=$(echo $domain | awk -F "${__SUBDOM}." '{print $2}')
+local __TMP="/tmp/$$.json"
+
+# parse OpenWrt script with
+# functions for parsing and generating json
+. /usr/share/libubox/jshn.sh
+
+# function copied from /usr/share/libubox/jshn.sh
+# from BB14.09 for backward compatibility to AA12.09
+json_get_keys() {
+ local __dest="$1"
+ local _tbl_cur
+
+ if [ -n "$2" ]; then
+ json_get_var _tbl_cur "$2"
+ else
+ _json_get_var _tbl_cur JSON_CUR
+ fi
+ local __var="${JSON_PREFIX}KEYS_${_tbl_cur}"
+ eval "export -- \"$__dest=\${$__var}\"; [ -n \"\${$__var+x}\" ]"
+}
+
+# function to "sed" unwanted string parts from DATFILE
+cleanup() {
+ #based on the sample output on cloudflare.com homepage we need to do some cleanup
+ sed -i 's/^[ \t]*//;s/[ \t]*$//' $DATFILE # remove invisible chars at beginning and end of lines
+ sed -i '/^-$/d' $DATFILE # remove lines with "-" (dash)
+ sed -i '/^$/d' $DATFILE # remove empty lines
+ sed -i "#'##g" $DATFILE # remove "'" (single quote)
+}
+
+# build url according to cloudflare client api at https://www.cloudflare.com/docs/client-api.html
+# to "rec_load_all" to detect rec_id needed for update
+__URL="https://www.cloudflare.com/api_json.html" # https://www.cloudflare.com/api_json.html
+__URL="${__URL}?a=rec_load_all" # -d 'a=rec_load_all'
+__URL="${__URL}&tkn=$password" # -d 'tkn=8afbe6dea02407989af4dd4c97bb6e25'
+__URL="${__URL}&email=$username" # -d 'email=sample@example.com'
+__URL="${__URL}&z=$__DOMAIN" # -d 'z=example.com'
+
+# lets request the data
+do_transfer "$__URL" || return 1
+
+cleanup # cleanup dat file
+json_load "$(cat $DATFILE)" # lets extract data
+__FOUND=0 # found record indicator
+json_get_var __RES "result" # cloudflare result of last request
+json_get_var __MSG "msg" # cloudflare error message
+[ "$__RES" != "success" ] && {
+ write_log 4 "'rec_load_all' failed with error: \n$__MSG"
+ return 1
+}
+
+json_select "response"
+json_select "recs"
+json_select "objs"
+json_get_keys __KEYS
+for __KEY in $__KEYS; do
+ local __ZONE __NAME __DISPLAY __TYPE
+ json_select "$__KEY"
+ json_get_var __ZONE "zone_name"
+ json_get_var __NAME "name"
+ json_get_var __DISPLAY "display_name"
+ json_get_var __TYPE "type"
+ # if "zone_name" == "name" == "display_name" == $domain, then we found a valid domain record
+ if [ "$__NAME" = "$domain" ]; then
+ [ "$__DISPLAY" = "$__ZONE" ] && __DOMREC=1 || __DOMREC=0
+ # we must verify IPv4 and IPv6 because there might be both for the same host
+ [ \( $use_ipv6 -eq 0 -a "$__TYPE" = "A" \) -o \( $use_ipv6 -eq 1 -a "$__TYPE" = "AAAA" \) ] && {
+ __FOUND=1 # mark found
+ break # found leave for loop
+ }
+ fi
+ json_select ..
+done
+[ $__FOUND -eq 0 ] && {
+ # we don't need to continue trying to update cloudflare because record to update does not exist
+ # user has to setup record first outside ddns-scripts
+ write_log 14 "No valid record found at Cloudflare setup. Please create first!"
+}
+json_get_var __RECID "rec_id" # last thing to do get rec_id
+json_cleanup # cleanup
+write_log 7 "rec_id '$__RECID' detected for host/domain '$domain'"
+
+# build url according to cloudflare client api at https://www.cloudflare.com/docs/client-api.html
+# for "rec_edit" to update IP address
+__URL="https://www.cloudflare.com/api_json.html" # https://www.cloudflare.com/api_json.html
+__URL="${__URL}?a=rec_edit" # -d 'a=rec_edit'
+__URL="${__URL}&tkn=$password" # -d 'tkn=8afbe6dea02407989af4dd4c97bb6e25'
+__URL="${__URL}&id=$__RECID" # -d 'id=9001'
+__URL="${__URL}&email=$username" # -d 'email=sample@example.com'
+[ $__DOMREC -eq 0 ] && __URL="${__URL}&z=$__DOMAIN" # -d 'z=example.com'
+[ $__DOMREC -eq 1 ] && __URL="${__URL}&z=$domain" # -d 'z=example.com'
+
+[ $use_ipv6 -eq 0 ] && __URL="${__URL}&type=A" # -d 'type=A' (IPv4)
+[ $use_ipv6 -eq 1 ] && __URL="${__URL}&type=AAAA" # -d 'type=AAAA' (IPv6)
+
+[ $__DOMREC -eq 0 ] && __URL="${__URL}&name=$__SUBDOM" # -d 'name=sub' (HOST/SUBDOMAIN)
+[ $__DOMREC -eq 1 ] && __URL="${__URL}&name=$domain" # -d 'name=example.com'(DOMAIN)
+
+__URL="${__URL}&content=$__IP" # -d 'content=1.2.3.4'
+__URL="${__URL}&service_mode=0" # -d 'service_mode=0'
+__URL="${__URL}&ttl=1" # -d 'ttl=1'
+
+# lets do the update
+do_transfer "$__URL" || return 1
+
+cleanup # cleanup tmp file
+json_load "$(cat $DATFILE)" # lets extract data
+json_get_var __RES "result" # cloudflare result of last request
+json_get_var __MSG "msg" # cloudflare error message
+[ "$__RES" != "success" ] && {
+ write_log 4 "'rec_edit' failed with error:\n$__MSG"
+ return 1
+}
+write_log 7 "Update of rec_id '$__RECID' successful"
+return 0
--- /dev/null
+#
+# script for sending updates to no-ip.com / noip.com
+# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
+#
+# This script is parsed by dynamic_dns_functions.sh inside send_update() function
+#
+# provider did not reactivate records, if no IP change was recognized
+# so we send a dummy (localhost) and a seconds later we send the correct IP addr
+#
+local __DUMMY
+local __UPDURL="http://[USERNAME]:[PASSWORD]@dynupdate.no-ip.com/nic/update?hostname=[DOMAIN]&myip=[IP]"
+
+# set IP version dependend dummy (localhost)
+[ $use_ipv6 -eq 0 ] && __DUMMY="127.0.0.1" || __DUMMY="::1"
+
+# lets do DUMMY transfer
+write_log 7 "sending dummy IP to 'no-ip.com'"
+__URL=$(echo $__UPDURL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
+ -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__DUMMY#g")
+[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
+
+do_transfer "$__URL" || return 1
+
+write_log 7 "'no-ip.com' answered:\n$(cat $DATFILE)"
+# analyse provider answers
+# "good [IP_ADR]" = successful
+# "nochg [IP_ADR]" = no change but OK
+grep -E "good|nochg" $DATFILE >/dev/null 2>&1 || return 1
+
+# lets wait a seconds
+sleep 1
+
+# now send the correct data
+write_log 7 "sending real IP to 'no-ip.com'"
+__URL=$(echo $__UPDURL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
+ -e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
+[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
+
+do_transfer "$__URL" || return 1
+
+write_log 7 "'no-ip.com' answered:\n$(cat $DATFILE)"
+# analyse provider answers
+# "good [IP_ADR]" = successful
+# "nochg [IP_ADR]" = no change but OK
+grep -E "good|nochg" $DATFILE >/dev/null 2>&1
+return $? # "0" if "good" or "nochg" found
+
-# sample script for sending user defined updates
+# sample script for sending user defined updates
# 2014 Christian Schoenebeck <christian dot schoenebeck at gmail dot com>
#
# activated inside /etc/config/ddns by setting
#
-# option update_script '/usr/lib/ddns/update_sample.sh'
+# option update_script '/usr/lib/ddns/update_sample.sh'
#
# the script is parsed (not executed) inside send_update() function
# of /usr/lib/ddns/dynamic_dns_functions.sh
# so you can use all available functions and global variables inside this script
# already defined in dynamic_dns_updater.sh and dynamic_dns_functions.sh
#
-# It make sence to define the update url ONLY inside this script
+# It make sence to define the update url ONLY inside this script
# because it's anyway unique to the update script
# otherwise it should work with the default scripts
#
# the code here is the copy of the default used inside send_update()
#
-local __USER __PASS __ANSWER
# tested with spdns.de
local __URL="http://[USERNAME]:[PASSWORD]@update.spdns.de/nic/update?hostname=[DOMAIN]&myip=[IP]"
# do replaces in URL
-__urlencode __USER "$username" # encode username, might be email or something like this
-__urlencode __PASS "$password" # encode password, might have special chars for security reason
-__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$__USER#g" -e "s#\[PASSWORD\]#$__PASS#g" \
+__URL=$(echo $__URL | sed -e "s#\[USERNAME\]#$URL_USER#g" -e "s#\[PASSWORD\]#$URL_PASS#g" \
-e "s#\[DOMAIN\]#$domain#g" -e "s#\[IP\]#$__IP#g")
[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#')
-__do_transfer __ANSWER "$__URL"
-__ERR=$?
-[ $__ERR -gt 0 ] && {
- verbose_echo "\n!!!!!!!!! ERROR =: Error sending update to DDNS Provider\n"
- return 1
-}
-verbose_echo " update send =: DDNS Provider answered\n$__ANSWER"
-return 0
+do_transfer "$__URL" || return 1
+
+write_log 7 "DDNS Provider answered:\n$(cat $DATFILE)"
+
+# analyse provider answers
+# "good [IP_ADR]" = successful
+# "nochg [IP_ADR]" = no change but OK
+grep -E "good|nochg" $DATFILE >/dev/null 2>&1
+return $? # "0" if "good" or "nochg" found
+
PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
PKG_LICENSE:=GPLv2
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.flyn.org/projects/dmapd
PKG_MD5SUM:=e7bf0c355d2bf6ee281ebc713c5fb987
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
default n
config FASTD_WITH_VERIFY
- bool "Include support for on-verify handlers"
- depends on PACKAGE_fastd
- default n
+ bool "Include support for on-verify handlers"
+ depends on PACKAGE_fastd
+ default n
+
+config FASTD_WITH_STATUS_SOCKET
+ bool "Include support for status sockets"
+ depends on PACKAGE_fastd
+ default y
+
endmenu
include $(TOPDIR)/rules.mk
PKG_NAME:=fastd
-PKG_VERSION:=14
-PKG_RELEASE:=3
+PKG_VERSION:=16
+PKG_RELEASE:=1
PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/75
-PKG_MD5SUM:=34f6bdebd0410a1fba7c8fd06fff7a05
+PKG_SOURCE_URL:=https://projects.universe-factory.net/attachments/download/78
+PKG_MD5SUM:=135b3083d2743e335738de3bd4bb0c3c
PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYRIGHT
+PKG_LICENSE_FILES:=COPYRIGHT
PKG_CONFIG_DEPENDS:=\
CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST \
CONFIG_FASTD_WITH_CMDLINE_LOGGING \
CONFIG_FASTD_WITH_CMDLINE_OPERATION \
CONFIG_FASTD_WITH_CMDLINE_COMMANDS \
- CONFIG_FASTD_WITH_VERIFY
+ CONFIG_FASTD_WITH_VERIFY \
+ CONFIG_FASTD_WITH_STATUS_SOCKET
PKG_BUILD_DEPENDS:=nacl libuecc
define Package/fastd
SECTION:=net
CATEGORY:=Network
- DEPENDS:=+kmod-tun +librt +libpthread
+ DEPENDS:=+kmod-tun +librt +libpthread +FASTD_WITH_STATUS_SOCKET:libjson-c
TITLE:=Fast and Secure Tunneling Daemon
URL:=https://projects.universe-factory.net/projects/fastd
SUBMENU:=VPN
-DWITH_CMDLINE_OPERATION:BOOL=FALSE \
-DWITH_CMDLINE_COMMANDS:BOOL=FALSE \
-DWITH_VERIFY:BOOL=FALSE \
+ -DWITH_STATUS_SOCKET:BOOL=FALSE \
-DWITH_CAPABILITIES:BOOL=FALSE \
-DENABLE_SYSTEMD:BOOL=FALSE \
-DENABLE_LIBSODIUM:BOOL=FALSE \
CMAKE_OPTIONS += -DWITH_VERIFY:BOOL=TRUE
endif
+ifeq ($(CONFIG_FASTD_WITH_STATUS_SOCKET),y)
+CMAKE_OPTIONS += -DWITH_STATUS_SOCKET:BOOL=TRUE
+endif
+
define Package/fastd/description
Fast and secure tunneling daemon, which is optimized on small code size and few dependencies
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/fastd $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/init.d/
- $(INSTALL_BIN) files/fastd.init $(1)/etc/init.d/fastd
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.init $(1)/etc/init.d/fastd
$(INSTALL_DIR) $(1)/etc/config
- $(INSTALL_CONF) files/fastd.config $(1)/etc/config/fastd
+ $(INSTALL_CONF) $(PKG_BUILD_DIR)/doc/examples/openwrt/fastd.config $(1)/etc/config/fastd
$(INSTALL_DIR) $(1)/etc/fastd
$(INSTALL_DIR) $(1)/lib/upgrade/keep.d
$(INSTALL_DATA) files/fastd.upgrade $(1)/lib/upgrade/keep.d/fastd
+++ /dev/null
-package fastd
-
-config fastd sample_config
-
- # Set to 1 to enable this instance:
- option enabled 0
-
- # Sets a static config file, optional
- # Options set via UCI have higher priority that statically configured ones
-# list config '/etc/fastd/sample_config/fastd.conf'
-
- # Configures a single static peer from a configuration file
-# list config_peer '/etc/fastd/sample_config/sample_peer.conf'
-
- # Sets an additional directory from which peers configurations are read
- # The peer list can be reloaded without restarting fastd
- # Peer can either be configured via UCI (see examples below) or via peer dirs
- # Can't be used in tun mode
-# list config_peer_dir '/etc/fastd/sample_config/peers'
-
- # Sets the log level
- # Possible values: error, warn, info, verbose, debug
- # Default: info
- option syslog_level 'info'
-
- # IP address and port of the local end, optional
- # 'any' can be used to bind to both IPv4 and IPv6
- # If no port is given fastd will bind to a random port
-# list bind 'any:1337'
-# list bind '0.0.0.0:1337'
-# list bind '[::]:1337'
-
- # "method null" uses no encryption or MAC
- # "method xsalsa20-poly1305" uses the XSalsa20 encryption ad the Poly1305 MAC
- list method 'xsalsa20-poly1305'
-
- # "mode tap" will create an ethernet tunnel (tap device),
- # "mode tun" will create an IP tunnel (tun device).
- option mode 'tap'
-
- # Set the name of the tunnel interface to use
- option interface 'tap0'
-# option interface 'tun0'
-# option interface 'fastd0'
-
- # Sets the MTU of the tunnel interface, default is 1500
- # 1426 is a good value that avoids fragmentation for the xsalsa20-poly1305 method
- # when the tunnel uses an IPv4 connection on a line with an MTU of 1492 or higher
- option mtu 1426
-
- # Enables direct forwaring of packets between peers
- # WARNING: Only enable this if you know what you are doing, as this can lead to forwarding loops!
- option forward 0
-
- # Disable for compatiblity with fastd v10 and older
- option secure_handshakes 1
-
- # Set a packet mark to filter for with iptables or ip rules
-# option packet_mark 42
-
- # Limits the maximum number of connections, optional
-# option peer_limit 5
-
- # The secret key
- # A keypair can be generated with `fastd --generate-key`
- # When the corresponding public key is lost it can be recovered with `/etc/init.d/fastd show-key <config name>`
-# option secret '0000000000000000000000000000000000000000000000000000000000000000'
-
- # Sets the user to run fastd as. Defaults to root
-# option user 'daemon'
-
- # Sets the group to run fastd as. Defaults to the user's primary group
-# option group 'daemon'
-
- # If set to 1, the logs won't contain peers' IP addresses
-# option hide_ip_addresses '0'
-
- # If set to 1, the logs won't contain peers' MAC addresses
-# option hide_mac_addresses '0'
-
- # Read the documentation about this one. Only ever useful in severly broken networks.
-# option pmtu ''
-
- # command to configure IP addresses etc. after the tunnel interface is up; $1 will be the interface name (optional)
-# option up ''
-
- # command to execute before the tunnel interface is set down; $1 will be the interface name (optional)
-# option down ''
-
-
-config peer sample_peer
-
- # Set to 1 to enable this peer
- # In tap mode peers can be reloaded dynamically
- option enabled 0
-
- # Controls which instance this peer is associated with
- option net 'sample_config'
-
- # Controls which peer group this peer belongs to, optional
- # For most use cases peer groups aren't necessary
-# option group 'sample_group'
-
- # The peer's public key
- option key '0000000000000000000000000000000000000000000000000000000000000000'
-
- # A remote specification consists of an address or a hostname, and a port
- # When a hostname is given, it is recommended to specify the address family to use
- # It is possible to specify no, one or multiple remotes
- # (but all entries must designate the same host as the public key must be unique)
-# list remote '192.0.2.1:1337'
-# list remote '[2001:db8::1]:1337'
-# list remote '"example.com" port 1337'
-# list remote 'ipv4 "example.com" port 1337'
-# list remote 'ipv6 "example.com" port 1337'
-
- # Setting float to 1 allow incoming connections with this key from other addresses/hostnames/ports than the specified remotes
-# option float 0
-
-
-config peer_group sample_group
-
- # Set to 1 to enable this peer group
- option enabled 0
-
- # Controls which instance this peer group is associated with
- # Peer groups can't be used in tun mode
- option net 'sample_config'
-
- # Allows configuring nested groups
-# option parent 'other_group'
-
- # Includes another config file inside the peer group definition
-# list config '/etc/fastd/sample_config/sample_group.conf'
-
- # Configures a single static peer from a configuration file
-# list config_peer '/etc/fastd/sample_config/sample_peer.conf'
-
- # Configures an additional peer directory for this group
-# list config_peer_dir '/etc/fastd/sample_config/peers2'
-
- # Limits the maximum number of connections to peers in this group (optional)
-# option peer_limit 5
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2012-2013 OpenWrt.org
-
-START=95
-
-SERVICE_USE_PID=1
-
-EXTRA_COMMANDS="up down show_key generate_key"
-
-LIST_SEP="
-"
-TMP_FASTD=/tmp/fastd
-FASTD_COMMAND=/usr/bin/fastd
-
-
-section_enabled() {
- config_get_bool enabled "$1" 'enabled' 0
- [ $enabled -gt 0 ]
-}
-
-error() {
- echo "${initscript}:" "$@" 1>&2
-}
-
-get_key_instance() {
- local s="$1"
-
- config_get secret "$s" secret
- if [ "$secret" = 'generate' ]; then
- secret=`"$FASTD_COMMAND" --generate-key --machine-readable`
- uci -q set fastd."$s".secret="$secret" && uci -q commit fastd
- fi
-
- echo "$secret"
-}
-
-
-escape_string() {
- local t=${1//\\/\\\\}
- echo -n "\"${t//\"/\\\"}\""
-}
-
-guard_value() {
- local t=${1//[^-a-z0-9\[\].:]/}
- echo -n "$t"
-}
-
-guard_remote() {
- local t=${1//[^-a-zA-Z0-9\[\].:\"% ]/}
- local quotes=${t//[^\"]/}
- if [ "${#quotes}" = 0 -o "${#quotes}" = 2 ]; then
- echo -n "$t"
- fi
-}
-
-yes_no() {
- case "$1" in
- 0|no|off|false|disabled) echo -n no;;
- *) echo -n yes;;
- esac
-}
-
-config_string_config='include $(escape_string "$value");'
-config_string_config_peer='include peer $(escape_string "$value");'
-config_string_config_peer_dir='include peers from $(escape_string "$value");'
-config_string_bind='bind $(guard_value "$value");'
-config_string_method='method $(escape_string "$value");'
-config_string_syslog_level='log to syslog level $(guard_value "$value");'
-config_string_mode='mode $(guard_value "$value");'
-config_string_interface='interface $(escape_string "$value");'
-config_string_mtu='mtu $(guard_value "$value");'
-config_string_peer_limit='peer limit $(guard_value "$value");'
-config_string_user='user $(escape_string "$value");'
-config_string_group='group $(escape_string "$value");'
-config_string_pmtu='pmtu $(yes_no "$value");'
-config_string_forward='forward $(yes_no "$value");'
-config_string_hide_ip_addresses='hide ip addresses $(yes_no "$value");'
-config_string_hide_mac_addresses='hide mac addresses $(yes_no "$value");'
-config_string_secure_handshakes='secure handshakes $(yes_no "$value");'
-config_string_packet_mark='packet mark $(guard_value "$value");'
-
-config_string_peer='peer $(escape_string "$value") {'
-config_string_peer_group='peer group $(escape_string "$value") {'
-
-peer_string_key='key $(escape_string "$value");'
-peer_string_float='float $(yes_no "$value");'
-peer_string_remote='remote $(guard_remote "$value");'
-
-generate_option() {
- local __string=$(eval echo \"\$$2\")
- local value="$1";
- eval echo "\"$__string\""
-}
-
-append_option() {
- local v; local len; local s="$1"; local prefix="$2"; local p="$3"
-
- config_get len "$s" "${p}_LENGTH"
-
- if [ -z "$len" ]; then
- config_get v "$s" "$p"
- [ -n "$v" ] && generate_option "$v" "${prefix}_string_${p}"
- else
- config_list_foreach "$s" "$p" generate_option "${prefix}_string_${p}"
- fi
-}
-
-append_options() {
- local p; local s="$1"; local prefix="$2"; shift; shift
- for p in $*; do
- append_option "$s" "$prefix" "$p"
- done
-}
-
-
-generate_config_secret() {
- echo "secret $(escape_string "$1");"
-}
-
-
-generate_peer_config() {
- local peer="$1"
-
- # These options are deprecated
- config_get address "$peer" address
- config_get hostname "$peer" hostname
- config_get address_family "$peer" address_family
- config_get port "$peer" port
-
- if [ "$address" -o "$hostname" ]; then
- if [ -z "$port" ]; then
- error "peer $peer: address or hostname, but no port given"
- return 1
- fi
-
- if [ "$hostname" ]; then
- generate_option peer_string_remote "$address_family \"$hostname\" port $port"
- fi
-
- if [ "$address" ]; then
- generate_option peer_string_remote "$address port $port"
- fi
- fi
-
- append_options "$peer" peer \
- key float remote
-}
-
-generate_single_peer_config() {
- local peer="$1"; local net="$2"
-
- config_get peer_net "$peer" net
- config_get peer_group "$peer" group
- [ "$net" = "$peer_net" -a "$peer_group" = '' ] || return 0
-
- section_enabled "$peer" || return 0
-
- generate_option "$peer" config_string_peer
- generate_peer_config "$peer"
- echo '}'
-}
-
-create_peer_config() {
- local peer="$1"; local net="$2"; local group="$3"; local path="$4"
-
- config_get peer_net "$peer" net
- config_get peer_group "$peer" group
- [ "$group" = "$peer_group" ] || return 0
-
- if [ "$net" != "$peer_net" ]; then
- [ -z "$group" ] || error "warning: the peer group of peer '$peer' doesn't match its net, the peer will be ignored"
- return 0
- fi
-
- section_enabled "$peer" || return 0
-
- generate_peer_config "$peer" >"$path/$peer"
-}
-
-update_peer_group() {
- local net="$1"; local group_dir="$2"; local group="$3"; local update_only="$4"
- local path="$TMP_FASTD/fastd.$net/$group_dir"
-
- rm -rf "$path"
- mkdir -p "$path"
-
- config_foreach create_peer_config 'peer' "$net" "$group" "$path"
-
- if [ -z "$update_only" ]; then
- generate_option "$path" config_string_config_peer_dir
- fi
-
- config_foreach generate_peer_group_config 'peer_group' "$net" "$group_dir" "$update_only" "$group"
-}
-
-generate_peer_group_config() {
- local group="$1"; local net="$2"; local group_dir="$3%$group"; local update_only="$4"; local parent="$5"
-
- config_get group_net "$group" net
- config_get group_parent "$group" parent
- [ "$parent" = "$group_parent" ] || return 0
-
- if [ "$net" != "$peer_net" ]; then
- [ -z "$parent" ] || error "warning: the parent of peer group '$group' doesn't match its net, the peer group will be ignored"
- return 0
- fi
-
- section_enabled "$group" || return 0
-
- if [ -z "$update_only" ]; then
- generate_option "$group" config_string_peer_group
- append_options "$group" config \
- config config_peer config_peer_dir peer_limit
- fi
-
- update_peer_group "$net" "$group_dir" "$group" "$update_only"
-
- if [ -z "$update_only" ]; then
- echo '}'
- fi
-}
-
-update_peer_groups() {
- local net="$1"; local update_only="$2"
-
- update_peer_group "$net" 'peers' '' "$update_only"
-}
-
-generate_config() {
- local s="$1"
-
- generate_option 'info' config_string_syslog_level
-
- append_options "$s" config \
- config config_peer config_peer_dir bind method syslog_level mode interface mtu peer_limit \
- user group pmtu forward hide_ip_addresses hide_mac_addresses secure_handshakes packet_mark
-
- config_get mode "$s" mode
-
- if [ "$mode" = "tun" ]; then
- config_foreach generate_single_peer_config 'peer' "$s"
- else
- update_peer_groups "$s"
- fi
-}
-
-
-generate_key_instance() {
- local s="$1"
-
- config_get secret "$s" secret
- if [ -z "$secret" -o "$secret" = 'generate' ]; then
- secret=`fastd --generate-key --machine-readable`
- uci -q set fastd."$s".secret="$secret" && uci -q commit fastd
- fi
-
- generate_config_secret "$secret" | "$FASTD_COMMAND" --config - --show-key --machine-readable
-}
-
-show_key_instance() {
- local s="$1"
-
- local secret=`get_key_instance "$s"`
- if [ -z "$secret" ]; then
- error "$s: secret is not set"
- return 1
- fi
-
- generate_config_secret "$secret" | "$FASTD_COMMAND" --config - --show-key --machine-readable
-}
-
-start_instance() {
- local s="$1"
-
- section_enabled "$s" || return 1
-
- SERVICE_PID_FILE="/var/run/fastd.$s.pid"
-
- config_get interface "$s" interface
- if [ -z "$interface" ]; then
- error "$s: interface is not set"
- return 1
- fi
-
- if ifconfig "$interface" &>/dev/null; then
- error "$s: interface '$interface' is already in use"
- return 1
- fi
-
- config_get mode "$s" mode
- if [ -z "$mode" ]; then
- error "$s: mode is not set"
- return 1
- fi
-
- local secret=`get_key_instance "$s"`
- if [ -z "$secret" ]; then
- error "$s: secret is not set"
- return 1
- fi
-
- rm -f "$SERVICE_PID_FILE"
- touch "$SERVICE_PID_FILE"
-
- config_get user "$s" user
- if [ "$user" ]; then
- chown "$user" "$SERVICE_PID_FILE"
- fi
-
- (generate_config_secret "$secret"; generate_config "$s") | service_start "$FASTD_COMMAND" --config - --daemon --pid-file "$SERVICE_PID_FILE"
-
- if ! ifconfig "$interface" >/dev/null 2>&1; then
- error "$s: startup failed"
- return 1
- fi
-
- config_get up "$s" up
- [ -n "$up" ] && sh -c "$up" - "$interface"
-}
-
-stop_instance() {
- local s="$1"
-
- section_enabled "$s" || return 1
-
- SERVICE_PID_FILE="/var/run/fastd.$s.pid"
-
- config_get interface "$s" interface
- if [ -z "$interface" ]; then
- error "$s: interface is not set"
- return 1
- fi
-
- if ! ifconfig "$interface" &>/dev/null; then
- error "$s: interface '$interface' does not exist"
- return 1
- fi
-
- config_get down "$s" down
- [ -n "$down" ] && sh -c "$down" - "$interface"
-
- service_stop "$FASTD_COMMAND"
-
- rm -rf "$TMP_FASTD/fastd.$s"
-}
-
-reload_instance() {
- local s="$1"
-
- section_enabled "$s" || return 1
-
- config_get mode "$s" mode
- [ "$mode" = "tun" ] && return 1
-
- update_peer_groups "$s" true
-
- SERVICE_PID_FILE="/var/run/fastd.$s.pid"
- service_reload "$FASTD_COMMAND"
-}
-
-start() {
- config_load 'fastd'
- config_foreach start_instance 'fastd'
- return 0
-}
-
-stop() {
- config_load 'fastd'
- config_foreach stop_instance 'fastd'
- return 0
-}
-
-reload() {
- config_load 'fastd'
- config_foreach reload_instance 'fastd'
- return 0
-}
-
-up() {
- local exists
- local instance
- config_load 'fastd'
- for instance in "$@"; do
- config_get exists "$instance" 'TYPE'
- if [ "$exists" = 'fastd' ]; then
- start_instance "$instance"
- fi
- done
-}
-
-down() {
- local exists
- local instance
- config_load 'fastd'
- for instance in "$@"; do
- config_get exists "$instance" 'TYPE'
- if [ "$exists" = 'fastd' ]; then
- stop_instance "$instance"
- fi
- done
-}
-
-show_key() {
- local exists
- local instance
- config_load 'fastd'
- for instance in "$@"; do
- config_get exists "$instance" 'TYPE'
- if [ "$exists" = 'fastd' ]; then
- show_key_instance "$instance"
- fi
- done
-}
-
-generate_key() {
- local exists
- local instance
- config_load 'fastd'
- for instance in "$@"; do
- config_get exists "$instance" 'TYPE'
- if [ "$exists" = 'fastd' ]; then
- generate_key_instance "$instance"
- fi
- done
-}
include $(TOPDIR)/rules.mk
PKG_NAME:=freeradius2
-PKG_VERSION:=2.2.5
+PKG_VERSION:=2.2.6
PKG_RELEASE:=1
PKG_SOURCE:=freeradius-server-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=ftp://ftp.freeradius.org/pub/freeradius/
-PKG_MD5SUM:=40535bace507d7a3134c3d858f3cbc5a
+PKG_MD5SUM:=e9a6f9bbee9706b008b924061ab3f915
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYRIGHT LICENSE
--- a/configure.in
+++ b/configure.in
-@@ -832,35 +832,6 @@ if test "x$WITH_OPENSSL" = xyes; then
+@@ -796,35 +796,6 @@ if test "x$WITH_OPENSSL" = xyes; then
OPENSSL_INCLUDE="-DOPENSSL_NO_KRB5"
fi
include $(TOPDIR)/rules.mk
PKG_NAME:=fwknop
-PKG_VERSION:=2.6.3
+PKG_VERSION:=2.6.4
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.cipherdyne.org/fwknop/download
-PKG_MD5SUM:=79e8a2feff54b429503bc7cade3bc32e
+PKG_MD5SUM:=259ae562a8fd845b67662fc8e504467e
PKG_MAINTAINER:=Jonathan Bennett <JBennett@incomsystems.biz>
PKG_INSTALL:=1
--- a/server/fwknopd.conf.inst
+++ b/server/fwknopd.conf.inst
-@@ -284,8 +284,13 @@
+@@ -392,8 +392,13 @@
# The IPT_FORWARD_ACCESS variable is only used if ENABLE_IPT_FORWARDING is
# enabled.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=haproxy
-PKG_VERSION:=1.5.5
-PKG_RELEASE:=02
+PKG_VERSION:=1.5.8
+PKG_RELEASE:=06
PKG_SOURCE:=haproxy-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://haproxy.1wt.eu/download/1.5/src/
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_MD5SUM:=952e4c2057d763a3fb74173a81028be5
+PKG_MD5SUM:=7bffa1afa069d90ce03b7cd9aa0557cd
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
PKG_LICENSE:=GPL-2.0
+++ /dev/null
-From 1f24e3fee3aba83fb3338d17589d0ad0f34f6c73 Mon Sep 17 00:00:00 2001
-From: Apollon Oikonomopoulos <apoikos@debian.org>
-Date: Wed, 8 Oct 2014 15:14:41 +0300
-Subject: [PATCH 1/2] BUG/MEDIUM: systemd: set KillMode to 'mixed'
-
-By default systemd will send SIGTERM to all processes in the service's
-control group. In our case, this includes the wrapper, the master
-process and all worker processes.
-
-Since commit c54bdd2a the wrapper actually catches SIGTERM and survives
-to see the master process getting killed by systemd and regard this as
-an error, placing the unit in a failed state during "systemctl stop".
-
-Since the wrapper now handles SIGTERM by itself, we switch the kill mode
-to 'mixed', which means that systemd will deliver the initial SIGTERM to
-the wrapper only, and if the actual haproxy processes don't exit after a
-given amount of time (default: 90s), a SIGKILL is sent to all remaining
-processes in the control group. See systemd.kill(5) for more
-information.
-
-This should also be backported to 1.5.
-(cherry picked from commit 74f016985ab1fa7a6a5afa301d982e77eba9c96a)
----
- contrib/systemd/haproxy.service.in | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/contrib/systemd/haproxy.service.in b/contrib/systemd/haproxy.service.in
-index 1a3d2c0..0bc5420 100644
---- a/contrib/systemd/haproxy.service.in
-+++ b/contrib/systemd/haproxy.service.in
-@@ -5,6 +5,7 @@ After=network.target
- [Service]
- ExecStart=@SBINDIR@/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
- ExecReload=/bin/kill -USR2 $MAINPID
-+KillMode=mixed
- Restart=always
-
- [Install]
---
-1.8.5.5
-
--- /dev/null
+From 184422d39df1aa27e6ef4c1ae75177489147ec99 Mon Sep 17 00:00:00 2001
+From: Arcadiy Ivanov <arcadiy.ivanov@servicemesh.com>
+Date: Tue, 4 Nov 2014 07:06:13 -0500
+Subject: [PATCH 1/6] BUILD: fix "make install" to support spaces in the
+ install dirs
+
+Makefile is unable to install into directories containing spaces.
+(cherry picked from commit 3785311e64792787de78370fa126fd806734f7fe)
+---
+ Makefile | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 707037b..9556069 100644
+--- a/Makefile
++++ b/Makefile
+@@ -710,19 +710,19 @@ src/dlmalloc.o: $(DLMALLOC_SRC)
+ $(CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $<
+
+ install-man:
+- install -d $(DESTDIR)$(MANDIR)/man1
+- install -m 644 doc/haproxy.1 $(DESTDIR)$(MANDIR)/man1
++ install -d "$(DESTDIR)$(MANDIR)"/man1
++ install -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1
+
+ install-doc:
+- install -d $(DESTDIR)$(DOCDIR)
++ install -d "$(DESTDIR)$(DOCDIR)"
+ for x in configuration architecture haproxy-en haproxy-fr; do \
+- install -m 644 doc/$$x.txt $(DESTDIR)$(DOCDIR) ; \
++ install -m 644 doc/$$x.txt "$(DESTDIR)$(DOCDIR)" ; \
+ done
+
+ install-bin: haproxy haproxy-systemd-wrapper
+- install -d $(DESTDIR)$(SBINDIR)
+- install haproxy $(DESTDIR)$(SBINDIR)
+- install haproxy-systemd-wrapper $(DESTDIR)$(SBINDIR)
++ install -d "$(DESTDIR)$(SBINDIR)"
++ install haproxy "$(DESTDIR)$(SBINDIR)"
++ install haproxy-systemd-wrapper "$(DESTDIR)$(SBINDIR)"
+
+ install: install-bin install-man install-doc
+
+--
+2.0.4
+
+++ /dev/null
-From 4ab232ce2fbdaf9b871c411fc7284096219bb854 Mon Sep 17 00:00:00 2001
-From: Willy Tarreau <w@1wt.eu>
-Date: Fri, 10 Oct 2014 14:54:25 +0200
-Subject: [PATCH 2/2] BUG/MEDIUM: config: avoid skipping disabled proxies
-
-Paul Taylor and Bryan Talbot found that after commit 419ead8 ("MEDIUM:
-config: compute the exact bind-process before listener's maxaccept"),
-a backend marked "disabled" would cause the next backend to be skipped
-and if it was the last one it would cause a segfault.
-
-The reason is that the commit above changed the "while" loop for a "for"
-loop but a "continue" statement still incrementing the current proxy was
-left in the code for disabled proxies, causing the next one to be skipped
-as well and the last one to try to dereference NULL when seeking ->next.
-
-The quick workaround consists in not disabling backends, or adding an
-empty dummy one after a disabled section.
-
-This fix must be backported to 1.5.
-(cherry picked from commit 06cc905813f1858c0606b44d1e271bd0b6a25224)
----
- src/cfgparse.c | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/src/cfgparse.c b/src/cfgparse.c
-index ec6d923..392a692 100644
---- a/src/cfgparse.c
-+++ b/src/cfgparse.c
-@@ -6104,7 +6104,6 @@ int check_config_validity()
- if (curproxy->state == PR_STSTOPPED) {
- /* ensure we don't keep listeners uselessly bound */
- stop_proxy(curproxy);
-- curproxy = curproxy->next;
- continue;
- }
-
---
-1.8.5.5
-
--- /dev/null
+From 90951497008967f10ba8f9927b53c6e6bc138540 Mon Sep 17 00:00:00 2001
+From: Emeric Brun <ebrun@haproxy.comw>
+Date: Wed, 12 Nov 2014 17:35:37 +0100
+Subject: [PATCH 2/6] BUG/MEDIUM: ssl: fix bad ssl context init can cause
+ segfault in case of OOM.
+
+Some SSL context's init functions errors were not handled and
+can cause a segfault due to an incomplete SSL context
+initialization.
+
+This fix must be backported to 1.5.
+(cherry picked from commit 5547615cdac377797ae351a2e024376dbf6d6963)
+---
+ src/ssl_sock.c | 44 ++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 34 insertions(+), 10 deletions(-)
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index f8bfbe7..620609f 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -2040,15 +2040,29 @@ static int ssl_sock_init(struct connection *conn)
+ return -1;
+ }
+
+- SSL_set_connect_state(conn->xprt_ctx);
+- if (objt_server(conn->target)->ssl_ctx.reused_sess)
+- SSL_set_session(conn->xprt_ctx, objt_server(conn->target)->ssl_ctx.reused_sess);
+-
+ /* set fd on SSL session context */
+- SSL_set_fd(conn->xprt_ctx, conn->t.sock.fd);
++ if (!SSL_set_fd(conn->xprt_ctx, conn->t.sock.fd)) {
++ SSL_free(conn->xprt_ctx);
++ conn->xprt_ctx = NULL;
++ conn->err_code = CO_ER_SSL_NO_MEM;
++ return -1;
++ }
+
+ /* set connection pointer */
+- SSL_set_app_data(conn->xprt_ctx, conn);
++ if (!SSL_set_app_data(conn->xprt_ctx, conn)) {
++ SSL_free(conn->xprt_ctx);
++ conn->xprt_ctx = NULL;
++ conn->err_code = CO_ER_SSL_NO_MEM;
++ return -1;
++ }
++
++ SSL_set_connect_state(conn->xprt_ctx);
++ if (objt_server(conn->target)->ssl_ctx.reused_sess) {
++ if(!SSL_set_session(conn->xprt_ctx, objt_server(conn->target)->ssl_ctx.reused_sess)) {
++ SSL_SESSION_free(objt_server(conn->target)->ssl_ctx.reused_sess);
++ objt_server(conn->target)->ssl_ctx.reused_sess = NULL;
++ }
++ }
+
+ /* leave init state and start handshake */
+ conn->flags |= CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN;
+@@ -2065,13 +2079,23 @@ static int ssl_sock_init(struct connection *conn)
+ return -1;
+ }
+
+- SSL_set_accept_state(conn->xprt_ctx);
+-
+ /* set fd on SSL session context */
+- SSL_set_fd(conn->xprt_ctx, conn->t.sock.fd);
++ if (!SSL_set_fd(conn->xprt_ctx, conn->t.sock.fd)) {
++ SSL_free(conn->xprt_ctx);
++ conn->xprt_ctx = NULL;
++ conn->err_code = CO_ER_SSL_NO_MEM;
++ return -1;
++ }
+
+ /* set connection pointer */
+- SSL_set_app_data(conn->xprt_ctx, conn);
++ if (!SSL_set_app_data(conn->xprt_ctx, conn)) {
++ SSL_free(conn->xprt_ctx);
++ conn->xprt_ctx = NULL;
++ conn->err_code = CO_ER_SSL_NO_MEM;
++ return -1;
++ }
++
++ SSL_set_accept_state(conn->xprt_ctx);
+
+ /* leave init state and start handshake */
+ conn->flags |= CO_FL_SSL_WAIT_HS | CO_FL_WAIT_L6_CONN;
+--
+2.0.4
+
--- /dev/null
+From 9bcc01ae25985dd540080f43b160beab1f1a2bc6 Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Thu, 13 Nov 2014 13:48:58 +0100
+Subject: [PATCH 3/6] BUG/MEDIUM: ssl: force a full GC in case of memory
+ shortage
+
+When memory becomes scarce and openssl refuses to allocate a new SSL
+session, it is worth freeing the pools and trying again instead of
+rejecting all incoming SSL connection. This can happen when some
+memory usage limits have been assigned to the haproxy process using
+-m or with ulimit -m/-v.
+
+This is mostly an enhancement of previous fix and is worth backporting
+to 1.5.
+(cherry picked from commit fba03cdc5ac6e3ca318b34915596cbc0a0dacc55)
+---
+ src/ssl_sock.c | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index 620609f..f50efe5 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -2033,9 +2033,16 @@ static int ssl_sock_init(struct connection *conn)
+ /* If it is in client mode initiate SSL session
+ in connect state otherwise accept state */
+ if (objt_server(conn->target)) {
++ int may_retry = 1;
++
++ retry_connect:
+ /* Alloc a new SSL session ctx */
+ conn->xprt_ctx = SSL_new(objt_server(conn->target)->ssl_ctx.ctx);
+ if (!conn->xprt_ctx) {
++ if (may_retry--) {
++ pool_gc2();
++ goto retry_connect;
++ }
+ conn->err_code = CO_ER_SSL_NO_MEM;
+ return -1;
+ }
+@@ -2044,6 +2051,10 @@ static int ssl_sock_init(struct connection *conn)
+ if (!SSL_set_fd(conn->xprt_ctx, conn->t.sock.fd)) {
+ SSL_free(conn->xprt_ctx);
+ conn->xprt_ctx = NULL;
++ if (may_retry--) {
++ pool_gc2();
++ goto retry_connect;
++ }
+ conn->err_code = CO_ER_SSL_NO_MEM;
+ return -1;
+ }
+@@ -2052,6 +2063,10 @@ static int ssl_sock_init(struct connection *conn)
+ if (!SSL_set_app_data(conn->xprt_ctx, conn)) {
+ SSL_free(conn->xprt_ctx);
+ conn->xprt_ctx = NULL;
++ if (may_retry--) {
++ pool_gc2();
++ goto retry_connect;
++ }
+ conn->err_code = CO_ER_SSL_NO_MEM;
+ return -1;
+ }
+@@ -2072,9 +2087,16 @@ static int ssl_sock_init(struct connection *conn)
+ return 0;
+ }
+ else if (objt_listener(conn->target)) {
++ int may_retry = 1;
++
++ retry_accept:
+ /* Alloc a new SSL session ctx */
+ conn->xprt_ctx = SSL_new(objt_listener(conn->target)->bind_conf->default_ctx);
+ if (!conn->xprt_ctx) {
++ if (may_retry--) {
++ pool_gc2();
++ goto retry_accept;
++ }
+ conn->err_code = CO_ER_SSL_NO_MEM;
+ return -1;
+ }
+@@ -2083,6 +2105,10 @@ static int ssl_sock_init(struct connection *conn)
+ if (!SSL_set_fd(conn->xprt_ctx, conn->t.sock.fd)) {
+ SSL_free(conn->xprt_ctx);
+ conn->xprt_ctx = NULL;
++ if (may_retry--) {
++ pool_gc2();
++ goto retry_accept;
++ }
+ conn->err_code = CO_ER_SSL_NO_MEM;
+ return -1;
+ }
+@@ -2091,6 +2117,10 @@ static int ssl_sock_init(struct connection *conn)
+ if (!SSL_set_app_data(conn->xprt_ctx, conn)) {
+ SSL_free(conn->xprt_ctx);
+ conn->xprt_ctx = NULL;
++ if (may_retry--) {
++ pool_gc2();
++ goto retry_accept;
++ }
+ conn->err_code = CO_ER_SSL_NO_MEM;
+ return -1;
+ }
+--
+2.0.4
+
--- /dev/null
+From 1f96a87c4e1412ccdc6cfe81bfd6f20a1782886a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Cyril=20Bont=C3=A9?= <cyril.bonte@free.fr>
+Date: Sat, 15 Nov 2014 22:41:27 +0100
+Subject: [PATCH 4/6] BUG/MEDIUM: checks: fix conflicts between agent checks
+ and ssl healthchecks
+
+Lasse Birnbaum Jensen reported an issue when agent checks are used at the same
+time as standard healthchecks when SSL is enabled on the server side.
+
+The symptom is that agent checks try to communicate in SSL while it should
+manage raw data. This happens because the transport layer is shared between all
+kind of checks.
+
+To fix the issue, the transport layer is now stored in each check type,
+allowing to use SSL healthchecks when required, while an agent check should
+always use the raw_sock implementation.
+
+The fix must be backported to 1.5.
+(cherry picked from commit 9ce1311ebc834e20addc7a8392c0fc4e4ad687b7)
+---
+ include/types/checks.h | 3 ++-
+ include/types/server.h | 1 -
+ src/checks.c | 2 +-
+ src/server.c | 2 +-
+ src/ssl_sock.c | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/include/types/checks.h b/include/types/checks.h
+index a50043b..42b7b07 100644
+--- a/include/types/checks.h
++++ b/include/types/checks.h
+@@ -125,6 +125,7 @@ enum {
+ };
+
+ struct check {
++ struct xprt_ops *xprt; /* transport layer operations for health checks */
+ struct connection *conn; /* connection state for health checks */
+ unsigned short port; /* the port to use for the health checks */
+ struct buffer *bi, *bo; /* input and output buffers to send/recv check */
+@@ -132,7 +133,7 @@ struct check {
+ struct timeval start; /* last health check start time */
+ long duration; /* time in ms took to finish last health check */
+ short status, code; /* check result, check code */
+- char desc[HCHK_DESC_LEN]; /* health check descritpion */
++ char desc[HCHK_DESC_LEN]; /* health check description */
+ int use_ssl; /* use SSL for health checks */
+ int send_proxy; /* send a PROXY protocol header with checks */
+ struct tcpcheck_rule *current_step; /* current step when using tcpcheck */
+diff --git a/include/types/server.h b/include/types/server.h
+index 313f58d..c419b40 100644
+--- a/include/types/server.h
++++ b/include/types/server.h
+@@ -194,7 +194,6 @@ struct server {
+
+ struct { /* configuration used by health-check and agent-check */
+ struct protocol *proto; /* server address protocol for health checks */
+- struct xprt_ops *xprt; /* transport layer operations for health checks */
+ struct sockaddr_storage addr; /* the address to check, if different from <addr> */
+ } check_common;
+
+diff --git a/src/checks.c b/src/checks.c
+index 5318f35..84bf0e5 100644
+--- a/src/checks.c
++++ b/src/checks.c
+@@ -1413,7 +1413,7 @@ static int connect_chk(struct task *t)
+
+ /* prepare a new connection */
+ conn_init(conn);
+- conn_prepare(conn, s->check_common.proto, s->check_common.xprt);
++ conn_prepare(conn, s->check_common.proto, check->xprt);
+ conn_attach(conn, check, &check_conn_cb);
+ conn->target = &s->obj_type;
+
+diff --git a/src/server.c b/src/server.c
+index fdb63cc..94a31b6 100644
+--- a/src/server.c
++++ b/src/server.c
+@@ -929,7 +929,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
+
+ newsrv->addr = *sk;
+ newsrv->proto = newsrv->check_common.proto = protocol_by_family(newsrv->addr.ss_family);
+- newsrv->xprt = newsrv->check_common.xprt = &raw_sock;
++ newsrv->xprt = newsrv->check.xprt = newsrv->agent.xprt = &raw_sock;
+
+ if (!newsrv->proto) {
+ Alert("parsing [%s:%d] : Unknown protocol family %d '%s'\n",
+diff --git a/src/ssl_sock.c b/src/ssl_sock.c
+index f50efe5..b73d6f9 100644
+--- a/src/ssl_sock.c
++++ b/src/ssl_sock.c
+@@ -1812,7 +1812,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv, struct proxy *curproxy)
+ if (srv->use_ssl)
+ srv->xprt = &ssl_sock;
+ if (srv->check.use_ssl)
+- srv->check_common.xprt = &ssl_sock;
++ srv->check.xprt = &ssl_sock;
+
+ srv->ssl_ctx.ctx = SSL_CTX_new(SSLv23_client_method());
+ if (!srv->ssl_ctx.ctx) {
+--
+2.0.4
+
--- /dev/null
+From cac307c020db7a938b73d4fef27a3b4ad2ecdf6a Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Tue, 18 Nov 2014 15:04:29 +0100
+Subject: [PATCH 5/6] BUG/MINOR: config: don't inherit the default balance
+ algorithm in frontends
+
+Tom Limoncelli from Stack Exchange reported a minor bug : the frontend
+inherits the LB parameters from the defaults sections. The impact is
+that if a "balance" directive uses any L7 parameter in the defaults
+sections and the frontend is in TCP mode, a warning is emitted about
+their incompatibility. The warning is harmless but a valid, sane config
+should never cause any warning to be reported.
+
+This fix should be backported into 1.5 and possibly 1.4.
+(cherry picked from commit 743c128580ee29c8f073b4a29771a5ce715f3721)
+---
+ src/cfgparse.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/cfgparse.c b/src/cfgparse.c
+index 392a692..40d20ab 100644
+--- a/src/cfgparse.c
++++ b/src/cfgparse.c
+@@ -2003,7 +2003,6 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
+ curproxy->no_options = defproxy.no_options;
+ curproxy->no_options2 = defproxy.no_options2;
+ curproxy->bind_proc = defproxy.bind_proc;
+- curproxy->lbprm.algo = defproxy.lbprm.algo;
+ curproxy->except_net = defproxy.except_net;
+ curproxy->except_mask = defproxy.except_mask;
+ curproxy->except_to = defproxy.except_to;
+@@ -2037,6 +2036,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
+ }
+
+ if (curproxy->cap & PR_CAP_BE) {
++ curproxy->lbprm.algo = defproxy.lbprm.algo;
+ curproxy->fullconn = defproxy.fullconn;
+ curproxy->conn_retries = defproxy.conn_retries;
+ curproxy->max_ka_queue = defproxy.max_ka_queue;
+--
+2.0.4
+
--- /dev/null
+From 8ba50128832bb31e95f06fe4cb2bd172f2b945fe Mon Sep 17 00:00:00 2001
+From: Willy Tarreau <w@1wt.eu>
+Date: Tue, 18 Nov 2014 18:49:19 +0100
+Subject: [PATCH 6/6] BUG/MAJOR: frontend: initialize capture pointers earlier
+
+Denys Fedoryshchenko reported and diagnosed a nasty bug caused by TCP
+captures, introduced in late 1.5-dev by commit 18bf01e ("MEDIUM: tcp:
+add a new tcp-request capture directive"). The problem is that we're
+using the array of capture pointers initially designed for HTTP usage
+only, and that this array was only reset when starting to process an
+HTTP request. In a tcp-only frontend, the pointers are not reset, and
+if the capture pool is shared, we can very well point to whatever other
+memory location, resulting in random crashes when tcp-request content
+captures are processed.
+
+The fix simply consists in initializing these pointers when the pools
+are prepared.
+
+A workaround for existing versions consists in either disabling TCP
+captures in tcp-only frontends, or in forcing the frontends to work in
+HTTP mode.
+
+Thanks to Denys for the amount of testing and detailed reports.
+
+This fix must be backported to 1.5.
+(cherry picked from commit 9654e57fac86c773091b892f42015ba2ba56be5a)
+---
+ src/frontend.c | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/src/frontend.c b/src/frontend.c
+index 3f80774..2928047 100644
+--- a/src/frontend.c
++++ b/src/frontend.c
+@@ -106,11 +106,17 @@ int frontend_accept(struct session *s)
+ if (global.tune.client_rcvbuf)
+ setsockopt(cfd, SOL_SOCKET, SO_RCVBUF, &global.tune.client_rcvbuf, sizeof(global.tune.client_rcvbuf));
+
+- if (unlikely(s->fe->nb_req_cap > 0 && (s->txn.req.cap = pool_alloc2(s->fe->req_cap_pool)) == NULL))
+- goto out_return; /* no memory */
++ if (unlikely(s->fe->nb_req_cap > 0)) {
++ if ((s->txn.req.cap = pool_alloc2(s->fe->req_cap_pool)) == NULL)
++ goto out_return; /* no memory */
++ memset(s->txn.req.cap, 0, s->fe->nb_req_cap * sizeof(void *));
++ }
+
+- if (unlikely(s->fe->nb_rsp_cap > 0 && (s->txn.rsp.cap = pool_alloc2(s->fe->rsp_cap_pool)) == NULL))
+- goto out_free_reqcap; /* no memory */
++ if (unlikely(s->fe->nb_rsp_cap > 0)) {
++ if ((s->txn.rsp.cap = pool_alloc2(s->fe->rsp_cap_pool)) == NULL)
++ goto out_free_reqcap; /* no memory */
++ memset(s->txn.rsp.cap, 0, s->fe->nb_rsp_cap * sizeof(void *));
++ }
+
+ if (s->fe->http_needed) {
+ /* we have to allocate header indexes only if we know
+--
+2.0.4
+
PKG_MAINTAINER:=Bruno Randolf <br1@einfach.org>
PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_PARALLEL:=1
PKG_SOURCE_URL:=http://lftp.yar.ru/ftp \ http://lftp.cybermirror.org \ http://lftp.cybermirror.org/old
PKG_MD5SUM:=e58fc886e3d7c6d994de5ce51de46087
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING
+
include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
PKG_MD5SUM:=c7ae774eab4cb7ac85e41b712f4ee9ba
PKG_LICENSE:=BSD-3c
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
--- /dev/null
+#
+# Copyright (C) 2010 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=luci-app-bcp38
+PKG_VERSION:=2
+PKG_RELEASE:=1
+PKG_LICENSE:=Apache-2.0
+LUCI_DIR:=/usr/lib/lua/luci
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/luci-app-bcp38
+ SECTION:=luci
+ CATEGORY:=LuCI
+ TITLE:=BCP38 LuCI interface
+ MAINTAINER:=Toke Høiland-Jørgensen <toke@toke.dk>
+ PKGARCH:=all
+ DEPENDS:= lua luci-base +bcp38
+ SUBMENU:=3. Applications
+endef
+
+define Package/luci-app-bcp38/description
+ Control BCP38 subnet blocking
+endef
+
+define Build/Compile
+endef
+
+define Build/Configure
+endef
+
+define Package/luci-app-bcp38/install
+ $(INSTALL_DIR) $(1)$(LUCI_DIR)/controller $(1)$(LUCI_DIR)/model/cbi
+ $(INSTALL_DATA) ./files/bcp38-controller.lua $(1)$(LUCI_DIR)/controller/bcp38.lua
+ $(INSTALL_DATA) ./files/bcp38-cbi.lua $(1)$(LUCI_DIR)/model/cbi/bcp38.lua
+ $(INSTALL_DIR) $(1)/etc/uci-defaults
+ $(INSTALL_BIN) ./files/uci-defaults-bcp38 $(1)/etc/uci-defaults/luci-bcp38
+endef
+
+define Package/luci-app-bcp38/postinst
+#!/bin/sh
+[ -x /etc/uci-defaults/luci-bcp38 ] && /etc/uci-defaults/luci-bcp38 || exit 0
+endef
+
+define Package/luci-app-bcp38/postrm
+#!/bin/sh
+uci delete ucitrack.@bcp38[0]
+uci commit
+endef
+
+$(eval $(call BuildPackage,luci-app-bcp38))
--- /dev/null
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2014 Toke Høiland-Jørgensen <toke@toke.dk>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+local wa = require "luci.tools.webadmin"
+local net = require "luci.model.network".init()
+local ifaces = net:get_interfaces()
+
+m = Map("bcp38", translate("BCP38"),
+ translate("This function blocks packets with private address destinations " ..
+ "from going out onto the internet as per " ..
+ "<a href=\"http://tools.ietf.org/html/bcp38\">BCP 38</a>."))
+
+s = m:section(TypedSection, "bcp38", translate("BCP38 config"))
+s.anonymous = true
+-- BASIC
+e = s:option(Flag, "enabled", translate("Enable"))
+e.rmempty = false
+
+a = s:option(Flag, "detect_upstream", translate("Auto-detect upstream IP"),
+ translate("Attempt to automatically detect if the upstream IP " ..
+ "will be blocked by the configuration, and add an exception if it will. " ..
+ "If this does not work correctly, you can add exceptions manually below."))
+a.rmempty = false
+
+n = s:option(ListValue, "interface", translate("Interface name"), translate("Interface to apply the blocking to " ..
+ "(should be the upstream WAN interface)."))
+for _, iface in ipairs(ifaces) do
+ if iface:is_up() then
+ n:value(iface:name())
+ end
+end
+n.rmempty = false
+
+ma = s:option(DynamicList, "match",
+ translate("Blocked IP ranges"))
+
+ma.datatype = "ip4addr"
+
+nm = s:option(DynamicList, "nomatch",
+ translate("Allowed IP ranges"), translate("Takes precedence over blocked ranges. "..
+ "Use to whitelist your upstream network if you're behind a double NAT " ..
+ "and the auto-detection doesn't work."))
+
+nm.datatype = "ip4addr"
+
+
+return m
--- /dev/null
+module("luci.controller.bcp38", package.seeall)
+
+function index()
+ entry({"admin", "network", "firewall", "bcp38"},
+ cbi("bcp38"),
+ _("BCP38"), 50).dependent = false
+end
--- /dev/null
+#!/bin/sh
+
+uci -q batch <<-EOF >/dev/null
+ delete ucitrack.@bcp38[-1]
+ add ucitrack bcp38
+ add_list ucitrack.@bcp38[0].affects=firewall
+ commit ucitrack
+EOF
+
+rm -f /tmp/luci-indexcache
+exit 0
PKG_VERSION:=1.3.5
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=LICENSE.txt
+PKG_LICENSE_FILES:=LICENSE.txt
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://mosquitto.org/files/source/
PKG_SOURCE_URL:=http://nmap.org/dist/
PKG_MD5SUM:=edfe81f6763223c0a29bfa15a8526e2a
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
#
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
PKG_SOURCE_URL:=http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/
PKG_MD5SUM:=00df80a84ec9528fcfb09498075525bc
+PKG_LICENSE:=Unique
+PKG_LICENSE_FILES:=COPYRIGHT html/copyright.html
+
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_FIXUP:=autoreconf
define Package/ntpd/Default/description
The ISC ntp suite is a collection of tools used to synchronize the
- system clock with remote NTP time servers and run/montior local NTP
+ system clock with remote NTP time servers and run/monitor local NTP
servers.
endef
bool "use external libprotobuf"
default y
+config OCSERV_HTTP_PARSER
+ bool "use external libhttp-parser"
+ default y
+
endmenu
include $(TOPDIR)/rules.mk
PKG_NAME:=ocserv
-PKG_VERSION:=0.8.7
-PKG_RELEASE:=1
+PKG_VERSION:=0.8.8
+PKG_RELEASE:=2
PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL :=ftp://ftp.infradead.org/pub/ocserv/
-PKG_MD5SUM:=79c00132c3366bb60546f256068211eb
+PKG_MD5SUM:=d9b12a3fa976dfda3e4c0238173744e6
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=COPYING
TITLE:=OpenConnect VPN server
URL:=http://www.infradead.org/ocserv/
MAINTAINER:=Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com>
- DEPENDS:= +libgnutls +certtool +libncurses +libreadline +OCSERV_PAM:libpam +OCSERV_PROTOBUF:libprotobuf-c
+ DEPENDS:= +OCSERV_HTTP_PARSER:libhttp-parser +libgnutls +certtool +libncurses +libreadline +OCSERV_PAM:libpam +OCSERV_PROTOBUF:libprotobuf-c
USERID:=ocserv=72:ocserv=72
endef
CONFIGURE_ARGS += --without-protobuf
endif
+ifneq ($(CONFIG_OCSERV_HTTP_PARSER),y)
+CONFIGURE_ARGS += --without-http-parser
+endif
+
define Package/ocserv/conffiles
/etc/config/ocserv
endef
--- /dev/null
+From ef48fe731f8b43c58b9580a048d793a69bd5a903 Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
+Date: Sat, 29 Nov 2014 19:44:03 +0100
+Subject: [PATCH] use define _XOPEN_SOURCE to get crypt()
+
+---
+ configure.ac | 3 ++-
+ src/auth/plain.c | 3 +++
+ src/ocpasswd.c | 3 +++
+ 3 files changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8bb0044..622929d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -190,7 +190,8 @@ fi
+
+ gl_INIT
+
+-AC_LIB_HAVE_LINKFLAGS(crypt,, [#include <unistd.h>], [crypt(0,0);])
++AC_LIB_HAVE_LINKFLAGS(crypt,, [#define _XOPEN_SOURCE
++#include <unistd.h>], [crypt(0,0);])
+
+ AC_ARG_WITH(utmp,
+ AS_HELP_STRING([--without-utmp], [do not use libutil for utmp support]),
+diff --git a/src/auth/plain.c b/src/auth/plain.c
+index f429ef4..0e13241 100644
+--- a/src/auth/plain.c
++++ b/src/auth/plain.c
+@@ -22,6 +22,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#ifndef _XOPEN_SOURCE
++# define _XOPEN_SOURCE
++#endif
+ #include <unistd.h>
+ #include <vpn.h>
+ #include <c-ctype.h>
+diff --git a/src/ocpasswd.c b/src/ocpasswd.c
+index 8b33d76..aced94a 100644
+--- a/src/ocpasswd.c
++++ b/src/ocpasswd.c
+@@ -23,6 +23,9 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <stdint.h>
++#ifndef _XOPEN_SOURCE
++# define _XOPEN_SOURCE
++#endif
+ #include <unistd.h>
+ #include <gnutls/gnutls.h>
+ #include <gnutls/crypto.h> /* for random */
+--
+2.1.3
+
include $(TOPDIR)/rules.mk
PKG_NAME:=openconnect
-PKG_VERSION:=6.00
-PKG_RELEASE:=4
+PKG_VERSION:=7.00
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/
-PKG_MD5SUM:=7e28e23c6e281be31446e6c365f5d273
+PKG_MD5SUM:=208b03fb66cd8e26633a19b9e12f35af
PKG_CONFIG_DEPENDS:= \
CONFIG_OPENCONNECT_GNUTLS \
CONFIGURE_ARGS += \
--disable-shared \
- --with-vpnc-script=/lib/netifd/vpnc-script
+ --with-vpnc-script=/lib/netifd/vpnc-script \
+ --without-libpcsclite
ifeq ($(CONFIG_OPENCONNECT_OPENSSL),y)
CONFIGURE_ARGS += \
cmdline="$server$port -i vpn-$config --non-inter --syslog --script /lib/netifd/vpnc-script"
- [ -f /etc/openconnect/ca-vpn-$config.pem ] && append cmdline "--cafile /etc/openconnect/ca-vpn-$config.pem"
+ [ -f /etc/openconnect/ca-vpn-$config.pem ] && append cmdline "--no-system-trust --cafile /etc/openconnect/ca-vpn-$config.pem"
[ -f /etc/openconnect/user-cert-vpn-$config.pem ] && append cmdline "-c /etc/openconnect/user-cert-vpn-$config.pem"
[ -f /etc/openconnect/user-key-vpn-$config.pem ] && append cmdline "--sslkey /etc/openconnect/user-key-vpn-$config.pem"
- [ -n "$serverhash" ] && append cmdline "--servercert=$serverhash"
+ [ -n "$serverhash" ] && append cmdline "--no-system-trust --servercert=$serverhash"
[ -n "$authgroup" ] && append cmdline "--authgroup $authgroup"
[ -n "$username" ] && append cmdline "-u $username"
[ -n "$password" ] && {
+++ /dev/null
-From 826ad45a86f1556910c2f00dfa6477879deb978f Mon Sep 17 00:00:00 2001
-From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Date: Thu, 24 Jul 2014 21:59:01 +0200
-Subject: [PATCH] Added a default timeout value in CSTP handshake using gnutls
-
-[dwmw2: move it to openconnect_open_https() so it's done only once]
-
-Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
-Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
----
- gnutls.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/gnutls.c b/gnutls.c
-index 3e3204a..2ef836c 100644
---- a/gnutls.c
-+++ b/gnutls.c
-@@ -2017,6 +2017,10 @@ int openconnect_open_https(struct openconnect_info *vpninfo)
- vpn_progress(vpninfo, PRG_INFO, _("SSL negotiation with %s\n"),
- vpninfo->hostname);
-
-+#ifdef GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT
-+ gnutls_handshake_set_timeout(vpninfo->https_sess,
-+ GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
-+#endif
-
- err = cstp_handshake(vpninfo, 1);
- if (err)
---
-2.0.0
-
--- /dev/null
+diff --git a/cstp.c b/cstp.c
+index b1235ef..f955b82 100644
+--- a/cstp.c
++++ b/cstp.c
+@@ -570,7 +570,10 @@ int openconnect_make_cstp_connection(struct openconnect_info *vpninfo)
+ return ret;
+ }
+
+-static int cstp_reconnect(struct openconnect_info *vpninfo)
++/* When dead peer is set, this function will re-attempt resolving
++ * the peer in case its IP changed.
++ */
++static int cstp_reconnect(struct openconnect_info *vpninfo, unsigned dead_peer)
+ {
+ int ret;
+ int timeout;
+@@ -591,6 +594,16 @@ static int cstp_reconnect(struct openconnect_info *vpninfo)
+ timeout = vpninfo->reconnect_timeout;
+ interval = vpninfo->reconnect_interval;
+
++ /* handle cases with dynamic DNS by forcing a new resolve.
++ * The original IP is saved to retry as fallback if resolving
++ * fails.
++ */
++ if (dead_peer && vpninfo->first_peer_addr == NULL) {
++ vpninfo->first_peer_addr = vpninfo->peer_addr;
++ vpninfo->first_peer_addrlen = vpninfo->peer_addrlen;
++ vpninfo->peer_addr = NULL;
++ }
++
+ while ((ret = openconnect_make_cstp_connection(vpninfo))) {
+ if (timeout <= 0)
+ return ret;
+@@ -611,6 +624,11 @@ static int cstp_reconnect(struct openconnect_info *vpninfo)
+ interval += vpninfo->reconnect_interval;
+ if (interval > RECONNECT_INTERVAL_MAX)
+ interval = RECONNECT_INTERVAL_MAX;
++
++ if (dead_peer && vpninfo->first_peer_addr != NULL) {
++ free(vpninfo->peer_addr);
++ vpninfo->peer_addr = NULL;
++ }
+ }
+ script_config_tun(vpninfo, "reconnect");
+ return 0;
+@@ -903,8 +921,15 @@ int cstp_mainloop(struct openconnect_info *vpninfo, int *timeout)
+ /* Not that this will ever happen; we don't even process
+ the setting when we're asked for it. */
+ vpn_progress(vpninfo, PRG_INFO, _("CSTP rekey due\n"));
+- if (vpninfo->ssl_times.rekey_method == REKEY_TUNNEL)
+- goto do_reconnect;
++ if (vpninfo->ssl_times.rekey_method == REKEY_TUNNEL) {
++ ret = cstp_reconnect(vpninfo, 0);
++ if (ret) {
++ vpn_progress(vpninfo, PRG_ERR, _("Reconnect failed\n"));
++ vpninfo->quit_reason = "CSTP reconnect failed";
++ return ret;
++ }
++ goto do_dtls_reconnect;
++ }
+ else if (vpninfo->ssl_times.rekey_method == REKEY_SSL) {
+ ret = cstp_handshake(vpninfo, 0);
+ if (ret) {
+@@ -922,7 +947,7 @@ int cstp_mainloop(struct openconnect_info *vpninfo, int *timeout)
+ vpn_progress(vpninfo, PRG_ERR,
+ _("CSTP Dead Peer Detection detected dead peer!\n"));
+ do_reconnect:
+- ret = cstp_reconnect(vpninfo);
++ ret = cstp_reconnect(vpninfo, 1);
+ if (ret) {
+ vpn_progress(vpninfo, PRG_ERR, _("Reconnect failed\n"));
+ vpninfo->quit_reason = "CSTP reconnect failed";
+diff --git a/library.c b/library.c
+index f5d3dc9..7c8d5ec 100644
+--- a/library.c
++++ b/library.c
+@@ -178,6 +178,7 @@ void openconnect_vpninfo_free(struct openconnect_info *vpninfo)
+ CloseHandle(vpninfo->dtls_event);
+ #endif
+ free(vpninfo->peer_addr);
++ free(vpninfo->first_peer_addr);
+ free_optlist(vpninfo->csd_env);
+ free_optlist(vpninfo->script_env);
+ free_optlist(vpninfo->cookies);
+@@ -291,6 +292,8 @@ int openconnect_set_hostname(struct openconnect_info *vpninfo,
+ vpninfo->unique_hostname = NULL;
+ free(vpninfo->peer_addr);
+ vpninfo->peer_addr = NULL;
++ free(vpninfo->first_peer_addr);
++ vpninfo->first_peer_addr = NULL;
+
+ return 0;
+ }
+diff --git a/openconnect-internal.h b/openconnect-internal.h
+index 1bc79e5..cafbb3c 100644
+--- a/openconnect-internal.h
++++ b/openconnect-internal.h
+@@ -424,6 +424,9 @@ struct openconnect_info {
+ struct sockaddr *peer_addr;
+ struct sockaddr *dtls_addr;
+
++ struct sockaddr *first_peer_addr;
++ socklen_t first_peer_addrlen;
++
+ int dtls_local_port;
+
+ int deflate;
+diff --git a/ssl.c b/ssl.c
+index b50652d..e341871 100644
+--- a/ssl.c
++++ b/ssl.c
+@@ -110,6 +110,7 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+ {
+ int ssl_sock = -1;
+ int err;
++ unsigned retry_old_ip = 0;
+
+ if (!vpninfo->port)
+ vpninfo->port = 443;
+@@ -230,6 +231,8 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+ if (hints.ai_flags & AI_NUMERICHOST)
+ free(hostname);
+ ssl_sock = -EINVAL;
++ if (vpninfo->first_peer_addr != NULL)
++ retry_old_ip = 1;
+ goto out;
+ }
+ if (hints.ai_flags & AI_NUMERICHOST)
+@@ -291,7 +294,10 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+ }
+ freeaddrinfo(result);
+
++
+ if (ssl_sock < 0) {
++ if (vpninfo->first_peer_addr != NULL)
++ retry_old_ip = 1;
+ vpn_progress(vpninfo, PRG_ERR,
+ _("Failed to connect to host %s\n"),
+ vpninfo->proxy?:vpninfo->hostname);
+@@ -314,6 +320,21 @@ int connect_https_socket(struct openconnect_info *vpninfo)
+ }
+ }
+ out:
++ if (retry_old_ip != 0 && vpninfo->first_peer_addr != NULL) {
++ vpn_progress(vpninfo, PRG_ERR,
++ _("Retrying connection to host %s with original IP\n"),
++ vpninfo->proxy?:vpninfo->hostname);
++
++ retry_old_ip = 0;
++ if (vpninfo->first_peer_addrlen > vpninfo->peer_addrlen || vpninfo->peer_addr == NULL)
++ realloc_inplace(vpninfo->peer_addr, vpninfo->first_peer_addrlen);
++
++ if (vpninfo->peer_addr != NULL) {
++ memcpy(vpninfo->peer_addr, vpninfo->first_peer_addr, vpninfo->first_peer_addrlen);
++ goto reconnect;
++ }
++ }
++
+ /* If proxy processing returned -EAGAIN to reconnect before attempting
+ further auth, and we failed to reconnect, we have to clean up here. */
+ cleanup_proxy_auth(vpninfo);
PKG_MD5SUM:=3246aa79317b1d23cae783a3bf8275d6
PKG_LICENSE:=BSD ISC
-PKG_LICENSE_FILE:=LICENCE
+PKG_LICENSE_FILES:=LICENCE
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
include $(TOPDIR)/rules.mk
PKG_NAME:=opentracker
-PKG_VERSION:=20130804
+PKG_VERSION:=20141007
PKG_RELEASE:=1
-PKG_REV:=954f5029dfa17734dc408336ef710c192268e8a4
+PKG_REV:=6c60309745ced3c121a2c5c7d80ed85a573b848e
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=Beerware
-Index: opentracker-20130804/Makefile
-===================================================================
---- opentracker-20130804.orig/Makefile
-+++ opentracker-20130804/Makefile
+--- a/Makefile
++++ b/Makefile
@@ -9,13 +9,13 @@ CC?=gcc
# BSD flavour
PKG_VERSION:=2.3.0
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_LICENSE:=Apache-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_USE_MIPS16:=0
PKG_SOURCE_PROTO:=git
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_MAINTAINER:= Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0 OpenSSL
-PKG_LICENSE_FILE:=COPYING COPYING.OpenSSL
+PKG_LICENSE_FILES:=COPYING COPYING.OpenSSL
PKG_INSTALL:=1
PKG_NAME:=sqm-scripts
PKG_VERSION:=7
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_LICENSE:=GPLv2
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
endef
define Package/sqm-scripts/install
- $(INSTALL_DIR) $(1)
- $(CP) ./files/* $(1)/
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/etc/init.d/sqm $(1)/etc/init.d/sqm
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/etc/config/sqm $(1)/etc/config/sqm
+ $(INSTALL_DIR) $(1)/usr/lib/sqm
+ $(INSTALL_BIN) ./files/usr/lib/sqm/*.sh $(1)/usr/lib/sqm/
+ $(INSTALL_BIN) ./files/usr/lib/sqm/*.qos $(1)/usr/lib/sqm/
+ $(INSTALL_DATA) ./files/usr/lib/sqm/*.help $(1)/usr/lib/sqm/
endef
$(eval $(call BuildPackage,sqm-scripts))
PKG_MD5SUM:=55126473bcde635f9ee019c6caf19bb7
PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
PKG_VERSION:=1.0.48
PKG_REV:=22d9567f39e5eb8a794ce2cb5a2190abdbecaa1f
PKG_RELEASE:=1
+PKG_USE_MIPS16:=0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/fujita/tgt.git
https://archive.torproject.org/tor-package-archive
PKG_MD5SUM:=9acb86b529f0f48cc495da3801f85d1f
PKG_MAINTAINER:=Hauke Mehrtens <hauke@hauke-m.de>
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
PKG_BUILD_DEPENDS:=libminiupnpc libnatpmp
PKG_INSTALL:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
include $(INCLUDE_DIR)/package.mk
PKG_MD5SUM:=7c71ec460dfea5287eba27472c521ebc
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_FIXUP:=autoreconf
PKG_RELEASE:=1
PKG_LICENSE:=BSD-3-Clause
-PKG_LICENSE_FILE:=LICENSE
+PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Michael Hanselmann <public@hansmi.ch>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_NAME:=znc
PKG_VERSION:=1.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://znc.in/releases \
define Package/znc
$(Package/znc/default)
- DEPENDS:=+libopenssl +libpthread $(CXX_DEPENDS)
+ DEPENDS:=+libopenssl +libpthread +libstdcpp
MENU:=1
endef
PKG_CONFIG_DEPENDS := $(patsubst %,CONFIG_PACKAGE_%,$(ZNC_MODULES))
-include $(INCLUDE_DIR)/uclibc++.mk
include $(INCLUDE_DIR)/package.mk
CONFIGURE_VARS += \
- CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti -nostdinc++" \
+ CXXFLAGS="$(TARGET_CFLAGS) -fno-builtin -fno-rtti" \
CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
LDFLAGS="-nodefaultlibs -lc -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib" \
- LIBS="-luClibc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
+ LIBS="-lstdc++ -lm -lssl -lcrypto $(LIBGCC_S) -lc"
CONFIGURE_ARGS += \
--disable-c-ares \
+++ /dev/null
-From fa14938321eda39f16bee6068296e6abc9df7b85 Mon Sep 17 00:00:00 2001
-From: Jonas Gorski <jonas.gorski+openwrt@gmail.com>
-Date: Wed, 6 Apr 2011 04:11:48 +0200
-Subject: [PATCH] Add a uClibc++ build workaround
-
----
- modules/webadmin.cpp | 4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
---- a/modules/webadmin.cpp
-+++ b/modules/webadmin.cpp
-@@ -20,6 +20,7 @@
- #include <znc/IRCNetwork.h>
- #include <znc/IRCSock.h>
-
-+using std::string;
- using std::stringstream;
- using std::make_pair;
- using std::set;
-@@ -75,7 +76,7 @@ class CWebAdminMod : public CModule {
- public:
- MODCONSTRUCTOR(CWebAdminMod) {
- VPair vParams;
-- vParams.push_back(make_pair("user", ""));
-+ vParams.push_back(make_pair((string)"user", (string)""));
- AddSubPage(new CWebSubPage("settings", "Global Settings", CWebSubPage::F_ADMIN));
- AddSubPage(new CWebSubPage("edituser", "Your Settings", vParams));
- AddSubPage(new CWebSubPage("traffic", "Traffic Info", CWebSubPage::F_ADMIN));
+++ /dev/null
-diff --git a/modules/certauth.cpp b/modules/certauth.cpp
-index 61e5687..4857d59 100644
---- a/modules/certauth.cpp
-+++ b/modules/certauth.cpp
-@@ -204,7 +204,7 @@ public:
- return;
- }
-
-- SCString::const_iterator it2 = it->second.begin();
-+ SCString::iterator it2 = it->second.begin();
- while (id > 1) {
- ++it2;
- id--;
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_PARALLEL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=ccid
-PKG_VERSION:=1.4.17
+PKG_VERSION:=1.4.18
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4091
-PKG_MD5SUM:=a227a20a0dd034cd4bb7400806a0a2d0
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4111
+PKG_MD5SUM:=8d57342bda53aaee706ef2d02409c4f4
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=MIT
-PKG_LICENSE_FILE:=doc/COPYING
+PKG_LICENSE_FILES:=doc/COPYING
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=coreutils
-PKG_VERSION:=8.16
+PKG_VERSION:=8.23
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@GNU/coreutils
-PKG_MD5SUM:=89b06f91634208dceba7b36ad1f9e8b9
+PKG_MD5SUM:=abed135279f87ad6762ce57ff6d89c41
PKG_BUILD_DEPENDS:=libpthread
PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
DEPENDS_timeout = +librt
DEPENDS_expr = +libgmp
DEPENDS_factor = +libgmp
+DEPENDS_cp = +libacl
+DEPENDS_dir = +libacl
+DEPENDS_install = +libacl
+DEPENDS_ls = +libacl
+DEPENDS_mv = +libacl
+DEPENDS_vdir = +libacl
define Package/coreutils/Default
SECTION:=utils
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
SHELL="/bin/bash" \
- all install install-root
+ all install
endef
define Package/coreutils/install
ALL_RECURSIVE_TARGETS =
--SUBDIRS = lib src doc man po tests gnulib-tests
-+SUBDIRS = lib src po
+-SUBDIRS = po . gnulib-tests
++SUBDIRS = po
changelog_etc = \
ChangeLog-2005 \
+@@ -213,6 +213,4 @@ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib
+
+ include $(top_srcdir)/lib/local.mk
+ include $(top_srcdir)/src/local.mk
+-include $(top_srcdir)/doc/local.mk
+-include $(top_srcdir)/man/local.mk
+-include $(top_srcdir)/tests/local.mk
++
--- a/Makefile.in
+++ b/Makefile.in
-@@ -1639,7 +1639,7 @@ top_srcdir = @top_srcdir@
-
- # Some tests always need root privileges, others need them only sometimes.
- ALL_RECURSIVE_TARGETS = install-root check-root distcheck-hook
--SUBDIRS = lib src doc man po tests gnulib-tests
-+SUBDIRS = lib src po
+@@ -159,8 +159,7 @@ build_triplet = @build@
+ host_triplet = @host@
+ DIST_COMMON = $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk \
+ $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk \
+- $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk \
+- $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk \
++ $(top_srcdir)/src/single-binary.mk \
+ INSTALL NEWS README AUTHORS ChangeLog $(srcdir)/Makefile.in \
+ $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(top_srcdir)/lib/config.hin ABOUT-NLS \
+@@ -2276,11 +2275,7 @@ RECURSIVE_TARGETS = all-recursive check-
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+-am__can_run_installinfo = \
+- case $$AM_UPDATE_INFO_DIR in \
+- n|no|NO) false;; \
+- *) (install-info --version) >/dev/null 2>&1;; \
+- esac
++am__can_run_installinfo = false
+ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+ am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+@@ -2606,7 +2601,7 @@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ ERRNO_H = @ERRNO_H@
+ EXEEXT = @EXEEXT@
+-EXTRA_MANS = @EXTRA_MANS@
++EXTRA_MANS =
+ FLOAT_H = @FLOAT_H@
+ FNMATCH_H = @FNMATCH_H@
+ GETADDRINFO_LIB = @GETADDRINFO_LIB@
+@@ -3820,7 +3815,7 @@ libexecdir = @libexecdir@
+ lispdir = @lispdir@
+ localedir = @localedir@
+ localstatedir = @localstatedir@
+-man1_MANS = @man1_MANS@
++man1_MANS =
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ oldincludedir = @oldincludedir@
+@@ -3843,7 +3838,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ ALL_RECURSIVE_TARGETS = distcheck-hook check-root
+-SUBDIRS = po . gnulib-tests
++SUBDIRS = po
changelog_etc = \
ChangeLog-2005 \
ChangeLog-2006 \
+@@ -5767,7 +5762,7 @@ all: $(BUILT_SOURCES)
+ .SUFFIXES: .1 .c .dvi .log .o .obj .pl .pl$(EXEEXT) .ps .sed .sh .sh$(EXEEXT) .sin .trs .x .xpl .xpl$(EXEEXT) .y
+ am--refresh: Makefile
+ @:
+-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk $(am__configure_deps)
++$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+@@ -5790,7 +5785,7 @@ Makefile: $(srcdir)/Makefile.in $(top_bu
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+-$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk $(top_srcdir)/doc/local.mk $(top_srcdir)/man/local.mk $(top_srcdir)/tests/local.mk:
++$(top_srcdir)/lib/local.mk $(srcdir)/lib/gnulib.mk $(top_srcdir)/src/local.mk $(srcdir)/src/cu-progs.mk $(top_srcdir)/src/single-binary.mk:
+
+ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
--- a/lib/pthread.in.h
+++ b/lib/pthread.in.h
-@@ -232,6 +232,9 @@ pthread_mutex_unlock (pthread_mutex_t *m
+@@ -252,6 +252,9 @@ pthread_mutex_unlock (pthread_mutex_t *m
/* Approximate spinlocks with mutexes. */
+#endif
typedef pthread_mutex_t pthread_spinlock_t;
- static inline int
+ _GL_PTHREAD_INLINE int
+++ /dev/null
-diff --git a/lib/stdio.in.h b/lib/stdio.in.h
-index 9dc7c4a..9fdac77 100644
---- a/lib/stdio.in.h
-+++ b/lib/stdio.in.h
-@@ -711,10 +711,6 @@ _GL_CXXALIAS_SYS (gets, char *, (char *s));
- # undef gets
- # endif
- _GL_CXXALIASWARN (gets);
--/* It is very rare that the developer ever has full control of stdin,
-- so any use of gets warrants an unconditional warning. Assume it is
-- always declared, since it is required by C89. */
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
- #endif
-
-
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
+include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
TARGET_LDFLAGS+= \
ac_cv_have_abstract_sockets="yes" \
ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
+HOST_CONFIGURE_ARGS+= \
+ --enable-shared \
+ --enable-static \
+ --disable-abstract-sockets \
+ --disable-ansi \
+ --disable-asserts \
+ --disable-console-owner-file \
+ --disable-docygen-docs \
+ --disable-compiler_coverage \
+ --disable-selinux \
+ --disable-tests \
+ --disable-verbose-mode \
+ --disable-xml-docs \
+ --with-dbus-user=root \
+ --with-dbus-daemondir="$(STAGIND_DIR_HOST)/bin" \
+ --with-system-socket="$(STAGING_DIR_HOST)/var/run/dbus/system_bus_socket" \
+ --with-system-pid-file="$(STAGING_DIR_HOST)/var/run/dbus.pid" \
+ --without-x \
+ --libexecdir="$(STAGING_DIR_HOST)/lib/dbus-1"
+
+HOST_CONFIGURE_VARS+= \
+ ac_cv_have_abstract_sockets="yes" \
+ ac_cv_lib_expat_XML_ParserCreate_MM="yes" \
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(1)/usr/bin/
endef
+$(eval $(call HostBuild))
$(eval $(call BuildPackage,libdbus))
$(eval $(call BuildPackage,dbus))
$(eval $(call BuildPackage,dbus-utils))
include $(TOPDIR)/rules.mk
PKG_NAME:=dump1090
-PKG_VERSION:=2014-10-27
+PKG_VERSION:=2014-11-09
PKG_RELEASE:=$(PKG_SOURCE_VERSION)
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=git://github.com/MalcolmRobb/dump1090.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=65751ed6e9e20dcd6ab4e693cc5c80c698664da8
+PKG_SOURCE_VERSION:=bff92c4ad772a0a8d433f788d39dae97e00e4dbe
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
option modeac '0'
option net_beast '0'
option net_only '0'
+ option net_bind_address ''
option net_http_port '8080'
option net_ri_port ''
option net_ro_port ''
append_bool "$cfg" modeac "--modeac"
append_bool "$cfg" net_beast "--net-beast"
append_bool "$cfg" net_only "--net-only"
+ append_arg "$cfg" net_bind_address "--net-bind-address"
append_arg "$cfg" net_http_port "--net-http-port"
append_arg "$cfg" net_ri_port "--net-ri-port"
append_arg "$cfg" net_ro_port "--net-ro-port"
PKG_MD5SUM:=54db1be9588b11afbbdd8b82d4ea883a
PKG_LICENSE:=GPL-3.0
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_INSTALL:=1
PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com>
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=
+PKG_LICENSE_FILES:=
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)
--- /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:=hdparm
+PKG_VERSION:=9.45
+PKG_RELEASE:=1
+PKG_USE_MIPS16:=0
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@SF/$(PKG_NAME)
+PKG_MD5SUM:=1c75d0751a44928b6c4bc81fb16d7fe8
+PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
+PKG_LICENSE:=BSD-Style Open Source License
+
+include $(INCLUDE_DIR)/package.mk
+
+TARGET_CFLAGS+=-D_GNU_SOURCE
+
+define Package/hdparm
+ SECTION:=utils
+ CATEGORY:=Utilities
+ SUBMENU:=disc
+ TITLE:=Hard disk drive configuration utilitity
+ URL:=http://sourceforge.net/projects/hdparm/
+endef
+
+define Package/hdparm/description
+ get/set SATA/IDE device parameters
+endef
+
+define Package/hdparm/install
+ $(INSTALL_DIR) $(1)/sbin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/sbin
+endef
+
+$(eval $(call BuildPackage,hdparm))
--- /dev/null
+--- a/hdparm.h
++++ b/hdparm.h
+@@ -2,6 +2,7 @@
+
+ //#undef __KERNEL_STRICT_NAMES
+ #include <linux/types.h>
++#include <sys/types.h>
+
+ #if !defined(__GNUC__) && !defined(__attribute__)
+ #define __attribute__(x)
+--- a/sysfs.c
++++ b/sysfs.c
+@@ -12,6 +12,7 @@
+ #include <stdio.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <limits.h>
+ #include <dirent.h>
+ #include <sys/stat.h>
+ #include <linux/types.h>
PKG_NAME:=luci-app-lxc
PKG_RELEASE:=20141012
+PKG_LICENSE:=Apache-2.0
+
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
CATEGORY:=LuCI
SUBMENU:=3. Applications
TITLE:=LXC management Web UI
- DEPENDS:=+luci-mod-admin-full +lxc +liblxc +rpcd-mod-lxc
+ DEPENDS:=+luci-mod-admin-full +lxc +lxc-create +liblxc +rpcd-mod-lxc
MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr>
endef
local target = _G.DISTRIB_TARGET:match('([^/]+)')
- local res = os.execute("lxc-create -t download -n " .. lxc_name .. " -- --server=" .. url .. " --no-validate --dist " .. lxc_template .. " --release bb --arch " .. target)
+ local data = conn:call("lxc", "create", { name = lxc_name, template = "download", args = { "--server", url, "--no-validate", "--dist", lxc_template, "--release", "bb", "--arch", target } } )
- luci.http.write(tostring(res))
+ luci.http.write(data)
end
function lxc_action(lxc_action, lxc_name)
include $(TOPDIR)/rules.mk
PKG_NAME:=LVM2
-PKG_VERSION:=2.02.111
+PKG_VERSION:=2.02.113
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0 LGPL-2.1
PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz
PKG_SOURCE_URL:=ftp://sources.redhat.com/pub/lvm2
-PKG_MD5SUM:=02487ab2a9e02d1ee76fe217183df28a
+PKG_MD5SUM:=f71aa8e64030f3d2a3fdabcc36e45094
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME).$(PKG_VERSION)
--- a/make.tmpl.in
+++ b/make.tmpl.in
-@@ -19,7 +19,7 @@
+@@ -19,7 +19,7 @@ SHELL = /bin/sh
# Allow environment to override any built-in default value for CC.
# If there is a built-in default, CC is NOT set to @CC@ here.
-diff -urN LVM2.2.02.111.old/lib/device/dev-type.c LVM2.2.02.111/lib/device/dev-type.c
---- LVM2.2.02.111.old/lib/device/dev-type.c 2014-09-17 09:41:08.281821278 -0400
-+++ LVM2.2.02.111/lib/device/dev-type.c 2014-09-17 09:41:50.773821280 -0400
+--- a/lib/device/dev-type.c
++++ b/lib/device/dev-type.c
@@ -22,7 +22,7 @@
#include <ctype.h>
PKG_VERSION:=1.0.6
PKG_RELEASE:=1
+PKG_LICENSE:=LGPL-2.1+ BSD-2-Clause GPL-2.0
+
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/
PKG_MD5SUM:=4aad3aee84b42faa194e44091d723a3b
DEPENDS_APPLETS = +libpthread +libcap +liblxc
+DEPENDS_create = +lxc-configs +lxc-hooks +lxc-templates
DEPENDS_ls = +lxc-config
DEPENDS_top = +lxc-lua +luafilesystem @BROKEN
$(INSTALL_DIR) $(1)/etc/lxc/
$(CP) \
$(PKG_INSTALL_DIR)/etc/lxc/default.conf \
+ $(1)/etc/lxc/default.conf
+
+ $(INSTALL_DIR) $(1)/etc/lxc/
+ $(CP) \
+ ./files/lxc.conf \
$(1)/etc/lxc/lxc.conf
$(INSTALL_DIR) $(1)/lxc/
--- /dev/null
+lxc.lxcpath = /lxc
+++ /dev/null
---- a/config/etc/default.conf.unknown
-+++ b/config/etc/default.conf.unknown
-@@ -1 +1,2 @@
-+lxc.lxcpath = /lxc
- lxc.network.type = empty
--- /dev/null
+menu "Configuration"
+ depends on PACKAGE_mc
+
+config MC_DIFFVIEWER
+ bool "Enable internal diff viewer"
+ default n
+ help
+ This option enables the built-in diff viewer.
+ Disabled by default.
+
+config MC_EDITOR
+ bool "Enable internal editor"
+ default n
+ help
+ This option enables the built-in file editor.
+ Disabled by default.
+
+config MC_SUBSHELL
+ bool "Enable concurrent subshell"
+ default n
+ help
+ This option enables concurrent subshell support.
+ Disabled by default.
+
+config MC_LARGEFILE
+ bool "Enable largefile support"
+ default n
+ help
+ This option enables support for large files (> 2 GB).
+ Disabled by default.
+
+config MC_BACKGROUND
+ bool "Enable background operations"
+ default n
+ help
+ This option enables support for background operations which
+ allow to perform some tasks such as copying files in a
+ separate background process. Background code is known
+ to be less stable than the rest of the code.
+ Disabled by default.
+
+config MC_CHARSET
+ bool "Enable charset support"
+ default n
+ help
+ This option adds support for selecting character set of the text in
+ the internal viewer and editor and converting it on the fly.
+ The implementation is currently incomplete.
+ Disabled by default.
+
+config MC_VFS
+ bool "Enable virtual filesystem support"
+ default n
+ help
+ This option enables the Virtual File System switch code to get
+ transparent access to the following file systems:
+ cpio, tar, fish, sfs, ftp, sftp, extfs, smb.
+ Disabled by default.
+
+endmenu
--- /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:=mc
+PKG_VERSION:=4.8.13
+PKG_RELEASE:=1.2
+PKG_MAINTAINER:=Dirk Brenken <dibdot@gmail.com>
+PKG_LICENSE:=GPL-3.0+
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=http://ftp.midnight-commander.org/
+PKG_MD5SUM:=d967caa12765eb86e52a6a63ca202500
+
+PKG_BUILD_PARALLEL:=1
+PKG_FIXUP:=autoreconf
+
+PKG_CONFIG_DEPENDS := \
+ CONFIG_PACKAGE_MC \
+ CONFIG_MC_DIFFVIEWER \
+ CONFIG_MC_EDITOR \
+ CONFIG_MC_SUBSHELL \
+ CONFIG_MC_LARGEFILE \
+ CONFIG_MC_BACKGROUND \
+ CONFIG_MC_CHARSET \
+ CONFIG_MC_VFS
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/mc
+ SECTION:=utils
+ CATEGORY:=Utilities
+ DEPENDS:=+glib2 +libncurses +MC_VFS:libssh2 $(LIBRPC_DEPENDS) $(ICONV_DEPENDS)
+ TITLE:=Midnight Commander - a powerful visual file manager
+ URL:=http://www.midnight-commander.org/
+ MENU:=1
+endef
+
+define Package/mc/config
+ source "$(SOURCE)/Config.in"
+endef
+
+define Package/mc/description
+ GNU Midnight Commander is a visual file manager,
+ licensed under GNU General Public License and therefore qualifies as Free Software.
+ It's a feature rich full-screen text mode application that allows you to copy,
+ move and delete files and whole directory trees, search for files
+ and run commands in the subshell. Internal viewer and editor are included.
+endef
+
+CONFIGURE_ARGS += \
+ --disable-doxygen-doc \
+ --with-screen=ncurses \
+ --without-gpm-mouse \
+ --without-x \
+
+CONFIGURE_VARS += \
+ ac_cv_search_addwstr=no \
+
+ifeq ($(CONFIG_MC_DIFFVIEWER),)
+CONFIGURE_ARGS += \
+ --without-diff-viewer
+endif
+
+ifeq ($(CONFIG_MC_EDITOR),)
+CONFIGURE_ARGS += \
+ --without-internal-edit
+endif
+
+ifeq ($(CONFIG_MC_SUBSHELL),)
+CONFIGURE_ARGS += \
+ --without-subshell
+endif
+
+ifeq ($(CONFIG_MC_LARGEFILE),)
+CONFIGURE_ARGS += \
+ --disable-largefile
+endif
+
+ifeq ($(CONFIG_MC_BACKGROUND),)
+CONFIGURE_ARGS += \
+ --disable-background
+endif
+
+ifeq ($(CONFIG_MC_CHARSET),)
+CONFIGURE_ARGS += \
+ --disable-charset
+endif
+
+ifeq ($(CONFIG_MC_VFS),)
+CONFIGURE_ARGS += \
+ --disable-vfs
+endif
+
+define Package/mc/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mc $(1)/usr/bin
+ $(INSTALL_DIR) $(1)/etc/mc
+ifeq ($(CONFIG_MC_DIFFVIEWER),y)
+ ln -sf mc $(1)/usr/bin/mcdiff
+endif
+ifeq ($(CONFIG_MC_EDITOR),y)
+ ln -sf mc $(1)/usr/bin/mcedit
+endif
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/mc.menu $(1)/etc/mc
+ $(INSTALL_DIR) $(1)/etc/mc/skins
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/misc/skins/default.ini $(1)/etc/mc/skins
+ $(INSTALL_DIR) $(1)/root/.mc/cedit/Syntax
+endef
+
+define Package/mc/conffiles
+/etc/mc/mc.menu
+/etc/mc/skins/default.ini
+endef
+
+$(eval $(call BuildPackage,mc))
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mpack
+PKG_VERSION:=1.6
+PKG_RELEASE:=1
+PKG_LICENSE:=NLPL
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://ftp.andrew.cmu.edu/pub/mpack/
+PKG_MD5SUM:=a70fa5afa76539a9afb70b9d81568fe8
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/mpack
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=mpack/munpack MIME format mail messages
+ URL:=http://ftp.andrew.cmu.edu/pub/mpack/
+ MAINTAINER:=Dmitry V. Zimin <pfzim@mail.ru>
+endef
+
+define Package/mpack/description
+ Mpack and munpack are utilities for encoding and decoding
+ (respectively) binary files in MIME (Multipurpose Internet Mail
+ Extensions) format mail messages. For compatibility with older forms
+ of transferring binary files, the munpack program can also decode
+ messages in split-uuencoded format.
+endef
+
+define Package/mpack/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,mpack))
+
PKG_MD5SUM:=f11d563816249d730a00498983485f3a
PKG_LICENSE:=GPL-2.0 LGPL-2.0
-PKG_LICENSE_FILE:=COPYING COPYING.LIB
+PKG_LICENSE_FILES:=COPYING COPYING.LIB
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
--- /dev/null
+#
+# Copyright (C) 2013-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:=open-plc-utils
+PKG_VERSION:=2013-01-29
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=git://github.com/qca/open-plc-utils.git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=6beeb6fe6ce2b16b14284c26e1b9220b68044591
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_MAINTAINER:=Florian Fainelli <florian@openwrt.org>
+
+PKG_LICENSE:=ISC
+PKG_LICENSE_FILE:=LICENSE
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/open-plc-utils/Default
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Qualcomm Atheros Power Line Communication utilities
+ URL:=https://github.com/qca/open-plc-utils/blob/master/README
+endef
+
+define Package/open-plc-utils
+ $(call Package/open-plc-utils/Default)
+ MENU:=1
+endef
+
+define GenPlugin
+ define Package/$(addprefix open-plc-utils-,$(1))
+ $(call Package/open-plc-utils/Default)
+ DEPENDS:=open-plc-utils
+ TITLE:=Utility $(2) from the Open PLC utilities
+ endef
+
+ define Package/$(addprefix open-plc-utils-,$(1))/description
+ Utility $(2) from the Open PLC utilities package.
+ endef
+endef
+
+OPEN_PLC_UTILS_APPS:=efbu efeu efru efsu edru edsu nics \
+ hpavkey hpavkeys rkey mac2pw mac2pwd \
+ mdioblock mdioblock2 mdiodump mdiogen \
+ hpav mme \
+ chknvm chknvm2 nvmsplit nvmmerge \
+ chkpib chkpib2 setpib getpib modpib pib2xml \
+ pibcomp pibdump pibruin xml2pib psin psout pskey \
+ psgraph psnotch pibrump \
+ int6k int6kboot int6keth int6kf int6khost \
+ int64host int6kid int6klist int6klog int6kmdio \
+ int6kmdio2 int6kmod int6kstat int6ktest int6krate \
+ int6krule int6ktone int6kwait CMEncrypt sada \
+ coqos_add coqos_info coqos_man coqos_mod coqos_rel \
+ mdustats ampboot amphost ampID amplist amprate \
+ ampstat amptest amptool amptone ampwait \
+ plcboot plchost plcID plclist plcrate plcrule \
+ plcstat plctest plctool plctone \
+ plcwait plchostd plcget plcset plcotst plcfwd \
+ plcdevs plclog plcmdio16 plcmdio32 \
+ config2cfg sdram \
+ int6kuart int6kbaud ttysig ptsctl weeder ttysend \
+ ttyrecv ttycat int6kdetect
+
+$(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call GenPlugin,$(a))))
+
+define Build/Compile
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ EXTRA_CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_CFLAGS) $(TARGET_LDFLAGS)" \
+ CROSS="$(TARGET_CROSS)" \
+ ROOTFS="$(PKG_INSTALL_DIR)" \
+ OWNER="$(shell id -u $(shell whoami))" \
+ GROUP="$(shell id -g $(shell whoami))" \
+ all install
+endef
+
+define Package/open-plc-utils/install
+endef
+
+define BuildPlugin
+ define Package/$(1)/install
+ $(INSTALL_DIR) $$(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/bin/$(subst open-plc-utils-,,$(1)) \
+ $$(1)/usr/bin/
+ endef
+
+ $$(eval $$(call BuildPackage,$(1)))
+endef
+
+$(eval $(call BuildPackage,open-plc-utils))
+$(foreach a,$(OPEN_PLC_UTILS_APPS),$(eval $(call BuildPlugin,open-plc-utils-$(a))))
include $(TOPDIR)/rules.mk
PKG_NAME:=opensc
-PKG_VERSION:=20140317
+PKG_VERSION:=20141126
PKG_RELEASE:=1
PKG_LICENSE:=LGPL-2.1+
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/OpenSC/OpenSC.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=de6d61405b271e22244376e4817e16b49018e1ce
+PKG_SOURCE_VERSION:=8aadbbd678730dbafb819382da553439887499fd
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_BUILD_DEPENDS:=+libpcsclite
PKG_FIXUP:=libtool
-From c706491fc9b08d4cc6d7b254cf936d6b8d8691bc Mon Sep 17 00:00:00 2001
+From 471b40173b73f213ee72bf05735abf3357658197 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Wed, 20 Feb 2013 11:54:30 +0700
-Subject: [PATCH 01/18] OpenPGP: Detect and support Gnuk Token.
+Subject: [PATCH 01/26] OpenPGP: Detect and support Gnuk Token.
http://www.fsij.org/gnuk/
---
src/libopensc/card-openpgp.c | 61 ++++++++++++++++++++++++++++++++++----------
src/libopensc/cards.h | 1 +
- src/tools/openpgp-tool.c | 9 +++++--
- 3 files changed, 56 insertions(+), 15 deletions(-)
+ src/tools/openpgp-tool.c | 7 ++++-
+ 3 files changed, 55 insertions(+), 14 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 743e79c..716052b 100644
+index 6774fe1..c785a55 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
@@ -43,6 +43,7 @@
priv->ext_caps |= EXT_CAP_SM;
if ((priv->bcd_version >= OPENPGP_CARD_2_0) && (blob->len >= 10)) {
-@@ -1055,12 +1060,18 @@ static int
+@@ -1057,12 +1062,18 @@ static int
pgp_get_pubkey(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
{
sc_apdu_t apdu;
apdu.lc = 2;
apdu.data = ushort2bebytes(idbuf, tag);
apdu.datalen = 2;
-@@ -1152,6 +1163,7 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+@@ -1154,6 +1165,7 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
u8 ins = 0xDA;
u8 p1 = tag >> 8;
u8 p2 = tag & 0xFF;
int r;
LOG_FUNC_CALLED(card->ctx);
-@@ -1193,13 +1205,17 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+@@ -1195,13 +1207,17 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
/* Build APDU */
if (buf != NULL && buf_len > 0) {
apdu.datalen = buf_len;
apdu.lc = buf_len;
}
-@@ -1326,6 +1342,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
+@@ -1328,6 +1344,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
struct pgp_priv_data *priv = DRVDATA(card);
sc_security_env_t *env = &priv->sec_env;
sc_apdu_t apdu;
int r;
LOG_FUNC_CALLED(card->ctx);
-@@ -1334,14 +1351,19 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
+@@ -1336,14 +1353,19 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
LOG_TEST_RET(card->ctx, SC_ERROR_INVALID_ARGUMENTS,
"invalid operation");
break;
case 0x01:
default:
-@@ -1350,7 +1372,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
+@@ -1352,7 +1374,7 @@ pgp_compute_signature(sc_card_t *card, const u8 *data,
}
apdu.lc = data_len;
apdu.datalen = data_len;
apdu.le = ((outlen >= 256) && !(card->caps & SC_CARD_CAP_APDU_EXT)) ? 256 : outlen;
apdu.resp = out;
-@@ -1374,6 +1396,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
+@@ -1376,6 +1398,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
struct pgp_priv_data *priv = DRVDATA(card);
sc_security_env_t *env = &priv->sec_env;
sc_apdu_t apdu;
u8 *temp = NULL;
int r;
-@@ -1398,7 +1421,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
+@@ -1400,7 +1423,7 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
case 0x01: /* Decryption key */
case 0x02: /* authentication key */
/* PSO DECIPHER */
break;
case 0x00: /* signature key */
default:
-@@ -1407,8 +1430,13 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
+@@ -1409,8 +1432,13 @@ pgp_decipher(sc_card_t *card, const u8 *in, size_t inlen,
"invalid key reference");
}
* sc_format_apdu() */
apdu_le = card->max_recv_size;
diff --git a/src/libopensc/cards.h b/src/libopensc/cards.h
-index 0fbf9ca..01b08fd 100644
+index 7be6667..a3f3634 100644
--- a/src/libopensc/cards.h
+++ b/src/libopensc/cards.h
-@@ -104,6 +104,7 @@ enum {
+@@ -105,6 +105,7 @@ enum {
SC_CARD_TYPE_OPENPGP_BASE = 9000,
SC_CARD_TYPE_OPENPGP_V1,
SC_CARD_TYPE_OPENPGP_V2,
/* jcop driver */
SC_CARD_TYPE_JCOP_BASE = 10000,
diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
-index 7058aaa..8b5e327 100644
+index f42e6d6..a24a395 100644
--- a/src/tools/openpgp-tool.c
+++ b/src/tools/openpgp-tool.c
-@@ -32,6 +32,7 @@
- #include "libopensc/asn1.h"
+@@ -33,6 +33,7 @@
#include "libopensc/cards.h"
#include "libopensc/cardctl.h"
+ #include "libopensc/errors.h"
+#include "libopensc/log.h"
#include "util.h"
+ #include "libopensc/log.h"
- #define OPT_RAW 256
-@@ -216,7 +217,7 @@ static void display_data(const struct ef_name_map *mapping, char *value)
- } else {
- const char *label = mapping->name;
-
-- printf("%s:%*s%s\n", label, 10-strlen(label), "", value);
-+ printf("%s:%*s%s\n", label, 10 - (int)strlen(label), "", value);
- }
- }
- }
-@@ -390,6 +391,8 @@ int do_genkey(sc_card_t *card, u8 key_id, unsigned int key_len)
+@@ -396,6 +397,8 @@ int do_genkey(sc_card_t *card, u8 key_id, unsigned int key_len)
sc_path_t path;
sc_file_t *file;
if (key_id < 1 || key_id > 3) {
printf("Unknown key ID %d.\n", key_id);
return 1;
-@@ -481,8 +484,10 @@ int main(int argc, char **argv)
+@@ -487,8 +490,10 @@ int main(int argc, char **argv)
/* check card type */
if ((card->type != SC_CARD_TYPE_OPENPGP_V1) &&
goto out;
}
--
-1.9.3
+2.1.3
-From ecc6460d17147b37def27a9b776e1fc5a61408d0 Mon Sep 17 00:00:00 2001
+From 00a2c08c9125103ee0bff9af9e7ff42c5cdc14fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Fri, 12 Apr 2013 17:24:00 +0700
-Subject: [PATCH 02/18] OpenPGP: Add Gnuk in pkcs15 emulation layer.
+Subject: [PATCH 02/26] OpenPGP: Add Gnuk in pkcs15 emulation layer.
---
src/libopensc/pkcs15-openpgp.c | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index d9dc074..5a8a1ca 100644
+index 4daaa98..fdf720a 100644
--- a/src/libopensc/pkcs15-openpgp.c
+++ b/src/libopensc/pkcs15-openpgp.c
-@@ -155,7 +155,8 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
+@@ -151,7 +151,8 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
u8 c4data[10];
u8 c5data[70];
int r, i;
sc_path_t path;
sc_file_t *file;
-@@ -367,7 +368,8 @@ failed: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
+@@ -363,7 +364,8 @@ failed: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
static int openpgp_detect_card(sc_pkcs15_card_t *p15card)
{
else
return SC_ERROR_WRONG_CARD;
diff --git a/src/libopensc/pkcs15-syn.c b/src/libopensc/pkcs15-syn.c
-index e2f6004..a9f8c0b 100644
+index ffbf642..d2c086c 100644
--- a/src/libopensc/pkcs15-syn.c
+++ b/src/libopensc/pkcs15-syn.c
-@@ -112,6 +112,7 @@ int sc_pkcs15_is_emulation_only(sc_card_t *card)
+@@ -115,6 +115,7 @@ int sc_pkcs15_is_emulation_only(sc_card_t *card)
case SC_CARD_TYPE_GEMSAFEV1_PTEID:
case SC_CARD_TYPE_OPENPGP_V1:
case SC_CARD_TYPE_OPENPGP_V2:
+ case SC_CARD_TYPE_OPENPGP_GNUK:
case SC_CARD_TYPE_SC_HSM:
- return 1;
- default:
+ case SC_CARD_TYPE_DNIE_BASE:
+ case SC_CARD_TYPE_DNIE_BLANK:
--
-1.9.3
+2.1.3
-From 5f751ba5628f9d85e9d8dca9939a93f49d2525d0 Mon Sep 17 00:00:00 2001
+From 2d348b60ab8c22791b56f291600954abd716a791 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Fri, 22 Mar 2013 17:37:16 +0700
-Subject: [PATCH 03/18] OpenPGP: Include private DO to filesystem at driver
+Subject: [PATCH 03/26] OpenPGP: Include private DO to filesystem at driver
initialization.
In old implementation, the DOs which their access is restricted by
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 716052b..ead07ae 100644
+index c785a55..1cc3923 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
@@ -357,7 +357,7 @@ pgp_init(sc_card_t *card)
child = pgp_new_blob(card, priv->mf, info->id, sc_file_new());
--
-1.9.3
+2.1.3
-From fbf8e392db4456de97796259a62ccb972fe24df8 Mon Sep 17 00:00:00 2001
+From fda9b6dd088e734de372fc85c091f88e8607bc2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Tue, 26 Feb 2013 17:37:16 +0700
-Subject: [PATCH 04/18] PKCS15-OpenPGP: Declare DATA objects.
+Subject: [PATCH 04/26] PKCS15-OpenPGP: Declare DATA objects.
Begin to support read/write DATA object for PKCS-OpenPGP binding.
This object is used by TrueCrypt.
1 file changed, 35 insertions(+)
diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index 5a8a1ca..9f239ef 100644
+index fdf720a..fea2805 100644
--- a/src/libopensc/pkcs15-openpgp.c
+++ b/src/libopensc/pkcs15-openpgp.c
-@@ -36,6 +36,7 @@ typedef USHORT ushort;
- #endif
+@@ -32,6 +32,7 @@
+ #include "log.h"
int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
+static int sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *);
#define PGP_USER_PIN_FLAGS (SC_PKCS15_PIN_FLAG_CASE_SENSITIVE \
-@@ -45,6 +46,8 @@ int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
+@@ -41,6 +42,8 @@ int sc_pkcs15emu_openpgp_init_ex(sc_pkcs15_card_t *, sc_pkcs15emu_opt_t *);
| SC_PKCS15_PIN_FLAG_UNBLOCK_DISABLED \
| SC_PKCS15_PIN_FLAG_SO_PIN)
typedef struct _pgp_pin_cfg {
const char *label;
int reference;
-@@ -359,6 +362,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
+@@ -355,6 +358,9 @@ sc_pkcs15emu_openpgp_init(sc_pkcs15_card_t *p15card)
goto failed;
}
return 0;
failed: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP emulation: %s\n",
-@@ -366,6 +372,35 @@ failed: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
+@@ -362,6 +368,35 @@ failed: sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "Failed to initialize OpenPGP e
return r;
}
{
if (p15card->card->type == SC_CARD_TYPE_OPENPGP_V1 || p15card->card->type == SC_CARD_TYPE_OPENPGP_V2
--
-1.9.3
+2.1.3
-From 4cdc5f3102f5ad93d263eea2f8206bb5e9fffc6c Mon Sep 17 00:00:00 2001
+From 6d138f0199575516bfaad18cbbafcfa2ee61e58f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Mon, 4 Mar 2013 11:28:08 +0700
-Subject: [PATCH 05/18] OpenPGP: Support erasing (reset) card.
+Subject: [PATCH 05/26] OpenPGP: Support erasing (reset) card.
Command: openpgp-tool --erase
---
src/libopensc/card-openpgp.c | 64 ++++++++++++++++++++++++++++++++++++++++++++
- src/tools/openpgp-tool.c | 23 +++++++++++++++-
- 2 files changed, 86 insertions(+), 1 deletion(-)
+ src/tools/openpgp-tool.c | 22 ++++++++++++++-
+ 2 files changed, 85 insertions(+), 1 deletion(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index ead07ae..42a9684 100644
+index 1cc3923..7349876 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -2197,6 +2197,66 @@ out:
+@@ -2195,6 +2195,66 @@ out:
#endif /* ENABLE_OPENSSL */
/* ABI: card ctl: perform special card-specific operations */
static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
{
-@@ -2221,6 +2281,10 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
+@@ -2219,6 +2279,10 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
LOG_FUNC_RETURN(card->ctx, r);
break;
#endif /* ENABLE_OPENSSL */
LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
-index 8b5e327..0d360a3 100644
+index a24a395..de1c9d4 100644
--- a/src/tools/openpgp-tool.c
+++ b/src/tools/openpgp-tool.c
-@@ -76,6 +76,7 @@ static int opt_verify = 0;
- static char *verifytype = NULL;
- static int opt_pin = 0;
+@@ -78,6 +78,7 @@ static int opt_pin = 0;
static char *pin = NULL;
+ static int opt_dump_do = 0;
+ static u8 do_dump_idx;
+static int opt_erase = 0;
static const char *app_name = "openpgp-tool";
-@@ -92,6 +93,7 @@ static const struct option options[] = {
+@@ -94,6 +95,7 @@ static const struct option options[] = {
{ "help", no_argument, NULL, 'h' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
+ { "erase", no_argument, NULL, 'E' },
{ "verify", required_argument, NULL, OPT_VERIFY },
{ "pin", required_argument, NULL, OPT_PIN },
- { NULL, 0, NULL, 0 }
-@@ -110,6 +112,7 @@ static const char *option_help[] = {
+ { "do", required_argument, NULL, 'd' },
+@@ -113,6 +115,7 @@ static const char *option_help[] = {
/* h */ "Print this help message",
/* v */ "Verbose operation. Use several times to enable debug output.",
/* V */ "Show version number",
+/* E */ "Erase (reset) the card",
"Verify PIN (CHV1, CHV2, CHV3...)",
- "PIN string"
- };
-@@ -228,7 +231,7 @@ static int decode_options(int argc, char **argv)
+ "PIN string",
+ /* d */ "Dump private data object number <arg> (i.e. PRIVATE-DO-<arg>)"
+@@ -232,7 +235,7 @@ static int decode_options(int argc, char **argv)
{
int c;
-- while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvV", options, (int *) 0)) != EOF) {
-+ while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVE", options, (int *) 0)) != EOF) {
+- while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVd:", options, (int *) 0)) != EOF) {
++ while ((c = getopt_long(argc, argv,"r:x:CUG:L:hwvVd:E", options, (int *) 0)) != EOF) {
switch (c) {
case 'r':
opt_reader = optarg;
-@@ -288,6 +291,9 @@ static int decode_options(int argc, char **argv)
- show_version();
- exit(EXIT_SUCCESS);
- break;
+@@ -296,6 +299,8 @@ static int decode_options(int argc, char **argv)
+ do_dump_idx = optarg[0] - '0';
+ opt_dump_do++;
+ actions++;
+ case 'E':
+ opt_erase++;
-+ break;
+ break;
default:
util_print_usage_and_die(app_name, options, option_help, NULL);
- }
-@@ -446,6 +452,18 @@ int do_verify(sc_card_t *card, u8 *type, u8* pin)
+@@ -452,6 +457,18 @@ int do_verify(sc_card_t *card, char *type, char *pin)
return r;
}
int main(int argc, char **argv)
{
sc_context_t *ctx = NULL;
-@@ -521,6 +539,9 @@ int main(int argc, char **argv)
+@@ -531,6 +548,9 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
sc_unlock(card);
sc_disconnect_card(card);
--
-1.9.3
+2.1.3
-From bbbedd3b358f80a7f98df2b22cf541cb007dd62e Mon Sep 17 00:00:00 2001
+From 469b6567d9adc4af6f49fa65534162673060454d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Mon, 4 Mar 2013 18:13:03 +0700
-Subject: [PATCH 06/18] openpgp-tool: Support deleting key in Gnuk.
+Subject: [PATCH 06/26] openpgp-tool: Support deleting key in Gnuk.
---
- src/tools/openpgp-tool.c | 144 ++++++++++++++++++++++++++++++++++++++++++++++-
- 1 file changed, 143 insertions(+), 1 deletion(-)
+ src/tools/openpgp-tool.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 142 insertions(+)
diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
-index 0d360a3..239c86b 100644
+index de1c9d4..374819a 100644
--- a/src/tools/openpgp-tool.c
+++ b/src/tools/openpgp-tool.c
-@@ -39,6 +39,7 @@
+@@ -41,6 +41,7 @@
#define OPT_PRETTY 257
#define OPT_VERIFY 258
#define OPT_PIN 259
/* define structures */
struct ef_name_map {
-@@ -77,6 +78,7 @@ static char *verifytype = NULL;
- static int opt_pin = 0;
- static char *pin = NULL;
+@@ -79,6 +80,7 @@ static char *pin = NULL;
+ static int opt_dump_do = 0;
+ static u8 do_dump_idx;
static int opt_erase = 0;
+static int opt_delkey = 0;
static const char *app_name = "openpgp-tool";
-@@ -96,6 +98,7 @@ static const struct option options[] = {
- { "erase", no_argument, NULL, 'E' },
+@@ -99,6 +101,7 @@ static const struct option options[] = {
{ "verify", required_argument, NULL, OPT_VERIFY },
{ "pin", required_argument, NULL, OPT_PIN },
+ { "do", required_argument, NULL, 'd' },
+ { "del-key", required_argument, NULL, OPT_DELKEY },
{ NULL, 0, NULL, 0 }
};
-@@ -114,7 +117,8 @@ static const char *option_help[] = {
- /* V */ "Show version number",
- /* E */ "Erase (reset) the card",
+@@ -119,6 +122,7 @@ static const char *option_help[] = {
"Verify PIN (CHV1, CHV2, CHV3...)",
-- "PIN string"
-+ "PIN string",
+ "PIN string",
+ /* d */ "Dump private data object number <arg> (i.e. PRIVATE-DO-<arg>)"
+ "Delete key (1, 2, 3 or all)"
};
static const struct ef_name_map openpgp_data[] = {
-@@ -294,6 +298,14 @@ static int decode_options(int argc, char **argv)
+@@ -302,6 +306,14 @@ static int decode_options(int argc, char **argv)
case 'E':
opt_erase++;
break;
default:
util_print_usage_and_die(app_name, options, option_help, NULL);
}
-@@ -452,6 +464,133 @@ int do_verify(sc_card_t *card, u8 *type, u8* pin)
+@@ -457,6 +469,133 @@ int do_verify(sc_card_t *card, char *type, char *pin)
return r;
}
int do_erase(sc_card_t *card)
{
int r;
-@@ -539,6 +678,9 @@ int main(int argc, char **argv)
+@@ -548,6 +687,9 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
exit_status != do_erase(card);
--
-1.9.3
+2.1.3
-From b6bc7a497e1fe20104f923de1092a35d137ba553 Mon Sep 17 00:00:00 2001
+From d210faa377bcec63876f84b82540b110ede16e57 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Mon, 4 Mar 2013 18:14:51 +0700
-Subject: [PATCH 07/18] OpenPGP: Correct building Extended Header List when
+Subject: [PATCH 07/26] OpenPGP: Correct building Extended Header List when
importing keys.
---
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 42a9684..47c1938 100644
+index 7349876..91c311b 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -1978,7 +1978,7 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
+@@ -1977,7 +1977,7 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
u8 *p = NULL;
u8 *components[] = {key_info->e, key_info->p, key_info->q, key_info->n};
size_t componentlens[] = {key_info->e_len, key_info->p_len, key_info->q_len, key_info->n_len};
"public exponent",
"prime p",
--
-1.9.3
+2.1.3
-From d1b8d3588336abac4876c1d537d8e8e5e578bc02 Mon Sep 17 00:00:00 2001
+From df98874784a77c96a7a1be54412a02a53fdd3a3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Mon, 25 Mar 2013 11:58:38 +0700
-Subject: [PATCH 08/18] OpenPGP: Read some empty DOs from Gnuk.
+Subject: [PATCH 08/26] OpenPGP: Read some empty DOs from Gnuk.
In Gnuk, some empty DOs are returned as not exist, instead of existing with empty value.
So, we will consider them exist in driver.
1 file changed, 25 insertions(+)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 47c1938..9b08bbb 100644
+index 91c311b..e7b25c0 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -813,6 +813,23 @@ pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
+@@ -815,6 +815,23 @@ pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
}
}
return SC_ERROR_FILE_NOT_FOUND;
}
-@@ -1147,6 +1164,14 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+@@ -1149,6 +1166,14 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
r = sc_check_sw(card, apdu.sw1, apdu.sw2);
LOG_FUNC_RETURN(card->ctx, apdu.resplen);
--
-1.9.3
+2.1.3
-From 6a4457cde65ef44f05b0689415ae7165b06fb8bf Mon Sep 17 00:00:00 2001
+From 42adc35954e18e24f253f710b16d850d1872bce5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Wed, 27 Mar 2013 11:38:42 +0700
-Subject: [PATCH 09/18] PKCS15-OpenPGP: Do not show empty DO in pkcs15
+Subject: [PATCH 09/26] PKCS15-OpenPGP: Do not show empty DO in pkcs15
emu_init.
---
1 file changed, 18 insertions(+)
diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index 9f239ef..850dd74 100644
+index fea2805..51a2032 100644
--- a/src/libopensc/pkcs15-openpgp.c
+++ b/src/libopensc/pkcs15-openpgp.c
-@@ -385,16 +385,34 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
+@@ -381,16 +381,34 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
sc_pkcs15_object_t dat_obj;
char name[8];
char path[9];
r = sc_pkcs15emu_add_data_object(p15card, &dat_obj, &dat_info);
}
--
-1.9.3
+2.1.3
-From 88ded8fc5802c073caa71b649cee5a3116699b2a Mon Sep 17 00:00:00 2001
+From f085e6a5f386875b5b071ef3bf115e4d9bb33bdb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Wed, 27 Mar 2013 11:39:33 +0700
-Subject: [PATCH 10/18] PKCS15-OpenPGP: Allow to store data to pkcs15 data
+Subject: [PATCH 10/26] PKCS15-OpenPGP: Allow to store data to pkcs15 data
object.
Only one DO is supported now.
2 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/src/libopensc/pkcs15-openpgp.c b/src/libopensc/pkcs15-openpgp.c
-index 850dd74..b701041 100644
+index 51a2032..4cc1c39 100644
--- a/src/libopensc/pkcs15-openpgp.c
+++ b/src/libopensc/pkcs15-openpgp.c
-@@ -397,7 +397,7 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
+@@ -393,7 +393,7 @@ sc_pkcs15emu_openpgp_add_data(sc_pkcs15_card_t *p15card)
*/
r = read_file(p15card->card, path, content, sizeof(content));
if (r <= 0 ) {
r = SC_ERROR_NOT_IMPLEMENTED;
}
--
-1.9.3
+2.1.3
-From 7231ee09bb628f0401939778decce818ef6e3665 Mon Sep 17 00:00:00 2001
+From 752f8981bed49a98d3592ead3aa50e743318dea8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Fri, 5 Apr 2013 17:18:50 +0700
-Subject: [PATCH 11/18] OpenPGP: Provide enough buffer to read pubkey from
+Subject: [PATCH 11/26] OpenPGP: Provide enough buffer to read pubkey from
Gnuk.
---
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 9b08bbb..8a1a270 100644
+index e7b25c0..1913eca 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
@@ -263,7 +263,12 @@ static struct do_info pgp2_objects[] = { /* OpenPGP card spec 2.0 */
#define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
struct pgp_priv_data {
-@@ -729,6 +734,14 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -731,6 +736,14 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
u8 buffer[2048];
size_t buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
? sizeof(buffer) : 256;
int r = blob->info->get_fn(card, blob->id, buffer, buf_len);
if (r < 0) { /* an error occurred */
-@@ -1830,6 +1843,7 @@ static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_in
+@@ -1828,6 +1841,7 @@ static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_in
u8 apdu_case;
u8 *apdu_data;
size_t apdu_le;
/* Send */
sc_log(card->ctx, "Waiting for the card to generate key...");
--
-1.9.3
+2.1.3
-From d8f63eb6fcc1441c12a44850da2fa22a6fe81634 Mon Sep 17 00:00:00 2001
+From 5110ae3ba33d165c43ea5eca8f929a82d81cb3fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Thu, 11 Apr 2013 11:47:51 +0700
-Subject: [PATCH 12/18] OpenPGP: Support write certificate for Gnuk.
+Subject: [PATCH 12/26] OpenPGP: Support write certificate for Gnuk.
---
src/libopensc/card-openpgp.c | 158 +++++++++++++++++++++++++++++++++----------
1 file changed, 123 insertions(+), 35 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 8a1a270..d9db948 100644
+index 1913eca..7cea84f 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -725,6 +725,8 @@ pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
+@@ -727,6 +727,8 @@ pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
static int
pgp_read_blob(sc_card_t *card, struct blob *blob)
{
if (blob->data != NULL)
return SC_SUCCESS;
if (blob->info == NULL)
-@@ -735,6 +737,11 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -737,6 +739,11 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
size_t buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
? sizeof(buffer) : 256;
/* Buffer length for Gnuk pubkey */
if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
(blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
-@@ -1190,49 +1197,75 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+@@ -1192,49 +1199,75 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
LOG_FUNC_RETURN(card->ctx, apdu.resplen);
}
/* Extended Header list (004D DO) needs a variant of PUT DATA command */
if (tag == 0x004D) {
-@@ -1258,15 +1291,70 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+@@ -1260,15 +1293,70 @@ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
apdu.lc = buf_len;
}
else {
if (r == SC_ERROR_SECURITY_STATUS_NOT_SATISFIED) {
sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Please verify PIN first.");
--
-1.9.3
+2.1.3
-From e5c94d3f1f7e6a96a98815d6e51190498c357fb6 Mon Sep 17 00:00:00 2001
+From 7823e836e8279c8d77786d8f10ffaa83cf50bf1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Wed, 10 Apr 2013 18:35:58 +0700
-Subject: [PATCH 13/18] pkcs15-openpgp: Change to sc_put_data instead of
+Subject: [PATCH 13/26] pkcs15-openpgp: Change to sc_put_data instead of
sc_update_binary when writing certificate.
---
case SC_PKCS15_TYPE_DATA_OBJECT:
--
-1.9.3
+2.1.3
-From df8a78e3c8c9d9d591c0d3fa31db7e010eb2c8c2 Mon Sep 17 00:00:00 2001
+From 3ff1f7234abb4c42273adedbe06d9e7f9f3a5f9d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Thu, 11 Apr 2013 16:18:31 +0700
-Subject: [PATCH 14/18] OpenPGP: Overcome the restriction of even data length
+Subject: [PATCH 14/26] OpenPGP: Overcome the restriction of even data length
of Gnuk.
When write certificate with odd length to Gnuk, we add zero padding to make it even.
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index d9db948..a666163 100644
+index 7cea84f..7a77a71 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -1206,6 +1206,10 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1208,6 +1208,10 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
sc_apdu_t apdu;
u8 *part;
size_t plen;
int r = SC_SUCCESS;
LOG_FUNC_CALLED(ctx);
-@@ -1236,8 +1240,20 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1238,8 +1242,20 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
sc_format_apdu(card, &apdu, SC_APDU_CASE_3_SHORT, 0xD6, i, 0);
}
apdu.flags |= SC_APDU_FLAGS_CHAINING;
r = sc_transmit_apdu(card, &apdu);
LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
--
-1.9.3
+2.1.3
-From 693b3ac5a53e89a0cdeab0f728d24a6e16864f5c Mon Sep 17 00:00:00 2001
+From 9af45c4cf052e3a6059a3004082f9ee3d2b3b2bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Fri, 12 Apr 2013 15:33:31 +0700
-Subject: [PATCH 15/18] OpenPGP: Delete key as file, for Gnuk.
+Subject: [PATCH 15/26] OpenPGP: Delete key as file, for Gnuk.
---
src/libopensc/card-openpgp.c | 51 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index a666163..19d3b04 100644
+index 7a77a71..4d0500d 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -2437,6 +2437,44 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
+@@ -2435,6 +2435,44 @@ static int pgp_card_ctl(sc_card_t *card, unsigned long cmd, void *ptr)
LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
}
/* ABI: DELETE FILE */
static int
pgp_delete_file(sc_card_t *card, const sc_path_t *path)
-@@ -2444,6 +2482,7 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+@@ -2442,6 +2480,7 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
struct pgp_priv_data *priv = DRVDATA(card);
struct blob *blob;
sc_file_t *file;
int r;
LOG_FUNC_CALLED(card->ctx);
-@@ -2459,10 +2498,20 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+@@ -2457,10 +2496,20 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
if (blob == priv->mf)
LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
/* call pgp_put_data() with zero-sized NULL-buffer to zap the DO contents */
r = pgp_put_data(card, file->id, NULL, 0);
--
-1.9.3
+2.1.3
-From f96f7536a8c2efd0ba41fd94fe3334e5fa556854 Mon Sep 17 00:00:00 2001
+From ee23d262768e7e54ed0fc554bc0b869c65868ace Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Tue, 16 Apr 2013 10:19:34 +0700
-Subject: [PATCH 16/18] OpenPGP: Correct parameter checking.
+Subject: [PATCH 16/26] OpenPGP: Correct parameter checking.
---
src/libopensc/card-openpgp.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 19d3b04..196c094 100644
+index 4d0500d..beeee83 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -1221,6 +1221,8 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1223,6 +1223,8 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
/* Check response */
r = sc_check_sw(card, apdu.sw1, apdu.sw2);
LOG_FUNC_RETURN(card->ctx, length);
}
-@@ -2448,6 +2450,11 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
+@@ -2446,6 +2448,11 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
LOG_FUNC_CALLED(ctx);
/* Delete fingerprint */
sc_log(ctx, "Delete fingerprints");
r = pgp_put_data(card, 0xC6 + key_id, NULL, 0);
-@@ -2466,8 +2473,6 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
+@@ -2464,8 +2471,6 @@ gnuk_delete_key(sc_card_t *card, u8 key_id)
data = "\x4D\x02\xB8";
else if (key_id == 3)
data = "\x4D\x02\xA4";
r = pgp_put_data(card, 0x4D, data, strlen(data) + 1);
--
-1.9.3
+2.1.3
-From 8a69525a60391b46db4994033527d219d2adaa4e Mon Sep 17 00:00:00 2001
+From f4aec38233010953cea72c367bccc71c3687b2f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Tue, 16 Apr 2013 16:02:17 +0700
-Subject: [PATCH 17/18] OpenPGP: Make code neater
+Subject: [PATCH 17/26] OpenPGP: Make code neater
---
src/libopensc/card-openpgp.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index 196c094..c4ef3b6 100644
+index beeee83..ca0d01b 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -1220,10 +1220,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1222,10 +1222,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
r = sc_transmit_apdu(card, &apdu);
LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
/* Check response */
}
/* Ref: gnuk_put_binary_libusb.py and gnuk_token.py in Gnuk source tree */
-@@ -1260,8 +1257,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
+@@ -1262,8 +1259,7 @@ static int gnuk_write_certificate(sc_card_t *card, const u8 *buf, size_t length)
r = sc_transmit_apdu(card, &apdu);
LOG_TEST_RET(card->ctx, r, "APDU transmit failed");
/* Check response */
/* To next part */
i++;
--
-1.9.3
+2.1.3
-From a099f951d085d3abfefeead14a4af06913cb67d2 Mon Sep 17 00:00:00 2001
+From c84c84169f7a73eab27f6a9b13b77432baa5c3f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
<ng.hong.quan@gmail.com>
Date: Wed, 8 May 2013 16:51:21 +0700
-Subject: [PATCH 18/18] Move declaration to top of block.
+Subject: [PATCH 18/26] Move declaration to top of block.
---
src/libopensc/card-openpgp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
-index c4ef3b6..7f2006e 100644
+index ca0d01b..037ef73 100644
--- a/src/libopensc/card-openpgp.c
+++ b/src/libopensc/card-openpgp.c
-@@ -736,6 +736,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -738,6 +738,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
u8 buffer[2048];
size_t buf_len = (card->caps & SC_CARD_CAP_APDU_EXT)
? sizeof(buffer) : 256;
/* Buffer length for certificate */
if (blob->id == DO_CERT && priv->max_cert_size > 0) {
-@@ -749,7 +750,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+@@ -751,7 +752,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
buf_len = MAXLEN_RESP_PUBKEY_GNUK;
}
if (r < 0) { /* an error occurred */
blob->status = r;
--
-1.9.3
+2.1.3
--- /dev/null
+From c6abf7976f64be5191dc80fecdbcb07daab7a2e0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 3 Nov 2013 01:45:56 +0800
+Subject: [PATCH 19/26] OpenPGP: Make indentation consistent (space -> tab).
+
+---
+ src/libopensc/card-openpgp.c | 22 ++++++++---------
+ src/tools/openpgp-tool.c | 56 ++++++++++++++++++++++----------------------
+ 2 files changed, 39 insertions(+), 39 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 037ef73..ae40940 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -192,12 +192,12 @@ static struct do_info pgp1_objects[] = { /* OpenPGP card spec 1.1 */
+ { 0x5f35, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
+ { 0x5f50, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
+ { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
+- { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+ { 0, 0, 0, NULL, NULL },
+ };
+
+@@ -253,11 +253,11 @@ static struct do_info pgp2_objects[] = { /* OpenPGP card spec 2.0 */
+ /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
+ * However, their R/W access condition may block the process of importing key in pkcs15init.
+ * So we set their accesses condition as WRITE_PIN3 (writable). */
+- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+ { 0, 0, 0, NULL, NULL },
+ };
+
+diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
+index 374819a..a0334ca 100644
+--- a/src/tools/openpgp-tool.c
++++ b/src/tools/openpgp-tool.c
+@@ -37,11 +37,11 @@
+ #include "util.h"
+ #include "libopensc/log.h"
+
+-#define OPT_RAW 256
+-#define OPT_PRETTY 257
+-#define OPT_VERIFY 258
+-#define OPT_PIN 259
+-#define OPT_DELKEY 260
++#define OPT_RAW 256
++#define OPT_PRETTY 257
++#define OPT_VERIFY 258
++#define OPT_PIN 259
++#define OPT_DELKEY 260
+
+ /* define structures */
+ struct ef_name_map {
+@@ -142,10 +142,10 @@ static const struct ef_name_map openpgp_data[] = {
+ static void show_version(void)
+ {
+ fprintf(stderr,
+- "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
+- "\n"
+- "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
+- "Licensed under LGPL v2\n");
++ "openpgp-tool - OpenPGP card utility version " PACKAGE_VERSION "\n"
++ "\n"
++ "Copyright (c) 2012 Peter Marschall <peter@adpm.de>\n"
++ "Licensed under LGPL v2\n");
+ }
+
+
+@@ -176,16 +176,16 @@ static char *prettify_language(char *str)
+ {
+ if (str != NULL) {
+ switch (strlen(str)) {
+- case 8: memmove(str+7, str+6, 1+strlen(str+6));
++ case 8: memmove(str+7, str+6, 1+strlen(str+6));
+ str[6] = ',';
+ /* fall through */
+- case 6: memmove(str+5, str+4, 1+strlen(str+4));
++ case 6: memmove(str+5, str+4, 1+strlen(str+4));
+ str[4] = ',';
+ /* fall through */
+- case 4: memmove(str+3, str+2, 1+strlen(str+2));
++ case 4: memmove(str+3, str+2, 1+strlen(str+2));
+ str[2] = ',';
+ /* fall through */
+- case 2: return str;
++ case 2: return str;
+ }
+ }
+ return NULL;
+@@ -197,10 +197,10 @@ static char *prettify_gender(char *str)
+ {
+ if (str != NULL) {
+ switch (*str) {
+- case '0': return "unknown";
+- case '1': return "male";
+- case '2': return "female";
+- case '9': return "not applicable";
++ case '0': return "unknown";
++ case '1': return "male";
++ case '2': return "female";
++ case '9': return "not applicable";
+ }
+ }
+ return NULL;
+@@ -218,7 +218,7 @@ static void display_data(const struct ef_name_map *mapping, char *value)
+ char *envvar;
+
+ envvar = malloc(strlen(mapping->env_name) +
+- strlen(value) + 2);
++ strlen(value) + 2);
+ if (envvar != NULL) {
+ strcpy(envvar, mapping->env_name);
+ strcat(envvar, "=");
+@@ -346,20 +346,20 @@ static int do_userinfo(sc_card_t *card)
+ if (!count)
+ continue;
+
+- if (count > (int)sizeof(buf) - 1) {
++ if (count > (int)sizeof(buf) - 1) {
+ fprintf(stderr, "Too small buffer to read the OpenPGP data\n");
+ return EXIT_FAILURE;
+ }
+-
+- r = sc_read_binary(card, 0, buf, count, 0);
+- if (r < 0) {
++
++ r = sc_read_binary(card, 0, buf, count, 0);
++ if (r < 0) {
+ fprintf(stderr, "%s: read failed - %s\n", openpgp_data[i].ef, sc_strerror(r));
+ return EXIT_FAILURE;
+- }
+- if (r != count) {
+- fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
++ }
++ if (r != count) {
++ fprintf(stderr, "%s: expecting %d, got only %d bytes\n", openpgp_data[i].ef, count, r);
+ return EXIT_FAILURE;
+- }
++ }
+
+ buf[count] = '\0';
+
+@@ -628,7 +628,7 @@ int main(int argc, char **argv)
+ r = sc_context_create(&ctx, &ctx_param);
+ if (r) {
+ util_fatal("failed to establish context: %s\n",
+- sc_strerror(r));
++ sc_strerror(r));
+ return EXIT_FAILURE;
+ }
+
+@@ -640,7 +640,7 @@ int main(int argc, char **argv)
+ r = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose);
+ if (r) {
+ util_fatal("failed to connect to card: %s\n",
+- sc_strerror(r));
++ sc_strerror(r));
+ return EXIT_FAILURE;
+ }
+
+--
+2.1.3
+
--- /dev/null
+From 9acf5c1ad7d8a32b472203d3bd8860ea2cbde0e7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 3 Nov 2013 02:53:35 +0800
+Subject: [PATCH 20/26] OpenPGP: Don't use sc_log in openpgp-tool.
+
+---
+ src/tools/openpgp-tool.c | 21 +++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
+index a0334ca..505abd9 100644
+--- a/src/tools/openpgp-tool.c
++++ b/src/tools/openpgp-tool.c
+@@ -414,8 +414,6 @@ int do_genkey(sc_card_t *card, u8 key_id, unsigned int key_len)
+ sc_path_t path;
+ sc_file_t *file;
+
+- LOG_FUNC_CALLED(card->ctx);
+-
+ if (key_id < 1 || key_id > 3) {
+ printf("Unknown key ID %d.\n", key_id);
+ return 1;
+@@ -479,14 +477,14 @@ int delete_key_gnuk(sc_card_t *card, u8 key_id)
+ u8 *data = NULL;
+
+ /* Delete fingerprint */
+- sc_log(ctx, "Delete fingerprints");
++ fprintf(stdout, "Delete fingerprints");
+ r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
+ /* Delete creation time */
+- sc_log(ctx, "Delete creation time");
++ fprintf(stdout, "Delete creation time");
+ r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
+
+ /* Rewrite Extended Header List */
+- sc_log(ctx, "Rewrite Extended Header List");
++ fprintf(stdout, "Rewrite Extended Header List");
+
+ if (key_id == 1)
+ data = "\x4D\x02\xB6";
+@@ -534,15 +532,18 @@ int delete_key_openpgp(sc_card_t *card, u8 key_id)
+ /* Build APDU from binary array */
+ r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
+ if (r) {
+- sc_log(ctx, "Failed to build APDU");
+- LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
++ fprintf(stderr, "Failed to build APDU: %s\n", sc_strerror(r));
++ return r;
+ }
+ apdu.resp = rbuf;
+ apdu.resplen = sizeof(rbuf);
+
+ /* Send APDU to card */
+ r = sc_transmit_apdu(card, &apdu);
+- LOG_TEST_RET(ctx, r, "Transmiting APDU failed");
++ if (r) {
++ fprintf(stderr, "Transmiting APDU failed: %s\n", sc_strerror(r));
++ return r;
++ }
+ }
+ /* TODO: Rewrite Extended Header List.
+ * Not support by OpenGPG v2 yet */
+@@ -557,7 +558,7 @@ int delete_key(sc_card_t *card, u8 key_id)
+ LOG_FUNC_CALLED(ctx);
+ /* Check key ID */
+ if (key_id < 1 || key_id > 3) {
+- sc_log(ctx, "Invalid key ID %d", key_id);
++ fprintf(stderr, "Invalid key ID %d", key_id);
+ LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
+ }
+
+@@ -649,7 +650,7 @@ int main(int argc, char **argv)
+ (card->type != SC_CARD_TYPE_OPENPGP_V2) &&
+ (card->type != SC_CARD_TYPE_OPENPGP_GNUK)) {
+ util_error("not an OpenPGP card");
+- sc_log(card->ctx, "Card type %X", card->type);
++ fprintf(stderr, "Card type %X\n", card->type);
+ exit_status = EXIT_FAILURE;
+ goto out;
+ }
+--
+2.1.3
+
--- /dev/null
+From 0fdbf868976172486af210accafbab163452ff78 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 3 Nov 2013 11:26:25 +0800
+Subject: [PATCH 21/26] OpenPGP: Don't reimplement gnuk_delete_key in
+ openpgp-tool.
+
+---
+ src/tools/openpgp-tool.c | 64 ++++++------------------------------------------
+ 1 file changed, 8 insertions(+), 56 deletions(-)
+
+diff --git a/src/tools/openpgp-tool.c b/src/tools/openpgp-tool.c
+index 505abd9..a7796e7 100644
+--- a/src/tools/openpgp-tool.c
++++ b/src/tools/openpgp-tool.c
+@@ -468,38 +468,6 @@ int do_verify(sc_card_t *card, char *type, char *pin)
+ }
+
+ /**
+- * Delete key, for Gnuk.
+- **/
+-int delete_key_gnuk(sc_card_t *card, u8 key_id)
+-{
+- sc_context_t *ctx = card->ctx;
+- int r = SC_SUCCESS;
+- u8 *data = NULL;
+-
+- /* Delete fingerprint */
+- fprintf(stdout, "Delete fingerprints");
+- r |= sc_put_data(card, 0xC6 + key_id, NULL, 0);
+- /* Delete creation time */
+- fprintf(stdout, "Delete creation time");
+- r |= sc_put_data(card, 0xCD + key_id, NULL, 0);
+-
+- /* Rewrite Extended Header List */
+- fprintf(stdout, "Rewrite Extended Header List");
+-
+- if (key_id == 1)
+- data = "\x4D\x02\xB6";
+- else if (key_id == 2)
+- data = "\x4D\x02\xB8";
+- else if (key_id == 3)
+- data = "\x4D\x02\xA4";
+- else
+- return SC_ERROR_INVALID_ARGUMENTS;
+-
+- r |= sc_put_data(card, 0x4D, data, strlen(data) + 1);
+- return r;
+-}
+-
+-/**
+ * Delete key, for OpenPGP card.
+ * This function is not complete and is reserved for future version (> 2) of OpenPGP card.
+ **/
+@@ -547,32 +515,13 @@ int delete_key_openpgp(sc_card_t *card, u8 key_id)
+ }
+ /* TODO: Rewrite Extended Header List.
+ * Not support by OpenGPG v2 yet */
+- LOG_FUNC_RETURN(ctx, r);
+-}
+-
+-int delete_key(sc_card_t *card, u8 key_id)
+-{
+- sc_context_t *ctx = card->ctx;
+- int r;
+-
+- LOG_FUNC_CALLED(ctx);
+- /* Check key ID */
+- if (key_id < 1 || key_id > 3) {
+- fprintf(stderr, "Invalid key ID %d", key_id);
+- LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
+- }
+-
+- if (card->type == SC_CARD_TYPE_OPENPGP_GNUK)
+- r = delete_key_gnuk(card, key_id);
+- else
+- r = delete_key_openpgp(card, key_id);
+-
+- LOG_FUNC_RETURN(ctx, r);
++ return r;
+ }
+
+ int do_delete_key(sc_card_t *card, u8 key_id)
+ {
+ sc_context_t *ctx = card->ctx;
++ sc_path_t path;
+ int r = SC_SUCCESS;
+
+ /* Currently, only Gnuk supports deleting keys */
+@@ -586,13 +535,16 @@ int do_delete_key(sc_card_t *card, u8 key_id)
+ return SC_ERROR_INVALID_ARGUMENTS;
+ }
+ if (key_id == 1 || key_id == 'a') {
+- r |= delete_key(card, 1);
++ sc_format_path("B601", &path);
++ r |= sc_delete_file(card, &path);
+ }
+ if (key_id == 2 || key_id == 'a') {
+- r |= delete_key(card, 2);
++ sc_format_path("B801", &path);
++ r |= sc_delete_file(card, &path);
+ }
+ if (key_id == 3 || key_id == 'a') {
+- r |= delete_key(card, 3);
++ sc_format_path("A401", &path);
++ r |= sc_delete_file(card, &path);
+ }
+ return r;
+ }
+--
+2.1.3
+
--- /dev/null
+From 0cd2a488d86006bb2740a4e73e7a0d859e1bf33c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 13 Jul 2014 17:37:59 +0800
+Subject: [PATCH 22/26] OpenPGP: Use directly binary array of APDUs for ERASE
+ command.
+
+I used a string presentation before and it needed an extra conversion step.
+---
+ src/libopensc/card-openpgp.c | 47 +++++++++++++++++++++++---------------------
+ 1 file changed, 25 insertions(+), 22 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index ae40940..724fe73 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -2347,24 +2347,27 @@ out:
+ static int pgp_erase_card(sc_card_t *card)
+ {
+ sc_context_t *ctx = card->ctx;
+- u8 *apdustring[10] = {
+- "00:20:00:81:08:40:40:40:40:40:40:40:40",
+- "00:20:00:81:08:40:40:40:40:40:40:40:40",
+- "00:20:00:81:08:40:40:40:40:40:40:40:40",
+- "00:20:00:81:08:40:40:40:40:40:40:40:40",
+- "00:20:00:83:08:40:40:40:40:40:40:40:40",
+- "00:20:00:83:08:40:40:40:40:40:40:40:40",
+- "00:20:00:83:08:40:40:40:40:40:40:40:40",
+- "00:20:00:83:08:40:40:40:40:40:40:40:40",
+- "00:e6:00:00",
+- "00:44:00:00"
++ /* Special series of commands to erase OpenPGP card,
++ * according to https://www.crypto-stick.com/en/faq
++ * (How to reset a Crypto Stick? question).
++ * Gnuk is known not to support this feature. */
++ u8 apdu_binaries[10][13] = {
++ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x81, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0x20, 0, 0x83, 0x08, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40},
++ {0, 0xe6, 0, 0},
++ {0, 0x44, 0, 0}
+ };
++ u8 apdu_lens[10] = {13, 13, 13, 13, 13, 13, 13, 13, 4, 4};
+ u8 buf[SC_MAX_APDU_BUFFER_SIZE];
+ u8 rbuf[SC_MAX_APDU_BUFFER_SIZE];
+ sc_apdu_t apdu;
+- size_t len0;
+- int commandsnum = 10;
+- int i, r;
++ int i, l, r;
+
+ LOG_FUNC_CALLED(ctx);
+
+@@ -2376,17 +2379,17 @@ static int pgp_erase_card(sc_card_t *card)
+ sc_log(ctx, "Card is OpenPGP v2. Erase card.");
+
+ /* Iterate over 10 commands above */
+- for (i = 0; i < commandsnum; i++) {
+- /* Convert the string to binary array */
+- len0 = sizeof(buf);
+- sc_hex_to_bin(apdustring[i], buf, &len0);
+- printf("Sending: ");
+- for (r = 0; r < len0; r++)
+- printf("%02X ", buf[r]);
++ for (i = 0; i < sizeof(apdu_lens); i++) {
++ /* Length of the binary array of the current command */
++ l = apdu_lens[i];
++ /* Print the command to console */
++ printf("Sending %d: ", i);
++ for (r = 0; r < l; r++)
++ printf("%02X ", apdu_binaries[i][r]);
+ printf("\n");
+
+ /* Build APDU from binary array */
+- r = sc_bytes2apdu(card->ctx, buf, len0, &apdu);
++ r = sc_bytes2apdu(card->ctx, apdu_binaries[i], l, &apdu);
+ if (r) {
+ sc_log(ctx, "Failed to build APDU");
+ LOG_FUNC_RETURN(ctx, SC_ERROR_INTERNAL);
+--
+2.1.3
+
--- /dev/null
+From 6f56ea4cfc52323002d818731a50a31e863b6843 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 13 Jul 2014 19:41:36 +0800
+Subject: [PATCH 23/26] OpenPGP: Rename private "blob" type to avoid confusing
+ with variable name.
+
+This name has been used for both data type and variable name of that
+type.
+---
+ src/libopensc/card-openpgp.c | 96 ++++++++++++++++++++++----------------------
+ 1 file changed, 49 insertions(+), 47 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 724fe73..ca3173c 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -111,9 +111,9 @@ enum _card_state {
+ CARD_STATE_ACTIVATED = 0x05
+ };
+
+-struct blob {
+- struct blob * next; /* pointer to next sibling */
+- struct blob * parent; /* pointer to parent */
++typedef struct pgp_blob {
++ struct pgp_blob * next; /* pointer to next sibling */
++ struct pgp_blob * parent; /* pointer to parent */
+ struct do_info *info;
+
+ sc_file_t * file;
+@@ -122,8 +122,8 @@ struct blob {
+
+ unsigned char * data;
+ unsigned int len;
+- struct blob * files; /* pointer to 1st child */
+-};
++ struct pgp_blob * files; /* pointer to 1st child */
++} pgp_blob_t;
+
+ struct do_info {
+ unsigned int id; /* ID of the DO in question */
+@@ -141,12 +141,12 @@ struct do_info {
+
+ static int pgp_get_card_features(sc_card_t *card);
+ static int pgp_finish(sc_card_t *card);
+-static void pgp_iterate_blobs(struct blob *, int, void (*func)());
++static void pgp_iterate_blobs(pgp_blob_t *, int, void (*func)());
+
+-static int pgp_get_blob(sc_card_t *card, struct blob *blob,
+- unsigned int id, struct blob **ret);
+-static struct blob * pgp_new_blob(sc_card_t *, struct blob *, unsigned int, sc_file_t *);
+-static void pgp_free_blob(struct blob *);
++static int pgp_get_blob(sc_card_t *card, pgp_blob_t *blob,
++ unsigned int id, pgp_blob_t **ret);
++static pgp_blob_t * pgp_new_blob(sc_card_t *, pgp_blob_t *, unsigned int, sc_file_t *);
++static void pgp_free_blob(pgp_blob_t *);
+ static int pgp_get_pubkey(sc_card_t *, unsigned int,
+ u8 *, size_t);
+ static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+@@ -272,8 +272,8 @@ static struct do_info pgp2_objects[] = { /* OpenPGP card spec 2.0 */
+
+ #define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
+ struct pgp_priv_data {
+- struct blob * mf;
+- struct blob * current; /* currently selected file */
++ pgp_blob_t * mf;
++ pgp_blob_t * current; /* currently selected file */
+
+ enum _version bcd_version;
+ struct do_info *pgp_objects;
+@@ -311,7 +311,7 @@ pgp_init(sc_card_t *card)
+ sc_file_t *file = NULL;
+ struct do_info *info;
+ int r;
+- struct blob *child = NULL;
++ pgp_blob_t *child = NULL;
+
+ LOG_FUNC_CALLED(card->ctx);
+
+@@ -389,7 +389,7 @@ pgp_get_card_features(sc_card_t *card)
+ unsigned char *hist_bytes = card->atr.value;
+ size_t atr_len = card->atr.len;
+ size_t i = 0;
+- struct blob *blob, *blob6e, *blob73;
++ pgp_blob_t *blob, *blob6e, *blob73;
+
+ /* parse card capabilities from historical bytes */
+ while ((i < atr_len) && (hist_bytes[i] != 0x73))
+@@ -526,7 +526,7 @@ pgp_finish(sc_card_t *card)
+
+ /* internal: fill a blob's data */
+ static int
+-pgp_set_blob(struct blob *blob, const u8 *data, size_t len)
++pgp_set_blob(pgp_blob_t *blob, const u8 *data, size_t len)
+ {
+ if (blob->data)
+ free(blob->data);
+@@ -620,16 +620,16 @@ pgp_attach_acl(sc_card_t *card, sc_file_t *file, struct do_info *info)
+ }
+
+ /* internal: append a blob to the list of children of a given parent blob */
+-static struct blob *
+-pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
++static pgp_blob_t *
++pgp_new_blob(sc_card_t *card, pgp_blob_t *parent, unsigned int file_id,
+ sc_file_t *file)
+ {
+- struct blob *blob = NULL;
++ pgp_blob_t *blob = NULL;
+
+ if (file == NULL)
+ return NULL;
+
+- if ((blob = calloc(1, sizeof(struct blob))) != NULL) {
++ if ((blob = calloc(1, sizeof(pgp_blob_t))) != NULL) {
+ struct pgp_priv_data *priv = DRVDATA (card);
+ struct do_info *info;
+
+@@ -643,7 +643,7 @@ pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
+ blob->parent = parent;
+
+ if (parent != NULL) {
+- struct blob **p;
++ pgp_blob_t **p;
+
+ /* set file's path = parent's path + file's id */
+ blob->file->path = parent->file->path;
+@@ -681,11 +681,11 @@ pgp_new_blob(sc_card_t *card, struct blob *parent, unsigned int file_id,
+
+ /* internal: free a blob including its content */
+ static void
+-pgp_free_blob(struct blob *blob)
++pgp_free_blob(pgp_blob_t *blob)
+ {
+ if (blob) {
+ if (blob->parent) {
+- struct blob **p;
++ pgp_blob_t **p;
+
+ /* remove blob from list of parent's children */
+ for (p = &blob->parent->files; *p != NULL && *p != blob; p = &(*p)->next)
+@@ -705,14 +705,14 @@ pgp_free_blob(struct blob *blob)
+
+ /* internal: iterate through the blob tree, calling a function for each blob */
+ static void
+-pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
++pgp_iterate_blobs(pgp_blob_t *blob, int level, void (*func)())
+ {
+ if (blob) {
+ if (level > 0) {
+- struct blob *child = blob->files;
++ pgp_blob_t *child = blob->files;
+
+ while (child != NULL) {
+- struct blob *next = child->next;
++ pgp_blob_t *next = child->next;
+
+ pgp_iterate_blobs(child, level-1, func);
+ child = next;
+@@ -725,7 +725,7 @@ pgp_iterate_blobs(struct blob *blob, int level, void (*func)())
+
+ /* internal: read a blob's contents from card */
+ static int
+-pgp_read_blob(sc_card_t *card, struct blob *blob)
++pgp_read_blob(sc_card_t *card, pgp_blob_t *blob)
+ {
+ struct pgp_priv_data *priv = DRVDATA (card);
+
+@@ -772,7 +772,7 @@ pgp_read_blob(sc_card_t *card, struct blob *blob)
+ * The OpenPGP card has a TLV encoding according ASN.1 BER-encoding rules.
+ */
+ static int
+-pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
++pgp_enumerate_blob(sc_card_t *card, pgp_blob_t *blob)
+ {
+ const u8 *in;
+ int r;
+@@ -789,7 +789,7 @@ pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
+ unsigned int cla, tag, tmptag;
+ size_t len;
+ const u8 *data = in;
+- struct blob *new;
++ pgp_blob_t *new;
+
+ r = sc_asn1_read_tag(&data, blob->len - (in - blob->data),
+ &cla, &tag, &len);
+@@ -819,10 +819,10 @@ pgp_enumerate_blob(sc_card_t *card, struct blob *blob)
+
+ /* internal: find a blob by ID below a given parent, filling its contents when necessary */
+ static int
+-pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
+- struct blob **ret)
++pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, unsigned int id,
++ pgp_blob_t **ret)
+ {
+- struct blob *child;
++ pgp_blob_t *child;
+ int r;
+
+ if ((r = pgp_enumerate_blob(card, blob)) < 0)
+@@ -858,10 +858,10 @@ pgp_get_blob(sc_card_t *card, struct blob *blob, unsigned int id,
+
+ /* Internal: search recursively for a blob by ID below a given root */
+ static int
+-pgp_seek_blob(sc_card_t *card, struct blob *root, unsigned int id,
+- struct blob **ret)
++pgp_seek_blob(sc_card_t *card, pgp_blob_t *root, unsigned int id,
++ pgp_blob_t **ret)
+ {
+- struct blob *child;
++ pgp_blob_t *child;
+ int r;
+
+ if ((r = pgp_get_blob(card, root, id, ret)) == 0)
+@@ -883,11 +883,11 @@ pgp_seek_blob(sc_card_t *card, struct blob *root, unsigned int id,
+ }
+
+ /* internal: find a blob by tag - pgp_seek_blob with optimizations */
+-static struct blob *
++static pgp_blob_t *
+ pgp_find_blob(sc_card_t *card, unsigned int tag)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob = NULL;
++ pgp_blob_t *blob = NULL;
+ int r;
+
+ /* Check if current selected blob is which we want to test*/
+@@ -941,7 +941,7 @@ static int
+ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob;
++ pgp_blob_t *blob;
+ unsigned int path_start = 0;
+ unsigned int n;
+ sc_path_t dummy_path;
+@@ -1022,7 +1022,7 @@ static int
+ pgp_list_files(sc_card_t *card, u8 *buf, size_t buflen)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob;
++ pgp_blob_t *blob;
+ unsigned int k;
+ int r;
+
+@@ -1058,7 +1058,7 @@ pgp_read_binary(sc_card_t *card, unsigned int idx,
+ u8 *buf, size_t count, unsigned long flags)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob;
++ pgp_blob_t *blob;
+ int r;
+
+ LOG_FUNC_CALLED(card->ctx);
+@@ -1134,7 +1134,7 @@ static int
+ pgp_get_pubkey_pem(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob, *mod_blob, *exp_blob;
++ pgp_blob_t *blob, *mod_blob, *exp_blob;
+ sc_pkcs15_pubkey_t pubkey;
+ u8 *data;
+ size_t len;
+@@ -1329,7 +1329,7 @@ static int
+ pgp_put_data(sc_card_t *card, unsigned int tag, const u8 *buf, size_t buf_len)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *affected_blob = NULL;
++ pgp_blob_t *affected_blob = NULL;
+ struct do_info *dinfo = NULL;
+ int r;
+
+@@ -1603,7 +1603,7 @@ static int
+ pgp_update_new_algo_attr(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *algo_blob;
++ pgp_blob_t *algo_blob;
+ unsigned int old_modulus_len; /* Measured in bit */
+ unsigned int old_exponent_len;
+ const unsigned int tag = 0x00C0 | key_info->keytype;
+@@ -1708,7 +1708,7 @@ pgp_calculate_and_store_fingerprint(sc_card_t *card, time_t ctime,
+ u8 *p; /* Use this pointer to set fp_buffer content */
+ size_t pk_packet_len;
+ unsigned int tag;
+- struct blob *fpseq_blob;
++ pgp_blob_t *fpseq_blob;
+ u8 *newdata;
+ int r;
+
+@@ -1797,7 +1797,7 @@ pgp_update_pubkey_blob(sc_card_t *card, u8* modulus, size_t modulus_len,
+ u8* exponent, size_t exponent_len, u8 key_id)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *pk_blob;
++ pgp_blob_t *pk_blob;
+ unsigned int blob_id;
+ sc_pkcs15_pubkey_t pubkey;
+ u8 *data = NULL;
+@@ -1939,6 +1939,8 @@ static int pgp_update_card_algorithms(sc_card_t *card, sc_cardctl_openpgp_keygen
+ **/
+ static int pgp_gen_key(sc_card_t *card, sc_cardctl_openpgp_keygen_info_t *key_info)
+ {
++ struct pgp_priv_data *priv = DRVDATA(card);
++ pgp_blob_t *algo_blob;
+ sc_apdu_t apdu;
+ /* Temporary variables to hold APDU params */
+ u8 apdu_case;
+@@ -2132,7 +2134,7 @@ pgp_build_extended_header_list(sc_card_t *card, sc_cardctl_openpgp_keystore_info
+ };
+ size_t comp_to_add = 3;
+ size_t req_e_len = 0; /* The exponent length specified in Algorithm Attributes */
+- struct blob *alat_blob;
++ pgp_blob_t *alat_blob;
+ u8 i;
+ int r;
+
+@@ -2483,7 +2485,7 @@ static int
+ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob;
++ pgp_blob_t *blob;
+ sc_file_t *file;
+ u8 key_id;
+ int r;
+@@ -2533,7 +2535,7 @@ pgp_update_binary(sc_card_t *card, unsigned int idx,
+ const u8 *buf, size_t count, unsigned long flags)
+ {
+ struct pgp_priv_data *priv = DRVDATA(card);
+- struct blob *blob = priv->current;
++ pgp_blob_t *blob = priv->current;
+ int r = SC_SUCCESS;
+
+ LOG_FUNC_CALLED(card->ctx);
+--
+2.1.3
+
--- /dev/null
+From 8a87a4ee9107f250254d5c93c6fd62224c400ce7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Mon, 14 Jul 2014 01:30:28 +0800
+Subject: [PATCH 24/26] OpenPGP: Fix crash after accessing inexistent file.
+
+---
+ src/libopensc/card-openpgp.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index ca3173c..94c69ae 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -973,7 +973,6 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+ * So we set its size to be the same as max certificate size the card supports. */
+ (*ret)->size = priv->max_cert_size;
+ }
+- priv->current = NULL;
+ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
+ }
+
+@@ -990,7 +989,6 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+ /* This file ID is refered when importing key&certificate via pkcs15init, like above.
+ * We pretend to successfully find this inexistent file. */
+ if (id == 0x4402 || id == 0x5f48) {
+- priv->current = NULL;
+ if (ret == NULL)
+ /* No need to return file */
+ LOG_FUNC_RETURN(card->ctx, SC_SUCCESS);
+@@ -1002,7 +1000,6 @@ pgp_select_file(sc_card_t *card, const sc_path_t *path, sc_file_t **ret)
+ }
+
+ if (r < 0) { /* failure */
+- priv->current = NULL;
+ LOG_FUNC_RETURN(card->ctx, r);
+ }
+ }
+--
+2.1.3
+
--- /dev/null
+From da70a41383e2ab81fbcc89fb1067f5a189e0fb97 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?=
+ <ng.hong.quan@gmail.com>
+Date: Sun, 9 Nov 2014 15:58:40 +0700
+Subject: [PATCH 25/26] Replace hardcode.
+
+---
+ src/libopensc/card-openpgp.c | 72 +++++++++++++++++++++++++-------------------
+ 1 file changed, 41 insertions(+), 31 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 94c69ae..1e6e338 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -152,6 +152,24 @@ static int pgp_get_pubkey(sc_card_t *, unsigned int,
+ static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+ u8 *, size_t);
+
++/* The DO holding X.509 certificate is constructed but does not contain child DO.
++ * We should notice this when building fake file system later. */
++#define DO_CERT 0x7f21
++/* Control Reference Template of private keys. Ref: Section 4.3.3.7 of OpenPGP card v2 spec.
++ * Here we seen it as DO just for convenient */
++#define DO_SIGN 0xb600
++#define DO_ENCR 0xb800
++#define DO_AUTH 0xa400
++/* These DO does not exist. They are defined and used just for ease of implementation */
++#define DO_SIGN_SYM 0xb601
++#define DO_ENCR_SYM 0xb801
++#define DO_AUTH_SYM 0xa401
++/* Maximum length for response buffer when reading pubkey. This value is calculated with
++ * 4096-bit key length */
++#define MAXLEN_RESP_PUBKEY 527
++/* Gnuk only support 1 key length (2048 bit) */
++#define MAXLEN_RESP_PUBKEY_GNUK 271
++
+ static struct do_info pgp1_objects[] = { /* OpenPGP card spec 1.1 */
+ { 0x004f, SIMPLE, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
+ { 0x005b, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
+@@ -192,12 +210,12 @@ static struct do_info pgp1_objects[] = { /* OpenPGP card spec 1.1 */
+ { 0x5f35, SIMPLE, READ_ALWAYS | WRITE_PIN3, NULL, sc_put_data },
+ { 0x5f50, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
+ { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
+- { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { DO_AUTH, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { DO_AUTH_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { DO_SIGN, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { DO_SIGN_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { DO_ENCR, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { DO_ENCR_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+ { 0, 0, 0, NULL, NULL },
+ };
+
+@@ -246,30 +264,21 @@ static struct do_info pgp2_objects[] = { /* OpenPGP card spec 2.0 */
+ { 0x5f52, SIMPLE, READ_ALWAYS | WRITE_NEVER, sc_get_data, NULL },
+ /* The 7F21 is constructed DO in spec, but in practice, its content can be retrieved
+ * as simple DO (no need to parse TLV). */
+- { 0x7f21, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
++ { DO_CERT, SIMPLE, READ_ALWAYS | WRITE_PIN3, sc_get_data, sc_put_data },
+ { 0x7f48, CONSTRUCTED, READ_NEVER | WRITE_NEVER, NULL, NULL },
+ { 0x7f49, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, NULL, NULL },
+- { 0xa400, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { DO_AUTH, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+ /* The 0xA401, 0xB601, 0xB801 are just symbolic, it does not represent any real DO.
+ * However, their R/W access condition may block the process of importing key in pkcs15init.
+ * So we set their accesses condition as WRITE_PIN3 (writable). */
+- { 0xa401, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb600, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb601, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+- { 0xb800, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
+- { 0xb801, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { DO_AUTH_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { DO_SIGN, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { DO_SIGN_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
++ { DO_ENCR, CONSTRUCTED, READ_ALWAYS | WRITE_NEVER, pgp_get_pubkey, NULL },
++ { DO_ENCR_SYM, SIMPLE, READ_ALWAYS | WRITE_PIN3, pgp_get_pubkey_pem, NULL },
+ { 0, 0, 0, NULL, NULL },
+ };
+
+-/* The DO holding X.509 certificate is constructed but does not contain child DO.
+- * We should notice this when building fake file system later. */
+-#define DO_CERT 0x7f21
+-/* Maximum length for response buffer when reading pubkey. This value is calculated with
+- * 4096-bit key length */
+-#define MAXLEN_RESP_PUBKEY 527
+-/* Gnuk only support 1 key length (2048 bit) */
+-#define MAXLEN_RESP_PUBKEY_GNUK 271
+-
+ #define DRVDATA(card) ((struct pgp_priv_data *) ((card)->drv_data))
+ struct pgp_priv_data {
+ pgp_blob_t * mf;
+@@ -747,8 +756,9 @@ pgp_read_blob(sc_card_t *card, pgp_blob_t *blob)
+
+ /* Buffer length for Gnuk pubkey */
+ if (card->type == SC_CARD_TYPE_OPENPGP_GNUK &&
+- (blob->id == 0xa400 || blob->id == 0xb600 || blob->id == 0xb800
+- || blob->id == 0xa401 || blob->id == 0xb601 || blob->id == 0xb801)) {
++ (blob->id == DO_AUTH || blob->id == DO_SIGN || blob->id == DO_ENCR
++ || blob->id == DO_AUTH_SYM || blob->id == DO_SIGN_SYM
++ || blob->id == DO_ENCR_SYM)) {
+ buf_len = MAXLEN_RESP_PUBKEY_GNUK;
+ }
+
+@@ -1804,11 +1814,11 @@ pgp_update_pubkey_blob(sc_card_t *card, u8* modulus, size_t modulus_len,
+ LOG_FUNC_CALLED(card->ctx);
+
+ if (key_id == SC_OPENPGP_KEY_SIGN)
+- blob_id = 0xB601;
++ blob_id = DO_SIGN_SYM;
+ else if (key_id == SC_OPENPGP_KEY_ENCR)
+- blob_id = 0xB801;
++ blob_id = DO_ENCR_SYM;
+ else if (key_id == SC_OPENPGP_KEY_AUTH)
+- blob_id = 0xA401;
++ blob_id = DO_AUTH_SYM;
+ else {
+ sc_log(card->ctx, "Unknown key id %X.", key_id);
+ LOG_FUNC_RETURN(card->ctx, SC_ERROR_INVALID_ARGUMENTS);
+@@ -2501,17 +2511,17 @@ pgp_delete_file(sc_card_t *card, const sc_path_t *path)
+ LOG_FUNC_RETURN(card->ctx, SC_ERROR_NOT_SUPPORTED);
+
+ if (card->type != SC_CARD_TYPE_OPENPGP_GNUK &&
+- (file->id == 0xB601 || file->id == 0xB801 || file->id == 0xA401)) {
++ (file->id == DO_SIGN_SYM || file->id == DO_ENCR_SYM || file->id == DO_AUTH_SYM)) {
+ /* These tags are just symbolic. We don't really delete it. */
+ r = SC_SUCCESS;
+ }
+- else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB601) {
++ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_SIGN_SYM) {
+ r = gnuk_delete_key(card, 1);
+ }
+- else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xB801) {
++ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_ENCR_SYM) {
+ r = gnuk_delete_key(card, 2);
+ }
+- else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == 0xA401) {
++ else if (card->type == SC_CARD_TYPE_OPENPGP_GNUK && file->id == DO_AUTH_SYM) {
+ r = gnuk_delete_key(card, 3);
+ }
+ else {
+--
+2.1.3
+
--- /dev/null
+From b9dae832db54b206a15bcc12e290cef50f31c3d0 Mon Sep 17 00:00:00 2001
+From: george <ggkitsas@yahoo.com>
+Date: Tue, 11 Nov 2014 16:16:15 +0100
+Subject: [PATCH 26/26] hardcode->defines for DO's
+
+---
+ src/libopensc/card-openpgp.c | 16 ++++++++++++++--
+ 1 file changed, 14 insertions(+), 2 deletions(-)
+
+diff --git a/src/libopensc/card-openpgp.c b/src/libopensc/card-openpgp.c
+index 1e6e338..8464914 100644
+--- a/src/libopensc/card-openpgp.c
++++ b/src/libopensc/card-openpgp.c
+@@ -164,6 +164,18 @@ static int pgp_get_pubkey_pem(sc_card_t *, unsigned int,
+ #define DO_SIGN_SYM 0xb601
+ #define DO_ENCR_SYM 0xb801
+ #define DO_AUTH_SYM 0xa401
++/* Private DO's */
++#define DO_PRIV1 0x0101
++#define DO_PRIV2 0x0102
++#define DO_PRIV3 0x0103
++#define DO_PRIV4 0x0104
++/* Cardholder information DO's */
++#define DO_CARDHOLDER 0x65
++#define DO_NAME 0x5b
++#define DO_LANG_PREF 0x5f2d
++#define DO_SEX 0x5f35
++
++
+ /* Maximum length for response buffer when reading pubkey. This value is calculated with
+ * 4096-bit key length */
+ #define MAXLEN_RESP_PUBKEY 527
+@@ -851,7 +863,7 @@ pgp_get_blob(sc_card_t *card, pgp_blob_t *blob, unsigned int id,
+ /* Special case:
+ * Gnuk does not have default value for children of DO 65 (DOs 5B, 5F2D, 5F35)
+ * So, if these blob was not found, we create it. */
+- if (blob->id == 0x65 && (id == 0x5B || id == 0x5F2D || id == 0x5F35)) {
++ if (blob->id == DO_CARDHOLDER && (id == DO_NAME || id == DO_LANG_PREF || id == DO_SEX)) {
+ sc_log(card->ctx, "Create blob %X under %X", id, blob->id);
+ child = pgp_new_blob(card, blob, id, sc_file_new());
+ if (child) {
+@@ -1198,7 +1210,7 @@ pgp_get_data(sc_card_t *card, unsigned int tag, u8 *buf, size_t buf_len)
+ /* For Gnuk card, if there is no certificate, it returns error instead of empty data.
+ * So, for this case, we ignore error and consider success */
+ if (r == SC_ERROR_DATA_OBJECT_NOT_FOUND && card->type == SC_CARD_TYPE_OPENPGP_GNUK
+- && (tag == DO_CERT || tag == 0x0101 || tag == 0x0102 || tag == 0x0103 || tag == 0x0104)) {
++ && (tag == DO_CERT || tag == DO_PRIV1 || tag == DO_PRIV2 || tag == DO_PRIV3 || tag == DO_PRIV4)) {
+ r = SC_SUCCESS;
+ apdu.resplen = 0;
+ }
+--
+2.1.3
+
PKG_MD5SUM:=20682e4d8d1ae9ec5af3cf43e808b8cb
PKG_LICENSE:=BSD-2-Clause
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
PKG_INSTALL:=1
include $(TOPDIR)/rules.mk
PKG_NAME:=pciutils
-PKG_VERSION:=3.2.1
+PKG_VERSION:=3.3.0
PKG_RELEASE:=1
+PKG_USE_MIPS16:=0
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@KERNEL/software/utils/pciutils
-PKG_MD5SUM:=425b1acad6854cc2bbb06ac8e48e76fc
+PKG_MD5SUM:=bf6ce5c50b273ffc2d27f659e929a37e
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=GPL-2.0
--- a/Makefile
+++ b/Makefile
-@@ -108,7 +108,7 @@ distclean: clean
+@@ -111,7 +111,7 @@ distclean: clean
install: all
# -c is ignored on Linux, but required on FreeBSD
$(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7
--- a/Makefile
+++ b/Makefile
-@@ -85,7 +85,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS)
+@@ -88,7 +88,7 @@ lspci: LDLIBS+=$(LIBKMOD_LIBS)
ls-kernel.o: CFLAGS+=$(LIBKMOD_CFLAGS)
update-pciids: update-pciids.sh
echo_n "Looking for access methods..."
-LIBRESOLV=-lresolv
+LIBRESOLV=
+ LIBEXT=so
case $sys in
- linux*)
include $(TOPDIR)/rules.mk
PKG_NAME:=pcsc-lite
-PKG_VERSION:=1.8.11
+PKG_VERSION:=1.8.13
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/3991
-PKG_MD5SUM:=73502ca4ba6526727f9f49c63d805408
+PKG_SOURCE_URL:=https://alioth.debian.org/frs/download.php/file/4126
+PKG_MD5SUM:=4dcd22d20a6df8810fac5480cc320b6d
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
PKG_NAME:=rpcd-mod-lxc
PKG_RELEASE=20141012
+PKG_LICENSE:=ISC
+
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
--- /dev/null
+#
+# Copyright (C) 2008-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=sispmctl
+PKG_VERSION:=3.1+20120206
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=5ff4a05a5bcb6a64a9d6f77fed47014512f66b11
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_URL:=git://git.code.sf.net/p/sispmctl/git
+PKG_MAINTAINER:=Richard Kunze <richard.kunze@web.de>
+PKG_LICENSE:=GPL-2.0+
+
+PKG_INSTALL:=1
+PKG_FIXUP:=autoreconf
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/sispmctl
+ SECTION:=utils
+ CATEGORY:=Utilities
+ TITLE:=Silver Shield PM Control for Linux
+ URL:=http://sispmctl.sourceforge.net/
+ DEPENDS:=+libusb-compat
+endef
+
+define Package/sispmctl/description
+ The sispmctl tool can control Gembird SIS-PM Silver Shield
+ programmable power outlet strips (also known under the name
+ Revolt Intelli-Plug) from the command line.
+ .
+ It can be used to switch on or off any of the programmable
+ power sockets of the SIS-PM via USB. It can also show the
+ current status of each power socket, and it can handle
+ multiple SIS-PM devices, too.
+endef
+
+TARGET_CFLAGS += -D_GNU_SOURCE
+CONFIGURE_ARGS += \
+ --enable-webless \
+ --disable-dependency-tracking
+
+define Package/sispmctl/install
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(PKG_NAME) $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,sispmctl))
--- /dev/null
+--- a/src/sispm_ctl.c
++++ b/src/sispm_ctl.c
+@@ -33,6 +33,7 @@
+ #include <stdlib.h>
+ #include <unistd.h>
+ #include <time.h>
++#include <sys/types.h>
+ #include <usb.h>
+ #include <assert.h>
+ #include "sispm_ctl.h"
+--- a/src/main.c
++++ b/src/main.c
+@@ -34,11 +34,11 @@
+ #define __USE_XOPEN
+ #include <time.h>
+ #include <signal.h>
+-#include <usb.h>
+ #include <assert.h>
+ #include <getopt.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#include <usb.h>
+
+ #include <fcntl.h>
+
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_MAINTAINER:=Christian Pointner <equinox@spreadspace.org>
PKG_LICENSE:=GPL-2.0+
-PKG_LICENSE_FILE:=gpl-2.0.txt
+PKG_LICENSE_FILES:=gpl-2.0.txt
include $(INCLUDE_DIR)/package.mk
define Package/stm32flash
PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/tcsh/
PKG_MD5SUM:=6eed09dbd4223ab5b6955378450d228a
PKG_LICENSE:=BSD-4-Clause-UC
-PKG_LICENSE_FILE:=Copyright
+PKG_LICENSE_FILES:=Copyright
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
include $(TOPDIR)/rules.mk
PKG_NAME:=tracertools
-PKG_VERSION:=20141022
+PKG_VERSION:=20141027
PKG_RELEASE=$(PKG_SOURCE_VERSION)
PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://gitorious.org/tracertools/tracertools.git
-PKG_SOURCE_VERSION:=9c3c2e8b81fb8745752ee195b028a50b88dc711b
+PKG_SOURCE_VERSION:=9ba70d1fe4f3c0f24d565d98c79fee71711823f0
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/rules.mk
PKG_NAME:=unrar
-PKG_VERSION:=5.2.1
+PKG_VERSION:=5.2.2
PKG_RELEASE:=1
PKG_SOURCE:=unrarsrc-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.rarlab.com/rar
-PKG_MD5SUM:=451d75ce182abccfa60b47f605aaf736
+PKG_MD5SUM:=69ef5af8442cbb7dfdebe298bfb9c61a
PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
PKG_LICENSE:=UnRAR
PKG_MAINTAINER:=Lukasz Baj <l.baj@radytek.com>
PKG_LICENSE:=GPL-2.0
-PKG_LICENSE_FILE:=COPYING.GPLv2
+PKG_LICENSE_FILES:=COPYING.GPLv2
PKG_SOURCE_URL:=https://github.com/libimobiledevice/usbmuxd.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
PKG_LICENSE:=GPL-3.0+
-PKG_LICENSE_FILE:=COPYING
+PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
--- /dev/null
+#
+# Copyright (C) 2007-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# Author: Michael Geddes
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=zoneinfo
+PKG_VERSION:=2014j
+PKG_VERSION_CODE:=2014j
+PKG_RELEASE:=2
+
+#As i couldn't find real license used "Puplic Domain"
+#as referense to http://www.iana.org/time-zones/repository/tz-link.html
+PKG_LICENSE:=Public Domain
+
+PKG_SOURCE:=tzdata$(PKG_VERSION).tar.gz
+PKG_SOURCE_CODE:=tzcode$(PKG_VERSION_CODE).tar.gz
+PKG_SOURCE_URL:=http://www.iana.org/time-zones/repository/releases
+PKG_MD5SUM:=2d7ea9c309f0d4e162e426e568290ca3
+
+include $(INCLUDE_DIR)/package.mk
+
+define Download/tzcode
+ FILE=$(PKG_SOURCE_CODE)
+ URL=$(PKG_SOURCE_URL)
+ MD5SUM=970119e9765bc5a9320368851c91ecb6
+endef
+
+$(eval $(call Download,tzcode))
+
+define Package/zoneinfo/Default
+ SUBMENU:=zoneinfo
+ TITLE:=Zone Information
+ SECTION:=utils
+ CATEGORY:=Utilities
+ MAINTAINER=Vladimir Ulrich <admin@evl.su>
+endef
+
+define Package/zoneinfo-core
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (core)
+endef
+
+define Package/zoneinfo-simple
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (simple)
+endef
+
+define Package/zoneinfo-africa
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Africa)
+endef
+
+define Package/zoneinfo-northamerica
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (NorthAmerica)
+endef
+
+define Package/zoneinfo-southamerica
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (SouthAmerica)
+endef
+
+define Package/zoneinfo-poles
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Arctic, Antarctic)
+endef
+
+define Package/zoneinfo-asia
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Asia)
+endef
+
+define Package/zoneinfo-atlantic
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Atlantic)
+endef
+
+define Package/zoneinfo-australia-nz
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Australia-NZ)
+endef
+
+define Package/zoneinfo-pacific
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Pacific)
+endef
+
+define Package/zoneinfo-europe
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (Europe)
+endef
+
+define Package/zoneinfo-india
+$(call Package/zoneinfo/Default)
+ TITLE:=Zone Information (India)
+endef
+
+define Build/Prepare
+ (cd $(PKG_BUILD_DIR) && tar -xzf $(DL_DIR)/$(PKG_SOURCE_CODE) && tar -xzf $(DL_DIR)/$(PKG_SOURCE))
+endef
+
+define Build/Compile
+ CFLAGS="$(HOST_CFLAGS)" \
+ $(MAKE) -C $(PKG_BUILD_DIR) -f Makefile \
+ $(HOST_CONFIGURE_OPTS) \
+ CC="$(HOSTCC)" \
+ LD="\$$$$(CC)" \
+ CPPFLAGS="$(HOST_CPPFLAGS)" \
+ LDFLAGS="$(HOST_LDFLAGS)" \
+ TOPDIR="$(PKG_INSTALL_DIR)" \
+ TZDIR="$(PKG_INSTALL_DIR)/zoneinfo" \
+ install
+endef
+
+define Package/zoneinfo-core/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in \
+ CET CST6CDT EET EST EST5EDT GB-Eire Eire \
+ GB GMT GMT+0 GMT-0 GMT0 Greenwich \
+ HST MET MST MST7MDT \
+ PRC PST8PDT ROC ROK UCT UTC \
+ Universal W-SU WET Zulu Etc/* zone.tab ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-simple/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Pacific/Honolulu \
+ America/Anchorage America/Los_Angeles America/Denver \
+ America/Chicago America/New_York America/Caracas \
+ America/Sao_Paulo Europe/London Europe/Paris \
+ Africa/Cairo Europe/Moscow Asia/Dubai \
+ Asia/Karachi Asia/Dhaka Asia/Bankok \
+ Asia/Hong_Kong Asia/Tokyo Australia/Darwin \
+ Australia/Adelaide Australia/Brisbane Australia/Sydney \
+ Australia/Perth Pacific/Noumea ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-africa/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo/Africa
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/Africa/* \
+ $(1)/usr/share/zoneinfo/Africa
+endef
+
+define Package/zoneinfo-northamerica/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in US America Canada Mexico Cuba Jamaica Navajo ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+ rm -rf $(1)/usr/share/zoneinfo/America/Argentina
+endef
+
+define Package/zoneinfo-southamerica/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Brazil Chile ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo/America/Argentina
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/America/Argentina/* \
+ $(1)/usr/share/zoneinfo/America/Argentina
+endef
+
+define Package/zoneinfo-poles/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Antarctica Arctic ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-asia/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Asia Japan Singapore Hongkong ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-atlantic/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Atlantic Iceland ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-australia-nz/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in NZ NZ-CHAT Australia ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-pacific/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Pacific Kwajalein ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-europe/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Europe Portugal Poland ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+define Package/zoneinfo-india/install
+ $(INSTALL_DIR) $(1)/usr/share/zoneinfo
+ for i in Indian ; do \
+ $(CP) $(PKG_INSTALL_DIR)/zoneinfo/$$$$i \
+ $(1)/usr/share/zoneinfo ; \
+ done
+endef
+
+$(eval $(call BuildPackage,zoneinfo-simple))
+$(eval $(call BuildPackage,zoneinfo-core))
+$(eval $(call BuildPackage,zoneinfo-africa))
+$(eval $(call BuildPackage,zoneinfo-northamerica))
+$(eval $(call BuildPackage,zoneinfo-southamerica))
+$(eval $(call BuildPackage,zoneinfo-poles))
+$(eval $(call BuildPackage,zoneinfo-asia))
+$(eval $(call BuildPackage,zoneinfo-atlantic))
+$(eval $(call BuildPackage,zoneinfo-australia-nz))
+$(eval $(call BuildPackage,zoneinfo-pacific))
+$(eval $(call BuildPackage,zoneinfo-europe))
+$(eval $(call BuildPackage,zoneinfo-india))