diff options
163 files changed, 8922 insertions, 3069 deletions
diff --git a/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch b/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch new file mode 100644 index 000000000..afc5cfdc9 --- /dev/null +++ b/devel/gcc/patches/020-disable-check-for-sys-sdt-h.patch @@ -0,0 +1,45 @@ +diff --git a/gcc/configure b/gcc/configure +index 3793681..bcda752 100755 +--- a/gcc/configure ++++ b/gcc/configure +@@ -26876,19 +26876,6 @@ $as_echo "#define TARGET_LIBC_PROVIDES_SSP 1" >>confdefs.h + + fi + +-# Test for <sys/sdt.h> on the target. +- +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 +-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; } +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- +-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h +- +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 +-$as_echo "$have_sys_sdt_h" >&6; } + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 3ee1d67..e321218 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -4796,16 +4796,6 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then + [Define if your target C library provides stack protector support]) + fi + +-# Test for <sys/sdt.h> on the target. +-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) +-AC_MSG_CHECKING(sys/sdt.h in the target C library) +-have_sys_sdt_h=no +-if test -f $target_header_dir/sys/sdt.h; then +- have_sys_sdt_h=yes +- AC_DEFINE(HAVE_SYS_SDT_H, 1, +- [Define if your target C library provides sys/sdt.h]) +-fi +-AC_MSG_RESULT($have_sys_sdt_h) + + # Check if TFmode long double should be used by default or not. + # Some glibc targets used DFmode long double, but with glibc 2.4 diff --git a/lang/dkjson/Makefile b/lang/dkjson/Makefile index c7a7d8729..4a6422874 100644 --- a/lang/dkjson/Makefile +++ b/lang/dkjson/Makefile @@ -13,7 +13,6 @@ PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://dkolf.de/src/dkjson-lua.fsl/tarball/ -PKG_BUILD_DIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_MD5SUM:=dbe706722dd64308172cf8e37395e762 PKG_LICENSE:=MIT diff --git a/lang/luasql/Makefile b/lang/luasql/Makefile index 513fa247d..12fbfb61f 100644 --- a/lang/luasql/Makefile +++ b/lang/luasql/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luasql -PKG_VERSION:=2.1.1 +PKG_VERSION:=2.3.0 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://files.luaforge.net/releases/luasql/luasql -PKG_MD5SUM:=63bdd57de4b9d1be336ba112d8cb69eb +PKG_SOURCE:=v$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/keplerproject/luasql/archive/ +PKG_MD5SUM:=af9f0f3a2313a1fcf88c40700092048d PKG_LICENSE:=MIT PKG_LICENSE_FILE:=docs/us/license.html diff --git a/lang/micropython-lib/Makefile b/lang/micropython-lib/Makefile index a737192c7..b74ad0e08 100644 --- a/lang/micropython-lib/Makefile +++ b/lang/micropython-lib/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=micropython-lib -PKG_VERSION=0.1-20140822-$(PKG_SOURCE_VERSION) +PKG_VERSION=0.1-20141028-$(PKG_SOURCE_VERSION) PKG_RELEASE:=1 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com> @@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git -PKG_SOURCE_VERSION:=46ede279d8fae081319914d00cb4a9bb22102fa1 +PKG_SOURCE_VERSION:=610aa65ceff9f4b0a60514423f543aa807f49f76 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz @@ -27,6 +27,7 @@ PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk define Package/micropython-lib + SUBMENU:=Python SECTION:=lang CATEGORY:=Languages TITLE:=micropython-lib diff --git a/lang/micropython/Makefile b/lang/micropython/Makefile index e73ca7afc..aa9039e94 100644 --- a/lang/micropython/Makefile +++ b/lang/micropython/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=micropython -PKG_VERSION=1.3.3-20141006-$(PKG_SOURCE_VERSION) +PKG_VERSION=1.3.5-20141101-$(PKG_SOURCE_VERSION) PKG_RELEASE:=1 PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com> @@ -17,7 +17,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/micropython/micropython.git -PKG_SOURCE_VERSION:=67f25dfe6f4b13a3b8d40746d2b2fd720c63caed +PKG_SOURCE_VERSION:=1060baa2c26d45c2641ee786581655eb44ffda90 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz @@ -27,6 +27,7 @@ PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk define Package/micropython + SUBMENU:=Python SECTION:=lang CATEGORY:=Languages TITLE:=Micro Python diff --git a/lang/perl/Config.in b/lang/perl/Config.in new file mode 100644 index 000000000..3cfa71daa --- /dev/null +++ b/lang/perl/Config.in @@ -0,0 +1,15 @@ +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 diff --git a/lang/perl/Makefile b/lang/perl/Makefile index bef6c211d..be4f773ef 100644 --- a/lang/perl/Makefile +++ b/lang/perl/Makefile @@ -8,8 +8,8 @@ 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 \ @@ -20,7 +20,7 @@ PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \ 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 @@ -44,6 +44,16 @@ endif 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 @@ -63,6 +73,10 @@ define Package/perl/description 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) ) @@ -128,3 +142,37 @@ $(eval $(call BuildPackage,perl)) $(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)) diff --git a/lang/perl/files/config.sh-arm.in b/lang/perl/files/config.sh-arm.in index 523fef409..df6152ede 100644 --- a/lang/perl/files/config.sh-arm.in +++ b/lang/perl/files/config.sh-arm.in @@ -949,7 +949,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1050,8 +1049,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 - -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 @@ -1109,7 +1106,7 @@ i_syspoll='define' #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' @@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-armeb.in b/lang/perl/files/config.sh-armeb.in index 34520fd19..6c12a5366 100644 --- a/lang/perl/files/config.sh-armeb.in +++ b/lang/perl/files/config.sh-armeb.in @@ -32,7 +32,6 @@ alignbytes='4' ansi2knr='' aphostname='/bin/hostname' api_revision='5' -api_subversion='0' ar='ar' @@ -1050,8 +1049,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 - -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 @@ -1109,7 +1106,7 @@ i_syspoll='define' #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' @@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-avr32.in b/lang/perl/files/config.sh-avr32.in index 37a5d6c04..33cfa69db 100644 --- a/lang/perl/files/config.sh-avr32.in +++ b/lang/perl/files/config.sh-avr32.in @@ -951,7 +951,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1052,8 +1051,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 - -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 @@ -1111,7 +1108,7 @@ i_syspoll='define' #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' @@ -1152,12 +1149,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-i486.in b/lang/perl/files/config.sh-i486.in index f4566367a..b04fa4e7f 100644 --- a/lang/perl/files/config.sh-i486.in +++ b/lang/perl/files/config.sh-i486.in @@ -885,8 +885,8 @@ shortsize='2' 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' @@ -938,7 +938,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1037,7 +1036,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 PERL_PATCHLEVEL= @@ -1094,7 +1092,7 @@ i_syspoll='define' #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' @@ -1135,12 +1133,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-mips.in b/lang/perl/files/config.sh-mips.in index cb313b1e8..75ae8c92b 100644 --- a/lang/perl/files/config.sh-mips.in +++ b/lang/perl/files/config.sh-mips.in @@ -949,7 +949,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1050,8 +1049,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 - -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 @@ -1109,7 +1106,7 @@ i_syspoll='define' #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' @@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-mipsel.in b/lang/perl/files/config.sh-mipsel.in index a3e841613..86b6c6433 100644 --- a/lang/perl/files/config.sh-mipsel.in +++ b/lang/perl/files/config.sh-mipsel.in @@ -938,7 +938,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1037,7 +1036,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 PERL_PATCHLEVEL= @@ -1094,7 +1092,7 @@ i_syspoll='define' #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' @@ -1135,12 +1133,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-powerpc.in b/lang/perl/files/config.sh-powerpc.in index acd62b7ae..650f94f0f 100644 --- a/lang/perl/files/config.sh-powerpc.in +++ b/lang/perl/files/config.sh-powerpc.in @@ -949,7 +949,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1050,8 +1049,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 - -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 @@ -1109,7 +1106,7 @@ i_syspoll='define' #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' @@ -1150,12 +1147,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/config.sh-x86_64.in b/lang/perl/files/config.sh-x86_64.in index c7bb86ca4..6a2bd1bfb 100644 --- a/lang/perl/files/config.sh-x86_64.in +++ b/lang/perl/files/config.sh-x86_64.in @@ -938,7 +938,6 @@ stdio_stream_array='' strerror_r_proto='0' #strings='/usr/include/string.h' submit='' -subversion='0' sysman='/usr/share/man/man1' tail='' tar='' @@ -1037,7 +1036,6 @@ config_args='-der' config_argc=1 config_arg1='-der' PERL_REVISION=5 -PERL_SUBVERSION=0 PERL_API_REVISION=5 PERL_API_SUBVERSION=0 PERL_PATCHLEVEL= @@ -1094,7 +1092,7 @@ i_syspoll='define' #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' @@ -1135,12 +1133,14 @@ privlib='/usr/lib/perl5/5.20' 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%%' diff --git a/lang/perl/files/perl-run_tests.sh b/lang/perl/files/perl-run_tests.sh new file mode 100755 index 000000000..af6a39c94 --- /dev/null +++ b/lang/perl/files/perl-run_tests.sh @@ -0,0 +1,24 @@ +#!/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 diff --git a/lang/perl/perlbase.mk b/lang/perl/perlbase.mk index cc9169076..ab08b3860 100644 --- a/lang/perl/perlbase.mk +++ b/lang/perl/perlbase.mk @@ -19,6 +19,19 @@ endef $(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 @@ -27,11 +40,25 @@ endef 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 @@ -40,6 +67,7 @@ endef define Package/perlbase-attribute/install $(call perlmod/Install,$(1),Attribute,) +$(call perlmod/InstallBaseTests,$(1),dist/Attribute-Handlers/t) endef $(eval $(call BuildPackage,perlbase-attribute)) @@ -52,12 +80,26 @@ DEPENDS+=+perlbase-essential 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 @@ -66,6 +108,7 @@ endef define Package/perlbase-autoloader/install $(call perlmod/Install,$(1),AutoLoader.pm,) +$(call perlmod/InstallBaseTests,$(1),cpan/AutoLoader/t) endef $(eval $(call BuildPackage,perlbase-autoloader)) @@ -78,7 +121,7 @@ DEPENDS+=+perlbase-config +perlbase-essential +perlbase-file 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)) @@ -91,6 +134,7 @@ endef define Package/perlbase-autouse/install $(call perlmod/Install,$(1),autouse.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/autouse/t) endef $(eval $(call BuildPackage,perlbase-autouse)) @@ -104,6 +148,7 @@ endef 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)) @@ -117,6 +162,7 @@ endef define Package/perlbase-base/install $(call perlmod/Install,$(1),base.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/base/t) endef $(eval $(call BuildPackage,perlbase-base)) @@ -155,7 +201,8 @@ DEPENDS+=+perlbase-bigint +perlbase-essential 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)) @@ -194,6 +241,7 @@ endef 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)) @@ -202,11 +250,11 @@ $(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)) @@ -233,6 +281,7 @@ endef 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)) @@ -241,10 +290,12 @@ $(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)) @@ -253,11 +304,13 @@ $(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)) @@ -284,6 +337,7 @@ endef 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)) @@ -310,6 +364,7 @@ endef 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)) @@ -335,7 +390,9 @@ DEPENDS+=+perlbase-essential +perlbase-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)) @@ -362,6 +419,8 @@ endef 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)) @@ -388,6 +447,7 @@ endef define Package/perlbase-dumpvalue/install $(call perlmod/Install,$(1),Dumpvalue.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/Dumpvalue/t) endef $(eval $(call BuildPackage,perlbase-dumpvalue)) @@ -413,6 +473,7 @@ endef define Package/perlbase-dynaloader/install $(call perlmod/Install,$(1),DynaLoader.pm,) +$(call perlmod/InstallBaseTests,$(1),ext/DynaLoader/t) endef $(eval $(call BuildPackage,perlbase-dynaloader)) @@ -426,6 +487,7 @@ endef 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)) @@ -439,6 +501,7 @@ endef 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)) @@ -464,6 +527,7 @@ endef define Package/perlbase-env/install $(call perlmod/Install,$(1),Env.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/Env/t) endef $(eval $(call BuildPackage,perlbase-env)) @@ -477,6 +541,7 @@ endef define Package/perlbase-errno/install $(call perlmod/Install,$(1),Errno.pm,) +$(call perlmod/InstallBaseTests,$(1),ext/Errno/t) endef $(eval $(call BuildPackage,perlbase-errno)) @@ -485,24 +550,40 @@ $(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)) @@ -529,6 +610,7 @@ endef 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)) @@ -566,7 +648,9 @@ DEPENDS+=+perlbase-class +perlbase-config +perlbase-cwd +perlbase-errno +perlbas 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)) @@ -580,6 +664,7 @@ endef define Package/perlbase-filecache/install $(call perlmod/Install,$(1),FileCache.pm,) +$(call perlmod/InstallBaseTests,$(1),ext/FileCache/t) endef $(eval $(call BuildPackage,perlbase-filecache)) @@ -618,6 +703,7 @@ endef 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)) @@ -644,6 +730,7 @@ endef 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)) @@ -657,6 +744,7 @@ endef define Package/perlbase-getopt/install $(call perlmod/Install,$(1),Getopt,) +$(call perlmod/InstallBaseTests,$(1),cpan/Getopt-Long/t) endef $(eval $(call BuildPackage,perlbase-getopt)) @@ -670,11 +758,26 @@ endef 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 @@ -682,7 +785,9 @@ DEPENDS+=+perlbase-essential +perlbase-posix 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)) @@ -695,6 +800,7 @@ endef define Package/perlbase-if/install $(call perlmod/Install,$(1),if.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/if/t) endef $(eval $(call BuildPackage,perlbase-if)) @@ -720,6 +826,7 @@ endef 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)) @@ -733,11 +840,26 @@ endef 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 @@ -772,6 +894,7 @@ endef 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)) @@ -785,6 +908,7 @@ endef 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)) @@ -798,6 +922,7 @@ endef 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)) @@ -811,6 +936,7 @@ endef 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)) @@ -819,11 +945,13 @@ $(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)) @@ -836,7 +964,7 @@ DEPENDS+=+perlbase-essential 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)) @@ -850,6 +978,7 @@ endef 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)) @@ -863,6 +992,7 @@ endef define Package/perlbase-next/install $(call perlmod/Install,$(1),NEXT.pm,) +$(call perlmod/InstallBaseTests,$(1),cpan/NEXT/t) endef $(eval $(call BuildPackage,perlbase-next)) @@ -888,7 +1018,9 @@ DEPENDS+=+perlbase-essential +perlbase-xsloader 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)) @@ -920,6 +1052,20 @@ endef $(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 @@ -928,6 +1074,7 @@ endef define Package/perlbase-package/install $(call perlmod/Install,$(1),Package,) +$(call perlmod/InstallBaseTests,$(1),cpan/Package-Constants/t) endef $(eval $(call BuildPackage,perlbase-package)) @@ -941,6 +1088,7 @@ endef define Package/perlbase-params/install $(call perlmod/Install,$(1),Params,) +$(call perlmod/InstallBaseTests,$(1),cpan/Params-Check/t) endef $(eval $(call BuildPackage,perlbase-params)) @@ -967,6 +1115,7 @@ endef 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)) @@ -979,7 +1128,12 @@ DEPENDS+=+perlbase-config +perlbase-cwd +perlbase-encode +perlbase-essential +pe 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)) @@ -993,6 +1147,7 @@ endef 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)) @@ -1006,6 +1161,7 @@ endef 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)) @@ -1019,6 +1175,7 @@ endef define Package/perlbase-safe/install $(call perlmod/Install,$(1),Safe.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/Safe/t) endef $(eval $(call BuildPackage,perlbase-safe)) @@ -1032,6 +1189,8 @@ endef 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)) @@ -1045,6 +1204,7 @@ endef 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)) @@ -1058,6 +1218,7 @@ endef define Package/perlbase-search/install $(call perlmod/Install,$(1),Search,) +$(call perlmod/InstallBaseTests,$(1),dist/Search-Dict/t) endef $(eval $(call BuildPackage,perlbase-search)) @@ -1084,6 +1245,7 @@ endef define Package/perlbase-selfloader/install $(call perlmod/Install,$(1),SelfLoader.pm,) +$(call perlmod/InstallBaseTests,$(1),dist/SelfLoader/t) endef $(eval $(call BuildPackage,perlbase-selfloader)) @@ -1110,6 +1272,7 @@ endef 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)) @@ -1136,6 +1299,7 @@ endef 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)) @@ -1161,11 +1325,25 @@ endef 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 @@ -1174,6 +1352,7 @@ endef 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)) @@ -1182,11 +1361,13 @@ $(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 @@ -1197,11 +1378,12 @@ $(eval $(call BuildPackage,perlbase-test)) 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)) @@ -1215,6 +1397,7 @@ endef 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)) @@ -1228,6 +1411,7 @@ endef 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)) @@ -1240,7 +1424,8 @@ DEPENDS+=+perlbase-essential +perlbase-fcntl +perlbase-posix 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)) @@ -1254,6 +1439,7 @@ endef 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)) @@ -1267,6 +1453,7 @@ endef 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)) @@ -1325,11 +1512,12 @@ $(eval $(call BuildPackage,perlbase-utf8)) 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)) @@ -1342,6 +1530,10 @@ endef 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 diff --git a/lang/perl/perlmod.mk b/lang/perl/perlmod.mk index 3c3d56720..e8706dc6a 100644 --- a/lang/perl/perlmod.mk +++ b/lang/perl/perlmod.mk @@ -11,6 +11,9 @@ PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0 # 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 @@ -105,7 +108,7 @@ define perlmod/Compile 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 \ @@ -116,12 +119,37 @@ define perlmod/Install $(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 diff --git a/lang/php5/Makefile b/lang/php5/Makefile index 8216fdf80..256cc5b49 100644 --- a/lang/php5/Makefile +++ b/lang/php5/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=php -PKG_VERSION:=5.4.33 +PKG_VERSION:=5.4.34 PKG_RELEASE:=1 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org> @@ -18,7 +18,7 @@ PKG_LICENSE_FILE=LICENSE PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://www.php.net/distributions/ -PKG_MD5SUM:=c6878bb1cdb46bfc1e1a5cd67a024737 +PKG_MD5SUM:=1afe3a10cefec9618acb785ef5064bf9 PKG_FIXUP:=libtool no-autoreconf PKG_BUILD_PARALLEL:=1 diff --git a/lang/python-dns/Makefile b/lang/python-dns/Makefile new file mode 100644 index 000000000..150bdc52a --- /dev/null +++ b/lang/python-dns/Makefile @@ -0,0 +1,46 @@ +# +# 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:=dnspython +PKG_RELEASE:=1 +PKG_VERSION:=1.12.0 +PKG_SOURCE_URL:=http://www.dnspython.org/kits/$(PKG_VERSION) +PKG_MD5SUM:=3f2601ef3c8b77fc6d21a9c77a81efeb +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MAINTAINER:=Denis Shulyaka <Shulyaka@gmail.com> +PKG_LICENSE:=ISC +PKG_LICENSE_FILE:=LICENSE + +include $(INCLUDE_DIR)/package.mk +$(call include_mk, python-package.mk) + +define Package/python-dns + SECTION:=language-python + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=dnspython + URL:=http://www.dnspython.org/ + DEPENDS:=+python-mini +endef + +define Package/python-dns/description + dnspython is a DNS toolkit for Python. It supports almost all record types. It can be used for queries, zone transfers, and dynamic updates. It supports TSIG authenticated messages and EDNS0. +endef + +define Build/Compile + $(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR)) +endef + +define Package/python-dns/install + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/dns/* \ + $(1)$(PYTHON_PKG_DIR) +endef + +$(eval $(call BuildPackage,python-dns)) diff --git a/lang/python/Makefile b/lang/python/Makefile index edecefe1d..bab6ce335 100644 --- a/lang/python/Makefile +++ b/lang/python/Makefile @@ -28,7 +28,7 @@ HOST_BUILD_PARALLEL:=1 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 @@ -51,445 +51,141 @@ define Package/python/Default/description 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)" \ 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 Hooks/Configure/Pre/ConfigSiteInstall + $(CP) ./files/config.site $(PKG_BUILD_DIR)/config.site endef +Hooks/Configure/Pre+=\ + Hooks/Configure/Pre/ConfigSiteInstall + 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) \ $(1)/usr/include/ $(CP) \ $(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \ - $(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).so* \ + $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \ $(1)/usr/lib/ $(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)/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 - $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python - $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python2 - $(CP) $(PKG_BUILD_DIR)/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 +define PyPackage/python/filespec ++|/usr/lib/python$(PYTHON_VERSION) +-|/usr/lib/python$(PYTHON_VERSION)/config +-|/usr/lib/python$(PYTHON_VERSION)/distutils +-|/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 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); \ - ) +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 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)) diff --git a/lang/python/files/python-package.mk b/lang/python/files/python-package.mk index f5ec5cee9..b9349f3c1 100644 --- a/lang/python/files/python-package.mk +++ b/lang/python/files/python-package.mk @@ -17,10 +17,12 @@ PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages 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) \ @@ -28,12 +30,19 @@ define HostPython ) 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) define Package/$(1)/install find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f - @$(SH_FUNC) getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \ + @echo "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" | ( \ IFS='|'; \ while read fop fspec fperm; do \ if [ "$$$$$$$$fop" = "+" ]; then \ @@ -80,6 +89,7 @@ define Build/Compile/PyMod 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) \ diff --git a/lang/python3/Makefile b/lang/python3/Makefile index d97611ea8..d326b267c 100644 --- a/lang/python3/Makefile +++ b/lang/python3/Makefile @@ -70,7 +70,7 @@ MAKE_FLAGS:=\ DESTDIR="$(PKG_INSTALL_DIR)" \ CROSS_COMPILE=yes \ CFLAGS="$(TARGET_CFLAGS) -DNDEBUG -fno-inline" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS) -L$(PKG_BUILD_DIR)" \ LD="$(TARGET_CC)" ENABLE_IPV6:= @@ -102,7 +102,7 @@ define Build/Configure $(CP) ./files/config.site $(PKG_BUILD_DIR) $(call Build/Configure/Default, \ --sysconfdir=/etc \ - --disable-shared \ + --enable-shared \ --without-cxx-main \ --with-threads \ --with-system-ffi="$(STAGING_DIR)/usr" \ @@ -123,7 +123,7 @@ define Build/InstallDev $(1)/usr/include/ $(CP) \ $(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION) \ - $(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \ + $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \ $(1)/usr/lib/ $(CP) \ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \ @@ -156,7 +156,9 @@ endef define Py3Package/python3/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 $(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3 + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/ endef define Host/Configure diff --git a/lang/python3/files/config.site b/lang/python3/files/config.site index f4113357a..cfa56b89b 100644 --- a/lang/python3/files/config.site +++ b/lang/python3/files/config.site @@ -8,11 +8,5 @@ ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no - -# FIXME: moved from Makefile here -#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 \ +ac_cv_buggy_getaddrinfo=no diff --git a/lang/python3/files/python3-package.mk b/lang/python3/files/python3-package.mk index e85b64819..0c4057c7d 100644 --- a/lang/python3/files/python3-package.mk +++ b/lang/python3/files/python3-package.mk @@ -32,10 +32,15 @@ define Py3Package $(call shexport,Py3Package/$(1)/filespec) define Package/$(1)/install - @$(SH_FUNC) getvar $$(call shvar,Py3Package/$(1)/filespec) | ( \ + find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f + @echo "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" | ( \ IFS='|'; \ while read fop fspec fperm; do \ if [ "$$$$$$$$fop" = "+" ]; then \ + if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \ + echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \ + exit 1; \ + fi; \ dpath=`dirname "$$$$$$$$fspec"`; \ if [ -n "$$$$$$$$fperm" ]; then \ dperm="-m$$$$$$$$fperm"; \ @@ -67,9 +72,14 @@ endef define Build/Compile/Py3Mod $(call HostPython3, \ cd $(PKG_BUILD_DIR)/$(strip $(1)); \ + CC="$(TARGET_CC)" \ + CCSHARED="$(TARGET_CC) $(FPIC)" \ + LD="$(TARGET_CC)" \ + LDSHARED="$(TARGET_CC) -shared" \ CFLAGS="$(TARGET_CFLAGS)" \ - CPPFLAGS="$(TARGET_CPPFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \ + LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \ + _PYTHON_HOST_PLATFORM="linux-$(ARCH)" \ $(3) \ , \ ./setup.py $(2) \ diff --git a/lang/python3/patches/120-do-not-add-include-dirs-when-cross-compiling.patch b/lang/python3/patches/120-do-not-add-include-dirs-when-cross-compiling.patch new file mode 100644 index 000000000..44be1c8ff --- /dev/null +++ b/lang/python3/patches/120-do-not-add-include-dirs-when-cross-compiling.patch @@ -0,0 +1,14 @@ +diff --git a/setup.py b/setup.py +index 93f390f..ace1494 100644 +--- a/setup.py ++++ b/setup.py +@@ -461,7 +461,8 @@ class PyBuildExt(build_ext): + add_dir_to_list(dir_list, directory) + + if os.path.normpath(sys.base_prefix) != '/usr' \ +- and not sysconfig.get_config_var('PYTHONFRAMEWORK'): ++ and not sysconfig.get_config_var('PYTHONFRAMEWORK') \ ++ and not cross_compiling: + # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework + # (PYTHONFRAMEWORK is set) to avoid # linking problems when + # building a framework with different architectures than diff --git a/lang/python3/patches/130-do-not-run-distutils-tests.patch b/lang/python3/patches/130-do-not-run-distutils-tests.patch new file mode 100644 index 000000000..0291eb198 --- /dev/null +++ b/lang/python3/patches/130-do-not-run-distutils-tests.patch @@ -0,0 +1,37 @@ +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f36c11d..f2b6c71 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1217,32 +1217,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c + done; \ + done + $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt +- if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \ +- $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ +- $(DESTDIR)$(LIBDEST)/distutils/tests ; \ +- fi +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ +- $(DESTDIR)$(LIBDEST) +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \ +- -d $(LIBDEST)/site-packages -f \ +- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt +- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +- $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt + + # Create the PLATDIR source directory, if one wasn't distributed.. + $(srcdir)/Lib/$(PLATDIR): diff --git a/lang/ruby/Makefile b/lang/ruby/Makefile index 8b81daa99..8dc30d5f6 100644 --- a/lang/ruby/Makefile +++ b/lang/ruby/Makefile @@ -10,14 +10,14 @@ 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 @@ -86,7 +86,7 @@ endef 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 diff --git a/libs/avahi/Makefile b/libs/avahi/Makefile index f2d882d32..ea4353be8 100644 --- a/libs/avahi/Makefile +++ b/libs/avahi/Makefile @@ -18,7 +18,7 @@ endif PKG_NAME:=avahi PKG_VERSION:=0.6.31 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz @@ -172,6 +172,22 @@ $(call Package/avahi/Default/description) For more information please see the avahi documentation. endef +define Package/libavahi-compat-libdnssd + $(call Package/avahi/Default) + SECTION:=libs + CATEGORY:=Libraries + DEPENDS:=+libavahi-client + TITLE+= (libdnssd) +endef + +define Package/libavahi-compat-libdnssd/description +$(call Package/avahi/Default/description) + . + This packages adds the libavahi-compat-libdnssd library. + It also automatically adds the required libavahi-client package. + For more information please see the avahi documentation. +endef + define Package/avahi-utils $(call Package/avahi/Default) SUBMENU:=IP Addresses and Names @@ -203,6 +219,7 @@ CONFIGURE_ARGS+= \ --disable-dbm \ --enable-gdbm \ --enable-libdaemon \ + $(if $(CONFIG_PACKAGE_libavahi-compat-libdnssd),--enable-compat-libdns_sd) \ --disable-python \ --disable-pygtk \ --disable-python-dbus \ @@ -247,6 +264,9 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-* $(1)/usr/lib/ +ifneq ($(CONFIG_PACKAGE_libavahi-compat-libdnssd),) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd* $(1)/usr/lib/ +endif $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/ endef @@ -273,6 +293,11 @@ define Package/libavahi-client/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libavahi-client.so.* $(1)/usr/lib/ endef +define Package/libavahi-compat-libdnssd/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdns_sd.so.* $(1)/usr/lib/ +endef + define Package/avahi-utils/install $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ @@ -305,6 +330,7 @@ define Package/avahi-dnsconfd/install endef $(eval $(call BuildPackage,libavahi-client)) +$(eval $(call BuildPackage,libavahi-compat-libdnssd)) $(eval $(call BuildPackage,avahi-utils)) $(eval $(call BuildPackage,libavahi-dbus-support)) $(eval $(call BuildPackage,libavahi)) diff --git a/libs/db47/Makefile b/libs/db47/Makefile index 403355f19..563d47c88 100644 --- a/libs/db47/Makefile +++ b/libs/db47/Makefile @@ -12,9 +12,9 @@ BASE_VERSION:=4.7.25 PKG_NAME:=db47 PKG_VERSION:=$(BASE_VERSION).4.NC -PKG_RELEASE:=2 +PKG_RELEASE:=3 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/db-$(BASE_VERSION).NC +PKG_BUILD_DIR:=$(BUILD_DIR)/db-$(BASE_VERSION).NC PKG_SOURCE:=db-$(BASE_VERSION).NC.tar.gz PKG_SOURCE_URL:=http://download.oracle.com/berkeley-db/ PKG_MD5SUM:=073ab7f20d24b3872a51ca762f5090e7 @@ -29,71 +29,30 @@ PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk -define Package/libdb47/Default +define Package/libdb47 SECTION:=libs CATEGORY:=Libraries DEPENDS:=+libxml2 - PROVIDES:=libdb47 + TITLE:=Berkeley DB library (4.7) URL:=http://www.oracle.com/us/products/database/berkeley-db -endef - -define Package/libdb47/Default/description - Berkeley DB library (4.7). -endef - -define Package/libdb47 -$(call Package/libdb47/Default) - VARIANT:=small - TITLE:=Berkeley DB library (4.7) (without statistics etc. support) + PROVIDES:=libdb47-full endef define Package/libdb47/description -$(call Package/libdb47/Default/description) - This package is not built with statistics etc. support. -endef - -define Package/libdb47-full -$(call Package/libdb47/Default) - VARIANT:=full - TITLE:=Berkeley DB library (4.7) (with statistics etc. support) -endef - -define Package/libdb47-full/description -$(call Package/libdb47/Default/description) - This package is built with statistics etc. support. + Berkeley DB library (4.7). endef -define Package/libdb47xx/Default +define Package/libdb47xx SECTION:=libs CATEGORY:=Libraries DEPENDS:=+libdb47 $(CXX_DEPENDS) + TITLE:=Berkeley DB library (4.7) for C++ URL:=http://www.oracle.com/us/products/database/berkeley-db -endef - -define Package/libdb47xx/Default/description - Berkeley DB library (4.7). C++ wrapper. -endef - -define Package/libdb47xx -$(call Package/libdb47xx/Default) - VARIANT:=small - TITLE:=Berkeley DB library (4.7) for C++ (without statistics etc. support) + PROVIDES:=libdb47xx-full endef define Package/libdb47xx/description -$(call Package/libdb47xx/Default/description) - This package is not built with statistics etc. support. -endef - -define Package/libdb47xx-full -$(call Package/libdb47xx/Default) - VARIANT:=full - TITLE:=Berkeley DB library (4.7) for C++ (with statistics etc. support) -endef - -define Package/libdb47xx-full/description -$(call Package/libdb47xx/Default/description) - This package is built with statistics etc. support. + Berkeley DB library (4.7). C++ wrapper. endef CONFIGURE_PATH = build_unix @@ -108,13 +67,8 @@ CONFIGURE_ARGS += \ --disable-rpc \ --enable-compat185 \ --disable-debug \ - --enable-cryptography \ $(if $(CONFIG_PACKAGE_libdb47xx),--enable-cxx,--disable-cxx) -ifeq ($(BUILD_VARIANT),small) - CONFIGURE_ARGS += --enable-smallbuild -endif - TARGET_CFLAGS += $(FPIC) define Build/Compile @@ -129,21 +83,11 @@ define Package/libdb47/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/ endef -define Package/libdb47-full/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb-*.so $(1)/usr/lib/ -endef - define Package/libdb47xx/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb_cxx-*.so $(1)/usr/lib/ endef -define Package/libdb47xx-full/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libdb_cxx-*.so $(1)/usr/lib/ -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/db.h $(1)/usr/include/ @@ -153,6 +97,4 @@ define Build/InstallDev endef $(eval $(call BuildPackage,libdb47)) -$(eval $(call BuildPackage,libdb47-full)) $(eval $(call BuildPackage,libdb47xx)) -$(eval $(call BuildPackage,libdb47xx-full)) diff --git a/libs/file/Makefile b/libs/file/Makefile index 85f01ba62..39bf0bdd7 100644 --- a/libs/file/Makefile +++ b/libs/file/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=file -PKG_VERSION:=5.19 +PKG_VERSION:=5.20 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.astron.com/pub/file/ -PKG_MD5SUM:=e3526f59023f3f7d1ffa4d541335edab +PKG_MD5SUM:=5d5e13eb3e0e13839da869a31790faf2 PKG_LICENSE:=BSD-2c PKG_LICENSE_FILES:=COPYING diff --git a/libs/gnutls/Makefile b/libs/gnutls/Makefile index 4c6b238a6..a435d584f 100644 --- a/libs/gnutls/Makefile +++ b/libs/gnutls/Makefile @@ -21,6 +21,20 @@ PKG_INSTALL:=1 PKG_LIBTOOL_PATHS:=. lib PKG_CHECK_FORMAT_SECURITY:=0 +PKG_CONFIG_DEPENDS:= \ + CONFIG_GNUTLS_ALPN \ + CONFIG_GNUTLS_ANON \ + CONFIG_GNUTLS_CRYPTODEV \ + CONFIG_GNUTLS_DTLS_SRTP \ + CONFIG_GNUTLS_EXT_LIBTASN1 \ + CONFIG_GNUTLS_HEARTBEAT \ + CONFIG_GNUTLS_OCSP \ + CONFIG_GNUTLS_OPENPGP \ + CONFIG_GNUTLS_PKCS11 \ + CONFIG_GNUTLS_PSK \ + CONFIG_GNUTLS_SRP \ + CONFIG_LIBNETTLE_MINI \ + include $(INCLUDE_DIR)/package.mk diff --git a/libs/gperf/Makefile b/libs/gperf/Makefile new file mode 100644 index 000000000..4cdd470f3 --- /dev/null +++ b/libs/gperf/Makefile @@ -0,0 +1,47 @@ +# +# 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:=gperf +PKG_VERSION:=3.0.4 +PKG_RELEASE:=1 +PKG_MD5SUM:=c1f1db32fb6598d6a93e6e88796a8632 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@GNU/gperf +PKG_HOST_ONLY=1 + +PKG_MAINTAINER:=Espen Jürgensen <espenjurgensen+openwrt@gmail.com> +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=COPYING + +include $(INCLUDE_DIR)/host-build.mk +include $(INCLUDE_DIR)/package.mk + +define Package/gperf + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GNU gperf + BUILDONLY:=1 + URL:=http://www.gnu.org/software/gperf +endef + +define Package/gperf/description + GNU gperf is a perfect hash function generator. For a given list of strings, it + produces a hash function and hash table, in form of C or C++ code, for looking + up a value depending on the input string. The hash function is perfect, which + means that the hash table has no collisions, and the hash table lookup needs a + single string comparison only. +endef + +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) install +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,gperf)) diff --git a/libs/libmpdclient/Makefile b/libs/libmpdclient/Makefile index 0a2342295..d81095fb3 100644 --- a/libs/libmpdclient/Makefile +++ b/libs/libmpdclient/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libmpdclient PKG_VERSION:=2.9 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://www.musicpd.org/download/libmpdclient/2/ diff --git a/libs/libmpdclient/patches/001-WIP_musl_compatibility.patch b/libs/libmpdclient/patches/001-WIP_musl_compatibility.patch new file mode 100644 index 000000000..02ea65220 --- /dev/null +++ b/libs/libmpdclient/patches/001-WIP_musl_compatibility.patch @@ -0,0 +1,22 @@ +--- a/src/socket.c ++++ b/src/socket.c +@@ -43,6 +43,7 @@ + #else + # include <netinet/in.h> + # include <arpa/inet.h> ++# include <sys/select.h> + # include <sys/socket.h> + # include <netdb.h> + # include <sys/un.h> +--- a/src/sync.c ++++ b/src/sync.c +@@ -33,6 +33,9 @@ + #include <assert.h> + #include <stdlib.h> + #include <stdio.h> ++#ifndef WIN32 ++#include <sys/select.h> ++#endif + #include <fcntl.h> + #include <unistd.h> + diff --git a/libs/libsodium/Makefile b/libs/libsodium/Makefile index 730579234..d54e4f404 100644 --- a/libs/libsodium/Makefile +++ b/libs/libsodium/Makefile @@ -62,6 +62,8 @@ define Build/InstallDev $(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 diff --git a/libs/libxml2/Makefile b/libs/libxml2/Makefile index d7accab5f..1a7ed5d6a 100644 --- a/libs/libxml2/Makefile +++ b/libs/libxml2/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxml2 -PKG_VERSION:=2.9.1 +PKG_VERSION:=2.9.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://gd.tuwien.ac.at/languages/libxml/ \ http://xmlsoft.org/sources/ \ ftp://fr.rpmfind.net/pub/libxml/ -PKG_MD5SUM:=9c0cfef285d5c4a5c80d00904ddab380 +PKG_MD5SUM:=9e6a9aca9d155737868b3dc5fd82f788 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING diff --git a/libs/nspr/Makefile b/libs/nspr/Makefile index 7c9fe5037..d14d08607 100644 --- a/libs/nspr/Makefile +++ b/libs/nspr/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nspr -PKG_VERSION:=3.16.4 +PKG_VERSION:=3.16.6 PKG_RELEASE:=1 PKG_BUILD_DIR:=$(BUILD_DIR)/nss-$(PKG_VERSION) PKG_SOURCE:=nss-$(PKG_VERSION)-with-nspr-4.10.6.tar.gz -PKG_SOURCE_URL:=ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_4_RTM/src/ +PKG_SOURCE_URL:=ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_16_6_RTM/src/ +PKG_MD5SUM:=4722706ea101948712b5ad003629679f PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk diff --git a/mail/bogofilter/Makefile b/mail/bogofilter/Makefile index 4300c6ada..5ff72c0ff 100644 --- a/mail/bogofilter/Makefile +++ b/mail/bogofilter/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bogofilter PKG_VERSION:=1.2.4 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILE:=COPYING @@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/package.mk define Package/bogofilter SECTION:=mail CATEGORY:=Mail - DEPENDS:=+libdb47-full + DEPENDS:=+libdb47 TITLE:=bogofilter MAINTAINER:=W. Michael Petullo <mike@flyn.org> URL:=http://bogofilter.sourceforge.net/ diff --git a/mail/bogofilter/files/postfix-bogofilter b/mail/bogofilter/files/postfix-bogofilter index 7243b71e9..952d8cda3 100755 --- a/mail/bogofilter/files/postfix-bogofilter +++ b/mail/bogofilter/files/postfix-bogofilter @@ -12,7 +12,7 @@ FILTER_DIR=/mnt/sda1/var/spool/bogofilter # misleading traces in headers, such as local address # canonicalizations. POSTFIX="/usr/sbin/sendmail -G -i" -export BOGOFILTER_DIR=/var/lib/bogofilter +export BOGOFILTER_DIR=/etc/bogofilter # Exit codes from <sysexits.h> EX_TEMPFAIL=75 diff --git a/mail/dovecot/Makefile b/mail/dovecot/Makefile index 275fcb285..1032d9771 100644 --- a/mail/dovecot/Makefile +++ b/mail/dovecot/Makefile @@ -8,12 +8,12 @@ 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 diff --git a/mail/mailman/Makefile b/mail/mailman/Makefile new file mode 100644 index 000000000..1e85627f2 --- /dev/null +++ b/mail/mailman/Makefile @@ -0,0 +1,126 @@ +# +# 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:=mailman +PKG_RELEASE:=1 +PKG_SOURCE_URL:=ftp://ftp.gnu.org/gnu/mailman/ +PKG_VERSION:=2.1.18-1 +PKG_MD5SUM:=dc861ed9698a98499a951eaef7d4db9f +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 + +include $(INCLUDE_DIR)/package.mk + +define Package/mailman + SECTION:=mail + CATEGORY:=Mail + TITLE:=The GNU Mailing List Manager + URL:=http://www.gnu.org/software/mailman/ + DEPENDS:=+postfix +python-mini +uhttpd +python-dns #+python-dev +endef + +define Package/mailman/description + Mailman is free software for managing electronic mail discussion and e-newsletter lists. +endef + +prefix=/usr/local/mailman + +define Package/mailman/conffiles +$(prefix)/Mailman/mm_cfg.py +endef + +CONFIGURE_ARGS += \ + --prefix="$(prefix)" \ + --exec-prefix="$(prefix)" \ + --with-username="root" \ + --with-groupname="root" \ + --with-mail-gid="nogroup" \ + --with-cgi-gid="root" \ + --without-permcheck \ + +define Build/Compile +endef + +define Package/mailman/install + $(INSTALL_DIR) $(1)$(prefix) + cd $(PKG_BUILD_DIR); $(MAKE) DESTDIR=$(1) install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mailman.init $(1)/etc/init.d/mailman + $(INSTALL_DIR) $(1)/usr/www + ln -s $(prefix)/cgi-bin/ $(1)/usr/www/mailman + ln -s $(prefix)/archives/public/ $(1)/usr/www/pipermail + ln -s $(prefix)/icons $(1)/usr/www/icons +endef + +define Package/mailman/postinst +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + + if [ `postconf alias_maps | grep -ci mailman` -eq 0 ] + then + postconf -e "`postconf alias_maps`, cdb:$(prefix)/data/aliases" + fi + cd $(prefix) + hostname=`cat /proc/sys/kernel/hostname` + if [ ! -f data/aliases ] + then + ./bin/genaliases + fi + newaliases + if [ `grep -c DEFAULT_URL_HOST Mailman/mm_cfg.py` -eq 0 ] + then + echo "DEFAULT_EMAIL_HOST = '$$hostname'" >> Mailman/mm_cfg.py + echo "DEFAULT_URL_HOST = '$$hostname'" >> Mailman/mm_cfg.py + echo "add_virtualhost(DEFAULT_URL_HOST, DEFAULT_EMAIL_HOST)" >> Mailman/mm_cfg.py + echo "QRUNNERS.remove(('NewsRunner',1))" >> Mailman/mm_cfg.py + fi + if [ `./bin/list_lists | grep -ci mailman` -eq 0 ] + then + ./bin/newlist --urlhost=$$hostname --emailhost=$$hostname --quiet mailman root@$$hostname mailman + ./bin/config_list -i data/sitelist.cfg mailman + echo "NOTE: A default site-wide mailing list Mailman with password 'mailman' has been created. Please review it and change the password." + ./bin/mmsitepass mailman + echo "NOTE: The default site password 'mailman' has been created." + fi + # /etc/init.d/mailman enable + if [ `ps | grep "mailman/bin/qrunner" | grep -cv grep` -gt 0 ] + then + $(prefix)/bin/mailmanctl -q restart + fi + if [ `grep -c mailman /etc/config/uhttpd` -eq 0 ] + then #we assume that the server is not configured yet, thus print out some help for the first time: + echo "NOTE: Please set the site password using $(prefix)/bin/mmsitepass <your-site-password>" + echo "Please add uhttpd config section to your /etc/config/uhttpd like this:" + echo "config uhttpd mailman" + echo " list listen_http 0.0.0.0:80" + echo " option home /usr/www" + echo " option cgi_prefix /mailman" + echo " no_symlinks 0" + echo "Don't forget to setup firewall for accessing this website!" + echo "To add a mailing list go to http://$$hostname/mailman/create." + fi +fi +endef + +define Package/mailman/prerm +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + + if [ `ps | grep "mailman/bin/qrunner" | grep -cv grep` -gt 0 ] + then + $(prefix)/bin/mailmanctl stop + fi +fi +endef + +$(eval $(call BuildPackage,mailman)) diff --git a/mail/mailman/files/mailman.init b/mail/mailman/files/mailman.init new file mode 100644 index 000000000..f68a45676 --- /dev/null +++ b/mail/mailman/files/mailman.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=50 +STOP=50 + +PYTHON=/usr/bin/python +MAILMANHOME=/usr/local/mailman +MAILMANCTL=$MAILMANHOME/bin/mailmanctl + +start() { + #rm -f $MAILMANHOME/locks/* + $PYTHON $MAILMANCTL -s -q start +} + +stop() { + $PYTHON $MAILMANCTL -q stop +} + +restart() { + $PYTHON $MAILMANCTL -q restart +} diff --git a/mail/mailman/patches/100-postfix.patch b/mail/mailman/patches/100-postfix.patch new file mode 100644 index 000000000..857b99b73 --- /dev/null +++ b/mail/mailman/patches/100-postfix.patch @@ -0,0 +1,12 @@ +diff -rupN mailman-2.1.14-1/Mailman/Defaults.py.in mailman-2.1.14-1_patched/Mailman/Defaults.py.in +--- mailman-2.1.14-1/Mailman/Defaults.py.in 2011-03-01 23:35:57.000000000 +0300 ++++ mailman-2.1.14-1_patched/Mailman/Defaults.py.in 2011-03-09 12:26:10.000000000 +0300 +@@ -439,7 +439,7 @@ DELIVERY_MODULE = 'SMTPDirect' + # standard out (or send an email to the site list owner) for manual twiddling + # of an /etc/aliases style file. Use 'Postfix' if you are using the Postfix + # MTA -- but then also see POSTFIX_STYLE_VIRTUAL_DOMAINS. +-MTA = 'Manual' ++MTA = 'Postfix' + + # If you set MTA='Postfix', then you also want to set the following variable, + # depending on whether you're using virtual domains in Postfix, and which diff --git a/mail/mailman/patches/200-nohostdnspython.patch b/mail/mailman/patches/200-nohostdnspython.patch new file mode 100644 index 000000000..e32110665 --- /dev/null +++ b/mail/mailman/patches/200-nohostdnspython.patch @@ -0,0 +1,68 @@ +diff -Naur mailman-2.1.18-1/configure mailman-2.1.18-1_patched/configure +--- mailman-2.1.18-1/configure 2014-10-26 12:00:38.090360119 +0300 ++++ mailman-2.1.18-1_patched/configure 2014-10-26 12:00:21.323016430 +0300 +@@ -2236,35 +2236,35 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $version" >&5 + $as_echo "$version" >&6; } + +-# See if dnspython is installed. +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dnspython" >&5 +-$as_echo_n "checking dnspython... " >&6; } +- +-cat > conftest.py <<EOF +-try: +- import dns.resolver +- res = 'ok' +-except ImportError: +- res = 'no' +-fp = open("conftest.out", "w") +-fp.write("%s\n" % res) +-fp.close() +-EOF +- +-$PYTHON conftest.py +-havednspython=`cat conftest.out` +-rm -f conftest.out conftest.py +-if test "$havednspython" = "no" +-then +- as_fn_error $? " +- +-***** dnspython not found. It is required for the new +-***** dmarc_moderation_action featurer. Get it from +-***** <http://www.dnspython.org/> or +-***** <https://pypi.python.org/pypi/dnspython/>" "$LINENO" 5 +-fi +-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $havednspython" >&5 +-$as_echo "$havednspython" >&6; } ++## See if dnspython is installed. ++#{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dnspython" >&5 ++#$as_echo_n "checking dnspython... " >&6; } ++# ++#cat > conftest.py <<EOF ++#try: ++# import dns.resolver ++# res = 'ok' ++#except ImportError: ++# res = 'no' ++#fp = open("conftest.out", "w") ++#fp.write("%s\n" % res) ++#fp.close() ++#EOF ++# ++#$PYTHON conftest.py ++#havednspython=`cat conftest.out` ++#rm -f conftest.out conftest.py ++#if test "$havednspython" = "no" ++#then ++# as_fn_error $? " ++# ++#***** dnspython not found. It is required for the new ++#***** dmarc_moderation_action featurer. Get it from ++#***** <http://www.dnspython.org/> or ++#***** <https://pypi.python.org/pypi/dnspython/>" "$LINENO" 5 ++#fi ++#{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $havednspython" >&5 ++#$as_echo "$havednspython" >&6; } + + # Check the email package version. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's email package" >&5 diff --git a/mail/mailman/patches/300-targetpython.patch b/mail/mailman/patches/300-targetpython.patch new file mode 100644 index 000000000..1dd2859f2 --- /dev/null +++ b/mail/mailman/patches/300-targetpython.patch @@ -0,0 +1,12 @@ +diff -Naur mailman-2.1.18-1/configure mailman-2.1.18-1_patched/configure +--- mailman-2.1.18-1/configure 2014-05-06 20:43:56.000000000 +0400 ++++ mailman-2.1.18-1_patched/configure 2014-11-04 15:02:32.892666331 +0300 +@@ -3927,6 +3927,8 @@ + $as_echo "$URLHOST" >&6; } + rm -f conftest.out conftest.py + ++PYTHON=/usr/bin/python ++ + # Checks for libraries. + + for ac_func in strerror setregid syslog diff --git a/mail/mailman/patches/400-modules.patch b/mail/mailman/patches/400-modules.patch new file mode 100644 index 000000000..9fa72a26e --- /dev/null +++ b/mail/mailman/patches/400-modules.patch @@ -0,0 +1,35 @@ +diff -Naur mailman-2.1.18-1/Mailman/MailList.py mailman-2.1.18-1_patched/Mailman/MailList.py +--- mailman-2.1.18-1/Mailman/MailList.py 2014-05-06 20:43:56.000000000 +0400 ++++ mailman-2.1.18-1_patched/Mailman/MailList.py 2014-11-04 15:57:06.832636147 +0300 +@@ -30,7 +30,7 @@ + import shutil + import socket + import urllib +-import cPickle ++import pickle as cPickle + + from cStringIO import StringIO + from UserDict import UserDict +diff -Naur mailman-2.1.18-1/misc/paths.py.in mailman-2.1.18-1_patched/misc/paths.py.in +--- mailman-2.1.18-1/misc/paths.py.in 2014-05-06 20:43:56.000000000 +0400 ++++ mailman-2.1.18-1_patched/misc/paths.py.in 2014-11-04 15:55:49.594941540 +0300 +@@ -66,14 +66,14 @@ + # In a normal interactive Python environment, the japanese.pth and korean.pth + # files would be imported automatically. But because we inhibit the importing + # of the site module, we need to be explicit about importing these codecs. +-if not jaok: +- import japanese ++#if not jaok: ++# import japanese + # As of KoreanCodecs 2.0.5, you had to do the second import to get the Korean + # codecs installed, however leave the first import in there in case an upgrade + # changes this. +-if not kook: +- import korean +- import korean.aliases ++#if not kook: ++# import korean ++# import korean.aliases + # Arabic and Hebrew (RFC-1556) encoding aliases. (temporary solution) + import encodings.aliases + encodings.aliases.aliases.update({ diff --git a/mail/postfix/Makefile b/mail/postfix/Makefile index 213d8d65f..704530e2d 100644 --- a/mail/postfix/Makefile +++ b/mail/postfix/Makefile @@ -8,15 +8,15 @@ include $(TOPDIR)/rules.mk PKG_NAME:=postfix -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=ftp://ftp.porcupine.org/mirrors/postfix-release/official/ -PKG_VERSION:=2.11.1 -PKG_MD5SUM:=56ac1f1a79737c4ac1e24535a122a4a6 +PKG_VERSION:=2.11.3 +PKG_MD5SUM:=c3f0f51d8865559b40e9350eb3816011 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_BUILD_DEPENDS:=+tinycdb +PKG_BUILD_DEPENDS:=+POSTFIX_CDB:tinycdb include $(INCLUDE_DIR)/package.mk @@ -25,7 +25,7 @@ define Package/postfix CATEGORY:=Mail TITLE:=Postfix Mail Transmit Agent URL:=http://www.postfix.org/ - DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +libpcre + DEPENDS:=+POSTFIX_TLS:libopenssl +POSTFIX_SASL:libsasl2 +POSTFIX_LDAP:libopenldap +POSTFIX_DB:libdb47 +libpcre endef define Package/postfix/description @@ -49,17 +49,22 @@ define Package/postfix/config default y help Implements LDAP support in postfix (using OpenLDAP). + config POSTFIX_DB + bool "BerkeleyDB support" + default n + help + Implements support for btree files using Berkeley DB. Note that hash files support is not compiled into Berkeley DB OpenWRT distribution + config POSTFIX_CDB + bool "CDB support" + default y + help + Implements support for cdb files using tinycdb endmenu endef -define Package/postfix/conffiles -/etc/postfix/main.cf -/etc/postfix/master.cf -/etc/postfix/aliases -endef - -CCARGS=-DHAS_CDB -DNO_DB -DNO_EPOLL -DNO_SIGSETJMP -DNO_NIS -DDEF_DB_TYPE=\"cdb\" -AUXLIBS=-L$(STAGING_DIR)/usr/lib -lcdb +CCARGS=-DNO_EPOLL -DNO_SIGSETJMP -DNO_NIS +AUXLIBS=-L$(STAGING_DIR)/usr/lib +default_database_type=cdb ifdef CONFIG_POSTFIX_TLS CCARGS+=-DUSE_TLS @@ -76,6 +81,23 @@ ifdef CONFIG_POSTFIX_LDAP AUXLIBS+=-lldap -llber endif +ifdef CONFIG_POSTFIX_CDB + CCARGS+=-DHAS_CDB + AUXLIBS+=-lcdb +endif + +ifdef CONFIG_POSTFIX_DB + AUXLIBS+=-ldb + CCARGS+=-DHAS_DB + ifndef CONFIG_POSTFIX_CDB + default_database_type=btree + endif +else + CCARGS+=-DNO_DB +endif + +CCARGS+=-DDEF_DB_TYPE=\"$(default_database_type)\" + config_directory=/etc/postfix sample_directory=/etc/postfix command_directory=/usr/sbin @@ -93,14 +115,28 @@ mailq_path=/usr/bin/mailq ln_suffix=.postfix ln_old_suffix=.old +define Package/postfix/conffiles +$(config_directory)/main.cf +$(config_directory)/master.cf +$(config_directory)/aliases +endef + define Build/Configure + if [ "$(CONFIG_POSTFIX_DB)" = "" -a "$(CONFIG_POSTFIX_CDB)" = "" ]; then\ + echo "Build error: You must select at least one of the DB types";\ + exit 1;\ + fi + cd $(PKG_BUILD_DIR); $(MAKE) makefiles CCARGS='$(CCARGS)' $(TARGET_CONFIGURE_OPTS) AUXLIBS="$(AUXLIBS)" endef define Build/Compile # Currently postfix has a bug with Makefiles that CCARGS are not passed to the compiler, so we are copying them to CC cd $(PKG_BUILD_DIR); $(MAKE) $(TARGET_CONFIGURE_OPTS) CC='$(TARGET_CC) $(CCARGS)' - mv $(PKG_BUILD_DIR)/conf/main.cf.default.openwrt $(PKG_BUILD_DIR)/conf/main.cf.default + cp ./files/main.cf.default $(PKG_BUILD_DIR)/conf/main.cf.default + echo "default_database_type = $(default_database_type)" >> $(PKG_BUILD_DIR)/conf/main.cf.default + echo "alias_database = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default + echo "alias_maps = $(default_database_type):$(config_directory)/aliases" >> $(PKG_BUILD_DIR)/conf/main.cf.default echo "sendmail_path = $(sendmail_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default echo "newaliases_path = $(newaliases_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default echo "mailq_path = $(mailq_path)$(ln_suffix)" >> $(PKG_BUILD_DIR)/conf/main.cf.default @@ -120,7 +156,7 @@ define Package/postfix/install cd $(PKG_BUILD_DIR); $(MAKE) install_root=$(1) command_directory=$(command_directory) daemon_directory=$(daemon_directory) data_directory=$(data_directory) html_directory=$(html_directory) mail_owner=postfix mailq_path=$(mailq_path)$(ln_suffix) manpage_directory=$(manpage_directory) newaliases_path=$(newaliases_path)$(ln_suffix) queue_directory=$(queue_directory) readme_directory=$(readme_directory) sendmail_path=$(sendmail_path)$(ln_suffix) setgid_group=postdrop sample_directory=$(sample_directory) config_directory=$(config_directory) non-interactive-package $(INSTALL_DIR) $(1)$(mail_spool_directory) $(INSTALL_DIR) $(1)/etc/init.d/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/postfix_init $(1)/etc/init.d/postfix + $(INSTALL_BIN) ./files/postfix.init $(1)/etc/init.d/postfix endef define Package/postfix/postinst @@ -156,24 +192,24 @@ if [ -z "$${IPKG_INSTROOT}" ]; then echo "mydomain = $$(uci get system.@system[0].hostname|sed -e "s/[^\.]*\.\(.*\)/\1/")" >> $(config_directory)/main.cf.default for net in $$(uci show network|grep ipaddr|sed -e "s/network\.\([^\.]*\).*/\1/"); do eval "$$(ipcalc.sh $$(uci get network.$$net.ipaddr) $$(uci get network.$$net.netmask))"; echo "$$IP/$$PREFIX"; done | xargs echo "mynetworks =" >> $(config_directory)/main.cf.default - grep -qc "^sendmail_path" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^sendmail_path =" /etc/postfix/main.cf.default)" - grep -qc "^newaliases_path" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^newaliases_path =" /etc/postfix/main.cf.default)" - grep -qc "^mailq_path" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^mailq_path =" /etc/postfix/main.cf.default)" - grep -qc "^html_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^html_directory =" /etc/postfix/main.cf.default)" - grep -qc "^manpage_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^manpage_directory =" /etc/postfix/main.cf.default)" - grep -qc "^sample_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^sample_directory =" /etc/postfix/main.cf.default)" - grep -qc "^readme_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^readme_directory =" /etc/postfix/main.cf.default)" - grep -qc "^command_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^command_directory =" /etc/postfix/main.cf.default)" - grep -qc "^daemon_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^daemon_directory =" /etc/postfix/main.cf.default)" - grep -qc "^data_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^data_directory =" /etc/postfix/main.cf.default)" - grep -qc "^queue_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^queue_directory =" /etc/postfix/main.cf.default)" - grep -qc "^config_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^config_directory =" /etc/postfix/main.cf.default)" - grep -qc "^mail_spool_directory" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^mail_spool_directory =" /etc/postfix/main.cf.default)" - grep -qc "^mail_owner" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^mail_owner =" /etc/postfix/main.cf.default)" - grep -qc "^setgid_group" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^setgid_group =" /etc/postfix/main.cf.default)" - grep -qc "^myhostname" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^myhostname =" /etc/postfix/main.cf.default)" - grep -qc "^mydomain" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^mydomain =" /etc/postfix/main.cf.default)" - grep -qc "^mynetworks" /etc/postfix/main.cf >/dev/null || postconf -e "$$(grep "^mynetworks =" /etc/postfix/main.cf.default)" + grep -qc "^sendmail_path" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^sendmail_path =" $(config_directory)/main.cf.default)" + grep -qc "^newaliases_path" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^newaliases_path =" $(config_directory)/main.cf.default)" + grep -qc "^mailq_path" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^mailq_path =" $(config_directory)/main.cf.default)" + grep -qc "^html_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^html_directory =" $(config_directory)/main.cf.default)" + grep -qc "^manpage_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^manpage_directory =" $(config_directory)/main.cf.default)" + grep -qc "^sample_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^sample_directory =" $(config_directory)/main.cf.default)" + grep -qc "^readme_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^readme_directory =" $(config_directory)/main.cf.default)" + grep -qc "^command_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^command_directory =" $(config_directory)/main.cf.default)" + grep -qc "^daemon_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^daemon_directory =" $(config_directory)/main.cf.default)" + grep -qc "^data_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^data_directory =" $(config_directory)/main.cf.default)" + grep -qc "^queue_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^queue_directory =" $(config_directory)/main.cf.default)" + grep -qc "^config_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^config_directory =" $(config_directory)/main.cf.default)" + grep -qc "^mail_spool_directory" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^mail_spool_directory =" $(config_directory)/main.cf.default)" + grep -qc "^mail_owner" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^mail_owner =" $(config_directory)/main.cf.default)" + grep -qc "^setgid_group" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^setgid_group =" $(config_directory)/main.cf.default)" + grep -qc "^myhostname" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^myhostname =" $(config_directory)/main.cf.default)" + grep -qc "^mydomain" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^mydomain =" $(config_directory)/main.cf.default)" + grep -qc "^mynetworks" $(config_directory)/main.cf >/dev/null || postconf -e "$$(grep "^mynetworks =" $(config_directory)/main.cf.default)" EXTRA_COMMANDS=create_users /etc/init.d/postfix create_users @@ -181,15 +217,10 @@ if [ -z "$${IPKG_INSTROOT}" ]; then postfix post-install upgrade-source postfix upgrade-configuration newaliases - if [ `ps | grep "postfix/master" | grep -cv grep` -gt 0 ] - then - postfix reload - fi - if [ `grep -c aliases /etc/sysupgrade.conf` -eq 0 ] - then - echo "$(config_directory)/main.cf" >> /etc/sysupgrade.conf - echo "$(config_directory)/aliases" >> /etc/sysupgrade.conf - fi + ps | grep "postfix/master" | grep -cvq grep >/dev/null && postfix reload + grep -qc main\.cf /etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/main.cf" >> /etc/sysupgrade.conf + grep -qc master\.cf /etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/master.cf" >> /etc/sysupgrade.conf + grep -qc aliases /etc/sysupgrade.conf >/dev/null || echo "$(config_directory)/aliases" >> /etc/sysupgrade.conf fi endef @@ -199,11 +230,7 @@ define Package/postfix/prerm # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then - if [ `ps | grep "postfix/master" | grep -cv grep` -gt 0 ] - then - postfix stop - fi - + ps | grep "postfix/master" | grep -cvq grep >/dev/null && postfix stop /etc/init.d/postfix disable fi @@ -213,7 +240,7 @@ define Package/postfix/postrm #!/bin/sh # check if we are on real system if [ -z "$${IPKG_INSTROOT}" ]; then - rm -f $(config_directory)/aliases.cdb $(data_directory)/master.lock + rm -f $(config_directory)/aliases.cdb $(config_directory)/aliases.db $(data_directory)/master.lock rm -f "$(sendmail_path)" "$(newaliases_path)" "$(mailq_path)" diff --git a/mail/postfix/files/main.cf.default b/mail/postfix/files/main.cf.default new file mode 100644 index 000000000..7947dbc30 --- /dev/null +++ b/mail/postfix/files/main.cf.default @@ -0,0 +1,816 @@ +# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE +# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX. +# +2bounce_notice_recipient = postmaster +access_map_defer_code = 450 +access_map_reject_code = 554 +address_verify_cache_cleanup_interval = 12h +address_verify_default_transport = $default_transport +address_verify_local_transport = $local_transport +address_verify_map = btree:$data_directory/verify_cache +address_verify_negative_cache = yes +address_verify_negative_expire_time = 3d +address_verify_negative_refresh_time = 3h +address_verify_poll_count = ${stress?1}${stress:3} +address_verify_poll_delay = 3s +address_verify_positive_expire_time = 31d +address_verify_positive_refresh_time = 7d +address_verify_relay_transport = $relay_transport +address_verify_relayhost = $relayhost +address_verify_sender = $double_bounce_sender +address_verify_sender_dependent_default_transport_maps = $sender_dependent_default_transport_maps +address_verify_sender_dependent_relayhost_maps = $sender_dependent_relayhost_maps +address_verify_sender_ttl = 0s +address_verify_service_name = verify +address_verify_transport_maps = $transport_maps +address_verify_virtual_transport = $virtual_transport +allow_mail_to_commands = alias, forward +allow_mail_to_files = alias, forward +allow_min_user = no +allow_percent_hack = yes +allow_untrusted_routing = no +alternate_config_directories = +always_add_missing_headers = no +always_bcc = +anvil_rate_time_unit = 60s +anvil_status_update_time = 600s +append_at_myorigin = yes +append_dot_mydomain = yes +application_event_drain_time = 100s +authorized_flush_users = static:anyone +authorized_mailq_users = static:anyone +authorized_submit_users = static:anyone +backwards_bounce_logfile_compatibility = yes +berkeley_db_create_buffer_size = 16777216 +berkeley_db_read_buffer_size = 131072 +best_mx_transport = +biff = yes +body_checks = +body_checks_size_limit = 51200 +bounce_notice_recipient = postmaster +bounce_queue_lifetime = 5d +bounce_service_name = bounce +bounce_size_limit = 50000 +bounce_template_file = +broken_sasl_auth_clients = no +canonical_classes = envelope_sender, envelope_recipient, header_sender, header_recipient +canonical_maps = +cleanup_service_name = cleanup +command_execution_directory = +command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ +command_time_limit = 1000s +connection_cache_protocol_timeout = 5s +connection_cache_service_name = scache +connection_cache_status_update_time = 600s +connection_cache_ttl_limit = 2s +content_filter = +cyrus_sasl_config_path = +daemon_table_open_error_is_fatal = no +daemon_timeout = 18000s +debug_peer_level = 2 +debug_peer_list = +debugger_command = +default_delivery_slot_cost = 5 +default_delivery_slot_discount = 50 +default_delivery_slot_loan = 3 +default_destination_concurrency_failed_cohort_limit = 1 +default_destination_concurrency_limit = 20 +default_destination_concurrency_negative_feedback = 1 +default_destination_concurrency_positive_feedback = 1 +default_destination_rate_delay = 0s +default_destination_recipient_limit = 50 +default_extra_recipient_limit = 1000 +default_filter_nexthop = +default_minimum_delivery_slots = 3 +default_privs = nobody +default_process_limit = 100 +default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason} +default_recipient_limit = 20000 +default_recipient_refill_delay = 5s +default_recipient_refill_limit = 100 +default_transport = smtp +default_verp_delimiters = += +defer_code = 450 +defer_service_name = defer +defer_transports = +delay_logging_resolution_limit = 2 +delay_notice_recipient = postmaster +delay_warning_time = 0h +deliver_lock_attempts = 20 +deliver_lock_delay = 1s +destination_concurrency_feedback_debug = no +detect_8bit_encoding_header = yes +disable_dns_lookups = no +disable_mime_input_processing = no +disable_mime_output_conversion = no +disable_verp_bounces = no +disable_vrfy_command = no +dnsblog_reply_delay = 0s +dnsblog_service_name = dnsblog +dont_remove = 0 +double_bounce_sender = double-bounce +duplicate_filter_limit = 1000 +empty_address_default_transport_maps_lookup_key = <> +empty_address_recipient = MAILER-DAEMON +empty_address_relayhost_maps_lookup_key = <> +enable_long_queue_ids = no +enable_original_recipient = yes +error_delivery_slot_cost = $default_delivery_slot_cost +error_delivery_slot_discount = $default_delivery_slot_discount +error_delivery_slot_loan = $default_delivery_slot_loan +error_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +error_destination_concurrency_limit = $default_destination_concurrency_limit +error_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +error_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +error_destination_rate_delay = $default_destination_rate_delay +error_destination_recipient_limit = $default_destination_recipient_limit +error_extra_recipient_limit = $default_extra_recipient_limit +error_initial_destination_concurrency = $initial_destination_concurrency +error_minimum_delivery_slots = $default_minimum_delivery_slots +error_notice_recipient = postmaster +error_recipient_limit = $default_recipient_limit +error_recipient_refill_delay = $default_recipient_refill_delay +error_recipient_refill_limit = $default_recipient_refill_limit +error_service_name = error +execution_directory_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ +expand_owner_alias = no +export_environment = TZ MAIL_CONFIG LANG +fallback_transport = +fallback_transport_maps = +fast_flush_domains = $relay_domains +fast_flush_purge_time = 7d +fast_flush_refresh_time = 12h +fault_injection_code = 0 +flush_service_name = flush +fork_attempts = 5 +fork_delay = 1s +forward_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ +forward_path = $home/.forward${recipient_delimiter}${extension}, $home/.forward +frozen_delivered_to = yes +hash_queue_depth = 1 +hash_queue_names = deferred, defer +header_address_token_limit = 10240 +header_checks = +header_size_limit = 102400 +helpful_warnings = yes +home_mailbox = +hopcount_limit = 50 +ignore_mx_lookup_error = no +import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C +in_flow_delay = 1s +inet_interfaces = all +inet_protocols = all +initial_destination_concurrency = 5 +internal_mail_filter_classes = +invalid_hostname_reject_code = 501 +ipc_idle = 5s +ipc_timeout = 3600s +ipc_ttl = 1000s +line_length_limit = 2048 +lmdb_map_size = 16777216 +lmtp_address_preference = any +lmtp_assume_final = no +lmtp_bind_address = +lmtp_bind_address6 = +lmtp_body_checks = +lmtp_cname_overrides_servername = no +lmtp_connect_timeout = 0s +lmtp_connection_cache_destinations = +lmtp_connection_cache_on_demand = yes +lmtp_connection_cache_time_limit = 2s +lmtp_connection_reuse_count_limit = 0 +lmtp_connection_reuse_time_limit = 300s +lmtp_data_done_timeout = 600s +lmtp_data_init_timeout = 120s +lmtp_data_xfer_timeout = 180s +lmtp_defer_if_no_mx_address_found = no +lmtp_delivery_slot_cost = $default_delivery_slot_cost +lmtp_delivery_slot_discount = $default_delivery_slot_discount +lmtp_delivery_slot_loan = $default_delivery_slot_loan +lmtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +lmtp_destination_concurrency_limit = $default_destination_concurrency_limit +lmtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +lmtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +lmtp_destination_rate_delay = $default_destination_rate_delay +lmtp_destination_recipient_limit = $default_destination_recipient_limit +lmtp_discard_lhlo_keyword_address_maps = +lmtp_discard_lhlo_keywords = +lmtp_dns_resolver_options = +lmtp_dns_support_level = +lmtp_enforce_tls = no +lmtp_extra_recipient_limit = $default_extra_recipient_limit +lmtp_generic_maps = +lmtp_header_checks = +lmtp_host_lookup = dns +lmtp_initial_destination_concurrency = $initial_destination_concurrency +lmtp_lhlo_name = $myhostname +lmtp_lhlo_timeout = 300s +lmtp_line_length_limit = 998 +lmtp_mail_timeout = 300s +lmtp_mime_header_checks = +lmtp_minimum_delivery_slots = $default_minimum_delivery_slots +lmtp_mx_address_limit = 5 +lmtp_mx_session_limit = 2 +lmtp_nested_header_checks = +lmtp_per_record_deadline = no +lmtp_pix_workaround_delay_time = 10s +lmtp_pix_workaround_maps = +lmtp_pix_workaround_threshold_time = 500s +lmtp_pix_workarounds = disable_esmtp,delay_dotcrlf +lmtp_quit_timeout = 300s +lmtp_quote_rfc821_envelope = yes +lmtp_randomize_addresses = yes +lmtp_rcpt_timeout = 300s +lmtp_recipient_limit = $default_recipient_limit +lmtp_recipient_refill_delay = $default_recipient_refill_delay +lmtp_recipient_refill_limit = $default_recipient_refill_limit +lmtp_reply_filter = +lmtp_rset_timeout = 20s +lmtp_sasl_auth_cache_name = +lmtp_sasl_auth_cache_time = 90d +lmtp_sasl_auth_enable = no +lmtp_sasl_auth_soft_bounce = yes +lmtp_sasl_mechanism_filter = +lmtp_sasl_password_maps = +lmtp_sasl_path = +lmtp_sasl_security_options = noplaintext, noanonymous +lmtp_sasl_tls_security_options = $lmtp_sasl_security_options +lmtp_sasl_tls_verified_security_options = $lmtp_sasl_tls_security_options +lmtp_sasl_type = cyrus +lmtp_send_dummy_mail_auth = no +lmtp_send_xforward_command = no +lmtp_sender_dependent_authentication = no +lmtp_skip_5xx_greeting = yes +lmtp_skip_quit_response = no +lmtp_starttls_timeout = 300s +lmtp_tcp_port = 24 +lmtp_tls_CAfile = +lmtp_tls_CApath = +lmtp_tls_block_early_mail_reply = no +lmtp_tls_cert_file = +lmtp_tls_ciphers = export +lmtp_tls_dcert_file = +lmtp_tls_dkey_file = $lmtp_tls_dcert_file +lmtp_tls_eccert_file = +lmtp_tls_eckey_file = $lmtp_tls_eccert_file +lmtp_tls_enforce_peername = yes +lmtp_tls_exclude_ciphers = +lmtp_tls_fingerprint_cert_match = +lmtp_tls_fingerprint_digest = md5 +lmtp_tls_force_insecure_host_tlsa_lookup = no +lmtp_tls_key_file = $lmtp_tls_cert_file +lmtp_tls_loglevel = 0 +lmtp_tls_mandatory_ciphers = medium +lmtp_tls_mandatory_exclude_ciphers = +lmtp_tls_mandatory_protocols = !SSLv2 +lmtp_tls_note_starttls_offer = no +lmtp_tls_per_site = +lmtp_tls_policy_maps = +lmtp_tls_protocols = !SSLv2 +lmtp_tls_scert_verifydepth = 9 +lmtp_tls_secure_cert_match = nexthop +lmtp_tls_security_level = +lmtp_tls_session_cache_database = +lmtp_tls_session_cache_timeout = 3600s +lmtp_tls_trust_anchor_file = +lmtp_tls_verify_cert_match = hostname +lmtp_use_tls = no +lmtp_xforward_timeout = 300s +local_command_shell = +local_delivery_slot_cost = $default_delivery_slot_cost +local_delivery_slot_discount = $default_delivery_slot_discount +local_delivery_slot_loan = $default_delivery_slot_loan +local_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +local_destination_concurrency_limit = 2 +local_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +local_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +local_destination_rate_delay = $default_destination_rate_delay +local_destination_recipient_limit = 1 +local_extra_recipient_limit = $default_extra_recipient_limit +local_header_rewrite_clients = permit_inet_interfaces +local_initial_destination_concurrency = $initial_destination_concurrency +local_minimum_delivery_slots = $default_minimum_delivery_slots +local_recipient_limit = $default_recipient_limit +local_recipient_maps = proxy:unix:passwd.byname $alias_maps +local_recipient_refill_delay = $default_recipient_refill_delay +local_recipient_refill_limit = $default_recipient_refill_limit +local_transport = local:$myhostname +luser_relay = +mail_name = Postfix +mail_owner = postfix +mail_release_date = 20140507 +mail_version = 2.11.1 +mailbox_command = +mailbox_command_maps = +mailbox_delivery_lock = fcntl, dotlock +mailbox_size_limit = 51200000 +mailbox_transport = +mailbox_transport_maps = +maps_rbl_domains = +maps_rbl_reject_code = 554 +masquerade_classes = envelope_sender, header_sender, header_recipient +masquerade_domains = +masquerade_exceptions = +master_service_disable = +max_idle = 100s +max_use = 100 +maximal_backoff_time = 4000s +maximal_queue_lifetime = 5d +message_reject_characters = +message_size_limit = 10240000 +message_strip_characters = +milter_command_timeout = 30s +milter_connect_macros = j {daemon_name} v +milter_connect_timeout = 30s +milter_content_timeout = 300s +milter_data_macros = i +milter_default_action = tempfail +milter_end_of_data_macros = i +milter_end_of_header_macros = i +milter_header_checks = +milter_helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer} +milter_macro_daemon_name = $myhostname +milter_macro_v = $mail_name $mail_version +milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer} +milter_protocol = 6 +milter_rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer} +milter_unknown_command_macros = +mime_boundary_length_limit = 2048 +mime_header_checks = $header_checks +mime_nesting_limit = 100 +minimal_backoff_time = 300s +multi_instance_directories = +multi_instance_enable = no +multi_instance_group = +multi_instance_name = +multi_instance_wrapper = +multi_recipient_bounce_reject_code = 550 +mydestination = $myhostname, localhost.$mydomain, localhost +mynetworks_style = subnet +myorigin = $myhostname +nested_header_checks = $header_checks +non_fqdn_reject_code = 504 +non_smtpd_milters = +notify_classes = resource, software +owner_request_special = yes +parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps +permit_mx_backup_networks = +pickup_service_name = pickup +plaintext_reject_code = 450 +postmulti_control_commands = reload flush +postmulti_start_commands = start +postmulti_stop_commands = stop abort drain quick-stop +postscreen_access_list = permit_mynetworks +postscreen_bare_newline_action = ignore +postscreen_bare_newline_enable = no +postscreen_bare_newline_ttl = 30d +postscreen_blacklist_action = ignore +postscreen_cache_cleanup_interval = 12h +postscreen_cache_map = btree:$data_directory/postscreen_cache +postscreen_cache_retention_time = 7d +postscreen_client_connection_count_limit = $smtpd_client_connection_count_limit +postscreen_command_count_limit = 20 +postscreen_command_filter = +postscreen_command_time_limit = ${stress?10}${stress:300}s +postscreen_disable_vrfy_command = $disable_vrfy_command +postscreen_discard_ehlo_keyword_address_maps = $smtpd_discard_ehlo_keyword_address_maps +postscreen_discard_ehlo_keywords = $smtpd_discard_ehlo_keywords +postscreen_dnsbl_action = ignore +postscreen_dnsbl_reply_map = +postscreen_dnsbl_sites = +postscreen_dnsbl_threshold = 1 +postscreen_dnsbl_ttl = 1h +postscreen_dnsbl_whitelist_threshold = 0 +postscreen_enforce_tls = $smtpd_enforce_tls +postscreen_expansion_filter = $smtpd_expansion_filter +postscreen_forbidden_commands = $smtpd_forbidden_commands +postscreen_greet_action = ignore +postscreen_greet_banner = $smtpd_banner +postscreen_greet_ttl = 1d +postscreen_greet_wait = ${stress?2}${stress:6}s +postscreen_helo_required = $smtpd_helo_required +postscreen_non_smtp_command_action = drop +postscreen_non_smtp_command_enable = no +postscreen_non_smtp_command_ttl = 30d +postscreen_pipelining_action = enforce +postscreen_pipelining_enable = no +postscreen_pipelining_ttl = 30d +postscreen_post_queue_limit = $default_process_limit +postscreen_pre_queue_limit = $default_process_limit +postscreen_reject_footer = $smtpd_reject_footer +postscreen_tls_security_level = $smtpd_tls_security_level +postscreen_upstream_proxy_protocol = +postscreen_upstream_proxy_timeout = 5s +postscreen_use_tls = $smtpd_use_tls +postscreen_watchdog_timeout = 10s +postscreen_whitelist_interfaces = static:all +prepend_delivered_header = command, file, forward +process_id = 6537 +process_id_directory = pid +process_name = postconf +propagate_unmatched_extensions = canonical, virtual +proxy_interfaces = +proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps $alias_maps +proxy_write_maps = $smtp_sasl_auth_cache_name $lmtp_sasl_auth_cache_name $address_verify_map $postscreen_cache_map +proxymap_service_name = proxymap +proxywrite_service_name = proxywrite +qmgr_clog_warn_time = 300s +qmgr_daemon_timeout = 1000s +qmgr_fudge_factor = 100 +qmgr_ipc_timeout = 60s +qmgr_message_active_limit = 20000 +qmgr_message_recipient_limit = 20000 +qmgr_message_recipient_minimum = 10 +qmqpd_authorized_clients = +qmqpd_client_port_logging = no +qmqpd_error_delay = 1s +qmqpd_timeout = 300s +queue_file_attribute_count_limit = 100 +queue_minfree = 0 +queue_run_delay = 300s +queue_service_name = qmgr +rbl_reply_maps = +receive_override_options = +recipient_bcc_maps = +recipient_canonical_classes = envelope_recipient, header_recipient +recipient_canonical_maps = +recipient_delimiter = +reject_code = 554 +reject_tempfail_action = defer_if_permit +relay_clientcerts = +relay_delivery_slot_cost = $default_delivery_slot_cost +relay_delivery_slot_discount = $default_delivery_slot_discount +relay_delivery_slot_loan = $default_delivery_slot_loan +relay_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +relay_destination_concurrency_limit = $default_destination_concurrency_limit +relay_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +relay_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +relay_destination_rate_delay = $default_destination_rate_delay +relay_destination_recipient_limit = $default_destination_recipient_limit +relay_domains = $mydestination +relay_domains_reject_code = 554 +relay_extra_recipient_limit = $default_extra_recipient_limit +relay_initial_destination_concurrency = $initial_destination_concurrency +relay_minimum_delivery_slots = $default_minimum_delivery_slots +relay_recipient_limit = $default_recipient_limit +relay_recipient_maps = +relay_recipient_refill_delay = $default_recipient_refill_delay +relay_recipient_refill_limit = $default_recipient_refill_limit +relay_transport = relay +relayhost = +relocated_maps = +remote_header_rewrite_domain = +require_home_directory = no +reset_owner_alias = no +resolve_dequoted_address = yes +resolve_null_domain = no +resolve_numeric_domain = no +retry_delivery_slot_cost = $default_delivery_slot_cost +retry_delivery_slot_discount = $default_delivery_slot_discount +retry_delivery_slot_loan = $default_delivery_slot_loan +retry_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +retry_destination_concurrency_limit = $default_destination_concurrency_limit +retry_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +retry_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +retry_destination_rate_delay = $default_destination_rate_delay +retry_destination_recipient_limit = $default_destination_recipient_limit +retry_extra_recipient_limit = $default_extra_recipient_limit +retry_initial_destination_concurrency = $initial_destination_concurrency +retry_minimum_delivery_slots = $default_minimum_delivery_slots +retry_recipient_limit = $default_recipient_limit +retry_recipient_refill_delay = $default_recipient_refill_delay +retry_recipient_refill_limit = $default_recipient_refill_limit +rewrite_service_name = rewrite +send_cyrus_sasl_authzid = no +sender_bcc_maps = +sender_canonical_classes = envelope_sender, header_sender +sender_canonical_maps = +sender_dependent_default_transport_maps = +sender_dependent_relayhost_maps = +sendmail_fix_line_endings = always +service_throttle_time = 60s +setgid_group = postdrop +show_user_unknown_table_name = yes +showq_service_name = showq +smtp_address_preference = any +smtp_always_send_ehlo = yes +smtp_bind_address = +smtp_bind_address6 = +smtp_body_checks = +smtp_cname_overrides_servername = no +smtp_connect_timeout = 30s +smtp_connection_cache_destinations = +smtp_connection_cache_on_demand = yes +smtp_connection_cache_time_limit = 2s +smtp_connection_reuse_count_limit = 0 +smtp_connection_reuse_time_limit = 300s +smtp_data_done_timeout = 600s +smtp_data_init_timeout = 120s +smtp_data_xfer_timeout = 180s +smtp_defer_if_no_mx_address_found = no +smtp_delivery_slot_cost = $default_delivery_slot_cost +smtp_delivery_slot_discount = $default_delivery_slot_discount +smtp_delivery_slot_loan = $default_delivery_slot_loan +smtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +smtp_destination_concurrency_limit = $default_destination_concurrency_limit +smtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +smtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +smtp_destination_rate_delay = $default_destination_rate_delay +smtp_destination_recipient_limit = $default_destination_recipient_limit +smtp_discard_ehlo_keyword_address_maps = +smtp_discard_ehlo_keywords = +smtp_dns_resolver_options = +smtp_dns_support_level = +smtp_enforce_tls = no +smtp_extra_recipient_limit = $default_extra_recipient_limit +smtp_fallback_relay = $fallback_relay +smtp_generic_maps = +smtp_header_checks = +smtp_helo_name = $myhostname +smtp_helo_timeout = 300s +smtp_host_lookup = dns +smtp_initial_destination_concurrency = $initial_destination_concurrency +smtp_line_length_limit = 998 +smtp_mail_timeout = 300s +smtp_mime_header_checks = +smtp_minimum_delivery_slots = $default_minimum_delivery_slots +smtp_mx_address_limit = 5 +smtp_mx_session_limit = 2 +smtp_nested_header_checks = +smtp_never_send_ehlo = no +smtp_per_record_deadline = no +smtp_pix_workaround_delay_time = 10s +smtp_pix_workaround_maps = +smtp_pix_workaround_threshold_time = 500s +smtp_pix_workarounds = disable_esmtp,delay_dotcrlf +smtp_quit_timeout = 300s +smtp_quote_rfc821_envelope = yes +smtp_randomize_addresses = yes +smtp_rcpt_timeout = 300s +smtp_recipient_limit = $default_recipient_limit +smtp_recipient_refill_delay = $default_recipient_refill_delay +smtp_recipient_refill_limit = $default_recipient_refill_limit +smtp_reply_filter = +smtp_rset_timeout = 20s +smtp_sasl_auth_cache_name = +smtp_sasl_auth_cache_time = 90d +smtp_sasl_auth_enable = no +smtp_sasl_auth_soft_bounce = yes +smtp_sasl_mechanism_filter = +smtp_sasl_password_maps = +smtp_sasl_path = +smtp_sasl_security_options = noplaintext, noanonymous +smtp_sasl_tls_security_options = $smtp_sasl_security_options +smtp_sasl_tls_verified_security_options = $smtp_sasl_tls_security_options +smtp_sasl_type = cyrus +smtp_send_dummy_mail_auth = no +smtp_send_xforward_command = no +smtp_sender_dependent_authentication = no +smtp_skip_5xx_greeting = yes +smtp_skip_quit_response = yes +smtp_starttls_timeout = 300s +smtp_tls_CAfile = +smtp_tls_CApath = +smtp_tls_block_early_mail_reply = no +smtp_tls_cert_file = +smtp_tls_ciphers = export +smtp_tls_dcert_file = +smtp_tls_dkey_file = $smtp_tls_dcert_file +smtp_tls_eccert_file = +smtp_tls_eckey_file = $smtp_tls_eccert_file +smtp_tls_enforce_peername = yes +smtp_tls_exclude_ciphers = +smtp_tls_fingerprint_cert_match = +smtp_tls_fingerprint_digest = md5 +smtp_tls_force_insecure_host_tlsa_lookup = no +smtp_tls_key_file = $smtp_tls_cert_file +smtp_tls_loglevel = 0 +smtp_tls_mandatory_ciphers = medium +smtp_tls_mandatory_exclude_ciphers = +smtp_tls_mandatory_protocols = !SSLv2 +smtp_tls_note_starttls_offer = no +smtp_tls_per_site = +smtp_tls_policy_maps = +smtp_tls_protocols = !SSLv2 +smtp_tls_scert_verifydepth = 9 +smtp_tls_secure_cert_match = nexthop, dot-nexthop +smtp_tls_security_level = +smtp_tls_session_cache_database = +smtp_tls_session_cache_timeout = 3600s +smtp_tls_trust_anchor_file = +smtp_tls_verify_cert_match = hostname +smtp_use_tls = no +smtp_xforward_timeout = 300s +smtpd_authorized_verp_clients = $authorized_verp_clients +smtpd_authorized_xclient_hosts = +smtpd_authorized_xforward_hosts = +smtpd_banner = $myhostname ESMTP $mail_name +smtpd_client_connection_count_limit = 50 +smtpd_client_connection_rate_limit = 0 +smtpd_client_event_limit_exceptions = ${smtpd_client_connection_limit_exceptions:$mynetworks} +smtpd_client_message_rate_limit = 0 +smtpd_client_new_tls_session_rate_limit = 0 +smtpd_client_port_logging = no +smtpd_client_recipient_rate_limit = 0 +smtpd_client_restrictions = +smtpd_command_filter = +smtpd_data_restrictions = +smtpd_delay_open_until_valid_rcpt = yes +smtpd_delay_reject = yes +smtpd_discard_ehlo_keyword_address_maps = +smtpd_discard_ehlo_keywords = +smtpd_end_of_data_restrictions = +smtpd_enforce_tls = no +smtpd_error_sleep_time = 1s +smtpd_etrn_restrictions = +smtpd_expansion_filter = \t\40!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ +smtpd_forbidden_commands = CONNECT GET POST +smtpd_hard_error_limit = ${stress?1}${stress:20} +smtpd_helo_required = no +smtpd_helo_restrictions = +smtpd_history_flush_threshold = 100 +smtpd_junk_command_limit = ${stress?1}${stress:100} +smtpd_log_access_permit_actions = +smtpd_milters = +smtpd_noop_commands = +smtpd_null_access_lookup_key = <> +smtpd_peername_lookup = yes +smtpd_per_record_deadline = ${stress?yes}${stress:no} +smtpd_policy_service_max_idle = 300s +smtpd_policy_service_max_ttl = 1000s +smtpd_policy_service_timeout = 100s +smtpd_proxy_ehlo = $myhostname +smtpd_proxy_filter = +smtpd_proxy_options = +smtpd_proxy_timeout = 100s +smtpd_recipient_limit = 1000 +smtpd_recipient_overshoot_limit = 1000 +smtpd_recipient_restrictions = +smtpd_reject_footer = +smtpd_reject_unlisted_recipient = yes +smtpd_reject_unlisted_sender = no +smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination +smtpd_restriction_classes = +smtpd_sasl_auth_enable = no +smtpd_sasl_authenticated_header = no +smtpd_sasl_exceptions_networks = +smtpd_sasl_local_domain = +smtpd_sasl_path = smtpd +smtpd_sasl_security_options = noanonymous +smtpd_sasl_service = smtp +smtpd_sasl_tls_security_options = $smtpd_sasl_security_options +smtpd_sasl_type = cyrus +smtpd_sender_login_maps = +smtpd_sender_restrictions = +smtpd_service_name = smtpd +smtpd_soft_error_limit = 10 +smtpd_starttls_timeout = ${stress?10}${stress:300}s +smtpd_timeout = ${stress?10}${stress:300}s +smtpd_tls_CAfile = +smtpd_tls_CApath = +smtpd_tls_always_issue_session_ids = yes +smtpd_tls_ask_ccert = no +smtpd_tls_auth_only = no +smtpd_tls_ccert_verifydepth = 9 +smtpd_tls_cert_file = +smtpd_tls_ciphers = export +smtpd_tls_dcert_file = +smtpd_tls_dh1024_param_file = +smtpd_tls_dh512_param_file = +smtpd_tls_dkey_file = $smtpd_tls_dcert_file +smtpd_tls_eccert_file = +smtpd_tls_eckey_file = $smtpd_tls_eccert_file +smtpd_tls_eecdh_grade = strong +smtpd_tls_exclude_ciphers = +smtpd_tls_fingerprint_digest = md5 +smtpd_tls_key_file = $smtpd_tls_cert_file +smtpd_tls_loglevel = 0 +smtpd_tls_mandatory_ciphers = medium +smtpd_tls_mandatory_exclude_ciphers = +smtpd_tls_mandatory_protocols = !SSLv2 +smtpd_tls_protocols = +smtpd_tls_received_header = no +smtpd_tls_req_ccert = no +smtpd_tls_security_level = +smtpd_tls_session_cache_database = +smtpd_tls_session_cache_timeout = 3600s +smtpd_tls_wrappermode = no +smtpd_upstream_proxy_protocol = +smtpd_upstream_proxy_timeout = 5s +smtpd_use_tls = no +soft_bounce = no +stale_lock_time = 500s +stress = +strict_7bit_headers = no +strict_8bitmime = no +strict_8bitmime_body = no +strict_mailbox_ownership = yes +strict_mime_encoding_domain = no +strict_rfc821_envelopes = no +sun_mailtool_compatibility = no +swap_bangpath = yes +syslog_facility = mail +syslog_name = ${multi_instance_name:postfix}${multi_instance_name?$multi_instance_name} +tcp_windowsize = 0 +tls_append_default_CA = no +tls_daemon_random_bytes = 32 +tls_dane_digest_agility = on +tls_dane_digests = sha512 sha256 +tls_dane_trust_anchor_digest_enable = yes +tls_disable_workarounds = +tls_eecdh_strong_curve = prime256v1 +tls_eecdh_ultra_curve = secp384r1 +tls_export_cipherlist = ALL:+RC4:@STRENGTH +tls_high_cipherlist = ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH +tls_legacy_public_key_fingerprints = no +tls_low_cipherlist = ALL:!EXPORT:+RC4:@STRENGTH +tls_medium_cipherlist = ALL:!EXPORT:!LOW:+RC4:@STRENGTH +tls_null_cipherlist = eNULL:!aNULL +tls_preempt_cipherlist = no +tls_random_bytes = 32 +tls_random_exchange_name = ${data_directory}/prng_exch +tls_random_prng_update_period = 3600s +tls_random_reseed_period = 3600s +tls_random_source = dev:/dev/urandom +tls_ssl_options = +tls_wildcard_matches_multiple_labels = yes +tlsmgr_service_name = tlsmgr +tlsproxy_enforce_tls = $smtpd_enforce_tls +tlsproxy_service_name = tlsproxy +tlsproxy_tls_CAfile = $smtpd_tls_CAfile +tlsproxy_tls_CApath = $smtpd_tls_CApath +tlsproxy_tls_always_issue_session_ids = $smtpd_tls_always_issue_session_ids +tlsproxy_tls_ask_ccert = $smtpd_tls_ask_ccert +tlsproxy_tls_ccert_verifydepth = $smtpd_tls_ccert_verifydepth +tlsproxy_tls_cert_file = $smtpd_tls_cert_file +tlsproxy_tls_ciphers = $smtpd_tls_ciphers +tlsproxy_tls_dcert_file = $smtpd_tls_dcert_file +tlsproxy_tls_dh1024_param_file = $smtpd_tls_dh1024_param_file +tlsproxy_tls_dh512_param_file = $smtpd_tls_dh512_param_file +tlsproxy_tls_dkey_file = $smtpd_tls_dkey_file +tlsproxy_tls_eccert_file = $smtpd_tls_eccert_file +tlsproxy_tls_eckey_file = $smtpd_tls_eckey_file +tlsproxy_tls_eecdh_grade = $smtpd_tls_eecdh_grade +tlsproxy_tls_exclude_ciphers = $smtpd_tls_exclude_ciphers +tlsproxy_tls_fingerprint_digest = $smtpd_tls_fingerprint_digest +tlsproxy_tls_key_file = $smtpd_tls_key_file +tlsproxy_tls_loglevel = $smtpd_tls_loglevel +tlsproxy_tls_mandatory_ciphers = $smtpd_tls_mandatory_ciphers +tlsproxy_tls_mandatory_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers +tlsproxy_tls_mandatory_protocols = $smtpd_tls_mandatory_protocols +tlsproxy_tls_protocols = $smtpd_tls_protocols +tlsproxy_tls_req_ccert = $smtpd_tls_req_ccert +tlsproxy_tls_security_level = $smtpd_tls_security_level +tlsproxy_use_tls = $smtpd_use_tls +tlsproxy_watchdog_timeout = 10s +trace_service_name = trace +transport_maps = +transport_retry_time = 60s +trigger_timeout = 10s +undisclosed_recipients_header = +unknown_address_reject_code = 450 +unknown_address_tempfail_action = $reject_tempfail_action +unknown_client_reject_code = 450 +unknown_helo_hostname_tempfail_action = $reject_tempfail_action +unknown_hostname_reject_code = 450 +unknown_local_recipient_reject_code = 550 +unknown_relay_recipient_reject_code = 550 +unknown_virtual_alias_reject_code = 550 +unknown_virtual_mailbox_reject_code = 550 +unverified_recipient_defer_code = 450 +unverified_recipient_reject_code = 450 +unverified_recipient_reject_reason = +unverified_recipient_tempfail_action = $reject_tempfail_action +unverified_sender_defer_code = 450 +unverified_sender_reject_code = 450 +unverified_sender_reject_reason = +unverified_sender_tempfail_action = $reject_tempfail_action +verp_delimiter_filter = -=+ +virtual_alias_domains = $virtual_alias_maps +virtual_alias_expansion_limit = 1000 +virtual_alias_maps = $virtual_maps +virtual_alias_recursion_limit = 1000 +virtual_delivery_slot_cost = $default_delivery_slot_cost +virtual_delivery_slot_discount = $default_delivery_slot_discount +virtual_delivery_slot_loan = $default_delivery_slot_loan +virtual_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit +virtual_destination_concurrency_limit = $default_destination_concurrency_limit +virtual_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback +virtual_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback +virtual_destination_rate_delay = $default_destination_rate_delay +virtual_destination_recipient_limit = $default_destination_recipient_limit +virtual_extra_recipient_limit = $default_extra_recipient_limit +virtual_gid_maps = +virtual_initial_destination_concurrency = $initial_destination_concurrency +virtual_mailbox_base = +virtual_mailbox_domains = $virtual_mailbox_maps +virtual_mailbox_limit = 51200000 +virtual_mailbox_lock = fcntl, dotlock +virtual_mailbox_maps = +virtual_minimum_delivery_slots = $default_minimum_delivery_slots +virtual_minimum_uid = 100 +virtual_recipient_limit = $default_recipient_limit +virtual_recipient_refill_delay = $default_recipient_refill_delay +virtual_recipient_refill_limit = $default_recipient_refill_limit +virtual_transport = virtual +virtual_uid_maps = diff --git a/mail/postfix/files/postfix.init b/mail/postfix/files/postfix.init new file mode 100644 index 000000000..ceb3f6640 --- /dev/null +++ b/mail/postfix/files/postfix.init @@ -0,0 +1,19 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=50 +STOP=50 + +create_users() { + group_exists postfix || group_add postfix 87 + user_exists postfix || user_add postfix 87 + group_exists postdrop || group_add postdrop 88 +} + +start() { + postfix start +} + +stop() { + postfix stop +} diff --git a/mail/postfix/patches/300-bdb_hash_segfault.patch b/mail/postfix/patches/300-bdb_hash_segfault.patch new file mode 100644 index 000000000..c7f0df095 --- /dev/null +++ b/mail/postfix/patches/300-bdb_hash_segfault.patch @@ -0,0 +1,14 @@ +diff -Naur postfix-2.11.3/src/util/dict_db.c postfix-2.11.3_patched/src/util/dict_db.c +--- postfix-2.11.3/src/util/dict_db.c 2012-01-25 04:41:08.000000000 +0400 ++++ postfix-2.11.3_patched/src/util/dict_db.c 2014-11-01 12:36:44.287641712 +0300 +@@ -691,8 +691,8 @@ + msg_panic("db_create null result"); + if ((errno = db->set_cachesize(db, 0, dict_db_cache_size, 0)) != 0) + msg_fatal("set DB cache size %d: %m", dict_db_cache_size); +- if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0) +- msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM); ++// if (type == DB_HASH && db->set_h_nelem(db, DICT_DB_NELM) != 0) ++// msg_fatal("set DB hash element count %d: %m", DICT_DB_NELM); + #if DB_VERSION_MAJOR == 5 || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0) + if ((errno = db->open(db, 0, db_path, 0, type, db_flags, 0644)) != 0) + FREE_RETURN(dict_surrogate(class, path, open_flags, dict_flags, diff --git a/mail/postfix/patches/300-init.patch b/mail/postfix/patches/300-init.patch deleted file mode 100644 index 3c1bb7f5f..000000000 --- a/mail/postfix/patches/300-init.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -rupN postfix-2.8.1/postfix_init postfix-2.8.1_patched/postfix_init ---- postfix-2.8.1/postfix_init 1970-01-01 03:00:00.000000000 +0300 -+++ postfix-2.8.1_patched/postfix_init 2011-03-06 21:44:50.000000000 +0300 -@@ -0,0 +1,19 @@ -+#!/bin/sh /etc/rc.common -+# Copyright (C) 2014 OpenWrt.org -+ -+START=50 -+STOP=50 -+ -+create_users() { -+ group_exists postfix || group_add postfix 87 -+ user_exists postfix || user_add postfix 87 -+ group_exists postdrop || group_add postdrop 88 -+} -+ -+start() { -+ postfix start -+} -+ -+stop() { -+ postfix stop -+} diff --git a/mail/postfix/patches/700-defaultconfig.patch b/mail/postfix/patches/700-defaultconfig.patch index 394117dea..2f3dc3b1c 100644 --- a/mail/postfix/patches/700-defaultconfig.patch +++ b/mail/postfix/patches/700-defaultconfig.patch @@ -91,826 +91,3 @@ diff -Naur postfix-2.11.1/conf/main.cf postfix-2.11.1.patched/conf/main.cf -# -readme_directory = inet_protocols = ipv4 -diff -Naur postfix-2.11.1/conf/main.cf.default.openwrt postfix-2.11.1.patched/conf/main.cf.default.openwrt ---- postfix-2.11.1/conf/main.cf.default.openwrt 1970-01-01 03:00:00.000000000 +0300 -+++ postfix-2.11.1.patched/conf/main.cf.default.openwrt 2014-10-05 23:48:59.751127768 +0400 -@@ -0,0 +1,819 @@ -+# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE -+# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX. -+# -+2bounce_notice_recipient = postmaster -+access_map_defer_code = 450 -+access_map_reject_code = 554 -+address_verify_cache_cleanup_interval = 12h -+address_verify_default_transport = $default_transport -+address_verify_local_transport = $local_transport -+address_verify_map = btree:$data_directory/verify_cache -+address_verify_negative_cache = yes -+address_verify_negative_expire_time = 3d -+address_verify_negative_refresh_time = 3h -+address_verify_poll_count = ${stress?1}${stress:3} -+address_verify_poll_delay = 3s -+address_verify_positive_expire_time = 31d -+address_verify_positive_refresh_time = 7d -+address_verify_relay_transport = $relay_transport -+address_verify_relayhost = $relayhost -+address_verify_sender = $double_bounce_sender -+address_verify_sender_dependent_default_transport_maps = $sender_dependent_default_transport_maps -+address_verify_sender_dependent_relayhost_maps = $sender_dependent_relayhost_maps -+address_verify_sender_ttl = 0s -+address_verify_service_name = verify -+address_verify_transport_maps = $transport_maps -+address_verify_virtual_transport = $virtual_transport -+alias_database = cdb:/etc/aliases -+alias_maps = cdb:/etc/aliases -+allow_mail_to_commands = alias, forward -+allow_mail_to_files = alias, forward -+allow_min_user = no -+allow_percent_hack = yes -+allow_untrusted_routing = no -+alternate_config_directories = -+always_add_missing_headers = no -+always_bcc = -+anvil_rate_time_unit = 60s -+anvil_status_update_time = 600s -+append_at_myorigin = yes -+append_dot_mydomain = yes -+application_event_drain_time = 100s -+authorized_flush_users = static:anyone -+authorized_mailq_users = static:anyone -+authorized_submit_users = static:anyone -+backwards_bounce_logfile_compatibility = yes -+berkeley_db_create_buffer_size = 16777216 -+berkeley_db_read_buffer_size = 131072 -+best_mx_transport = -+biff = yes -+body_checks = -+body_checks_size_limit = 51200 -+bounce_notice_recipient = postmaster -+bounce_queue_lifetime = 5d -+bounce_service_name = bounce -+bounce_size_limit = 50000 -+bounce_template_file = -+broken_sasl_auth_clients = no -+canonical_classes = envelope_sender, envelope_recipient, header_sender, header_recipient -+canonical_maps = -+cleanup_service_name = cleanup -+command_execution_directory = -+command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -+command_time_limit = 1000s -+connection_cache_protocol_timeout = 5s -+connection_cache_service_name = scache -+connection_cache_status_update_time = 600s -+connection_cache_ttl_limit = 2s -+content_filter = -+cyrus_sasl_config_path = -+daemon_table_open_error_is_fatal = no -+daemon_timeout = 18000s -+debug_peer_level = 2 -+debug_peer_list = -+debugger_command = -+default_database_type = cdb -+default_delivery_slot_cost = 5 -+default_delivery_slot_discount = 50 -+default_delivery_slot_loan = 3 -+default_destination_concurrency_failed_cohort_limit = 1 -+default_destination_concurrency_limit = 20 -+default_destination_concurrency_negative_feedback = 1 -+default_destination_concurrency_positive_feedback = 1 -+default_destination_rate_delay = 0s -+default_destination_recipient_limit = 50 -+default_extra_recipient_limit = 1000 -+default_filter_nexthop = -+default_minimum_delivery_slots = 3 -+default_privs = nobody -+default_process_limit = 100 -+default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason} -+default_recipient_limit = 20000 -+default_recipient_refill_delay = 5s -+default_recipient_refill_limit = 100 -+default_transport = smtp -+default_verp_delimiters = += -+defer_code = 450 -+defer_service_name = defer -+defer_transports = -+delay_logging_resolution_limit = 2 -+delay_notice_recipient = postmaster -+delay_warning_time = 0h -+deliver_lock_attempts = 20 -+deliver_lock_delay = 1s -+destination_concurrency_feedback_debug = no -+detect_8bit_encoding_header = yes -+disable_dns_lookups = no -+disable_mime_input_processing = no -+disable_mime_output_conversion = no -+disable_verp_bounces = no -+disable_vrfy_command = no -+dnsblog_reply_delay = 0s -+dnsblog_service_name = dnsblog -+dont_remove = 0 -+double_bounce_sender = double-bounce -+duplicate_filter_limit = 1000 -+empty_address_default_transport_maps_lookup_key = <> -+empty_address_recipient = MAILER-DAEMON -+empty_address_relayhost_maps_lookup_key = <> -+enable_long_queue_ids = no -+enable_original_recipient = yes -+error_delivery_slot_cost = $default_delivery_slot_cost -+error_delivery_slot_discount = $default_delivery_slot_discount -+error_delivery_slot_loan = $default_delivery_slot_loan -+error_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+error_destination_concurrency_limit = $default_destination_concurrency_limit -+error_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+error_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+error_destination_rate_delay = $default_destination_rate_delay -+error_destination_recipient_limit = $default_destination_recipient_limit -+error_extra_recipient_limit = $default_extra_recipient_limit -+error_initial_destination_concurrency = $initial_destination_concurrency -+error_minimum_delivery_slots = $default_minimum_delivery_slots -+error_notice_recipient = postmaster -+error_recipient_limit = $default_recipient_limit -+error_recipient_refill_delay = $default_recipient_refill_delay -+error_recipient_refill_limit = $default_recipient_refill_limit -+error_service_name = error -+execution_directory_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -+expand_owner_alias = no -+export_environment = TZ MAIL_CONFIG LANG -+fallback_transport = -+fallback_transport_maps = -+fast_flush_domains = $relay_domains -+fast_flush_purge_time = 7d -+fast_flush_refresh_time = 12h -+fault_injection_code = 0 -+flush_service_name = flush -+fork_attempts = 5 -+fork_delay = 1s -+forward_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -+forward_path = $home/.forward${recipient_delimiter}${extension}, $home/.forward -+frozen_delivered_to = yes -+hash_queue_depth = 1 -+hash_queue_names = deferred, defer -+header_address_token_limit = 10240 -+header_checks = -+header_size_limit = 102400 -+helpful_warnings = yes -+home_mailbox = -+hopcount_limit = 50 -+ignore_mx_lookup_error = no -+import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C -+in_flow_delay = 1s -+inet_interfaces = all -+inet_protocols = all -+initial_destination_concurrency = 5 -+internal_mail_filter_classes = -+invalid_hostname_reject_code = 501 -+ipc_idle = 5s -+ipc_timeout = 3600s -+ipc_ttl = 1000s -+line_length_limit = 2048 -+lmdb_map_size = 16777216 -+lmtp_address_preference = any -+lmtp_assume_final = no -+lmtp_bind_address = -+lmtp_bind_address6 = -+lmtp_body_checks = -+lmtp_cname_overrides_servername = no -+lmtp_connect_timeout = 0s -+lmtp_connection_cache_destinations = -+lmtp_connection_cache_on_demand = yes -+lmtp_connection_cache_time_limit = 2s -+lmtp_connection_reuse_count_limit = 0 -+lmtp_connection_reuse_time_limit = 300s -+lmtp_data_done_timeout = 600s -+lmtp_data_init_timeout = 120s -+lmtp_data_xfer_timeout = 180s -+lmtp_defer_if_no_mx_address_found = no -+lmtp_delivery_slot_cost = $default_delivery_slot_cost -+lmtp_delivery_slot_discount = $default_delivery_slot_discount -+lmtp_delivery_slot_loan = $default_delivery_slot_loan -+lmtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+lmtp_destination_concurrency_limit = $default_destination_concurrency_limit -+lmtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+lmtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+lmtp_destination_rate_delay = $default_destination_rate_delay -+lmtp_destination_recipient_limit = $default_destination_recipient_limit -+lmtp_discard_lhlo_keyword_address_maps = -+lmtp_discard_lhlo_keywords = -+lmtp_dns_resolver_options = -+lmtp_dns_support_level = -+lmtp_enforce_tls = no -+lmtp_extra_recipient_limit = $default_extra_recipient_limit -+lmtp_generic_maps = -+lmtp_header_checks = -+lmtp_host_lookup = dns -+lmtp_initial_destination_concurrency = $initial_destination_concurrency -+lmtp_lhlo_name = $myhostname -+lmtp_lhlo_timeout = 300s -+lmtp_line_length_limit = 998 -+lmtp_mail_timeout = 300s -+lmtp_mime_header_checks = -+lmtp_minimum_delivery_slots = $default_minimum_delivery_slots -+lmtp_mx_address_limit = 5 -+lmtp_mx_session_limit = 2 -+lmtp_nested_header_checks = -+lmtp_per_record_deadline = no -+lmtp_pix_workaround_delay_time = 10s -+lmtp_pix_workaround_maps = -+lmtp_pix_workaround_threshold_time = 500s -+lmtp_pix_workarounds = disable_esmtp,delay_dotcrlf -+lmtp_quit_timeout = 300s -+lmtp_quote_rfc821_envelope = yes -+lmtp_randomize_addresses = yes -+lmtp_rcpt_timeout = 300s -+lmtp_recipient_limit = $default_recipient_limit -+lmtp_recipient_refill_delay = $default_recipient_refill_delay -+lmtp_recipient_refill_limit = $default_recipient_refill_limit -+lmtp_reply_filter = -+lmtp_rset_timeout = 20s -+lmtp_sasl_auth_cache_name = -+lmtp_sasl_auth_cache_time = 90d -+lmtp_sasl_auth_enable = no -+lmtp_sasl_auth_soft_bounce = yes -+lmtp_sasl_mechanism_filter = -+lmtp_sasl_password_maps = -+lmtp_sasl_path = -+lmtp_sasl_security_options = noplaintext, noanonymous -+lmtp_sasl_tls_security_options = $lmtp_sasl_security_options -+lmtp_sasl_tls_verified_security_options = $lmtp_sasl_tls_security_options -+lmtp_sasl_type = cyrus -+lmtp_send_dummy_mail_auth = no -+lmtp_send_xforward_command = no -+lmtp_sender_dependent_authentication = no -+lmtp_skip_5xx_greeting = yes -+lmtp_skip_quit_response = no -+lmtp_starttls_timeout = 300s -+lmtp_tcp_port = 24 -+lmtp_tls_CAfile = -+lmtp_tls_CApath = -+lmtp_tls_block_early_mail_reply = no -+lmtp_tls_cert_file = -+lmtp_tls_ciphers = export -+lmtp_tls_dcert_file = -+lmtp_tls_dkey_file = $lmtp_tls_dcert_file -+lmtp_tls_eccert_file = -+lmtp_tls_eckey_file = $lmtp_tls_eccert_file -+lmtp_tls_enforce_peername = yes -+lmtp_tls_exclude_ciphers = -+lmtp_tls_fingerprint_cert_match = -+lmtp_tls_fingerprint_digest = md5 -+lmtp_tls_force_insecure_host_tlsa_lookup = no -+lmtp_tls_key_file = $lmtp_tls_cert_file -+lmtp_tls_loglevel = 0 -+lmtp_tls_mandatory_ciphers = medium -+lmtp_tls_mandatory_exclude_ciphers = -+lmtp_tls_mandatory_protocols = !SSLv2 -+lmtp_tls_note_starttls_offer = no -+lmtp_tls_per_site = -+lmtp_tls_policy_maps = -+lmtp_tls_protocols = !SSLv2 -+lmtp_tls_scert_verifydepth = 9 -+lmtp_tls_secure_cert_match = nexthop -+lmtp_tls_security_level = -+lmtp_tls_session_cache_database = -+lmtp_tls_session_cache_timeout = 3600s -+lmtp_tls_trust_anchor_file = -+lmtp_tls_verify_cert_match = hostname -+lmtp_use_tls = no -+lmtp_xforward_timeout = 300s -+local_command_shell = -+local_delivery_slot_cost = $default_delivery_slot_cost -+local_delivery_slot_discount = $default_delivery_slot_discount -+local_delivery_slot_loan = $default_delivery_slot_loan -+local_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+local_destination_concurrency_limit = 2 -+local_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+local_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+local_destination_rate_delay = $default_destination_rate_delay -+local_destination_recipient_limit = 1 -+local_extra_recipient_limit = $default_extra_recipient_limit -+local_header_rewrite_clients = permit_inet_interfaces -+local_initial_destination_concurrency = $initial_destination_concurrency -+local_minimum_delivery_slots = $default_minimum_delivery_slots -+local_recipient_limit = $default_recipient_limit -+local_recipient_maps = proxy:unix:passwd.byname $alias_maps -+local_recipient_refill_delay = $default_recipient_refill_delay -+local_recipient_refill_limit = $default_recipient_refill_limit -+local_transport = local:$myhostname -+luser_relay = -+mail_name = Postfix -+mail_owner = postfix -+mail_release_date = 20140507 -+mail_version = 2.11.1 -+mailbox_command = -+mailbox_command_maps = -+mailbox_delivery_lock = fcntl, dotlock -+mailbox_size_limit = 51200000 -+mailbox_transport = -+mailbox_transport_maps = -+maps_rbl_domains = -+maps_rbl_reject_code = 554 -+masquerade_classes = envelope_sender, header_sender, header_recipient -+masquerade_domains = -+masquerade_exceptions = -+master_service_disable = -+max_idle = 100s -+max_use = 100 -+maximal_backoff_time = 4000s -+maximal_queue_lifetime = 5d -+message_reject_characters = -+message_size_limit = 10240000 -+message_strip_characters = -+milter_command_timeout = 30s -+milter_connect_macros = j {daemon_name} v -+milter_connect_timeout = 30s -+milter_content_timeout = 300s -+milter_data_macros = i -+milter_default_action = tempfail -+milter_end_of_data_macros = i -+milter_end_of_header_macros = i -+milter_header_checks = -+milter_helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer} -+milter_macro_daemon_name = $myhostname -+milter_macro_v = $mail_name $mail_version -+milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer} -+milter_protocol = 6 -+milter_rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer} -+milter_unknown_command_macros = -+mime_boundary_length_limit = 2048 -+mime_header_checks = $header_checks -+mime_nesting_limit = 100 -+minimal_backoff_time = 300s -+multi_instance_directories = -+multi_instance_enable = no -+multi_instance_group = -+multi_instance_name = -+multi_instance_wrapper = -+multi_recipient_bounce_reject_code = 550 -+mydestination = $myhostname, localhost.$mydomain, localhost -+mynetworks_style = subnet -+myorigin = $myhostname -+nested_header_checks = $header_checks -+non_fqdn_reject_code = 504 -+non_smtpd_milters = -+notify_classes = resource, software -+owner_request_special = yes -+parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps -+permit_mx_backup_networks = -+pickup_service_name = pickup -+plaintext_reject_code = 450 -+postmulti_control_commands = reload flush -+postmulti_start_commands = start -+postmulti_stop_commands = stop abort drain quick-stop -+postscreen_access_list = permit_mynetworks -+postscreen_bare_newline_action = ignore -+postscreen_bare_newline_enable = no -+postscreen_bare_newline_ttl = 30d -+postscreen_blacklist_action = ignore -+postscreen_cache_cleanup_interval = 12h -+postscreen_cache_map = btree:$data_directory/postscreen_cache -+postscreen_cache_retention_time = 7d -+postscreen_client_connection_count_limit = $smtpd_client_connection_count_limit -+postscreen_command_count_limit = 20 -+postscreen_command_filter = -+postscreen_command_time_limit = ${stress?10}${stress:300}s -+postscreen_disable_vrfy_command = $disable_vrfy_command -+postscreen_discard_ehlo_keyword_address_maps = $smtpd_discard_ehlo_keyword_address_maps -+postscreen_discard_ehlo_keywords = $smtpd_discard_ehlo_keywords -+postscreen_dnsbl_action = ignore -+postscreen_dnsbl_reply_map = -+postscreen_dnsbl_sites = -+postscreen_dnsbl_threshold = 1 -+postscreen_dnsbl_ttl = 1h -+postscreen_dnsbl_whitelist_threshold = 0 -+postscreen_enforce_tls = $smtpd_enforce_tls -+postscreen_expansion_filter = $smtpd_expansion_filter -+postscreen_forbidden_commands = $smtpd_forbidden_commands -+postscreen_greet_action = ignore -+postscreen_greet_banner = $smtpd_banner -+postscreen_greet_ttl = 1d -+postscreen_greet_wait = ${stress?2}${stress:6}s -+postscreen_helo_required = $smtpd_helo_required -+postscreen_non_smtp_command_action = drop -+postscreen_non_smtp_command_enable = no -+postscreen_non_smtp_command_ttl = 30d -+postscreen_pipelining_action = enforce -+postscreen_pipelining_enable = no -+postscreen_pipelining_ttl = 30d -+postscreen_post_queue_limit = $default_process_limit -+postscreen_pre_queue_limit = $default_process_limit -+postscreen_reject_footer = $smtpd_reject_footer -+postscreen_tls_security_level = $smtpd_tls_security_level -+postscreen_upstream_proxy_protocol = -+postscreen_upstream_proxy_timeout = 5s -+postscreen_use_tls = $smtpd_use_tls -+postscreen_watchdog_timeout = 10s -+postscreen_whitelist_interfaces = static:all -+prepend_delivered_header = command, file, forward -+process_id = 6537 -+process_id_directory = pid -+process_name = postconf -+propagate_unmatched_extensions = canonical, virtual -+proxy_interfaces = -+proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $smtpd_sender_login_maps $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps $alias_maps -+proxy_write_maps = $smtp_sasl_auth_cache_name $lmtp_sasl_auth_cache_name $address_verify_map $postscreen_cache_map -+proxymap_service_name = proxymap -+proxywrite_service_name = proxywrite -+qmgr_clog_warn_time = 300s -+qmgr_daemon_timeout = 1000s -+qmgr_fudge_factor = 100 -+qmgr_ipc_timeout = 60s -+qmgr_message_active_limit = 20000 -+qmgr_message_recipient_limit = 20000 -+qmgr_message_recipient_minimum = 10 -+qmqpd_authorized_clients = -+qmqpd_client_port_logging = no -+qmqpd_error_delay = 1s -+qmqpd_timeout = 300s -+queue_file_attribute_count_limit = 100 -+queue_minfree = 0 -+queue_run_delay = 300s -+queue_service_name = qmgr -+rbl_reply_maps = -+receive_override_options = -+recipient_bcc_maps = -+recipient_canonical_classes = envelope_recipient, header_recipient -+recipient_canonical_maps = -+recipient_delimiter = -+reject_code = 554 -+reject_tempfail_action = defer_if_permit -+relay_clientcerts = -+relay_delivery_slot_cost = $default_delivery_slot_cost -+relay_delivery_slot_discount = $default_delivery_slot_discount -+relay_delivery_slot_loan = $default_delivery_slot_loan -+relay_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+relay_destination_concurrency_limit = $default_destination_concurrency_limit -+relay_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+relay_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+relay_destination_rate_delay = $default_destination_rate_delay -+relay_destination_recipient_limit = $default_destination_recipient_limit -+relay_domains = $mydestination -+relay_domains_reject_code = 554 -+relay_extra_recipient_limit = $default_extra_recipient_limit -+relay_initial_destination_concurrency = $initial_destination_concurrency -+relay_minimum_delivery_slots = $default_minimum_delivery_slots -+relay_recipient_limit = $default_recipient_limit -+relay_recipient_maps = -+relay_recipient_refill_delay = $default_recipient_refill_delay -+relay_recipient_refill_limit = $default_recipient_refill_limit -+relay_transport = relay -+relayhost = -+relocated_maps = -+remote_header_rewrite_domain = -+require_home_directory = no -+reset_owner_alias = no -+resolve_dequoted_address = yes -+resolve_null_domain = no -+resolve_numeric_domain = no -+retry_delivery_slot_cost = $default_delivery_slot_cost -+retry_delivery_slot_discount = $default_delivery_slot_discount -+retry_delivery_slot_loan = $default_delivery_slot_loan -+retry_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+retry_destination_concurrency_limit = $default_destination_concurrency_limit -+retry_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+retry_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+retry_destination_rate_delay = $default_destination_rate_delay -+retry_destination_recipient_limit = $default_destination_recipient_limit -+retry_extra_recipient_limit = $default_extra_recipient_limit -+retry_initial_destination_concurrency = $initial_destination_concurrency -+retry_minimum_delivery_slots = $default_minimum_delivery_slots -+retry_recipient_limit = $default_recipient_limit -+retry_recipient_refill_delay = $default_recipient_refill_delay -+retry_recipient_refill_limit = $default_recipient_refill_limit -+rewrite_service_name = rewrite -+send_cyrus_sasl_authzid = no -+sender_bcc_maps = -+sender_canonical_classes = envelope_sender, header_sender -+sender_canonical_maps = -+sender_dependent_default_transport_maps = -+sender_dependent_relayhost_maps = -+sendmail_fix_line_endings = always -+service_throttle_time = 60s -+setgid_group = postdrop -+show_user_unknown_table_name = yes -+showq_service_name = showq -+smtp_address_preference = any -+smtp_always_send_ehlo = yes -+smtp_bind_address = -+smtp_bind_address6 = -+smtp_body_checks = -+smtp_cname_overrides_servername = no -+smtp_connect_timeout = 30s -+smtp_connection_cache_destinations = -+smtp_connection_cache_on_demand = yes -+smtp_connection_cache_time_limit = 2s -+smtp_connection_reuse_count_limit = 0 -+smtp_connection_reuse_time_limit = 300s -+smtp_data_done_timeout = 600s -+smtp_data_init_timeout = 120s -+smtp_data_xfer_timeout = 180s -+smtp_defer_if_no_mx_address_found = no -+smtp_delivery_slot_cost = $default_delivery_slot_cost -+smtp_delivery_slot_discount = $default_delivery_slot_discount -+smtp_delivery_slot_loan = $default_delivery_slot_loan -+smtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+smtp_destination_concurrency_limit = $default_destination_concurrency_limit -+smtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+smtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+smtp_destination_rate_delay = $default_destination_rate_delay -+smtp_destination_recipient_limit = $default_destination_recipient_limit -+smtp_discard_ehlo_keyword_address_maps = -+smtp_discard_ehlo_keywords = -+smtp_dns_resolver_options = -+smtp_dns_support_level = -+smtp_enforce_tls = no -+smtp_extra_recipient_limit = $default_extra_recipient_limit -+smtp_fallback_relay = $fallback_relay -+smtp_generic_maps = -+smtp_header_checks = -+smtp_helo_name = $myhostname -+smtp_helo_timeout = 300s -+smtp_host_lookup = dns -+smtp_initial_destination_concurrency = $initial_destination_concurrency -+smtp_line_length_limit = 998 -+smtp_mail_timeout = 300s -+smtp_mime_header_checks = -+smtp_minimum_delivery_slots = $default_minimum_delivery_slots -+smtp_mx_address_limit = 5 -+smtp_mx_session_limit = 2 -+smtp_nested_header_checks = -+smtp_never_send_ehlo = no -+smtp_per_record_deadline = no -+smtp_pix_workaround_delay_time = 10s -+smtp_pix_workaround_maps = -+smtp_pix_workaround_threshold_time = 500s -+smtp_pix_workarounds = disable_esmtp,delay_dotcrlf -+smtp_quit_timeout = 300s -+smtp_quote_rfc821_envelope = yes -+smtp_randomize_addresses = yes -+smtp_rcpt_timeout = 300s -+smtp_recipient_limit = $default_recipient_limit -+smtp_recipient_refill_delay = $default_recipient_refill_delay -+smtp_recipient_refill_limit = $default_recipient_refill_limit -+smtp_reply_filter = -+smtp_rset_timeout = 20s -+smtp_sasl_auth_cache_name = -+smtp_sasl_auth_cache_time = 90d -+smtp_sasl_auth_enable = no -+smtp_sasl_auth_soft_bounce = yes -+smtp_sasl_mechanism_filter = -+smtp_sasl_password_maps = -+smtp_sasl_path = -+smtp_sasl_security_options = noplaintext, noanonymous -+smtp_sasl_tls_security_options = $smtp_sasl_security_options -+smtp_sasl_tls_verified_security_options = $smtp_sasl_tls_security_options -+smtp_sasl_type = cyrus -+smtp_send_dummy_mail_auth = no -+smtp_send_xforward_command = no -+smtp_sender_dependent_authentication = no -+smtp_skip_5xx_greeting = yes -+smtp_skip_quit_response = yes -+smtp_starttls_timeout = 300s -+smtp_tls_CAfile = -+smtp_tls_CApath = -+smtp_tls_block_early_mail_reply = no -+smtp_tls_cert_file = -+smtp_tls_ciphers = export -+smtp_tls_dcert_file = -+smtp_tls_dkey_file = $smtp_tls_dcert_file -+smtp_tls_eccert_file = -+smtp_tls_eckey_file = $smtp_tls_eccert_file -+smtp_tls_enforce_peername = yes -+smtp_tls_exclude_ciphers = -+smtp_tls_fingerprint_cert_match = -+smtp_tls_fingerprint_digest = md5 -+smtp_tls_force_insecure_host_tlsa_lookup = no -+smtp_tls_key_file = $smtp_tls_cert_file -+smtp_tls_loglevel = 0 -+smtp_tls_mandatory_ciphers = medium -+smtp_tls_mandatory_exclude_ciphers = -+smtp_tls_mandatory_protocols = !SSLv2 -+smtp_tls_note_starttls_offer = no -+smtp_tls_per_site = -+smtp_tls_policy_maps = -+smtp_tls_protocols = !SSLv2 -+smtp_tls_scert_verifydepth = 9 -+smtp_tls_secure_cert_match = nexthop, dot-nexthop -+smtp_tls_security_level = -+smtp_tls_session_cache_database = -+smtp_tls_session_cache_timeout = 3600s -+smtp_tls_trust_anchor_file = -+smtp_tls_verify_cert_match = hostname -+smtp_use_tls = no -+smtp_xforward_timeout = 300s -+smtpd_authorized_verp_clients = $authorized_verp_clients -+smtpd_authorized_xclient_hosts = -+smtpd_authorized_xforward_hosts = -+smtpd_banner = $myhostname ESMTP $mail_name -+smtpd_client_connection_count_limit = 50 -+smtpd_client_connection_rate_limit = 0 -+smtpd_client_event_limit_exceptions = ${smtpd_client_connection_limit_exceptions:$mynetworks} -+smtpd_client_message_rate_limit = 0 -+smtpd_client_new_tls_session_rate_limit = 0 -+smtpd_client_port_logging = no -+smtpd_client_recipient_rate_limit = 0 -+smtpd_client_restrictions = -+smtpd_command_filter = -+smtpd_data_restrictions = -+smtpd_delay_open_until_valid_rcpt = yes -+smtpd_delay_reject = yes -+smtpd_discard_ehlo_keyword_address_maps = -+smtpd_discard_ehlo_keywords = -+smtpd_end_of_data_restrictions = -+smtpd_enforce_tls = no -+smtpd_error_sleep_time = 1s -+smtpd_etrn_restrictions = -+smtpd_expansion_filter = \t\40!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -+smtpd_forbidden_commands = CONNECT GET POST -+smtpd_hard_error_limit = ${stress?1}${stress:20} -+smtpd_helo_required = no -+smtpd_helo_restrictions = -+smtpd_history_flush_threshold = 100 -+smtpd_junk_command_limit = ${stress?1}${stress:100} -+smtpd_log_access_permit_actions = -+smtpd_milters = -+smtpd_noop_commands = -+smtpd_null_access_lookup_key = <> -+smtpd_peername_lookup = yes -+smtpd_per_record_deadline = ${stress?yes}${stress:no} -+smtpd_policy_service_max_idle = 300s -+smtpd_policy_service_max_ttl = 1000s -+smtpd_policy_service_timeout = 100s -+smtpd_proxy_ehlo = $myhostname -+smtpd_proxy_filter = -+smtpd_proxy_options = -+smtpd_proxy_timeout = 100s -+smtpd_recipient_limit = 1000 -+smtpd_recipient_overshoot_limit = 1000 -+smtpd_recipient_restrictions = -+smtpd_reject_footer = -+smtpd_reject_unlisted_recipient = yes -+smtpd_reject_unlisted_sender = no -+smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, defer_unauth_destination -+smtpd_restriction_classes = -+smtpd_sasl_auth_enable = no -+smtpd_sasl_authenticated_header = no -+smtpd_sasl_exceptions_networks = -+smtpd_sasl_local_domain = -+smtpd_sasl_path = smtpd -+smtpd_sasl_security_options = noanonymous -+smtpd_sasl_service = smtp -+smtpd_sasl_tls_security_options = $smtpd_sasl_security_options -+smtpd_sasl_type = cyrus -+smtpd_sender_login_maps = -+smtpd_sender_restrictions = -+smtpd_service_name = smtpd -+smtpd_soft_error_limit = 10 -+smtpd_starttls_timeout = ${stress?10}${stress:300}s -+smtpd_timeout = ${stress?10}${stress:300}s -+smtpd_tls_CAfile = -+smtpd_tls_CApath = -+smtpd_tls_always_issue_session_ids = yes -+smtpd_tls_ask_ccert = no -+smtpd_tls_auth_only = no -+smtpd_tls_ccert_verifydepth = 9 -+smtpd_tls_cert_file = -+smtpd_tls_ciphers = export -+smtpd_tls_dcert_file = -+smtpd_tls_dh1024_param_file = -+smtpd_tls_dh512_param_file = -+smtpd_tls_dkey_file = $smtpd_tls_dcert_file -+smtpd_tls_eccert_file = -+smtpd_tls_eckey_file = $smtpd_tls_eccert_file -+smtpd_tls_eecdh_grade = strong -+smtpd_tls_exclude_ciphers = -+smtpd_tls_fingerprint_digest = md5 -+smtpd_tls_key_file = $smtpd_tls_cert_file -+smtpd_tls_loglevel = 0 -+smtpd_tls_mandatory_ciphers = medium -+smtpd_tls_mandatory_exclude_ciphers = -+smtpd_tls_mandatory_protocols = !SSLv2 -+smtpd_tls_protocols = -+smtpd_tls_received_header = no -+smtpd_tls_req_ccert = no -+smtpd_tls_security_level = -+smtpd_tls_session_cache_database = -+smtpd_tls_session_cache_timeout = 3600s -+smtpd_tls_wrappermode = no -+smtpd_upstream_proxy_protocol = -+smtpd_upstream_proxy_timeout = 5s -+smtpd_use_tls = no -+soft_bounce = no -+stale_lock_time = 500s -+stress = -+strict_7bit_headers = no -+strict_8bitmime = no -+strict_8bitmime_body = no -+strict_mailbox_ownership = yes -+strict_mime_encoding_domain = no -+strict_rfc821_envelopes = no -+sun_mailtool_compatibility = no -+swap_bangpath = yes -+syslog_facility = mail -+syslog_name = ${multi_instance_name:postfix}${multi_instance_name?$multi_instance_name} -+tcp_windowsize = 0 -+tls_append_default_CA = no -+tls_daemon_random_bytes = 32 -+tls_dane_digest_agility = on -+tls_dane_digests = sha512 sha256 -+tls_dane_trust_anchor_digest_enable = yes -+tls_disable_workarounds = -+tls_eecdh_strong_curve = prime256v1 -+tls_eecdh_ultra_curve = secp384r1 -+tls_export_cipherlist = ALL:+RC4:@STRENGTH -+tls_high_cipherlist = ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH -+tls_legacy_public_key_fingerprints = no -+tls_low_cipherlist = ALL:!EXPORT:+RC4:@STRENGTH -+tls_medium_cipherlist = ALL:!EXPORT:!LOW:+RC4:@STRENGTH -+tls_null_cipherlist = eNULL:!aNULL -+tls_preempt_cipherlist = no -+tls_random_bytes = 32 -+tls_random_exchange_name = ${data_directory}/prng_exch -+tls_random_prng_update_period = 3600s -+tls_random_reseed_period = 3600s -+tls_random_source = dev:/dev/urandom -+tls_ssl_options = -+tls_wildcard_matches_multiple_labels = yes -+tlsmgr_service_name = tlsmgr -+tlsproxy_enforce_tls = $smtpd_enforce_tls -+tlsproxy_service_name = tlsproxy -+tlsproxy_tls_CAfile = $smtpd_tls_CAfile -+tlsproxy_tls_CApath = $smtpd_tls_CApath -+tlsproxy_tls_always_issue_session_ids = $smtpd_tls_always_issue_session_ids -+tlsproxy_tls_ask_ccert = $smtpd_tls_ask_ccert -+tlsproxy_tls_ccert_verifydepth = $smtpd_tls_ccert_verifydepth -+tlsproxy_tls_cert_file = $smtpd_tls_cert_file -+tlsproxy_tls_ciphers = $smtpd_tls_ciphers -+tlsproxy_tls_dcert_file = $smtpd_tls_dcert_file -+tlsproxy_tls_dh1024_param_file = $smtpd_tls_dh1024_param_file -+tlsproxy_tls_dh512_param_file = $smtpd_tls_dh512_param_file -+tlsproxy_tls_dkey_file = $smtpd_tls_dkey_file -+tlsproxy_tls_eccert_file = $smtpd_tls_eccert_file -+tlsproxy_tls_eckey_file = $smtpd_tls_eckey_file -+tlsproxy_tls_eecdh_grade = $smtpd_tls_eecdh_grade -+tlsproxy_tls_exclude_ciphers = $smtpd_tls_exclude_ciphers -+tlsproxy_tls_fingerprint_digest = $smtpd_tls_fingerprint_digest -+tlsproxy_tls_key_file = $smtpd_tls_key_file -+tlsproxy_tls_loglevel = $smtpd_tls_loglevel -+tlsproxy_tls_mandatory_ciphers = $smtpd_tls_mandatory_ciphers -+tlsproxy_tls_mandatory_exclude_ciphers = $smtpd_tls_mandatory_exclude_ciphers -+tlsproxy_tls_mandatory_protocols = $smtpd_tls_mandatory_protocols -+tlsproxy_tls_protocols = $smtpd_tls_protocols -+tlsproxy_tls_req_ccert = $smtpd_tls_req_ccert -+tlsproxy_tls_security_level = $smtpd_tls_security_level -+tlsproxy_use_tls = $smtpd_use_tls -+tlsproxy_watchdog_timeout = 10s -+trace_service_name = trace -+transport_maps = -+transport_retry_time = 60s -+trigger_timeout = 10s -+undisclosed_recipients_header = -+unknown_address_reject_code = 450 -+unknown_address_tempfail_action = $reject_tempfail_action -+unknown_client_reject_code = 450 -+unknown_helo_hostname_tempfail_action = $reject_tempfail_action -+unknown_hostname_reject_code = 450 -+unknown_local_recipient_reject_code = 550 -+unknown_relay_recipient_reject_code = 550 -+unknown_virtual_alias_reject_code = 550 -+unknown_virtual_mailbox_reject_code = 550 -+unverified_recipient_defer_code = 450 -+unverified_recipient_reject_code = 450 -+unverified_recipient_reject_reason = -+unverified_recipient_tempfail_action = $reject_tempfail_action -+unverified_sender_defer_code = 450 -+unverified_sender_reject_code = 450 -+unverified_sender_reject_reason = -+unverified_sender_tempfail_action = $reject_tempfail_action -+verp_delimiter_filter = -=+ -+virtual_alias_domains = $virtual_alias_maps -+virtual_alias_expansion_limit = 1000 -+virtual_alias_maps = $virtual_maps -+virtual_alias_recursion_limit = 1000 -+virtual_delivery_slot_cost = $default_delivery_slot_cost -+virtual_delivery_slot_discount = $default_delivery_slot_discount -+virtual_delivery_slot_loan = $default_delivery_slot_loan -+virtual_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit -+virtual_destination_concurrency_limit = $default_destination_concurrency_limit -+virtual_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback -+virtual_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback -+virtual_destination_rate_delay = $default_destination_rate_delay -+virtual_destination_recipient_limit = $default_destination_recipient_limit -+virtual_extra_recipient_limit = $default_extra_recipient_limit -+virtual_gid_maps = -+virtual_initial_destination_concurrency = $initial_destination_concurrency -+virtual_mailbox_base = -+virtual_mailbox_domains = $virtual_mailbox_maps -+virtual_mailbox_limit = 51200000 -+virtual_mailbox_lock = fcntl, dotlock -+virtual_mailbox_maps = -+virtual_minimum_delivery_slots = $default_minimum_delivery_slots -+virtual_minimum_uid = 100 -+virtual_recipient_limit = $default_recipient_limit -+virtual_recipient_refill_delay = $default_recipient_refill_delay -+virtual_recipient_refill_limit = $default_recipient_refill_limit -+virtual_transport = virtual -+virtual_uid_maps = diff --git a/mail/ssmtp/Makefile b/mail/ssmtp/Makefile new file mode 100644 index 000000000..3d2439477 --- /dev/null +++ b/mail/ssmtp/Makefile @@ -0,0 +1,64 @@ +# +# 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)) diff --git a/mail/ssmtp/patches/002-fix_pointer.patch b/mail/ssmtp/patches/002-fix_pointer.patch new file mode 100644 index 000000000..57d83f557 --- /dev/null +++ b/mail/ssmtp/patches/002-fix_pointer.patch @@ -0,0 +1,401 @@ +--- 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); + +@@ -363,7 +363,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 +384,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 +519,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 +548,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 +576,7 @@ void rcpt_parse(char *str) + } + + /* End of string? */ +- if(*(q + 1) == (char)NULL) { ++ if(*(q + 1) == '\0') { + got_addr = True; + } + +@@ -584,7 +584,7 @@ void rcpt_parse(char *str) + if((*q == ',') && (in_quotes == False)) { + got_addr = True; + +- *q = (char)NULL; ++ *q = '\0'; + } + + if(got_addr) { +@@ -668,7 +668,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 +676,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 +739,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 +776,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 +809,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 +876,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 +890,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 +904,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 +949,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 +1025,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 +1036,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 +1045,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 +1054,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 +1119,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 +1307,7 @@ char *fd_gets(char *buf, int size, int f + buf[i++] = c; + } + } +- buf[i] = (char)NULL; ++ buf[i] = '\0'; + + return(buf); + } +@@ -1434,14 +1431,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 +1486,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(""); + } + +@@ -1737,7 +1734,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 +1752,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 +1769,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 +1867,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 +1886,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"); + } + } diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile index 2470ad256..4316aae49 100644 --- a/multimedia/ffmpeg/Makefile +++ b/multimedia/ffmpeg/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ffmpeg -PKG_VERSION:=2.3.4 +PKG_VERSION:=2.4.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ffmpeg.org/releases/ -PKG_MD5SUM:=d6a0c7f0827a2446ca2bed11ac9bf608 +PKG_MD5SUM:=9e6163b09b7b9331b834d80874c2c0ff PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net> PKG_LICENSE:=LGPL-2.1+ GPL-2+ LGPL-3 @@ -289,7 +289,7 @@ endef define Package/libffmpeg-custom $(call Package/libffmpeg/Default) TITLE+= (custom) - DEPENDS+= @DEVEL +libopus +libspeex + DEPENDS+= @DEVEL @!ALL +libopus +libspeex VARIANT:=custom MENU:=1 endef diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile index 6f49a5df4..412b5f90b 100644 --- a/multimedia/motion/Makefile +++ b/multimedia/motion/Makefile @@ -8,16 +8,21 @@ 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 @@ -30,7 +35,7 @@ define Package/motion endef define Package/motion/conffiles -/etc/motion.conf + /etc/motion.conf endef CONFIGURE_ARGS+= \ @@ -44,9 +49,9 @@ 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 diff --git a/multimedia/motion/patches/002-honor_cppflags.patch b/multimedia/motion/patches/002-honor_cppflags.patch deleted file mode 100644 index ac10f1e9c..000000000 --- a/multimedia/motion/patches/002-honor_cppflags.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- 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 - diff --git a/multimedia/shairplay/Makefile b/multimedia/shairplay/Makefile new file mode 100644 index 000000000..1c1b0af9a --- /dev/null +++ b/multimedia/shairplay/Makefile @@ -0,0 +1,56 @@ +# +# 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:=shairplay +PKG_VERSION:=2014-10-27 +PKG_RELEASE:=$(PKG_SOURCE_VERSION) + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git://github.com/juhovh/shairplay.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=64d59e3087f829006d091fa0d114efb50972a2bf +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz +PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com> + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +include $(INCLUDE_DIR)/package.mk + +PKG_FIXUP:=libtool + +define Package/shairplay + SECTION:=multimedia + CATEGORY:=Multimedia + DEPENDS:=+avahi-daemon +libao +libavahi-compat-libdnssd +libltdl +libpthread + TITLE:=Shairplay +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \ + ./autogen.sh;) + $(call Build/Configure/Default) +endef + +define Package/shairplay/description + Free portable AirPlay server implementation similar to ShairPort. +endef + +define Package/shairplay/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/shairplay $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/share/shairplay + $(INSTALL_DATA) $(PKG_BUILD_DIR)/airport.key $(1)/usr/share/shairplay/ + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) files/shairplay.init $(1)/etc/init.d/shairplay + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/shairplay.config $(1)/etc/config/shairplay +endef + +$(eval $(call BuildPackage,shairplay)) diff --git a/multimedia/shairplay/files/shairplay.config b/multimedia/shairplay/files/shairplay.config new file mode 100644 index 000000000..6e1f93937 --- /dev/null +++ b/multimedia/shairplay/files/shairplay.config @@ -0,0 +1,10 @@ +config shairplay main + option disabled '1' + option respawn '1' + option apname 'AirPlay' + option port '5000' + option password '' + option hwaddr '' + option ao_driver 'oss' + option ao_devicename '' + option ao_deviceid '' diff --git a/multimedia/shairplay/files/shairplay.init b/multimedia/shairplay/files/shairplay.init new file mode 100644 index 000000000..093a16805 --- /dev/null +++ b/multimedia/shairplay/files/shairplay.init @@ -0,0 +1,51 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=90 +USE_PROCD=1 + +append_arg() { + local cfg="$1" + local var="$2" + local opt="$3" + local def="$4" + local val + + config_get val "$cfg" "$var" + [ -n "$val" -o -n "$def" ] && procd_append_param command $opt="${val:-$def}" +} + +start_instance() { + local cfg="$1" + local aux + + config_get_bool aux "$cfg" 'disabled' '0' + [ "$aux" = 1 ] && return 1 + + procd_open_instance + + procd_set_param command /usr/bin/shairplay + + append_arg "$cfg" apname "--apname" "AirPlay" + append_arg "$cfg" port "--server_port" + append_arg "$cfg" password "--password" + append_arg "$cfg" hwaddr "--hwaddr" + + append_arg "$cfg" ao_driver "--ao_driver" + append_arg "$cfg" ao_devicename "--ao_devicename" + append_arg "$cfg" ao_deviceid "--ao_deviceid" + + config_get_bool aux "$cfg" 'respawn' '0' + [ "$aux" = 1 ] && procd_set_param respawn + + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "shairplay" +} + +start_service() { + config_load shairplay + config_foreach start_instance shairplay +} diff --git a/multimedia/shairplay/patches/001-key_file_dir.patch b/multimedia/shairplay/patches/001-key_file_dir.patch new file mode 100644 index 000000000..3c5e3a595 --- /dev/null +++ b/multimedia/shairplay/patches/001-key_file_dir.patch @@ -0,0 +1,11 @@ +--- a/src/shairplay.c ++++ b/src/shairplay.c +@@ -346,7 +346,7 @@ main(int argc, char *argv[]) + raop_cbs.audio_destroy = audio_destroy; + raop_cbs.audio_set_volume = audio_set_volume; + +- raop = raop_init_from_keyfile(10, &raop_cbs, "airport.key", NULL); ++ raop = raop_init_from_keyfile(10, &raop_cbs, "/usr/share/shairplay/airport.key", NULL); + if (raop == NULL) { + fprintf(stderr, "Could not initialize the RAOP service\n"); + fprintf(stderr, "Please make sure the airport.key file is in the current directory.\n"); diff --git a/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch b/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch new file mode 100644 index 000000000..ff70e24a6 --- /dev/null +++ b/multimedia/shairplay/patches/002-libavahi-compat-dnssd.patch @@ -0,0 +1,11 @@ +--- a/src/lib/dnssd.c ++++ b/src/lib/dnssd.c +@@ -167,7 +167,7 @@ dnssd_init(int *error) + return NULL; + } + #elif USE_LIBDL +- dnssd->module = dlopen("libdns_sd.so", RTLD_LAZY); ++ dnssd->module = dlopen("libdns_sd.so.1", RTLD_LAZY); + if (!dnssd->module) { + if (error) *error = DNSSD_ERROR_LIBNOTFOUND; + free(dnssd); diff --git a/multimedia/shairplay/patches/003-fix_big-endian.patch b/multimedia/shairplay/patches/003-fix_big-endian.patch new file mode 100644 index 000000000..7764aabc6 --- /dev/null +++ b/multimedia/shairplay/patches/003-fix_big-endian.patch @@ -0,0 +1,24 @@ +--- a/src/lib/alac/alac.c ++++ b/src/lib/alac/alac.c +@@ -29,11 +29,7 @@ + * + */ + +-#ifdef __BIG_ENDIAN__ +-static const int host_bigendian = 1; +-#else +-static const int host_bigendian = 0; +-#endif ++static int host_bigendian = 0; + + #include <stdio.h> + #include <stdlib.h> +@@ -1181,6 +1177,8 @@ alac_file *create_alac(int samplesize, i + { + alac_file *newfile = malloc(sizeof(alac_file)); + ++ host_bigendian = (htonl(42) == 42); ++ + newfile->samplesize = samplesize; + newfile->numchannels = numchannels; + newfile->bytespersample = (samplesize / 8) * numchannels; diff --git a/multimedia/shairport/Makefile b/multimedia/shairport/Makefile index 35678c7cc..0b7170766 100644 --- a/multimedia/shairport/Makefile +++ b/multimedia/shairport/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=shairport -PKG_VERSION:=2014-08-22 +PKG_VERSION:=2014-10-28 PKG_RELEASE:=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git diff --git a/multimedia/shairport/files/shairport.config b/multimedia/shairport/files/shairport.config index 851c927e4..9b2165a9a 100644 --- a/multimedia/shairport/files/shairport.config +++ b/multimedia/shairport/files/shairport.config @@ -1,12 +1,16 @@ config shairport main + option disabled '1' + option respawn '1' option bname 'AirPort' option password '' option port '5002' - option buffer '256' - option log '' + option buffer '' + option log_file '' + option err_file '' + option meta_dir '' option cmd_start '' option cmd_stop '' - option cmd_wait '' + option cmd_wait '0' option audio_output 'alsa' option mdns 'avahi' @@ -16,3 +20,17 @@ config shairport main option mixer_type '' option mixer_control '' option mixer_index '' + + # options for ao output + option ao_driver '' + option ao_name '' + option ao_id '' + option ao_options '' + + # options for pipe output + option output_fifo '' + + # options for pulse output + option pulse_server '' + option pulse_sink '' + option pulse_appname '' diff --git a/multimedia/shairport/files/shairport.init b/multimedia/shairport/files/shairport.init index 0e649d684..341ff6fee 100644 --- a/multimedia/shairport/files/shairport.init +++ b/multimedia/shairport/files/shairport.init @@ -28,16 +28,21 @@ append_bool() { start_instance() { local cfg="$1" - local ao dev + local ao dev aux + + config_get_bool aux "$cfg" 'disabled' '0' + [ "$aux" = 1 ] && return 1 procd_open_instance procd_set_param command /usr/bin/shairport append_arg "$cfg" bname "-a" "AirPort" - append_arg "$cfg" log "-l" - append_arg "$cfg" buffer "-b" "256" - append_arg "$cfg" port "-p" "5002" + append_arg "$cfg" log_file "-l" + append_arg "$cfg" err_file "-e" + append_arg "$cfg" meta_dir "-M" + append_arg "$cfg" buffer "-b" + append_arg "$cfg" port "-p" append_arg "$cfg" password "-k" append_arg "$cfg" mdns "-m" @@ -58,8 +63,34 @@ start_instance() { append_arg "$cfg" mixer_control "-c" append_arg "$cfg" mixer_index "-i" fi + elif [ "$ao" = "ao" ]; then + config_get dev "$cfg" ao_driver "" + if [ -n "$dev" ]; then + procd_append_param command "--" + append_arg "$cfg" ao_driver "-d" + append_arg "$cfg" ao_id "-i" + append_arg "$cfg" ao_name "-n" + append_arg "$cfg" ao_options "-o" + fi + elif [ "$ao" = "pipe" ]; then + config_get dev "$cfg" output_fifo "" + if [ -n "$dev" ]; then + procd_append_param command "--" + append_arg "$cfg" output_fifo "" + fi + elif [ "$ao" = "pulse" ]; then + config_get dev "$cfg" pulse_server "" + if [ -n "$dev" ]; then + procd_append_param command "--" + append_arg "$cfg" pulse_server "-a" + append_arg "$cfg" pulse_sink "-s" + append_arg "$cfg" pulse_appname "-n" + fi fi + config_get_bool aux "$cfg" 'respawn' '0' + [ "$aux" = 1 ] && procd_set_param respawn + procd_close_instance } diff --git a/net/bcp38/Makefile b/net/bcp38/Makefile new file mode 100644 index 000000000..280bcc504 --- /dev/null +++ b/net/bcp38/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2014 Openwrt.org +# +# This is free software, licensed under the GNU General Public License v2. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bcp38 +PKG_VERSION:=4 +PKG_RELEASE:=1 +PKG_LICENCE:=GPL-3.0+ + +include $(INCLUDE_DIR)/package.mk + +define Package/bcp38 + SECTION:=net + CATEGORY:=Network + SUBMENU:=Routing and Redirection + TITLE:=BCP38 compliance + URL:=https://github.com/dtaht/ceropackages-3.10 + MAINTAINER:=Toke Høiland-Jørgensen <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)) diff --git a/net/bcp38/files/bcp38.config b/net/bcp38/files/bcp38.config new file mode 100644 index 000000000..08e8e20b3 --- /dev/null +++ b/net/bcp38/files/bcp38.config @@ -0,0 +1,22 @@ +config bcp38 + option enabled 0 + option interface 'eth1' + option detect_upstream 1 + list match '127.0.0.0/8' + list match '0.0.0.0/8' # RFC 1700 + list match '240.0.0.0/4' # RFC 5745 + list match '192.0.2.0/24' # RFC 5737 + list match '198.51.100.0/24' # RFC 5737 + list match '203.0.113.0/24' # RFC 5737 + list match '192.168.0.0/16' # RFC 1918 + list match '10.0.0.0/8' # RFC 1918 + list match '172.16.0.0/12' # RFC 1918 + list match '169.254.0.0/16' # RFC 3927 + +# list nomatch '172.26.0.0/21' # Example of something not to match +# There is a dhcp trigger to do this for the netmask of a +# double natted connection needed + +# I will argue that this level of indirection doesn't scale +# very well - see how to block china as an example +# http://www.okean.com/china.txt diff --git a/net/bcp38/files/bcp38.defaults b/net/bcp38/files/bcp38.defaults new file mode 100644 index 000000000..d7e0d8063 --- /dev/null +++ b/net/bcp38/files/bcp38.defaults @@ -0,0 +1,13 @@ +#!/bin/sh + +uci -q batch <<-EOT + delete firewall.bcp38 + set firewall.bcp38=include + set firewall.bcp38.type=script + set firewall.bcp38.path=/usr/lib/bcp38/run.sh + set firewall.bcp38.family=IPv4 + set firewall.bcp38.reload=1 + commit firewall +EOT + +exit 0 diff --git a/net/bcp38/files/run.sh b/net/bcp38/files/run.sh new file mode 100755 index 000000000..bafdf3bb8 --- /dev/null +++ b/net/bcp38/files/run.sh @@ -0,0 +1,104 @@ +#!/bin/sh +# BCP38 filtering implementation for CeroWrt. +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 3 of the License, or (at your option) any later +# version. +# +# Author: Toke Høiland-Jørgensen <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 diff --git a/net/bmon/Makefile b/net/bmon/Makefile new file mode 100644 index 000000000..44da26c09 --- /dev/null +++ b/net/bmon/Makefile @@ -0,0 +1,48 @@ +# +# Copyright (C) 2007-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=bmon +PKG_VERSION:=3.5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/tgraf/bmon/releases/download/v$(PKG_VERSION)/ +PKG_MD5SUM:=b7d0d055727f2cf1e452f26dfbf6a825 +PKG_MAINTAINER:=Baptiste Jonglez <openwrt-pkg@bitsofnetworks.org> +PKG_LICENSE:=MIT + +include $(INCLUDE_DIR)/package.mk + +define Package/bmon + SECTION:=net + CATEGORY:=Network + DEPENDS:=+PACKAGE_libncursesw:libncursesw +!PACKAGE_libncursesw:libncurses +libnl +confuse + TITLE:=bmon is a portable bandwidth monitor + URL:=https://github.com/tgraf/bmon/ +endef + +define Package/bmon/description + bmon is a portable bandwidth monitor + and rate estimator running on various + operating systems. It supports various + input methods for different architectures. +endef + +CONFIGURE_ARGS += \ + --disable-cnt-workaround \ + +CONFIGURE_VARS += \ + ac_cv_lib_nl_nl_connect=no \ + +define Package/bmon/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/bmon $(1)/usr/sbin/ +endef + +$(eval $(call BuildPackage,bmon)) diff --git a/net/ddns-scripts/CHANGELOG b/net/ddns-scripts/CHANGELOG new file mode 100644 index 000000000..31757ac02 --- /dev/null +++ b/net/ddns-scripts/CHANGELOG @@ -0,0 +1,84 @@ +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 diff --git a/net/ddns-scripts/Makefile b/net/ddns-scripts/Makefile index 71c57866e..01d579885 100644 --- a/net/ddns-scripts/Makefile +++ b/net/ddns-scripts/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ddns-scripts -PKG_VERSION:=2.0.1 -PKG_RELEASE:=9 +PKG_VERSION:=2.1.0 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -62,7 +62,10 @@ endef 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 # add new section "ddns" "global" if not exists uci -q get ddns.global > /dev/null || uci -q set ddns.global='ddns' @@ -79,7 +82,7 @@ endef 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 diff --git a/net/ddns-scripts/files/etc/config/ddns b/net/ddns-scripts/files/etc/config/ddns index 54ec42c12..cbedef7e8 100644 --- a/net/ddns-scripts/files/etc/config/ddns +++ b/net/ddns-scripts/files/etc/config/ddns @@ -1,5 +1,6 @@ # # Please read ddns.sample +# or http://wiki.openwrt.org/doc/uci/ddns # config ddns "global" option date_format "%F %R" @@ -9,8 +10,8 @@ config ddns "global" 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" diff --git a/net/ddns-scripts/files/etc/config/ddns.sample b/net/ddns-scripts/files/etc/config/ddns.sample index 8625b3899..8240cc72d 100644 --- a/net/ddns-scripts/files/etc/config/ddns.sample +++ b/net/ddns-scripts/files/etc/config/ddns.sample @@ -127,7 +127,7 @@ config service "myddns" ########### # 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. + # 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 @@ -139,8 +139,8 @@ config service "myddns" # 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 @@ -210,11 +210,10 @@ config service "myddns" 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" @@ -236,6 +235,7 @@ config service "myddns" # 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 '' @@ -247,7 +247,7 @@ config service "myddns" # wait this time before verify if update was successful send. # !!! 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' @@ -256,7 +256,7 @@ config service "myddns" ########### # 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 @@ -276,7 +276,7 @@ config service "myddns" # 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' diff --git a/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns b/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns index dab2385cb..dfb35f6d7 100644 --- a/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns +++ b/net/ddns-scripts/files/etc/hotplug.d/iface/25-ddns @@ -1,8 +1,14 @@ #!/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 diff --git a/net/ddns-scripts/files/etc/init.d/ddns b/net/ddns-scripts/files/etc/init.d/ddns index 1194543cb..4ea560191 100644 --- a/net/ddns-scripts/files/etc/init.d/ddns +++ b/net/ddns-scripts/files/etc/init.d/ddns @@ -1,16 +1,26 @@ #!/bin/sh /etc/rc.common START=95 +STOP=10 boot() { return 0 } +reload() { + killall -1 dynamic_dns_updater.sh # 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 } - diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh index aeabe5280..f535d033c 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_functions.sh @@ -16,7 +16,7 @@ # - the usage of BIND's host instead of BusyBox's nslookup if installed (DNS via TCP) # - extended Verbose Mode and log file support for better error detection # -# function __timeout +# function timeout # copied from http://www.ict.griffith.edu.au/anthony/software/timeout.sh # @author Anthony Thyssen 6 April 2011 # @@ -31,7 +31,6 @@ # 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 @@ -43,13 +42,12 @@ LOGDIR=$(uci -q get ddns.global.log_dir) || LOGDIR="/var/log/ddns" LOGFILE="" # NEW # logfile can be enabled as new option # 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 @@ -58,12 +56,13 @@ EPOCH_TIME=0 # seconds since 1.1.1970 00:00:00 REGISTERED_IP="" # holds the IP read from DNS LOCAL_IP="" # holds the local IP read from the box +URL_USER="" # url encoded $username from config file +URL_PASS="" # url encoded $password from config file + ERR_LAST=0 # used to save $? return code of program and function calls -ERR_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" @@ -113,9 +112,26 @@ load_all_config_options() 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" @@ -123,59 +139,102 @@ start_daemon_for_all_ddns_sections() 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 + [ "$SECTION_ID" = "lucihelper" ] && 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) @@ -183,13 +242,15 @@ critical_error() { # "$"(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 @@ -218,14 +279,15 @@ __urlencode() { # 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 @@ -256,10 +318,12 @@ get_service_data() { 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 ))";; @@ -269,7 +333,7 @@ get_seconds() { 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 @@ -314,7 +378,7 @@ __timeout() { SIG=-TERM - while [ $# -gt 0 ]; do + while [ $# -gt 0 ]; do case "$1" in --) # forced end of user options @@ -368,9 +432,10 @@ __timeout() { 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 @@ -380,92 +445,119 @@ __verify_host_port() { # 3 nc (netcat) error # 4 unmatched IP version + [ $# -ne 2 ] && write_log 12 "Error calling 'verify_host_port()' - wrong number of parameters" + __RUNPROG="nslookup $__HOST 2>/dev/null" __ERRPROG="nslookup $__HOST 2>&1" - verbose_echo " resolver prog =: '$__RUNPROG'" + write_log 7 "#> $__RUNPROG" __TMP=$(eval $__RUNPROG) # test if nslookup runs without errors __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 7 "Error:\n$(eval $__ERRPROG)" + write_log 3 "DNS Resolver Error - BusyBox nslookup Error '$__ERR'" 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=$(echo "$__TMP" | sed -ne "3,\$ { s/^Address [0-9]*: \($IPV4_REGEX\).*$/\\1/p }") + __IPV6=$(echo "$__TMP" | 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 ] && { + [ "$SECTION_ID" = "lucihelper" ] && return 4 + write_log 14 "Invalid 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!'" + 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" + 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 + # 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 # 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'" + 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 7 "Error:\n$(eval $__ERRPROG)" + write_log 3 "Connect error - BusyBox nc (netcat) Error '$__ERR'" 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 -- nc $__IP $__PORT </dev/null >/dev/null 2>&1" + 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 -gt 0 ]; do + # DNS uses port 53 + verify_host_port "$1" "53" + __ERR=$? + if [ "$SECTION_ID" = "lucihelper" ]; 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 7 "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 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}') @@ -481,24 +573,51 @@ verify_proxy() { __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" ] && { + [ "$SECTION_ID" = "lucihelper" ] && 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 [ "$SECTION_ID" = "lucihelper" ]; 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 7 "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() { +do_transfer() { # $1 # Variable to store Answer of transfer # $2 # URL to use local __URL="$2" local __ERR=0 + local __CNT=0 # error counter local __PROG __RUNPROG __ERRPROG __DATA + [ $# -ne 2 ] && 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 + if /usr/bin/wget --version 2>&1 | grep "\+ssl" >/dev/null 2>&1 ; then __PROG="/usr/bin/wget -t 2 -O -" # standard output only 2 retrys on error # 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 @@ -510,7 +629,7 @@ __do_transfer() { 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) @@ -518,21 +637,14 @@ __do_transfer() { __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 - } + __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" # 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 @@ -544,7 +656,7 @@ __do_transfer() { 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) @@ -554,163 +666,218 @@ __do_transfer() { 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 - } + __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 -" # 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" + __ERRPROG="$__PROG '$__URL' 2>&1" # + __PROG="Busybox Wget" # reuse for error logging + + else + write_log 13 "Neither 'Wget' nor 'cURL' installed or executable" + fi + + while : ; do + write_log 7 "#> $__RUNPROG" __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'" + [ $__ERR -eq 0 ] && { + eval "$1='$__DATA'" # everything ok + return 0 # return + } + + [ "$SECTION_ID" = "lucihelper" ] && return 1 # no retry if called by LuCI helper script + + write_log 7 "Error:\n$(eval $__ERRPROG)" # report error + write_log 3 "$__PROG error: '$__ERR'" + __DATA="" + + [ $VERBOSE_MODE -gt 1 ] && { + # VERBOSE_MODE > 1 then NO retry + write_log 7 "Verbose Mode: $VERBOSE_MODE - NO retry on error" return 1 } - else - critical_error "Program not found - Neither 'Wget' nor 'cURL' installed or executable" - fi + __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" - eval "$1='$__DATA'" - return 0 + 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 14 "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 __ANSWER __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 __ANSWER "$__URL" || return 1 # if VERBOSE_MODE > 1 + + write_log 7 "DDNS Provider answered:\n$__ANSWER" + + # analyse provider answers + # "good [IP_ADR]" = successful + # "nochg [IP_ADR]" = no change but OK + echo "$__ANSWER" | grep -E "good|nochg" >/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 __ANSWER + + [ $# -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'" + $__RUNPROG __DATA "$ip_network" + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on network '$ip_network'" + ;; + interface) + write_log 7 "#> ifconfig '$ip_interface'" + if [ $use_ipv6 -eq 0 ]; then + __DATA=$(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 + __DATA=$(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 + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected on interface '$ip_interface'" + ;; + script) + write_log 7 "#> $ip_script" + __DATA=$($ip_script) # get ip from script + [ -n "$__DATA" ] && write_log 7 "Local IP '$__DATA' detected via script '$ip_script'" + ;; + web) + for __URL in $ip_url; do + do_transfer __ANSWER "$__URL" + [ -n "$__ANSWER" ] && break # Answer detected, leave "for do done" + done + # use correct regular expression + [ $use_ipv6 -eq 0 ] \ + && __DATA=$(echo "$__ANSWER" | grep -m 1 -o "$IPV4_REGEX") \ + || __DATA=$(echo "$__ANSWER" | grep -m 1 -o "$IPV6_REGEX") + [ -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 + [ "$SECTION_ID" = "lucihelper" ] && return 1 # no retry if called by LuCI helper script + [ $VERBOSE_MODE -gt 1 ] && { + # VERBOSE_MODE > 1 then NO retry + write_log 7 "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 __ERRPROG __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 @@ -720,55 +887,106 @@ get_registered_ip() { __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}' ) - } - + __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" + __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" + __DATA=$(eval $__RUNPROG) + __ERR=$? + if [ $__ERR -ne 0 ]; then + write_log 7 "Error:\n$(eval $__ERRPROG)" + write_log 3 "$__PROG error: '$__ERR'" + __DATA="" + else + if [ "$__PROG" = "BIND host" ]; then + __DATA=$(echo "$__DATA" | awk -F "address " '/has/ {print $2; exit}' ) + else + __DATA=$(echo "$__DATA" | 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 + + [ "$SECTION_ID" = "lucihelper" ] && 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 7 "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%%.*}'" } + +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 + + # exit with correct handling: + # remove trap handling settings and send kill to myself + trap - 0 1 2 3 15 + [ $1 -gt 0 ] && kill -$1 $$ +} diff --git a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh index 6c715cb49..107d0ebd5 100755 --- a/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/dynamic_dns_updater.sh @@ -10,11 +10,12 @@ # 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 +# - 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 @@ -38,7 +39,7 @@ . /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 @@ -47,15 +48,23 @@ LOGFILE="$LOGDIR/$SECTION_ID.log" # log file # VERBOSE_MODE > 1 delete logfile if exist to create an empty one # only with this data of this run for easier diagnostic -# new one created by 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): # @@ -108,23 +117,23 @@ LOGFILE="$LOGDIR/$SECTION_ID.log" # log file [ "$(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)" 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)" +write_log 7 "uci configuraion:\n$(uci -q show ddns.$SECTION_ID | sort)" # set defaults if not defined [ -z "$enabled" ] && enabled=0 @@ -142,48 +151,47 @@ verbose_echo " UCI CONFIG =:\n$(uci -q show ddns.$SECTION_ID | sort)" [ "$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!" + +# 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 script if configured and executable +# 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" + [ -z "$ip_script" ] && write_log 14 "No script defined to detect local IP!" + [ -x "$ip_script" ] || write_log 14 "Script to detect local IP not found or 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 @@ -201,242 +209,118 @@ get_uptime CURR_TIME [ $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 + [ $ERR_LAST -eq 0 ] && { + 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 - fi - done + && write_log 6 "Update successful - IP '$LOCAL_IP' send" \ + || write_log 6 "Forced update successful - IP: '$LOCAL_IP' send" + } || write_log 3 "Can not update IP at DDNS Provider" + 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 - - # we checked successful the last update - ERR_UPDATE=0 # reset error counter + else + # we checked successful the last update + ERR_UPDATE=0 # reset error counter + fi - # 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" + # force_update=0 or VERBOSE_MODE > 1 - leave here + [ $VERBOSE_MODE -gt 1 ] && write_log 7 "Verbose Mode: $VERBOSE_MODE - NO reloop"; exit 0 + [ $FORCE_SECONDS -eq 0 ] && write_log 6 "Configured to run once"; exit 0 + 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" diff --git a/net/ddns-scripts/files/usr/lib/ddns/services b/net/ddns-scripts/files/usr/lib/ddns/services index bb447fb41..0bb596817 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/services +++ b/net/ddns-scripts/files/usr/lib/ddns/services @@ -1,45 +1,54 @@ -# 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]" @@ -56,7 +65,7 @@ "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]" @@ -75,3 +84,6 @@ # 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]" diff --git a/net/ddns-scripts/files/usr/lib/ddns/services_ipv6 b/net/ddns-scripts/files/usr/lib/ddns/services_ipv6 index b0faf4d47..8aeb4e127 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/services_ipv6 +++ b/net/ddns-scripts/files/usr/lib/ddns/services_ipv6 @@ -1,32 +1,34 @@ -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# !!!!! 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 +#IPv6 @ 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 # -# # -########################################################################################################### - -# MyDNS.JP +#IPv6 @ MyDNS.JP "mydns.jp" "http://www.mydns.jp/directip.html?MID=[USERNAME]&PWD=[PASSWORD]&IPV6ADDR=[IP]" diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_no-ip.sh b/net/ddns-scripts/files/usr/lib/ddns/update_no-ip.sh new file mode 100644 index 000000000..e7e86d650 --- /dev/null +++ b/net/ddns-scripts/files/usr/lib/ddns/update_no-ip.sh @@ -0,0 +1,47 @@ +# +# 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 __ANSWER __LH +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 ] && __LH="127.0.0.1" || __LH="::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\]#$__LH#g") +[ $use_https -ne 0 ] && __URL=$(echo $__URL | sed -e 's#^http:#https:#') + +do_transfer __ANSWER "$__URL" || return 1 + +write_log 7 "'no-ip.com' answered:\n$__ANSWER" +# analyse provider answers +# "good [IP_ADR]" = successful +# "nochg [IP_ADR]" = no change but OK +echo "$__ANSWER" | grep -E "good|nochg" >/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 __ANSWER "$__URL" || return 1 + +write_log 7 "'no-ip.com' answered:\n$__ANSWER" +# analyse provider answers +# "good [IP_ADR]" = successful +# "nochg [IP_ADR]" = no change but OK +echo "$__ANSWER" | grep -E "good|nochg" >/dev/null 2>&1 +return $? # "0" if "good" or "nochg" found + diff --git a/net/ddns-scripts/files/usr/lib/ddns/update_sample.sh b/net/ddns-scripts/files/usr/lib/ddns/update_sample.sh index fb69081ac..5faafc8cc 100644 --- a/net/ddns-scripts/files/usr/lib/ddns/update_sample.sh +++ b/net/ddns-scripts/files/usr/lib/ddns/update_sample.sh @@ -16,22 +16,22 @@ # # the code here is the copy of the default used inside send_update() # -local __USER __PASS __ANSWER +local __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 __ANSWER "$__URL" || return 1 + +write_log 7 "DDNS Provider answered:\n$__ANSWER" + +# analyse provider answers +# "good [IP_ADR]" = successful +# "nochg [IP_ADR]" = no change but OK +echo "$__ANSWER" | grep -E "good|nochg" >/dev/null 2>&1 +return $? # "0" if "good" or "nochg" found + diff --git a/net/fastd/Makefile b/net/fastd/Makefile index ee6b2b579..7a5a4324b 100644 --- a/net/fastd/Makefile +++ b/net/fastd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fastd PKG_VERSION:=14 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_MAINTAINER:=Matthias Schiffer <mschiffer@universe-factory.net> PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -79,7 +79,8 @@ CMAKE_OPTIONS += \ -DWITH_VERIFY:BOOL=FALSE \ -DWITH_CAPABILITIES:BOOL=FALSE \ -DENABLE_SYSTEMD:BOOL=FALSE \ - -DENABLE_LIBSODIUM:BOOL=FALSE + -DENABLE_LIBSODIUM:BOOL=FALSE \ + -DENABLE_LTO:BOOL=TRUE ifeq ($(CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST),y) diff --git a/net/haproxy/Makefile b/net/haproxy/Makefile index 05f7f8048..7330bb6ca 100644 --- a/net/haproxy/Makefile +++ b/net/haproxy/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=haproxy -PKG_VERSION:=1.5.5 -PKG_RELEASE:=02 +PKG_VERSION:=1.5.8 +PKG_RELEASE:=00 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 diff --git a/net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch b/net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch deleted file mode 100644 index aa94fd0e3..000000000 --- a/net/haproxy/patches/0001-BUG-MEDIUM-systemd-set-KillMode-to-mixed.patch +++ /dev/null @@ -1,41 +0,0 @@ -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 - diff --git a/net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch b/net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch deleted file mode 100644 index 71a437c78..000000000 --- a/net/haproxy/patches/0002-BUG-MEDIUM-config-avoid-skipping-disabled-proxies.patch +++ /dev/null @@ -1,39 +0,0 @@ -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 - diff --git a/net/kismet/Makefile b/net/kismet/Makefile new file mode 100644 index 000000000..de609495a --- /dev/null +++ b/net/kismet/Makefile @@ -0,0 +1,142 @@ +# +# 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:=kismet +PKG_VERSION:=2013-03-R1b +PKG_RELEASE:=1 + +PKG_LICENSE:=LGPLv2.1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.kismetwireless.net/code +PKG_MD5SUM:=6cdcd78baf2e15edbe8a9de3c5493f02 + +PKG_BUILD_DEPENDS:=libpcap libncurses libpcre + +include $(INCLUDE_DIR)/uclibc++.mk +include $(INCLUDE_DIR)/package.mk + +define Package/kismet/Default + SECTION:=net + CATEGORY:=Network + TITLE:=Kismet + MAINTAINER:=Sebastian Wendel <packages@sourceindex.de> + DEPENDS:= $(CXX_DEPENDS) +libnl + URL:=http://www.kismetwireless.net/ + SUBMENU:=wireless +endef + +define Package/kismet/Default/description + An 802.11 layer2 wireless network detector, sniffer, and intrusion + detection system. +endef + +define Package/kismet-client/conffiles +/etc/kismet/kismet.conf +endef + +define Package/kismet-drone/conffiles +/etc/kismet/kismet_drone.conf +endef + +define Package/kismet-server/conffiles +/etc/kismet/kismet.conf +endef + +define Package/kismet-client +$(call Package/kismet/Default) + TITLE+= client + DEPENDS+= +libncurses +endef + +define Package/kismet-client/description +$(call Package/kismet/Default/description) + This package contains the kismet text interface client. +endef + +define Package/kismet-drone +$(call Package/kismet/Default) + DEPENDS+= +libpcap +libpcre +libcap +wireless-tools + TITLE+= drone +endef + +define Package/kismet-drone/description +$(call Package/kismet/Default/description) + This package contains the kismet remote sniffing.and monitoring drone. +endef + +define Package/kismet-server +$(call Package/kismet/Default) + DEPENDS+= +libpcap +libpcre +libcap +wireless-tools + TITLE+= server +endef + +define Package/kismet-server/description +$(call Package/kismet/Default/description) + This package contains the kismet server. +endef + +CONFIGURE_ARGS += \ + --sysconfdir=/etc/kismet \ + +CONFIGURE_VARS += \ + CXXFLAGS="$$$$CXXFLAGS -fno-rtti" \ + LIBS="-lm" \ + CLIENTCLIBS="-lm" + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LD="$(TARGET_CXX)" \ + all +endef + +define Package/kismet/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/scripts/kismet $(1)/usr/bin/kismet +endef + +define Package/kismet-client/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_client $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/kismet/ + $(INSTALL_CONF) ./files/kismet.conf $(1)/etc/kismet/ +endef + +define Package/kismet-drone/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_drone $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/kismet/ + $(INSTALL_CONF) ./files/kismet_drone.conf $(1)/etc/kismet/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/kismet_drone.config $(1)/etc/config/kismet_drone + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/kismet_drone.init $(1)/etc/init.d/kismet_drone +endef + +define Package/kismet-server/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_server $(1)/usr/bin/ + + $(INSTALL_DIR) $(1)/etc/kismet/ + $(INSTALL_CONF) ./files/kismet.conf $(1)/etc/kismet/ + + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/kismet_server.config $(1)/etc/config/kismet_server + + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/kismet_server.init $(1)/etc/init.d/kismet_server +endef + +$(eval $(call BuildPackage,kismet-client)) +$(eval $(call BuildPackage,kismet-drone)) +$(eval $(call BuildPackage,kismet-server)) diff --git a/net/kismet/files/kismet.conf b/net/kismet/files/kismet.conf new file mode 100644 index 000000000..971f2e23d --- /dev/null +++ b/net/kismet/files/kismet.conf @@ -0,0 +1,304 @@ +# Kismet config file +# Most of the "static" configs have been moved to here -- the command line +# config was getting way too crowded and cryptic. We want functionality, +# not continually reading --help! + +# Version of Kismet config +version=2009-newcore + +# Name of server (Purely for organizational purposes) +# If commented out, defaults to host name of system +# servername=Kismet Server + +# Prefix of where we log (as used in the logtemplate later) +logprefix=/tmp + +# Do we process the contents of data frames? If this is enabled, data +# frames will be truncated to the headers only immediately after frame type +# detection. This will disable IP detection, etc, however it is likely +# safer (and definitely more polite) if monitoring networks you do not own. +# hidedata=true + +# Do we allow plugins to be used? This will load plugins from the system +# and user plugin directiories when set to true (See the README for the default +# plugin locations). +allowplugins=false + +# See the README for full information on the new source format +# ncsource=interface:options +# for example: +# ncsource=wifi0:type=madwifi +# ncsource=wlan0:name=intel,hop=false,channel=11 +ncsource=wlan0 + +# Comma-separated list of sources to enable. This is only needed if you defined +# multiple sources and only want to enable some of them. By default, all defined +# sources are enabled. +# For example, if sources with name=prismsource and name=ciscosource are defined, +# and you only want to enable those two: +# enablesources=prismsource,ciscosource + +# Control which channels we like to spend more time on. By default, the list +# of channels is pulled from the driver automatically. By setting preferred channels, +# if they are present in the channel list, they'll be set with a timing delay so that +# more time is spent on them. Since 1, 6, 11 are the common default channels, it makes +# sense to spend more time monitoring them. +# For finer control, see further down in the config for the channellist= directives. +preferredchannels=1,6,11 + +# How many channels per second do we hop? (1-10) +channelvelocity=3 + +# By setting the dwell time for channel hopping we override the channelvelocity +# setting above and dwell on each channel for the given number of seconds. +#channeldwell=10 + +# Channels are defined as: +# channellist=name:ch1,ch2,ch3 +# or +# channellist=name:range-start-end-width-offset,ch,range,ch,... +# +# Channels may be a numeric channel or a frequency +# +# Channels may specify an additional wait period. For common default channels, +# an additional wait period can be useful. Wait periods delay for that number +# of times per second - so a configuration hopping 10 times per second with a +# channel of 6:3 would delay 3/10ths of a second on channel 6. +# +# Channel lists may have up to 256 channels and ranges (combined). For power +# users scanning more than 256 channels with a single card, ranges must be used. +# +# Ranges are meant for "power users" who wish to define a very large number of +# channels. A range may specify channels or frequencies, and will automatically +# sort themselves to cover channels in a non-overlapping fashion. An example +# range for the normal 802.11b/g spectrum would be: +# +# range-1-11-3-1 +# +# which indicates starting at 1, ending at 11, a channel width of 3 channels, +# incrementing by one. A frequency based definition would be: +# +# range-2412-2462-22-5 +# +# since 11g channels are 22 mhz wide and 5 mhz apart. +# +# Ranges have the flaw that they cannot be shared between sources in a non-overlapping +# way, so multiple sources using the same range may hop in lockstep with each other +# and duplicate the coverage. +# +# channellist=demo:1:3,6:3,11:3,range-5000-6000-20-10 + +# Default channel lists +# These channel lists MUST BE PRESENT for Kismet to work properly. While it is +# possible to change these, it is not recommended. These are used when the supported +# channel list can not be found for the source; to force using these instead of +# the detected supported channels, override with channellist= in the source defintion +# +# IN GENERAL, if you think you want to modify these, what you REALLY want to do is +# copy them and use channellist= in the packet source. +channellist=IEEE80211b:1:3,6:3,11:3,2,7,3,8,4,9,5,10 +channellist=IEEE80211a:36,40,44,48,52,56,60,64,149,153,157,161,165 +channellist=IEEE80211ab:1:3,6:3,11:3,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64,149,153,157,161,165 + +# Client/server listen config +listen=tcp://127.0.0.1:2501 +#listen=tcp://0.0.0.0:2501 + +# People allowed to connect, comma seperated IP addresses or network/mask +# blocks. Netmasks can be expressed as dotted quad (/255.255.255.0) or as +# numbers (/24) +allowedhosts=127.0.0.1 +# Maximum number of concurrent GUI's +maxclients=5 +# Maximum backlog before we start throwing out or killing clients. The +# bigger this number, the more memory and the more power it will use. +maxbacklog=5000 + +# Server + Drone config options. To have a Kismet server export live packets +# as if it were a drone, uncomment these. +# dronelisten=tcp://127.0.0.1:3501 +# droneallowedhosts=127.0.0.1 +# dronemaxclients=5 +# droneringlen=65535 + +# OUI file, expected format 00:11:22<tab>manufname +# IEEE OUI file used to look up manufacturer info. We default to the +# wireshark one since most people have that. +#ouifile=/usr/share/manuf + +# Do we have a GPS? +gps=false +# Do we use a locally serial attached GPS, or use a gpsd server, or +# use a fixed virtual gps? +# (Pick only one) +gpstype=gpsd +# Host:port that GPSD is running on. This can be localhost OR remote! +gpshost=localhost:2947 + + +# gpstype=serial +# What serial device do we look for the GPS on? +# gpsdevice=/dev/rfcomm0 + +# gpstype=virtual +# gpsposition=100,-50 +# gpsaltitude=1234 + +# Do we lock the mode? This overrides coordinates of lock "0", which will +# generate some bad information until you get a GPS lock, but it will +# fix problems with GPS units with broken NMEA that report lock 0 +gpsmodelock=false +# Do we try to reconnect if we lose our link to the GPS, or do we just +# let it die and be disabled? +gpsreconnect=true + +# Do we export packets over tun/tap virtual interfaces? +tuntap_export=false +# What virtual interface do we use +tuntap_device=kistap0 + +# Packet filtering options: +# filter_tracker - Packets filtered from the tracker are not processed or +# recorded in any way. +# filter_export - Controls what packets influence the exported CSV, network, +# xml, gps, etc files. +# All filtering options take arguments containing the type of address and +# addresses to be filtered. Valid address types are 'ANY', 'BSSID', +# 'SOURCE', and 'DEST'. Filtering can be inverted by the use of '!' before +# the address. For example, +# filter_tracker=ANY(!"00:00:DE:AD:BE:EF") +# has the same effect as the previous mac_filter config file option. +# filter_tracker=... +# filter_dump=... +# filter_export=... +# filter_netclient=... + +# Alerts to be reported and the throttling rates. +# alert=name,throttle/unit,burst +# The throttle/unit describes the number of alerts of this type that are +# sent per time unit. Valid time units are second, minute, hour, and day. +# Burst describes the number of alerts sent before throttling takes place. +# For example: +# alert=FOO,10/min,5 +# Would allow 5 alerts through before throttling is enabled, and will then +# limit the number of alerts to 10 per minute. +# A throttle rate of 0 disables throttling of the alert. +# See the README for a list of alert types. +alert=ADHOCCONFLICT,5/min,1/sec +alert=AIRJACKSSID,5/min,1/sec +alert=APSPOOF,10/min,1/sec +alert=BCASTDISCON,5/min,2/sec +alert=BSSTIMESTAMP,5/min,1/sec +alert=CHANCHANGE,5/min,1/sec +alert=CRYPTODROP,5/min,1/sec +alert=DISASSOCTRAFFIC,10/min,1/sec +alert=DEAUTHFLOOD,5/min,2/sec +alert=DEAUTHCODEINVALID,5/min,1/sec +alert=DISCONCODEINVALID,5/min,1/sec +alert=DHCPNAMECHANGE,5/min,1/sec +alert=DHCPOSCHANGE,5/min,1/sec +alert=DHCPCLIENTID,5/min,1/sec +alert=DHCPCONFLICT,10/min,1/sec +alert=NETSTUMBLER,5/min,1/sec +alert=LUCENTTEST,5/min,1/sec +alert=LONGSSID,5/min,1/sec +alert=MSFBCOMSSID,5/min,1/sec +alert=MSFDLINKRATE,5/min,1/sec +alert=MSFNETGEARBEACON,5/min,1/sec +alert=NULLPROBERESP,5/min,1/sec +alert=PROBENOJOIN,5/min,1/sec + +# Controls behavior of the APSPOOF alert. SSID may be a literal match (ssid=) or +# a regex (ssidregex=) if PCRE was available when kismet was built. The allowed +# MAC list must be comma-separated and enclosed in quotes if there are multiple +# MAC addresses allowed. MAC address masks are allowed. +#apspoof=Foo1:ssidregex="(?i:foobar)",validmacs=00:11:22:33:44:55 +#apspoof=Foo2:ssid="Foobar",validmacs="00:11:22:33:44:55,aa:bb:cc:dd:ee:ff" + +# Known WEP keys to decrypt, bssid,hexkey. This is only for networks where +# the keys are already known, and it may impact throughput on slower hardware. +# Multiple wepkey lines may be used for multiple BSSIDs. +# wepkey=00:DE:AD:C0:DE:00,FEEDFACEDEADBEEF01020304050607080900 + +# Is transmission of the keys to the client allowed? This may be a security +# risk for some. If you disable this, you will not be able to query keys from +# a client. +allowkeytransmit=true + +# How often (in seconds) do we write all our data files (0 to disable) +writeinterval=10 + +# Do we use sound? +# Not to be confused with GUI sound parameter, this controls wether or not the +# server itself will play sound. Primarily for headless or automated systems. +enablesound=false +# Path to sound player +soundbin=play + +sound=newnet,true +sound=newcryptnet,true +sound=packet,true +sound=gpslock,true +sound=gpslost,true +sound=alert,true + +# Does the server have speech? (Again, not to be confused with the GUI's speech) +enablespeech=false +# Binary used for speech (if not in path, full path must be specified) +speechbin=flite +# Specify raw or festival; Flite (and anything else that doesn't need formatting +# around the string to speak) is 'raw', festival requires the string be wrapped in +# SayText("...") +speechtype=raw + +# How do we speak? Valid options: +# speech Normal speech +# nato NATO spellings (alpha, bravo, charlie) +# spell Spell the letters out (aye, bee, sea) +speechencoding=nato + +speech=new,"New network detected s.s.i.d. %1 channel %2" +speech=alert,"Alert %1" +speech=gpslost,"G.P.S. signal lost" +speech=gpslock,"G.P.S. signal O.K." + +# How many alerts do we backlog for new clients? Only change this if you have +# a -very- low memory system and need those extra bytes, or if you have a high +# memory system and a huge number of alert conditions. +alertbacklog=50 + +# File types to log, comma seperated. Built-in log file types: +# alert Text file of alerts +# gpsxml XML per-packet GPS log +# nettxt Networks in text format +# netxml Networks in XML format +# pcapdump tcpdump/wireshark compatible pcap log file +# string All strings seen (increases CPU load) +logtypes=pcapdump,gpsxml,netxml,alert + +# Format of the pcap dump (PPI or 80211) +pcapdumpformat=ppi +# pcapdumpformat=80211 + +# Default log title +logdefault=Kismet + +# logtemplate - Filename logging template. +# This is, at first glance, really nasty and ugly, but you'll hardly ever +# have to touch it so don't complain too much. +# +# %p is replaced by the logging prefix + '/' +# %n is replaced by the logging instance name +# %d is replaced by the starting date as Mon-DD-YYYY +# %D is replaced by the current date as YYYYMMDD +# %t is replaced by the starting time as HH-MM-SS +# %i is replaced by the increment log in the case of multiple logs +# %l is replaced by the log type (pcapdump, strings, etc) +# %h is replaced by the home directory + +logtemplate=%p%n-%D-%t-%i.%l + +# Where state info, etc, is stored. You shouldnt ever need to change this. +# This is a directory. +configdir=%h/.kismet/ + diff --git a/net/kismet/files/kismet_drone.conf b/net/kismet/files/kismet_drone.conf new file mode 100644 index 000000000..bd165403c --- /dev/null +++ b/net/kismet/files/kismet_drone.conf @@ -0,0 +1,69 @@ +# Kismet drone config file + +version=newcore.1 + +# Name of drone server (informational) +servername=Kismet-Drone + +# Drone configuration +# Protocol, interface, and port to listen on +dronelisten=tcp://127.0.0.1:2502 +# Hosts allowed to connect, comma separated. May include netmasks. +# allowedhosts=127.0.0.1,10.10.10.0/255.255.255.0 +droneallowedhosts=127.0.0.1 +# Maximum number of drone clients +dronemaxclients=10 +droneringlen=65535 + +# Do we have a GPS? +gps=true +# Do we use a locally serial attached GPS, or use a gpsd server? +# (Pick only one) +gpstype=gpsd +# gpstype=serial +# What serial device do we look for the GPS on? +gpsdevice=/dev/rfcomm0 +# Host:port that GPSD is running on. This can be localhost OR remote! +gpshost=localhost:2947 +# Do we lock the mode? This overrides coordinates of lock "0", which will +# generate some bad information until you get a GPS lock, but it will +# fix problems with GPS units with broken NMEA that report lock 0 +gpsmodelock=false +# Do we try to reconnect if we lose our link to the GPS, or do we just +# let it die and be disabled? +gpsreconnect=true + +# See the README for full information on the new source format +# ncsource=interface:options +ncsource=null +# for example: +# ncsource=wlan0 +# ncsource=wifi0:type=madwifi +# ncsource=wlan0:name=intel,hop=false,channel=11 + +# Special per-source options +# sourceopts=[sourcename|*]:opt1,opt2 +# sourceopts=*:fuzzycrypt,weakvalidate + +# Comma-separated list of sources to enable, if you don't want to enable all +# the sources you defined. +# enablesource=source1,source2 + +# How many channels per second do we hop? (1-10) +channelvelocity=5 + +# By setting the dwell time for channel hopping we override the channelvelocity +# setting above and dwell on each channel for the given number of seconds. +#channeldwell=10 + +# Users outside the US might want to use this list: +# channellist=IEEE80211b:1,7,13,2,8,3,14,9,4,10,5,11,6,12 +channellist=IEEE80211b:1:3,6:3,11:3,2,7,3,8,4,9,5,10 + +# US IEEE 80211a +channellist=IEEE80211a:36,40,44,48,52,56,60,64,149,153,157,161,165 + +# Combo +channellist=IEEE80211ab:1:3,6:3,11:3,2,7,3,8,4,9,5,10,36,40,44,48,52,56,60,64,149,153,157,161,165 + + diff --git a/net/kismet/files/kismet_drone.config b/net/kismet/files/kismet_drone.config new file mode 100644 index 000000000..749505d11 --- /dev/null +++ b/net/kismet/files/kismet_drone.config @@ -0,0 +1,2 @@ +config kismet_drone + option enabled 0 diff --git a/net/kismet/files/kismet_drone.init b/net/kismet/files/kismet_drone.init new file mode 100755 index 000000000..2cbbe7edb --- /dev/null +++ b/net/kismet/files/kismet_drone.init @@ -0,0 +1,26 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2013-2014 OpenWrt.org + +START=99 +STOP=99 + +USE_PROCD=1 +PROG=/usr/bin/kismet_drone +NAME=kismet_drone + +kismet_drone_instance() { + procd_open_instance + procd_set_param command "${PROG}" + procd_append_param command -f /etc/kismet/kismet_drone.conf -s + procd_set_param respawn + procd_close_instance +} + +start_service() { + config_load "${NAME}" + config_foreach kismet_drone_instance +} + +stop_service() { + service_stop "${PROG}" +} diff --git a/net/kismet/files/kismet_server.config b/net/kismet/files/kismet_server.config new file mode 100644 index 000000000..ad39f3e1c --- /dev/null +++ b/net/kismet/files/kismet_server.config @@ -0,0 +1,2 @@ +config kismet_server + option enabled 0 diff --git a/net/kismet/files/kismet_server.init b/net/kismet/files/kismet_server.init new file mode 100755 index 000000000..7d731e777 --- /dev/null +++ b/net/kismet/files/kismet_server.init @@ -0,0 +1,26 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2013-2014 OpenWrt.org + +START=99 +STOP=99 + +USE_PROCD=1 +PROG=/usr/bin/kismet_server +NAME=kismet_server + +kismet_server_instance() { + procd_open_instance + procd_set_param command "${PROG}" + procd_append_param command -f /etc/kismet/kismet.conf -s + procd_set_param respawn + procd_close_instance +} + +start_service() { + config_load "${NAME}" + config_foreach kismet_server_instance +} + +stop_service() { + service_stop "${PROG}" +} diff --git a/net/kismet/patches/010-dont-add-host-include-paths.patch b/net/kismet/patches/010-dont-add-host-include-paths.patch new file mode 100644 index 000000000..23a87bdcf --- /dev/null +++ b/net/kismet/patches/010-dont-add-host-include-paths.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index 6936a47..9a85269 100755 +--- a/configure ++++ b/configure +@@ -6980,9 +6980,6 @@ else + fi + + +-# Add additional cflags since some distros bury panel.h +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses" +- + termcontrol="none"; + + if test "$wantclient" = "yes"; then diff --git a/net/lftp/Makefile b/net/lftp/Makefile index e2aa28cd0..054d4a4dc 100644 --- a/net/lftp/Makefile +++ b/net/lftp/Makefile @@ -50,6 +50,7 @@ CONFIGURE_ARGS += \ --without-libiconv-prefix \ --without-libintl-prefix \ --without-gnutls \ + --without-libidn \ --without-libresolv \ --with-openssl="$(STAGING_DIR)/usr" \ --disable-static diff --git a/net/luci-app-bcp38/Makefile b/net/luci-app-bcp38/Makefile new file mode 100644 index 000000000..d42916cf0 --- /dev/null +++ b/net/luci-app-bcp38/Makefile @@ -0,0 +1,57 @@ +# +# 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)) diff --git a/net/luci-app-bcp38/files/bcp38-cbi.lua b/net/luci-app-bcp38/files/bcp38-cbi.lua new file mode 100644 index 000000000..b0b8f3879 --- /dev/null +++ b/net/luci-app-bcp38/files/bcp38-cbi.lua @@ -0,0 +1,58 @@ +--[[ +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 diff --git a/net/luci-app-bcp38/files/bcp38-controller.lua b/net/luci-app-bcp38/files/bcp38-controller.lua new file mode 100644 index 000000000..7ea22835d --- /dev/null +++ b/net/luci-app-bcp38/files/bcp38-controller.lua @@ -0,0 +1,7 @@ +module("luci.controller.bcp38", package.seeall) + +function index() + entry({"admin", "network", "firewall", "bcp38"}, + cbi("bcp38"), + _("BCP38"), 50).dependent = false +end diff --git a/net/luci-app-bcp38/files/uci-defaults-bcp38 b/net/luci-app-bcp38/files/uci-defaults-bcp38 new file mode 100755 index 000000000..c204236e3 --- /dev/null +++ b/net/luci-app-bcp38/files/uci-defaults-bcp38 @@ -0,0 +1,11 @@ +#!/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 diff --git a/net/luci-app-ocserv/Makefile b/net/luci-app-ocserv/Makefile deleted file mode 100644 index 18ff01929..000000000 --- a/net/luci-app-ocserv/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (C) 2014 Nikos Mavrogiannopoulos -# -# 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 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-ocserv -PKG_RELEASE:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/luci-app-ocserv - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:= OpenConnect VPN server configuration and status module - DEPENDS:=+luci-lib-json +luci-lib-nixio +luci-mod-admin-full +ocserv - MAINTAINER:= Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> -endef - -define Package/luci-app-ocserv/description - ocserv web module for LuCi web interface -endef - -define Build/Prepare -endef - -define Build/Configure -endef - -define Build/Compile -endef - -# Fixme: How can we add <%+ocserv_status%> in view/admin_status/index.htm? -define Package/luci-app-ocserv/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,luci-app-ocserv)) - diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/controller/ocserv.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/controller/ocserv.lua deleted file mode 100644 index 5cb0fb989..000000000 --- a/net/luci-app-ocserv/files/usr/lib/lua/luci/controller/ocserv.lua +++ /dev/null @@ -1,90 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - -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$ -]]-- - -module("luci.controller.ocserv", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/ocserv") then - return - end - - local page - - page = entry({"admin", "services", "ocserv"}, alias("admin", "services", "ocserv", "main"), - _("OpenConnect VPN")) - page.dependent = true - - page = entry({"admin", "services", "ocserv", "main"}, - cbi("ocserv/main"), - _("Server Settings"), 200) - page.dependent = true - - page = entry({"admin", "services", "ocserv", "users"}, - cbi("ocserv/users"), - _("User Settings"), 300) - page.dependent = true - - entry({"admin", "services", "ocserv", "status"}, - call("ocserv_status")).leaf = true - - entry({"admin", "services", "ocserv", "disconnect"}, - call("ocserv_disconnect")).leaf = true - -end - -function ocserv_status() - local ipt = io.popen("/usr/bin/occtl show users"); - - if ipt then - - local fwd = { } - while true do - - local ln = ipt:read("*l") - if not ln then break end - - local id, user, group, vpn_ip, ip, device, time, cipher, status = - ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*") - if id then - fwd[#fwd+1] = { - id = id, - user = user, - group = group, - vpn_ip = vpn_ip, - ip = ip, - device = device, - time = time, - cipher = cipher, - status = status - } - end - end - ipt:close() - luci.http.prepare_content("application/json") - luci.http.write_json(fwd) - end -end - -function ocserv_disconnect(num) - local idx = tonumber(num) - local uci = luci.model.uci.cursor() - - if idx and idx > 0 then - luci.sys.call("/usr/bin/occtl disconnect id %d" % idx) - luci.http.status(200, "OK") - - return - end - luci.http.status(400, "Bad request") -end diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/main.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/main.lua deleted file mode 100644 index 65f88785a..000000000 --- a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/main.lua +++ /dev/null @@ -1,146 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - -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 niulib = require "luci.niulib" -]]-- - -local fs = require "nixio.fs" -local has_ipv6 = fs.access("/proc/net/ipv6_route") - -m = Map("ocserv", translate("OpenConnect VPN")) - -s = m:section(TypedSection, "ocserv", "OpenConnect") -s.anonymous = true - -s:tab("general", translate("General Settings")) -s:tab("ca", translate("CA certificate")) -s:tab("template", translate("Edit Template")) - -local e = s:taboption("general", Flag, "enable", translate("Enable server")) -e.rmempty = false -e.default = "1" - -function m.on_commit(map) - luci.sys.call("/usr/bin/occtl reload >/dev/null 2>&1") -end - -function e.write(self, section, value) - if value == "0" then - luci.sys.call("/etc/init.d/ocserv stop >/dev/null 2>&1") - luci.sys.call("/etc/init.d/ocserv disable >/dev/null 2>&1") - else - luci.sys.call("/etc/init.d/ocserv enable >/dev/null 2>&1") - luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1") - end - Flag.write(self, section, value) -end - -local o - -o = s:taboption("general", ListValue, "auth", translate("User Authentication"), - translate("The authentication method for the users. The simplest is plain with a single username-password pair. Use PAM modules to authenticate using another server (e.g., LDAP, Radius).")) -o.rmempty = false -o.default = "plain" -o:value("plain") -o:value("PAM") - -o = s:taboption("general", Value, "zone", translate("Firewall Zone"), - translate("The firewall zone that the VPN clients will be set to")) -o.nocreate = true -o.default = "lan" -o.template = "cbi/firewall_zonelist" - -s:taboption("general", Value, "port", translate("Port"), - translate("The same UDP and TCP ports will be used")) -s:taboption("general", Value, "max_clients", translate("Max clients")) -s:taboption("general", Value, "max_same", translate("Max same clients")) -s:taboption("general", Value, "dpd", translate("Dead peer detection time (secs)")) - -local pip = s:taboption("general", Flag, "predictable_ips", translate("Predictable IPs"), - translate("The assigned IPs will be selected deterministically")) -pip.default = "1" - -local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"), - translate("Enable UDP channel support; this must be enabled unless you know what you are doing")) -udp.default = "1" - -local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect client compatibility"), - translate("Enable support for CISCO AnyConnect clients")) -cisco.default = "1" - -ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address")) -ipaddr.default = "192.168.100.1" - -nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Netmask")) -nm.default = "255.255.255.0" -nm:value("255.255.255.0") -nm:value("255.255.0.0") -nm:value("255.0.0.0") - -if has_ipv6 then - ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-Notation: address/prefix")) -end - - -tmpl = s:taboption("template", Value, "_tmpl", - translate("Edit the template that is used for generating the ocserv configuration.")) - -tmpl.template = "cbi/tvalue" -tmpl.rows = 20 - -function tmpl.cfgvalue(self, section) - return nixio.fs.readfile("/etc/ocserv/ocserv.conf.template") -end - -function tmpl.write(self, section, value) - value = value:gsub("\r\n?", "\n") - nixio.fs.writefile("/etc/ocserv/ocserv.conf.template", value) -end - -ca = s:taboption("ca", Value, "_ca", - translate("View the CA certificate used by this server. You will need to save it as 'ca.pem' and import it into the clients.")) - -ca.template = "cbi/tvalue" -ca.rows = 20 - -function ca.cfgvalue(self, section) - return nixio.fs.readfile("/etc/ocserv/ca.pem") -end - ---[[DNS]]-- - -s = m:section(TypedSection, "dns", translate("DNS servers"), - translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -s:option(Value, "ip", translate("IP Address")).rmempty = true - ---[[Routes]]-- - -s = m:section(TypedSection, "routes", translate("Routing table"), - translate("The routing table to be provided to clients; you can mix IPv4 and IPv6 routes, the server will send only the appropriate. Leave empty to set a default route")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -s:option(Value, "ip", translate("IP Address")).rmempty = true - -o = s:option(Value, "netmask", translate("Netmask (or IPv6-prefix)")) -o.default = "255.255.255.0" -o:value("255.255.255.0") -o:value("255.255.0.0") -o:value("255.0.0.0") - - -return m diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/user-config.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/user-config.lua deleted file mode 100644 index 65f88785a..000000000 --- a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/user-config.lua +++ /dev/null @@ -1,146 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - -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 niulib = require "luci.niulib" -]]-- - -local fs = require "nixio.fs" -local has_ipv6 = fs.access("/proc/net/ipv6_route") - -m = Map("ocserv", translate("OpenConnect VPN")) - -s = m:section(TypedSection, "ocserv", "OpenConnect") -s.anonymous = true - -s:tab("general", translate("General Settings")) -s:tab("ca", translate("CA certificate")) -s:tab("template", translate("Edit Template")) - -local e = s:taboption("general", Flag, "enable", translate("Enable server")) -e.rmempty = false -e.default = "1" - -function m.on_commit(map) - luci.sys.call("/usr/bin/occtl reload >/dev/null 2>&1") -end - -function e.write(self, section, value) - if value == "0" then - luci.sys.call("/etc/init.d/ocserv stop >/dev/null 2>&1") - luci.sys.call("/etc/init.d/ocserv disable >/dev/null 2>&1") - else - luci.sys.call("/etc/init.d/ocserv enable >/dev/null 2>&1") - luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1") - end - Flag.write(self, section, value) -end - -local o - -o = s:taboption("general", ListValue, "auth", translate("User Authentication"), - translate("The authentication method for the users. The simplest is plain with a single username-password pair. Use PAM modules to authenticate using another server (e.g., LDAP, Radius).")) -o.rmempty = false -o.default = "plain" -o:value("plain") -o:value("PAM") - -o = s:taboption("general", Value, "zone", translate("Firewall Zone"), - translate("The firewall zone that the VPN clients will be set to")) -o.nocreate = true -o.default = "lan" -o.template = "cbi/firewall_zonelist" - -s:taboption("general", Value, "port", translate("Port"), - translate("The same UDP and TCP ports will be used")) -s:taboption("general", Value, "max_clients", translate("Max clients")) -s:taboption("general", Value, "max_same", translate("Max same clients")) -s:taboption("general", Value, "dpd", translate("Dead peer detection time (secs)")) - -local pip = s:taboption("general", Flag, "predictable_ips", translate("Predictable IPs"), - translate("The assigned IPs will be selected deterministically")) -pip.default = "1" - -local udp = s:taboption("general", Flag, "udp", translate("Enable UDP"), - translate("Enable UDP channel support; this must be enabled unless you know what you are doing")) -udp.default = "1" - -local cisco = s:taboption("general", Flag, "cisco_compat", translate("AnyConnect client compatibility"), - translate("Enable support for CISCO AnyConnect clients")) -cisco.default = "1" - -ipaddr = s:taboption("general", Value, "ipaddr", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Network-Address")) -ipaddr.default = "192.168.100.1" - -nm = s:taboption("general", Value, "netmask", translate("VPN <abbr title=\"Internet Protocol Version 4\">IPv4</abbr>-Netmask")) -nm.default = "255.255.255.0" -nm:value("255.255.255.0") -nm:value("255.255.0.0") -nm:value("255.0.0.0") - -if has_ipv6 then - ip6addr = s:taboption("general", Value, "ip6addr", translate("VPN <abbr title=\"Internet Protocol Version 6\">IPv6</abbr>-Network-Address"), translate("<abbr title=\"Classless Inter-Domain Routing\">CIDR</abbr>-Notation: address/prefix")) -end - - -tmpl = s:taboption("template", Value, "_tmpl", - translate("Edit the template that is used for generating the ocserv configuration.")) - -tmpl.template = "cbi/tvalue" -tmpl.rows = 20 - -function tmpl.cfgvalue(self, section) - return nixio.fs.readfile("/etc/ocserv/ocserv.conf.template") -end - -function tmpl.write(self, section, value) - value = value:gsub("\r\n?", "\n") - nixio.fs.writefile("/etc/ocserv/ocserv.conf.template", value) -end - -ca = s:taboption("ca", Value, "_ca", - translate("View the CA certificate used by this server. You will need to save it as 'ca.pem' and import it into the clients.")) - -ca.template = "cbi/tvalue" -ca.rows = 20 - -function ca.cfgvalue(self, section) - return nixio.fs.readfile("/etc/ocserv/ca.pem") -end - ---[[DNS]]-- - -s = m:section(TypedSection, "dns", translate("DNS servers"), - translate("The DNS servers to be provided to clients; can be either IPv6 or IPv4")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -s:option(Value, "ip", translate("IP Address")).rmempty = true - ---[[Routes]]-- - -s = m:section(TypedSection, "routes", translate("Routing table"), - translate("The routing table to be provided to clients; you can mix IPv4 and IPv6 routes, the server will send only the appropriate. Leave empty to set a default route")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -s:option(Value, "ip", translate("IP Address")).rmempty = true - -o = s:option(Value, "netmask", translate("Netmask (or IPv6-prefix)")) -o.default = "255.255.255.0" -o:value("255.255.255.0") -o:value("255.255.0.0") -o:value("255.0.0.0") - - -return m diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/users.lua b/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/users.lua deleted file mode 100644 index 35c20fc64..000000000 --- a/net/luci-app-ocserv/files/usr/lib/lua/luci/model/cbi/ocserv/users.lua +++ /dev/null @@ -1,87 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2014 Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> - -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 dsp = require "luci.dispatcher" -local nixio = require "nixio" - -m = Map("ocserv", translate("OpenConnect VPN")) - -if m.uci:get("ocserv", "config", "auth") == "plain" then - ---[[Users]]-- - -function m.on_commit(map) - luci.sys.call("/etc/init.d/ocserv restart >/dev/null 2>&1") -end - -s = m:section(TypedSection, "ocservusers", translate("Available users")) -s.anonymous = true -s.addremove = true -s.template = "cbi/tblsection" - -s:option(Value, "name", translate("Name")).rmempty = true -s:option(DummyValue, "group", translate("Group")).rmempty = true -pwd = s:option(Value, "password", translate("Password")) -pwd.password = false - -function pwd.write(self, section, value) - local pass - if string.match(value, "^\$%d\$.*") then - pass = value - else - local t = tonumber(nixio.getpid()*os.time()) - local salt = "$5$" .. t .. "$" - pass = nixio.crypt(value, salt) - end - Value.write(self, section, pass) -end - ---[[if plain]]-- -end - -local lusers = { } -local fd = io.popen("/usr/bin/occtl show users", "r") -if fd then local ln - repeat - ln = fd:read("*l") - if not ln then break end - - local id, user, group, vpn_ip, ip, device, time, cipher, status = - ln:match("^%s*(%d+)%s+([-_%w]+)%s+([%.%*-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+)%s+([%:%.-_%w]+).*") - if id then - table.insert(lusers, {id, user, group, vpn_ip, ip, device, time, cipher, status}) - end - until not ln - fd:close() -end - - ---[[Active Users]]-- - -local s = m:section(Table, lusers, translate("Active users")) -s.anonymous = true -s.rmempty = true -s.template = "cbi/tblsection" - -s:option(DummyValue, 1, translate("ID")) -s:option(DummyValue, 2, translate("Username")) -s:option(DummyValue, 3, translate("Group")) -s:option(DummyValue, 4, translate("IP")) -s:option(DummyValue, 5, translate("VPN IP")) -s:option(DummyValue, 6, translate("Device")) -s:option(DummyValue, 7, translate("Time")) -s:option(DummyValue, 8, translate("Cipher")) -s:option(DummyValue, 9, translate("Status")) - -return m diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/view/admin_status/index/ocserv.htm b/net/luci-app-ocserv/files/usr/lib/lua/luci/view/admin_status/index/ocserv.htm deleted file mode 100644 index 457580695..000000000 --- a/net/luci-app-ocserv/files/usr/lib/lua/luci/view/admin_status/index/ocserv.htm +++ /dev/null @@ -1 +0,0 @@ -<%+ocserv_status%> diff --git a/net/luci-app-ocserv/files/usr/lib/lua/luci/view/ocserv_status.htm b/net/luci-app-ocserv/files/usr/lib/lua/luci/view/ocserv_status.htm deleted file mode 100644 index fabc1bca9..000000000 --- a/net/luci-app-ocserv/files/usr/lib/lua/luci/view/ocserv_status.htm +++ /dev/null @@ -1,76 +0,0 @@ -<script type="text/javascript">//<![CDATA[ - - function ocserv_disconnect(idx) { - XHR.get('<%=luci.dispatcher.build_url("admin", "services", "ocserv", "disconnect")%>/' + idx, null, - function(x) - { - var tb = document.getElementById('ocserv_status_table'); - if (tb && (idx < tb.rows.length)) - tb.rows[0].parentNode.removeChild(tb.rows[idx]); - } - ); - } - - XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "ocserv", "status")%>', null, - function(x, st) - { - var tb = document.getElementById('ocserv_status_table'); - if (st && tb) - { - /* clear all rows */ - while( tb.rows.length > 1 ) - tb.deleteRow(1); - - for( var i = 0; i < st.length; i++ ) - { - var tr = tb.insertRow(-1); - tr.className = 'cbi-section-table-row cbi-rowstyle-' + ((i % 2) + 1); - - tr.insertCell(-1).innerHTML = st[i].user; - tr.insertCell(-1).innerHTML = st[i].group; - tr.insertCell(-1).innerHTML = st[i].vpn_ip; - tr.insertCell(-1).innerHTML = st[i].ip; - tr.insertCell(-1).innerHTML = st[i].device; - tr.insertCell(-1).innerHTML = st[i].time; - tr.insertCell(-1).innerHTML = st[i].cipher; - tr.insertCell(-1).innerHTML = st[i].status; - - tr.insertCell(-1).innerHTML = String.format( - '<input class="cbi-button cbi-input-remove" type="button" value="<%:Disconnect%>" onclick="ocserv_disconnect(%d)" />', - st[i].id - ); - } - - if( tb.rows.length == 1 ) - { - var tr = tb.insertRow(-1); - tr.className = 'cbi-section-table-row'; - - var td = tr.insertCell(-1); - td.colSpan = 5; - td.innerHTML = '<em><br /><%:There are no active users.%></em>'; - } - } - } - ); -//]]></script> - -<fieldset class="cbi-section"> - <legend><%:Active OpenConnect Users%></legend> - <table class="cbi-section-table" id="ocserv_status_table"> - <tr class="cbi-section-table-titles"> - <th class="cbi-section-table-cell"><%:User%></th> - <th class="cbi-section-table-cell"><%:Group%></th> - <th class="cbi-section-table-cell"><%:IP Address%></th> - <th class="cbi-section-table-cell"><%:VPN IP Address%></th> - <th class="cbi-section-table-cell"><%:Device%></th> - <th class="cbi-section-table-cell"><%:Time%></th> - <th class="cbi-section-table-cell"><%:Cipher%></th> - <th class="cbi-section-table-cell"><%:Status%></th> - <th class="cbi-section-table-cell"> </th> - </tr> - <tr class="cbi-section-table-row"> - <td colspan="5"><em><br /><%:Collecting data...%></em></td> - </tr> - </table> -</fieldset> diff --git a/net/luci-proto-openconnect/Makefile b/net/luci-proto-openconnect/Makefile deleted file mode 100644 index a7b0d35a3..000000000 --- a/net/luci-proto-openconnect/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (C) 2014 Nikos Mavrogiannopoulos -# -# 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 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-proto-openconnect -PKG_RELEASE:=1 - -PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk - -define Package/luci-proto-openconnect - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=6. Protocols - TITLE:= OpenConnect VPN protocol configuration - DEPENDS:=+luci-mod-admin-full +luci-lib-nixio +openconnect - MAINTAINER:= Nikos Mavrogiannopoulos <n.mavrogiannopoulos@gmail.com> -endef - -define Package/luci-proto-openconnect/description - openconnect web module for LuCi web interface -endef - -define Build/Prepare -endef - -define Build/Configure -endef - -define Build/Compile -endef - -# Fixme: How can we add <%+openconnect_status%> in view/admin_status/index.htm? -define Package/luci-proto-openconnect/install - $(CP) ./files/* $(1)/ -endef - -$(eval $(call BuildPackage,luci-proto-openconnect)) - diff --git a/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/cbi/admin_network/proto_openconnect.lua b/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/cbi/admin_network/proto_openconnect.lua deleted file mode 100644 index 2e2eacee0..000000000 --- a/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/cbi/admin_network/proto_openconnect.lua +++ /dev/null @@ -1,78 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2014 Nikos Mavrogiannopoulos <nmav@gnutls.org> - -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 -]]-- - -local map, section, net = ... - -local server, username, password, cert, ca -local oc_cert_file, oc_key_file, oc_ca_file - -local ifc = net:get_interface():name() - -oc_cert_file = "/etc/openconnect/user-cert-" .. ifc .. ".pem" -oc_key_file = "/etc/openconnect/user-key-" .. ifc .. ".pem" -oc_ca_file = "/etc/openconnect/ca-" .. ifc .. ".pem" - -server = section:taboption("general", Value, "server", translate("VPN Server")) -server.datatype = "host" - -port = section:taboption("general", Value, "port", translate("VPN Server port")) -port.placeholder = "443" -port.datatype = "port" - -section:taboption("general", Value, "serverhash", translate("VPN Server's certificate SHA1 hash")) - -section:taboption("general", Value, "authgroup", translate("AuthGroup")) - -username = section:taboption("general", Value, "username", translate("Username")) -password = section:taboption("general", Value, "password", translate("Password")) -password.password = true - - -cert = section:taboption("advanced", Value, "usercert", translate("User certificate (PEM encoded)")) -cert.template = "cbi/tvalue" -cert.rows = 10 - -function cert.cfgvalue(self, section) - return nixio.fs.readfile(oc_cert_file) -end - -function cert.write(self, section, value) - value = value:gsub("\r\n?", "\n") - nixio.fs.writefile(oc_cert_file, value) -end - -cert = section:taboption("advanced", Value, "userkey", translate("User key (PEM encoded)")) -cert.template = "cbi/tvalue" -cert.rows = 10 - -function cert.cfgvalue(self, section) - return nixio.fs.readfile(oc_key_file) -end - -function cert.write(self, section, value) - value = value:gsub("\r\n?", "\n") - nixio.fs.writefile(oc_key_file, value) -end - - -ca = section:taboption("advanced", Value, "ca", translate("CA certificate; if empty it will be saved after the first connection.")) -ca.template = "cbi/tvalue" -ca.rows = 10 - -function ca.cfgvalue(self, section) - return nixio.fs.readfile(oc_ca_file) -end - -function ca.write(self, section, value) - value = value:gsub("\r\n?", "\n") - nixio.fs.writefile(oc_ca_file, value) -end diff --git a/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/network/proto_openconnect.lua b/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/network/proto_openconnect.lua deleted file mode 100644 index f5c16c7f0..000000000 --- a/net/luci-proto-openconnect/files/usr/lib/lua/luci/model/network/proto_openconnect.lua +++ /dev/null @@ -1,61 +0,0 @@ ---[[ -LuCI - Network model - dhcpv6 protocol extension - -Copyright 2012 David Woodhouse - -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 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -]]-- - -local netmod = luci.model.network -local interface = luci.model.network.interface -local proto = netmod:register_protocol("openconnect") - -function proto.get_i18n(self) - return luci.i18n.translate("OpenConnect (CISCO AnyConnect)") -end - -function proto.ifname(self) - return "vpn-" .. self.sid -end - -function proto.get_interface(self) - return interface(self:ifname(), self) -end - -function proto.opkg_package(self) - return "openconnect" -end - -function proto.is_installed(self) - return nixio.fs.access("/lib/netifd/proto/openconnect.sh") -end - -function proto.is_floating(self) - return true -end - -function proto.is_virtual(self) - return true -end - -function proto.get_interfaces(self) - return nil -end - -function proto.contains_interface(self, ifc) - return (netmod:ifnameof(ifc) == self:ifname()) - -end - -netmod:register_pattern_virtual("^vpn-%w") diff --git a/net/mdnsresponder/Makefile b/net/mdnsresponder/Makefile index 7e36ceb5e..50a3c4280 100644 --- a/net/mdnsresponder/Makefile +++ b/net/mdnsresponder/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE:=mDNSResponder-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://opensource.apple.com/tarballs/mDNSResponder/ PKG_MD5SUM:=39142ab70bd82a096801ce346f86cbab PKG_MAINTAINER:=Steven Barth <cyrus@openwrt.org> +PKG_LICENSE:=Apache-2.0 PKG_BUILD_DIR:=$(BUILD_DIR)/mDNSResponder-$(PKG_VERSION) diff --git a/net/net-snmp/files/snmpd.init b/net/net-snmp/files/snmpd.init index a89d0826b..2668b7b3e 100644 --- a/net/net-snmp/files/snmpd.init +++ b/net/net-snmp/files/snmpd.init @@ -119,6 +119,16 @@ snmpd_exec_add() { config_get miboid "$cfg" miboid echo "exec $miboid $name $prog $args" >> $RUN_C } +snmpd_disk_add() { + local cfg="$1" + local disk='disk' + + config_get partition "$cfg" partition + [ -n "$partition" ] || return 0 + config_get size "$cfg" size + [ -n "$size" ] || return 0 + echo "$disk $partition $size" >> $RUN_C +} start() { [ -d $LIB_D ] || mkdir -p $LIB_D [ -d $LOG_D ] || mkdir -p $LOG_D @@ -136,7 +146,8 @@ start() { config_foreach snmpd_access_add access config_foreach snmpd_pass_add pass config_foreach snmpd_exec_add exec - + config_foreach snmpd_disk_add disk + [ -f $DEFAULT ] && . $DEFAULT $DEBUG /usr/sbin/snmpd $OPTIONS } diff --git a/net/nut/Makefile b/net/nut/Makefile index a0125c487..d23b7cb5d 100644 --- a/net/nut/Makefile +++ b/net/nut/Makefile @@ -21,6 +21,19 @@ PKG_LICENSE_FILES:=LICENSE-GPL2 PKG_BUILD_DIR:=$(BUILD_DIR)/nut-$(PKG_VERSION) PKG_INSTALL:=1 +PKG_CONFIG_DEPENDS:= \ + CONFIG_NUT_CLIENTS_UPSC \ + CONFIG_NUT_CLIENTS_UPSCMD \ + CONFIG_NUT_CLIENTS_UPSLOG \ + CONFIG_NUT_CLIENTS_UPSMON \ + CONFIG_NUT_CLIENTS_UPSRW \ + CONFIG_NUT_CLIENTS_UPSSCHED \ + CONFIG_NUT_DRIVER_SERIAL \ + CONFIG_NUT_DRIVER_SNMP \ + CONFIG_NUT_DRIVER_USB \ + CONFIG_NUT_SERVER \ + CONFIG_NUT_SSL \ + include $(INCLUDE_DIR)/package.mk define Package/nut/Default diff --git a/net/ocserv/Makefile b/net/ocserv/Makefile index 9a5bf2e46..bf22c4bef 100644 --- a/net/ocserv/Makefile +++ b/net/ocserv/Makefile @@ -8,18 +8,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ocserv -PKG_VERSION:=0.8.6 +PKG_VERSION:=0.8.7 PKG_RELEASE:=1 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:=78301874643ae658d43a8c7f4aaabadb +PKG_MD5SUM:=79c00132c3366bb60546f256068211eb PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf +PKG_CONFIG_DEPENDS:= \ + CONFIG_OCSERV_PAM \ + CONFIG_OCSERV_PROTOBUF \ + include $(INCLUDE_DIR)/package.mk define Package/ocserv/config diff --git a/net/openconnect/Makefile b/net/openconnect/Makefile index 00fbf8b61..c14dd32a6 100644 --- a/net/openconnect/Makefile +++ b/net/openconnect/Makefile @@ -9,12 +9,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openconnect PKG_VERSION:=6.00 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=ftp://ftp.infradead.org/pub/openconnect/ PKG_MD5SUM:=7e28e23c6e281be31446e6c365f5d273 +PKG_CONFIG_DEPENDS:= \ + CONFIG_OPENCONNECT_GNUTLS \ + CONFIG_OPENCONNECT_OPENSSL \ + + include $(INCLUDE_DIR)/package.mk define Package/openconnect/config diff --git a/net/openconnect/files/openconnect-wrapper b/net/openconnect/files/openconnect-wrapper index 744e5a5cd..082dfba73 100755 --- a/net/openconnect/files/openconnect-wrapper +++ b/net/openconnect/files/openconnect-wrapper @@ -22,7 +22,17 @@ cleanup() exit 0 } -trap cleanup 1 2 3 6 15 +cleanup2() +{ + if ! test -z "$pid";then + kill -2 $pid + wait $pid + fi + exit 0 +} + +trap cleanup2 2 +trap cleanup 1 3 6 15 rm -f "$pidfile" /usr/sbin/openconnect $* <$pwfile & diff --git a/net/openconnect/files/openconnect.sh b/net/openconnect/files/openconnect.sh index ad708073a..30513f6b4 100755 --- a/net/openconnect/files/openconnect.sh +++ b/net/openconnect/files/openconnect.sh @@ -68,7 +68,7 @@ proto_openconnect_teardown() { rm -f $pwfile logger -t openconnect "bringing down openconnect" - proto_kill_command "$config" + proto_kill_command "$config" 2 } add_protocol openconnect diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index bb5b268dd..a198d0a85 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -94,7 +94,7 @@ define KernelPackage/openvswitch SUBMENU:=Network Support TITLE:=Open vSwitch Kernel Package KCONFIG:=CONFIG_BRIDGE - DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c + DEPENDS:=+kmod-stp +kmod-ipv6 +kmod-gre +kmod-lib-crc32c +kmod-vxlan FILES:= \ $(PKG_BUILD_DIR)/datapath/linux/openvswitch.$(LINUX_KMOD_SUFFIX) AUTOLOAD:=$(call AutoLoad,21,openvswitch) @@ -119,6 +119,11 @@ define Build/Configure $(call Build/Configure/Default,$(CONFIGURE_ARGS)) endef +KCFLAGS= +ifeq ($(CONFIG_GCC_VERSION_4_9),y) +KCFLAGS:=-Wno-error=date-time +endif + define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) \ $(TARGET_CONFIGURE_OPTS) \ @@ -131,6 +136,7 @@ define Build/Compile ARCH="$(LINUX_KARCH)" \ SUBDIRS="$(PKG_BUILD_DIR)/datapath/linux" \ PATH="$(TARGET_PATH)" \ + KCFLAGS="$(KCFLAGS)" \ KCC="$(KERNEL_CC)" endef diff --git a/net/openvswitch/patches/0004-datapath-linux-add-KCFLAGS-var-to-modules-Makefile.m.patch b/net/openvswitch/patches/0004-datapath-linux-add-KCFLAGS-var-to-modules-Makefile.m.patch new file mode 100644 index 000000000..bbc758d56 --- /dev/null +++ b/net/openvswitch/patches/0004-datapath-linux-add-KCFLAGS-var-to-modules-Makefile.m.patch @@ -0,0 +1,39 @@ +From deb44e6e9d64001562ee9395a2c8525848052394 Mon Sep 17 00:00:00 2001 +From: Alexandru Ardelean <aa@ocedo.com> +Date: Tue, 28 Oct 2014 11:03:53 +0200 +Subject: [PATCH] datapath/linux: add KCFLAGS var to modules Makefile.main.in + +This is mostly required because of GCC 4.9 which seems +to error out with: + openvswitch/datapath/linux/datapath.c:2108:10: + error: macro "DATE" might prevent reproducible builds + +We would have wanted to add '-Wno-error=date-time' directly +but that would be too specific, so we decided to add +a generic make flag and configure it with what we need. + +Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com> +--- + datapath/linux/Makefile.main.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/datapath/linux/Makefile.main.in b/datapath/linux/Makefile.main.in +index 88f144c..0b200b7 100644 +--- a/datapath/linux/Makefile.main.in ++++ b/datapath/linux/Makefile.main.in +@@ -67,10 +67,10 @@ ifeq (,$(wildcard $(CONFIG_FILE))) + endif + + default: +- $(MAKE) -C $(KSRC) M=$(builddir) modules ++ $(MAKE) -C $(KSRC) M=$(builddir) $(KCFLAGS) modules + + modules_install: +- $(MAKE) -C $(KSRC) M=$(builddir) modules_install ++ $(MAKE) -C $(KSRC) M=$(builddir) $(KCFLAGS) modules_install + depmod `sed -n 's/#define UTS_RELEASE "\([^"]*\)"/\1/p' $(KSRC)/include/generated/utsrelease.h` + endif + +-- +1.8.4.5 + diff --git a/net/openvswitch/patches/0005-datapath-backport___ip_select_ident_function.patch b/net/openvswitch/patches/0005-datapath-backport___ip_select_ident_function.patch new file mode 100644 index 000000000..0ea48c6dd --- /dev/null +++ b/net/openvswitch/patches/0005-datapath-backport___ip_select_ident_function.patch @@ -0,0 +1,43 @@ +commit 2ea824143172e38b4387ef23b8685cebaee21c69 +Author: Pravin B Shelar <pshelar@nicira.com> +Date: Tue Sep 24 18:42:43 2013 -0700 + + datapath: Backport __ip_select_ident() function + + definition of __ip_select_ident() changed in newer kernel and + it is backported to stable kernel, Therefore adding configure + check to detect the new function. + + Signed-off-by: Pravin B Shelar <pshelar@nicira.com> + Acked-by: Andy Zhou <azhou@nicira.com> + +diff --git a/acinclude.m4 b/acinclude.m4 +index 7e036e5..b0794d2 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -284,6 +284,8 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [ + OVS_GREP_IFELSE([$KSRC/include/linux/if_vlan.h], [vlan_set_encap_proto]) + + OVS_GREP_IFELSE([$KSRC/include/linux/in.h], [ipv4_is_multicast]) ++ OVS_GREP_IFELSE([$KSRC/include/net/ip.h], [__ip_select_ident.*dst_entry], ++ [OVS_DEFINE([HAVE_IP_SELECT_IDENT_USING_DST_ENTRY])]) + + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_disable_lro]) + OVS_GREP_IFELSE([$KSRC/include/linux/netdevice.h], [dev_get_stats]) +diff --git a/datapath/linux/compat/ip_tunnels_core.c b/datapath/linux/compat/ip_tunnels_core.c +index d650be2..a70aefc 100644 +--- a/datapath/linux/compat/ip_tunnels_core.c ++++ b/datapath/linux/compat/ip_tunnels_core.c +@@ -70,7 +70,12 @@ int iptunnel_xmit(struct rtable *rt, + iph->daddr = dst; + iph->saddr = src; + iph->ttl = ttl; ++ ++#ifdef HAVE_IP_SELECT_IDENT_USING_DST_ENTRY + __ip_select_ident(iph, &rt_dst(rt), (skb_shinfo(skb)->gso_segs ?: 1) - 1); ++#else ++ __ip_select_ident(iph, skb_shinfo(skb)->gso_segs ?: 1); ++#endif + + err = ip_local_out(skb); + if (unlikely(net_xmit_eval(err))) diff --git a/net/sqm-scripts/Makefile b/net/sqm-scripts/Makefile index ea296f1b4..298220dfa 100644 --- a/net/sqm-scripts/Makefile +++ b/net/sqm-scripts/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sqm-scripts PKG_VERSION:=7 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_LICENSE:=GPLv2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -44,8 +44,14 @@ define Build/Compile 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)) diff --git a/net/sqm-scripts/files/usr/lib/sqm/functions.sh b/net/sqm-scripts/files/usr/lib/sqm/functions.sh index f2ed44bbe..3411b8f31 100644 --- a/net/sqm-scripts/files/usr/lib/sqm/functions.sh +++ b/net/sqm-scripts/files/usr/lib/sqm/functions.sh @@ -29,6 +29,7 @@ ipt() { } do_modules() { +#sm TODO: check first whether the modules exist and only load then insmod act_ipt insmod sch_$QDISC insmod sch_ingress @@ -59,15 +60,18 @@ do_modules() { [ -z "$IECN" ] && IECN="ECN" [ -z "$EECN" ] && EECN="NOECN" [ -z "$SQUASH_DSCP" ] && SQUASH_DSCP="1" -[ -z "SQUASH_INGRESS" ] && SQUASH_INGRESS="1" +[ -z "$SQUASH_INGRESS" ] && SQUASH_INGRESS="1" [ -z "$IQDISC_OPTS" ] && IQDISC_OPTS="" [ -z "$EQDISC_OPTS" ] && EQDISC_OPTS="" [ -z "$TC" ] && TC=`which tc` #[ -z "$TC" ] && TC="sqm_logger tc"# this redirects all tc calls into the log [ -z "$IP" ] && IP=$( which ip ) [ -z "$INSMOD" ] && INSMOD=`which insmod` -[ -z "TARGET" ] && TARGET="5ms" +[ -z "$TARGET" ] && TARGET="5ms" +[ -z "$IPT_MASK" ] && IPT_MASK="0xff" +[ -z "$IPT_MASK_STRING" ] && IPT_MASK_STRING="/${IPT_MASK}" # for set-mark +#sqm_logger "${0} IPT_MASK: ${IPT_MASK_STRING}" diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple.qos b/net/sqm-scripts/files/usr/lib/sqm/simple.qos index c752660bb..5df6aa7e2 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simple.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simple.qos @@ -25,13 +25,13 @@ ipt_setup() { ipt -t mangle -N QOS_MARK_${IFACE} -ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2 +ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING} # You can go further with classification but... -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3 -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1 -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1 -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1 -ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1 +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING} # and it might be a good idea to do it for udp tunnels too @@ -43,16 +43,16 @@ sqm_logger "Squashing differentiated services code points (DSCP) from ingress." ipt -t mangle -I PREROUTING -i $IFACE -m dscp ! --dscp 0 -j DSCP --set-dscp-class be else sqm_logger "Keeping differentiated services code points (DSCP) from ingress." -ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00 -g QOS_MARK_${IFACE} +ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} fi -ipt -t mangle -A POSTROUTING -o $IFACE -m mark --mark 0x00 -g QOS_MARK_${IFACE} +ipt -t mangle -A POSTROUTING -o $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} # The Syn optimization was nice but fq_codel does it for us # ipt -t mangle -A PREROUTING -i s+ -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j MARK --set-mark 0x01 # Not sure if this will work. Encapsulation is a problem period -ipt -t mangle -I PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2 # tcp tunnels need ordering +ipt -t mangle -I PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2${IPT_MASK_STRING} # tcp tunnels need ordering # Emanating from router, do a little more optimization # but don't bother with it too much. diff --git a/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos b/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos index 2e84fab9e..d40d1bb85 100755 --- a/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos +++ b/net/sqm-scripts/files/usr/lib/sqm/simple_pppoe.qos @@ -19,19 +19,24 @@ # You need to jiggle these parameters. Note limits are tuned towards a <10Mbit uplink <60Mbup down -. /usr/lib/sqm/functions.sh +#sm: Goal to create a set of tc filters that also apply on pppoe encapsulated packets +# but having multiple filters run in succession is slow, so look at tc filter hashing +# (this should help cut down the number of OPs per packet considerably) + +. /usr/lib/sqm/functions.sh +#sqm_logger IPT_MASK: ${IPT_MASK_STRING} ipt_setup() { ipt -t mangle -N QOS_MARK_${IFACE} -ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2 +ipt -t mangle -A QOS_MARK_${IFACE} -j MARK --set-mark 0x2${IPT_MASK_STRING} # You can go further with classification but... -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3 -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1 -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1 -ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1 -ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1 +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS1 -j MARK --set-mark 0x3${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class CS6 -j MARK --set-mark 0x1${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class EF -j MARK --set-mark 0x1${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m dscp --dscp-class AF42 -j MARK --set-mark 0x1${IPT_MASK_STRING} +ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-mark 0x1${IPT_MASK_STRING} # and it might be a good idea to do it for udp tunnels too @@ -39,20 +44,20 @@ ipt -t mangle -A QOS_MARK_${IFACE} -m tos --tos Minimize-Delay -j MARK --set-ma if [ "$SQUASH_DSCP" = "1" ] then -sqm_logger "Squashing differentiad services code points (DSCP) from ingress." +sqm_logger "Squashing differentiated services code points (DSCP) from ingress." ipt -t mangle -I PREROUTING -i $IFACE -m dscp ! --dscp 0 -j DSCP --set-dscp-class be else sqm_logger "Keeping differentiad services code points (DSCP) from ingress." -ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00 -g QOS_MARK_${IFACE} +ipt -t mangle -A PREROUTING -i $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} fi -ipt -t mangle -A POSTROUTING -o $IFACE -m mark --mark 0x00 -g QOS_MARK_${IFACE} +ipt -t mangle -A POSTROUTING -o $IFACE -m mark --mark 0x00${IPT_MASK_STRING} -g QOS_MARK_${IFACE} # The Syn optimization was nice but fq_codel does it for us # ipt -t mangle -A PREROUTING -i s+ -p tcp -m tcp --tcp-flags SYN,RST,ACK SYN -j MARK --set-mark 0x01 # Not sure if this will work. Encapsulation is a problem period -ipt -t mangle -I PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2 # tcp tunnels need ordering +ipt -t mangle -I PREROUTING -i vtun+ -p tcp -j MARK --set-mark 0x2${IPT_MASK_STRING} # tcp tunnels need ordering # Emanating from router, do a little more optimization # but don't bother with it too much. @@ -65,25 +70,27 @@ ipt -t mangle -A OUTPUT -p udp -m multiport --ports 123,53 -j DSCP --set-dscp-cl } +MYBURST=1600 #sm: make burst and cburst as well as quantum configurable for ingress and egress in the GUI # TC rules egress() { CEIL=${UPLINK} -PRIO_RATE=`expr $CEIL / 3` # Ceiling for prioirty +PRIO_RATE=`expr $CEIL / 3` # Ceiling for priority BE_RATE=`expr $CEIL / 6` # Min for best effort BK_RATE=`expr $CEIL / 6` # Min for background BE_CEIL=`expr $CEIL - 16` # A little slop at the top LQ="quantum `get_mtu $IFACE $CEIL`" +HTB_BURSTS="burst ${MYBURST} cburst ${MYBURST}" $TC qdisc del dev $IFACE root 2> /dev/null $TC qdisc add dev $IFACE root handle 1: `get_stab_string` htb default 12 -$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` -$TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` +$TC class add dev $IFACE parent 1: classid 1:1 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` +$TC class add dev $IFACE parent 1:1 classid 1:10 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` +$TC class add dev $IFACE parent 1:1 classid 1:11 htb $LQ ${HTB_BURSTS} rate 128kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` +$TC class add dev $IFACE parent 1:1 classid 1:12 htb $LQ ${HTB_BURSTS} rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` +$TC class add dev $IFACE parent 1:1 classid 1:13 htb $LQ ${HTB_BURSTS} rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` $TC qdisc add dev $IFACE parent 1:11 handle 110: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${PRIO_RATE}` ${EQDISC_OPTS} $TC qdisc add dev $IFACE parent 1:12 handle 120: $QDISC `get_limit ${ELIMIT}` `get_target "${ETARGET}" ${UPLINK}` `get_ecn ${EECN}` `get_quantum 300` `get_flows ${BE_RATE}` ${EQDISC_OPTS} @@ -301,6 +308,7 @@ BK_RATE=`expr $CEIL / 6` # Min for background BE_CEIL=`expr $CEIL - 16` # A little slop at the top LQ="quantum `get_mtu $IFACE $CEIL`" +HTB_BURSTS="burst ${MYBURST} cburst ${MYBURST}" $TC qdisc del dev $IFACE handle ffff: ingress 2> /dev/null $TC qdisc add dev $IFACE handle ffff: ingress @@ -313,18 +321,18 @@ sqm_logger "Do not perform DSCP based filtering on ingress. (1-tier classificati # Revert to no dscp based filtering $TC qdisc del dev $DEV root 2>/dev/null $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 10 -$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` +$TC class add dev $DEV parent 1: classid 1:1 htb $LQ ${HTB_BURSTS} rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit `get_htb_adsll_string` +$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ ${HTB_BURSTS} rate ${DOWNLINK}kbit ceil ${DOWNLINK}kbit prio 0 `get_htb_adsll_string` $TC qdisc add dev $DEV parent 1:10 handle 110: $QDISC `get_limit ${ILIMIT}` `get_target "${ITARGET}" ${DOWNLINK}` `get_ecn ${IECN}` `get_flows ${DOWNLINK}` ${IQDISC_OPTS} else sqm_logger "Perform DSCP based filtering on ingress. (3-tier classification)" $TC qdisc add dev $DEV root handle 1: `get_stab_string` htb default 12 -$TC class add dev $DEV parent 1: classid 1:1 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` -$TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` +$TC class add dev $DEV parent 1: classid 1:1 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit `get_htb_adsll_string` +$TC class add dev $DEV parent 1:1 classid 1:10 htb $LQ ${HTB_BURSTS} rate ${CEIL}kbit ceil ${CEIL}kbit prio 0 `get_htb_adsll_string` +$TC class add dev $DEV parent 1:1 classid 1:11 htb $LQ ${HTB_BURSTS} rate 32kbit ceil ${PRIO_RATE}kbit prio 1 `get_htb_adsll_string` +$TC class add dev $DEV parent 1:1 classid 1:12 htb $LQ ${HTB_BURSTS} rate ${BE_RATE}kbit ceil ${BE_CEIL}kbit prio 2 `get_htb_adsll_string` +$TC class add dev $DEV parent 1:1 classid 1:13 htb $LQ ${HTB_BURSTS} rate ${BK_RATE}kbit ceil ${BE_CEIL}kbit prio 3 `get_htb_adsll_string` # I'd prefer to use a pre-nat filter but that causes permutation... diff --git a/net/udpxy/Makefile b/net/udpxy/Makefile index b8df5b817..8fc927645 100644 --- a/net/udpxy/Makefile +++ b/net/udpxy/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=udpxy -PKG_VERSION:=2014-08-24 +PKG_VERSION:=2014-10-27 PKG_RELEASE:=$(PKG_SOURCE_VERSION) PKG_SOURCE_PROTO:=git diff --git a/net/udpxy/files/udpxy.conf b/net/udpxy/files/udpxy.conf index 8ef2a1e05..9117a53e3 100644 --- a/net/udpxy/files/udpxy.conf +++ b/net/udpxy/files/udpxy.conf @@ -1,4 +1,6 @@ config udpxy + option disabled '1' + option respawn '1' option verbose '0' option status '1' # option bind '0.0.0.0' diff --git a/net/udpxy/files/udpxy.init b/net/udpxy/files/udpxy.init index a08f4a134..6f911a6fb 100644 --- a/net/udpxy/files/udpxy.init +++ b/net/udpxy/files/udpxy.init @@ -4,57 +4,64 @@ START=50 USE_PROCD=1 -udpxy_parse() { +append_arg() { local cfg="$1" + local var="$2" + local opt="$3" + local def="$4" + local val - local cfg_verbose - local cfg_status - local cfg_mcsub_renew - local cfg_bind - local cfg_port - local cfg_source - local cfg_max_clients - local cfg_log_file - local cfg_buffer_size - local cfg_buffer_messages - local cfg_buffer_time - local cfg_nice_increment - local cfg_mcsub_renew - - config_get_bool cfg_verbose $cfg 'verbose' 0 - config_get_bool cfg_status $cfg 'status' 1 - config_get cfg_bind $cfg 'bind' - config_get cfg_port $cfg 'port' '4022' - config_get cfg_source $cfg 'source' - config_get cfg_max_clients $cfg 'max_clients' - config_get cfg_log_file $cfg 'log_file' - config_get cfg_buffer_size $cfg 'buffer_size' - config_get cfg_buffer_messages $cfg 'buffer_messages' - config_get cfg_buffer_time $cfg 'buffer_time' - config_get cfg_nice_increment $cfg 'nice_increment' - config_get cfg_mcsub_renew $cfg 'mcsub_renew' + config_get val "$cfg" "$var" + [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}" +} + +append_bool() { + local cfg="$1" + local var="$2" + local opt="$3" + local def="$4" + local val + + config_get_bool val "$cfg" "$var" "$def" + [ "$val" = 1 ] && procd_append_param command "$opt" +} + +start_instance() { + local cfg="$1" + local aux + + config_get_bool aux "$cfg" 'disabled' '0' + [ "$aux" = 1 ] && return 1 procd_open_instance procd_set_param command /usr/bin/udpxy - procd_append_param command -T -p $cfg_port - [ "$cfg_verbose" -eq 1 ] && procd_append_param command -v - [ "$cfg_status" -eq 1 ] && procd_append_param command -S - [ ! -z "$cfg_bind" ] && procd_append_param command -a $cfg_bind - [ ! -z "$cfg_source" ] && procd_append_param command -m $cfg_source - [ ! -z "$cfg_max_clients" ] && procd_append_param command -c $cfg_max_clients - [ ! -z "$cfg_log_file" ] && procd_append_param command -l $cfg_log_file - [ ! -z "$cfg_buffer_size" ] && procd_append_param command -B $cfg_buffer_size - [ ! -z "$cfg_buffer_messages" ] && procd_append_param command -R $cfg_buffer_messages - [ ! -z "$cfg_buffer_time" ] && procd_append_param command -H $cfg_buffer_time - [ ! -z "$cfg_nice_increment" ] && procd_append_param command -n $cfg_nice_increment - [ ! -z "$cfg_mcsub_renew" ] && procd_append_param command -M $cfg_mcsub_renew - - procd_set_param respawn + procd_append_param command "-T" + + append_bool "$cfg" verbose "-V" + append_bool "$cfg" status "-S" + append_arg "$cfg" bind "-a" + append_arg "$cfg" port "-p" + append_arg "$cfg" source "-m" + append_arg "$cfg" max_clients "-c" + append_arg "$cfg" log_file "-l" + append_arg "$cfg" buffer_size "-B" + append_arg "$cfg" buffer_messages "-R" + append_arg "$cfg" buffer_time "-H" + append_arg "$cfg" nice_increment "-n" + append_arg "$cfg" mcsub_renew "-M" + + config_get_bool aux "$cfg" 'respawn' '0' + [ "$aux" = 1 ] && procd_set_param respawn + procd_close_instance } +service_triggers() { + procd_add_reload_trigger "udpxy" +} + start_service() { config_load udpxy - config_foreach udpxy_parse udpxy + config_foreach start_instance udpxy } diff --git a/net/wget/Makefile b/net/wget/Makefile index c03dffcb3..cb6230ad4 100644 --- a/net/wget/Makefile +++ b/net/wget/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2007-2011 OpenWrt.org +# Copyright (C) 2007-2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wget -PKG_VERSION:=1.15 +PKG_VERSION:=1.16 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_MD5SUM:=7a279d5ac5594919124d5526e7143e28 +PKG_MD5SUM:=fe102975ab3a6c049777883f1bb9ad07 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com> PKG_LICENSE:=GPL-3.0+ diff --git a/sound/espeak/Makefile b/sound/espeak/Makefile new file mode 100644 index 000000000..fd06c6efc --- /dev/null +++ b/sound/espeak/Makefile @@ -0,0 +1,57 @@ +# +# 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:=espeak +PKG_VERSION:=1.48.04 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-source.zip +PKG_SOURCE_URL:=@SF/espeak +PKG_MD5SUM:=cadd7482eaafe9239546bdc09fa244c3 + +PKG_LICENSE:=GPL-3.0 +PKG_LICENSE_FILES:=License.txt +PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org> + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-source +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/espeak + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+libpthread +libstdcpp +portaudio + TITLE:=Speech synthesizer + URL:=http://espeak.sourceforge.net/ +endef + +define Package/espeak/description + eSpeak is a compact open source software speech synthesizer for English and + other languages. +endef + +MAKE_FLAGS+= \ + AUDIO="portaudio" \ + DATADIR="/usr/share/espeak" \ + CXXFLAGS="$(TARGET_CFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" \ + +MAKE_PATH:=./src + +define Package/espeak/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/espeak $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libespeak.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/share + $(CP) $(PKG_INSTALL_DIR)/usr/share/espeak $(1)/usr/share/ +endef + +$(eval $(call BuildPackage,espeak)) diff --git a/sound/espeak/patches/101-portaudio.patch b/sound/espeak/patches/101-portaudio.patch new file mode 100644 index 000000000..ff396b3a3 --- /dev/null +++ b/sound/espeak/patches/101-portaudio.patch @@ -0,0 +1,2093 @@ +--- a/src/portaudio.h ++++ /dev/null +@@ -1,466 +0,0 @@ +-// NOTE: Copy this file to portaudio.h in order to compile with V18 portaudio +- +- +-#ifndef PORT_AUDIO_H +-#define PORT_AUDIO_H +- +-#ifdef __cplusplus +-extern "C" +-{ +-#endif /* __cplusplus */ +- +-/* +- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $ +- * PortAudio Portable Real-Time Audio Library +- * PortAudio API Header File +- * Latest version available at: http://www.audiomulch.com/portaudio/ +- * +- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk +- * +- * Permission is hereby granted, free of charge, to any person obtaining +- * a copy of this software and associated documentation files +- * (the "Software"), to deal in the Software without restriction, +- * including without limitation the rights to use, copy, modify, merge, +- * publish, distribute, sublicense, and/or sell copies of the Software, +- * and to permit persons to whom the Software is furnished to do so, +- * subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be +- * included in all copies or substantial portions of the Software. +- * +- * Any person wishing to distribute modifications to the Software is +- * requested to send the modifications to the original developer so that +- * they can be incorporated into the canonical version. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- * +- */ +- +-typedef int PaError; +-typedef enum { +- paNoError = 0, +- +- paHostError = -10000, +- paInvalidChannelCount, +- paInvalidSampleRate, +- paInvalidDeviceId, +- paInvalidFlag, +- paSampleFormatNotSupported, +- paBadIODeviceCombination, +- paInsufficientMemory, +- paBufferTooBig, +- paBufferTooSmall, +- paNullCallback, +- paBadStreamPtr, +- paTimedOut, +- paInternalError, +- paDeviceUnavailable +-} PaErrorNum; +- +-/* +- Pa_Initialize() is the library initialisation function - call this before +- using the library. +- +-*/ +- +-PaError Pa_Initialize( void ); +- +-/* +- Pa_Terminate() is the library termination function - call this after +- using the library. +- +-*/ +- +-PaError Pa_Terminate( void ); +- +-/* +- Pa_GetHostError() returns a host specific error code. +- This can be called after receiving a PortAudio error code of paHostError. +- +-*/ +- +-long Pa_GetHostError( void ); +- +-/* +- Pa_GetErrorText() translates the supplied PortAudio error number +- into a human readable message. +- +-*/ +- +-const char *Pa_GetErrorText( PaError errnum ); +- +-/* +- Sample formats +- +- These are formats used to pass sound data between the callback and the +- stream. Each device has a "native" format which may be used when optimum +- efficiency or control over conversion is required. +- +- Formats marked "always available" are supported (emulated) by all +- PortAudio implementations. +- +- The floating point representation (paFloat32) uses +1.0 and -1.0 as the +- maximum and minimum respectively. +- +- paUInt8 is an unsigned 8 bit format where 128 is considered "ground" +- +-*/ +- +-typedef unsigned long PaSampleFormat; +-#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ +-#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ +-#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ +-#define paInt24 ((PaSampleFormat) (1<<3)) +-#define paPackedInt24 ((PaSampleFormat) (1<<4)) +-#define paInt8 ((PaSampleFormat) (1<<5)) +-#define paUInt8 ((PaSampleFormat) (1<<6)) +-#define paCustomFormat ((PaSampleFormat) (1<<16)) +- +-/* +- Device enumeration mechanism. +- +- Device ids range from 0 to Pa_CountDevices()-1. +- +- Devices may support input, output or both. +- +-*/ +- +-typedef int PaDeviceID; +-#define paNoDevice -1 +- +-int Pa_CountDevices( void ); +- +-typedef struct +-{ +- int structVersion; +- const char *name; +- int maxInputChannels; +- int maxOutputChannels; +- /* Number of discrete rates, or -1 if range supported. */ +- int numSampleRates; +- /* Array of supported sample rates, or {min,max} if range supported. */ +- const double *sampleRates; +- PaSampleFormat nativeSampleFormats; +-} +-PaDeviceInfo; +- +-/* +- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the +- default device ids for input and output respectively, or paNoDevice if +- no device is available. +- The result can be passed to Pa_OpenStream(). +- +- On the PC, the user can specify a default device by +- setting an environment variable. For example, to use device #1. +- +- set PA_RECOMMENDED_OUTPUT_DEVICE=1 +- +- The user should first determine the available device ids by using +- the supplied application "pa_devs". +- +-*/ +- +-PaDeviceID Pa_GetDefaultInputDeviceID( void ); +-PaDeviceID Pa_GetDefaultOutputDeviceID( void ); +- +- +- +-/* +- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure +- for the device specified. +- If the device parameter is out of range the function returns NULL. +- +- PortAudio manages the memory referenced by the returned pointer, the client +- must not manipulate or free the memory. The pointer is only guaranteed to be +- valid between calls to Pa_Initialize() and Pa_Terminate(). +- +-*/ +- +-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device ); +- +-/* +- PaTimestamp is used to represent a continuous sample clock with arbitrary +- start time that can be used for syncronization. The type is used for the +- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime() +- +-*/ +- +-typedef double PaTimestamp; +- +-/* +- PortAudioCallback is implemented by PortAudio clients. +- +- inputBuffer and outputBuffer are arrays of interleaved samples, +- the format, packing and number of channels used by the buffers are +- determined by parameters to Pa_OpenStream() (see below). +- +- framesPerBuffer is the number of sample frames to be processed by the callback. +- +- outTime is the time in samples when the buffer(s) processed by +- this callback will begin being played at the audio output. +- See also Pa_StreamTime() +- +- userData is the value of a user supplied pointer passed to Pa_OpenStream() +- intended for storing synthesis data etc. +- +- return value: +- The callback can return a non-zero value to stop the stream. This may be +- useful in applications such as soundfile players where a specific duration +- of output is required. However, it is not necessary to utilise this mechanism +- as StopStream() will also terminate the stream. A callback returning a +- non-zero value must fill the entire outputBuffer. +- +- NOTE: None of the other stream functions may be called from within the +- callback function except for Pa_GetCPULoad(). +- +-*/ +- +-typedef int (PortAudioCallback)( +- void *inputBuffer, void *outputBuffer, +- unsigned long framesPerBuffer, +- PaTimestamp outTime, void *userData ); +- +- +-/* +- Stream flags +- +- These flags may be supplied (ored together) in the streamFlags argument to +- the Pa_OpenStream() function. +- +-*/ +- +-#define paNoFlag (0) +-#define paClipOff (1<<0) /* disable default clipping of out of range samples */ +-#define paDitherOff (1<<1) /* disable default dithering */ +-#define paPlatformSpecificFlags (0x00010000) +-typedef unsigned long PaStreamFlags; +- +-/* +- A single PortAudioStream provides multiple channels of real-time +- input and output audio streaming to a client application. +- Pointers to PortAudioStream objects are passed between PortAudio functions. +-*/ +- +-typedef void PortAudioStream; +-#define PaStream PortAudioStream +- +-/* +- Pa_OpenStream() opens a stream for either input, output or both. +- +- stream is the address of a PortAudioStream pointer which will receive +- a pointer to the newly opened stream. +- +- inputDevice is the id of the device used for input (see PaDeviceID above.) +- inputDevice may be paNoDevice to indicate that an input device is not required. +- +- numInputChannels is the number of channels of sound to be delivered to the +- callback. It can range from 1 to the value of maxInputChannels in the +- PaDeviceInfo record for the device specified by the inputDevice parameter. +- If inputDevice is paNoDevice numInputChannels is ignored. +- +- inputSampleFormat is the sample format of inputBuffer provided to the callback +- function. inputSampleFormat may be any of the formats described by the +- PaSampleFormat enumeration (see above). PortAudio guarantees support for +- the device's native formats (nativeSampleFormats in the device info record) +- and additionally 16 and 32 bit integer and 32 bit floating point formats. +- Support for other formats is implementation defined. +- +- inputDriverInfo is a pointer to an optional driver specific data structure +- containing additional information for device setup or stream processing. +- inputDriverInfo is never required for correct operation. If not used +- inputDriverInfo should be NULL. +- +- outputDevice is the id of the device used for output (see PaDeviceID above.) +- outputDevice may be paNoDevice to indicate that an output device is not required. +- +- numOutputChannels is the number of channels of sound to be supplied by the +- callback. See the definition of numInputChannels above for more details. +- +- outputSampleFormat is the sample format of the outputBuffer filled by the +- callback function. See the definition of inputSampleFormat above for more +- details. +- +- outputDriverInfo is a pointer to an optional driver specific data structure +- containing additional information for device setup or stream processing. +- outputDriverInfo is never required for correct operation. If not used +- outputDriverInfo should be NULL. +- +- sampleRate is the desired sampleRate. For full-duplex streams it is the +- sample rate for both input and output +- +- framesPerBuffer is the length in sample frames of all internal sample buffers +- used for communication with platform specific audio routines. Wherever +- possible this corresponds to the framesPerBuffer parameter passed to the +- callback function. +- +- numberOfBuffers is the number of buffers used for multibuffered communication +- with the platform specific audio routines. If you pass zero, then an optimum +- value will be chosen for you internally. This parameter is provided only +- as a guide - and does not imply that an implementation must use multibuffered +- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer() +- on the Macintosh.) +- +- streamFlags may contain a combination of flags ORed together. +- These flags modify the behaviour of the streaming process. Some flags may only +- be relevant to certain buffer formats. +- +- callback is a pointer to a client supplied function that is responsible +- for processing and filling input and output buffers (see above for details.) +- +- userData is a client supplied pointer which is passed to the callback +- function. It could for example, contain a pointer to instance data necessary +- for processing the audio buffers. +- +- return value: +- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a +- valid PortAudioStream in the stream argument. The stream is inactive (stopped). +- If a call to Pa_OpenStream() fails a non-zero error code is returned (see +- PaError above) and the value of stream is invalid. +- +-*/ +- +-PaError Pa_OpenStream( PortAudioStream** stream, +- PaDeviceID inputDevice, +- int numInputChannels, +- PaSampleFormat inputSampleFormat, +- void *inputDriverInfo, +- PaDeviceID outputDevice, +- int numOutputChannels, +- PaSampleFormat outputSampleFormat, +- void *outputDriverInfo, +- double sampleRate, +- unsigned long framesPerBuffer, +- unsigned long numberOfBuffers, +- PaStreamFlags streamFlags, +- PortAudioCallback *callback, +- void *userData ); +- +- +-/* +- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens +- the default input and/or output devices. Most parameters have identical meaning +- to their Pa_OpenStream() counterparts, with the following exceptions: +- +- If either numInputChannels or numOutputChannels is 0 the respective device +- is not opened. This has the same effect as passing paNoDevice in the device +- arguments to Pa_OpenStream(). +- +- sampleFormat applies to both the input and output buffers. +- +-*/ +- +-PaError Pa_OpenDefaultStream( PortAudioStream** stream, +- int numInputChannels, +- int numOutputChannels, +- PaSampleFormat sampleFormat, +- double sampleRate, +- unsigned long framesPerBuffer, +- unsigned long numberOfBuffers, +- PortAudioCallback *callback, +- void *userData ); +- +-/* +- Pa_CloseStream() closes an audio stream, flushing any pending buffers. +- +-*/ +- +-PaError Pa_CloseStream( PortAudioStream* ); +- +-/* +- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing. +- Pa_StopStream() waits until all pending audio buffers have been played. +- Pa_AbortStream() stops playing immediately without waiting for pending +- buffers to complete. +- +-*/ +- +-PaError Pa_StartStream( PortAudioStream *stream ); +- +-PaError Pa_StopStream( PortAudioStream *stream ); +- +-PaError Pa_AbortStream( PortAudioStream *stream ); +- +-/* +- Pa_StreamActive() returns one (1) when the stream is active (ie playing +- or recording audio), zero (0) when not playing, or a negative error number +- if the stream is invalid. +- The stream is active between calls to Pa_StartStream() and Pa_StopStream(), +- but may also become inactive if the callback returns a non-zero value. +- In the latter case, the stream is considered inactive after the last +- buffer has finished playing. +- +-*/ +- +-PaError Pa_StreamActive( PortAudioStream *stream ); +- +-/* +- Pa_StreamTime() returns the current output time in samples for the stream. +- This time may be used as a time reference (for example synchronizing audio to +- MIDI). +- +-*/ +- +-PaTimestamp Pa_StreamTime( PortAudioStream *stream ); +- +-/* +- Pa_GetCPULoad() returns the CPU Load for the stream. +- The "CPU Load" is a fraction of total CPU time consumed by the stream's +- audio processing routines including, but not limited to the client supplied +- callback. +- A value of 0.5 would imply that PortAudio and the sound generating +- callback was consuming roughly 50% of the available CPU time. +- This function may be called from the callback function or the application. +- +-*/ +- +-double Pa_GetCPULoad( PortAudioStream* stream ); +- +-/* +- Pa_GetMinNumBuffers() returns the minimum number of buffers required by +- the current host based on minimum latency. +- On the PC, for the DirectSound implementation, latency can be optionally set +- by user by setting an environment variable. +- For example, to set latency to 200 msec, put: +- +- set PA_MIN_LATENCY_MSEC=200 +- +- in the AUTOEXEC.BAT file and reboot. +- If the environment variable is not set, then the latency will be determined +- based on the OS. Windows NT has higher latency than Win95. +- +-*/ +- +-int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate ); +- +-/* +- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds. +- You may sleep longer than the requested time so don't rely on this for +- accurate musical timing. +- +- Pa_Sleep() is provided as a convenience for authors of portable code (such as +- the tests and examples in the PortAudio distribution.) +- +-*/ +- +-void Pa_Sleep( long msec ); +- +-/* +- Pa_GetSampleSize() returns the size in bytes of a single sample in the +- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is +- no supported. +- +-*/ +- +-PaError Pa_GetSampleSize( PaSampleFormat format ); +- +- +-#ifdef __cplusplus +-} +-#endif /* __cplusplus */ +-#endif /* PORT_AUDIO_H */ +--- a/src/portaudio18.h ++++ /dev/null +@@ -1,466 +0,0 @@ +-// NOTE: Copy this file to portaudio.h in order to compile with V18 portaudio +- +- +-#ifndef PORT_AUDIO_H +-#define PORT_AUDIO_H +- +-#ifdef __cplusplus +-extern "C" +-{ +-#endif /* __cplusplus */ +- +-/* +- * $Id: portaudio.h,v 1.5 2002/03/26 18:04:22 philburk Exp $ +- * PortAudio Portable Real-Time Audio Library +- * PortAudio API Header File +- * Latest version available at: http://www.audiomulch.com/portaudio/ +- * +- * Copyright (c) 1999-2000 Ross Bencina and Phil Burk +- * +- * Permission is hereby granted, free of charge, to any person obtaining +- * a copy of this software and associated documentation files +- * (the "Software"), to deal in the Software without restriction, +- * including without limitation the rights to use, copy, modify, merge, +- * publish, distribute, sublicense, and/or sell copies of the Software, +- * and to permit persons to whom the Software is furnished to do so, +- * subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be +- * included in all copies or substantial portions of the Software. +- * +- * Any person wishing to distribute modifications to the Software is +- * requested to send the modifications to the original developer so that +- * they can be incorporated into the canonical version. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- * +- */ +- +-typedef int PaError; +-typedef enum { +- paNoError = 0, +- +- paHostError = -10000, +- paInvalidChannelCount, +- paInvalidSampleRate, +- paInvalidDeviceId, +- paInvalidFlag, +- paSampleFormatNotSupported, +- paBadIODeviceCombination, +- paInsufficientMemory, +- paBufferTooBig, +- paBufferTooSmall, +- paNullCallback, +- paBadStreamPtr, +- paTimedOut, +- paInternalError, +- paDeviceUnavailable +-} PaErrorNum; +- +-/* +- Pa_Initialize() is the library initialisation function - call this before +- using the library. +- +-*/ +- +-PaError Pa_Initialize( void ); +- +-/* +- Pa_Terminate() is the library termination function - call this after +- using the library. +- +-*/ +- +-PaError Pa_Terminate( void ); +- +-/* +- Pa_GetHostError() returns a host specific error code. +- This can be called after receiving a PortAudio error code of paHostError. +- +-*/ +- +-long Pa_GetHostError( void ); +- +-/* +- Pa_GetErrorText() translates the supplied PortAudio error number +- into a human readable message. +- +-*/ +- +-const char *Pa_GetErrorText( PaError errnum ); +- +-/* +- Sample formats +- +- These are formats used to pass sound data between the callback and the +- stream. Each device has a "native" format which may be used when optimum +- efficiency or control over conversion is required. +- +- Formats marked "always available" are supported (emulated) by all +- PortAudio implementations. +- +- The floating point representation (paFloat32) uses +1.0 and -1.0 as the +- maximum and minimum respectively. +- +- paUInt8 is an unsigned 8 bit format where 128 is considered "ground" +- +-*/ +- +-typedef unsigned long PaSampleFormat; +-#define paFloat32 ((PaSampleFormat) (1<<0)) /*always available*/ +-#define paInt16 ((PaSampleFormat) (1<<1)) /*always available*/ +-#define paInt32 ((PaSampleFormat) (1<<2)) /*always available*/ +-#define paInt24 ((PaSampleFormat) (1<<3)) +-#define paPackedInt24 ((PaSampleFormat) (1<<4)) +-#define paInt8 ((PaSampleFormat) (1<<5)) +-#define paUInt8 ((PaSampleFormat) (1<<6)) +-#define paCustomFormat ((PaSampleFormat) (1<<16)) +- +-/* +- Device enumeration mechanism. +- +- Device ids range from 0 to Pa_CountDevices()-1. +- +- Devices may support input, output or both. +- +-*/ +- +-typedef int PaDeviceID; +-#define paNoDevice -1 +- +-int Pa_CountDevices( void ); +- +-typedef struct +-{ +- int structVersion; +- const char *name; +- int maxInputChannels; +- int maxOutputChannels; +- /* Number of discrete rates, or -1 if range supported. */ +- int numSampleRates; +- /* Array of supported sample rates, or {min,max} if range supported. */ +- const double *sampleRates; +- PaSampleFormat nativeSampleFormats; +-} +-PaDeviceInfo; +- +-/* +- Pa_GetDefaultInputDeviceID(), Pa_GetDefaultOutputDeviceID() return the +- default device ids for input and output respectively, or paNoDevice if +- no device is available. +- The result can be passed to Pa_OpenStream(). +- +- On the PC, the user can specify a default device by +- setting an environment variable. For example, to use device #1. +- +- set PA_RECOMMENDED_OUTPUT_DEVICE=1 +- +- The user should first determine the available device ids by using +- the supplied application "pa_devs". +- +-*/ +- +-PaDeviceID Pa_GetDefaultInputDeviceID( void ); +-PaDeviceID Pa_GetDefaultOutputDeviceID( void ); +- +- +- +-/* +- Pa_GetDeviceInfo() returns a pointer to an immutable PaDeviceInfo structure +- for the device specified. +- If the device parameter is out of range the function returns NULL. +- +- PortAudio manages the memory referenced by the returned pointer, the client +- must not manipulate or free the memory. The pointer is only guaranteed to be +- valid between calls to Pa_Initialize() and Pa_Terminate(). +- +-*/ +- +-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceID device ); +- +-/* +- PaTimestamp is used to represent a continuous sample clock with arbitrary +- start time that can be used for syncronization. The type is used for the +- outTime argument to the PortAudioCallback and as the result of Pa_StreamTime() +- +-*/ +- +-typedef double PaTimestamp; +- +-/* +- PortAudioCallback is implemented by PortAudio clients. +- +- inputBuffer and outputBuffer are arrays of interleaved samples, +- the format, packing and number of channels used by the buffers are +- determined by parameters to Pa_OpenStream() (see below). +- +- framesPerBuffer is the number of sample frames to be processed by the callback. +- +- outTime is the time in samples when the buffer(s) processed by +- this callback will begin being played at the audio output. +- See also Pa_StreamTime() +- +- userData is the value of a user supplied pointer passed to Pa_OpenStream() +- intended for storing synthesis data etc. +- +- return value: +- The callback can return a non-zero value to stop the stream. This may be +- useful in applications such as soundfile players where a specific duration +- of output is required. However, it is not necessary to utilise this mechanism +- as StopStream() will also terminate the stream. A callback returning a +- non-zero value must fill the entire outputBuffer. +- +- NOTE: None of the other stream functions may be called from within the +- callback function except for Pa_GetCPULoad(). +- +-*/ +- +-typedef int (PortAudioCallback)( +- void *inputBuffer, void *outputBuffer, +- unsigned long framesPerBuffer, +- PaTimestamp outTime, void *userData ); +- +- +-/* +- Stream flags +- +- These flags may be supplied (ored together) in the streamFlags argument to +- the Pa_OpenStream() function. +- +-*/ +- +-#define paNoFlag (0) +-#define paClipOff (1<<0) /* disable default clipping of out of range samples */ +-#define paDitherOff (1<<1) /* disable default dithering */ +-#define paPlatformSpecificFlags (0x00010000) +-typedef unsigned long PaStreamFlags; +- +-/* +- A single PortAudioStream provides multiple channels of real-time +- input and output audio streaming to a client application. +- Pointers to PortAudioStream objects are passed between PortAudio functions. +-*/ +- +-typedef void PortAudioStream; +-#define PaStream PortAudioStream +- +-/* +- Pa_OpenStream() opens a stream for either input, output or both. +- +- stream is the address of a PortAudioStream pointer which will receive +- a pointer to the newly opened stream. +- +- inputDevice is the id of the device used for input (see PaDeviceID above.) +- inputDevice may be paNoDevice to indicate that an input device is not required. +- +- numInputChannels is the number of channels of sound to be delivered to the +- callback. It can range from 1 to the value of maxInputChannels in the +- PaDeviceInfo record for the device specified by the inputDevice parameter. +- If inputDevice is paNoDevice numInputChannels is ignored. +- +- inputSampleFormat is the sample format of inputBuffer provided to the callback +- function. inputSampleFormat may be any of the formats described by the +- PaSampleFormat enumeration (see above). PortAudio guarantees support for +- the device's native formats (nativeSampleFormats in the device info record) +- and additionally 16 and 32 bit integer and 32 bit floating point formats. +- Support for other formats is implementation defined. +- +- inputDriverInfo is a pointer to an optional driver specific data structure +- containing additional information for device setup or stream processing. +- inputDriverInfo is never required for correct operation. If not used +- inputDriverInfo should be NULL. +- +- outputDevice is the id of the device used for output (see PaDeviceID above.) +- outputDevice may be paNoDevice to indicate that an output device is not required. +- +- numOutputChannels is the number of channels of sound to be supplied by the +- callback. See the definition of numInputChannels above for more details. +- +- outputSampleFormat is the sample format of the outputBuffer filled by the +- callback function. See the definition of inputSampleFormat above for more +- details. +- +- outputDriverInfo is a pointer to an optional driver specific data structure +- containing additional information for device setup or stream processing. +- outputDriverInfo is never required for correct operation. If not used +- outputDriverInfo should be NULL. +- +- sampleRate is the desired sampleRate. For full-duplex streams it is the +- sample rate for both input and output +- +- framesPerBuffer is the length in sample frames of all internal sample buffers +- used for communication with platform specific audio routines. Wherever +- possible this corresponds to the framesPerBuffer parameter passed to the +- callback function. +- +- numberOfBuffers is the number of buffers used for multibuffered communication +- with the platform specific audio routines. If you pass zero, then an optimum +- value will be chosen for you internally. This parameter is provided only +- as a guide - and does not imply that an implementation must use multibuffered +- i/o when reliable double buffering is available (such as SndPlayDoubleBuffer() +- on the Macintosh.) +- +- streamFlags may contain a combination of flags ORed together. +- These flags modify the behaviour of the streaming process. Some flags may only +- be relevant to certain buffer formats. +- +- callback is a pointer to a client supplied function that is responsible +- for processing and filling input and output buffers (see above for details.) +- +- userData is a client supplied pointer which is passed to the callback +- function. It could for example, contain a pointer to instance data necessary +- for processing the audio buffers. +- +- return value: +- Upon success Pa_OpenStream() returns PaNoError and places a pointer to a +- valid PortAudioStream in the stream argument. The stream is inactive (stopped). +- If a call to Pa_OpenStream() fails a non-zero error code is returned (see +- PaError above) and the value of stream is invalid. +- +-*/ +- +-PaError Pa_OpenStream( PortAudioStream** stream, +- PaDeviceID inputDevice, +- int numInputChannels, +- PaSampleFormat inputSampleFormat, +- void *inputDriverInfo, +- PaDeviceID outputDevice, +- int numOutputChannels, +- PaSampleFormat outputSampleFormat, +- void *outputDriverInfo, +- double sampleRate, +- unsigned long framesPerBuffer, +- unsigned long numberOfBuffers, +- PaStreamFlags streamFlags, +- PortAudioCallback *callback, +- void *userData ); +- +- +-/* +- Pa_OpenDefaultStream() is a simplified version of Pa_OpenStream() that opens +- the default input and/or output devices. Most parameters have identical meaning +- to their Pa_OpenStream() counterparts, with the following exceptions: +- +- If either numInputChannels or numOutputChannels is 0 the respective device +- is not opened. This has the same effect as passing paNoDevice in the device +- arguments to Pa_OpenStream(). +- +- sampleFormat applies to both the input and output buffers. +- +-*/ +- +-PaError Pa_OpenDefaultStream( PortAudioStream** stream, +- int numInputChannels, +- int numOutputChannels, +- PaSampleFormat sampleFormat, +- double sampleRate, +- unsigned long framesPerBuffer, +- unsigned long numberOfBuffers, +- PortAudioCallback *callback, +- void *userData ); +- +-/* +- Pa_CloseStream() closes an audio stream, flushing any pending buffers. +- +-*/ +- +-PaError Pa_CloseStream( PortAudioStream* ); +- +-/* +- Pa_StartStream() and Pa_StopStream() begin and terminate audio processing. +- Pa_StopStream() waits until all pending audio buffers have been played. +- Pa_AbortStream() stops playing immediately without waiting for pending +- buffers to complete. +- +-*/ +- +-PaError Pa_StartStream( PortAudioStream *stream ); +- +-PaError Pa_StopStream( PortAudioStream *stream ); +- +-PaError Pa_AbortStream( PortAudioStream *stream ); +- +-/* +- Pa_StreamActive() returns one (1) when the stream is active (ie playing +- or recording audio), zero (0) when not playing, or a negative error number +- if the stream is invalid. +- The stream is active between calls to Pa_StartStream() and Pa_StopStream(), +- but may also become inactive if the callback returns a non-zero value. +- In the latter case, the stream is considered inactive after the last +- buffer has finished playing. +- +-*/ +- +-PaError Pa_StreamActive( PortAudioStream *stream ); +- +-/* +- Pa_StreamTime() returns the current output time in samples for the stream. +- This time may be used as a time reference (for example synchronizing audio to +- MIDI). +- +-*/ +- +-PaTimestamp Pa_StreamTime( PortAudioStream *stream ); +- +-/* +- Pa_GetCPULoad() returns the CPU Load for the stream. +- The "CPU Load" is a fraction of total CPU time consumed by the stream's +- audio processing routines including, but not limited to the client supplied +- callback. +- A value of 0.5 would imply that PortAudio and the sound generating +- callback was consuming roughly 50% of the available CPU time. +- This function may be called from the callback function or the application. +- +-*/ +- +-double Pa_GetCPULoad( PortAudioStream* stream ); +- +-/* +- Pa_GetMinNumBuffers() returns the minimum number of buffers required by +- the current host based on minimum latency. +- On the PC, for the DirectSound implementation, latency can be optionally set +- by user by setting an environment variable. +- For example, to set latency to 200 msec, put: +- +- set PA_MIN_LATENCY_MSEC=200 +- +- in the AUTOEXEC.BAT file and reboot. +- If the environment variable is not set, then the latency will be determined +- based on the OS. Windows NT has higher latency than Win95. +- +-*/ +- +-int Pa_GetMinNumBuffers( int framesPerBuffer, double sampleRate ); +- +-/* +- Pa_Sleep() puts the caller to sleep for at least 'msec' milliseconds. +- You may sleep longer than the requested time so don't rely on this for +- accurate musical timing. +- +- Pa_Sleep() is provided as a convenience for authors of portable code (such as +- the tests and examples in the PortAudio distribution.) +- +-*/ +- +-void Pa_Sleep( long msec ); +- +-/* +- Pa_GetSampleSize() returns the size in bytes of a single sample in the +- supplied PaSampleFormat, or paSampleFormatNotSupported if the format is +- no supported. +- +-*/ +- +-PaError Pa_GetSampleSize( PaSampleFormat format ); +- +- +-#ifdef __cplusplus +-} +-#endif /* __cplusplus */ +-#endif /* PORT_AUDIO_H */ +--- a/src/portaudio19.h ++++ /dev/null +@@ -1,1127 +0,0 @@ +-// NOTE: Copy this file to portaudio.h in order to compile with V19 portaudio +- +-#ifndef PORTAUDIO_H +-#define PORTAUDIO_H +-/* +- * $Id: portaudio.h 1061 2006-06-19 22:46:41Z lschwardt $ +- * PortAudio Portable Real-Time Audio Library +- * PortAudio API Header File +- * Latest version available at: http://www.portaudio.com/ +- * +- * Copyright (c) 1999-2002 Ross Bencina and Phil Burk +- * +- * Permission is hereby granted, free of charge, to any person obtaining +- * a copy of this software and associated documentation files +- * (the "Software"), to deal in the Software without restriction, +- * including without limitation the rights to use, copy, modify, merge, +- * publish, distribute, sublicense, and/or sell copies of the Software, +- * and to permit persons to whom the Software is furnished to do so, +- * subject to the following conditions: +- * +- * The above copyright notice and this permission notice shall be +- * included in all copies or substantial portions of the Software. +- * +- * Any person wishing to distribute modifications to the Software is +- * requested to send the modifications to the original developer so that +- * they can be incorporated into the canonical version. +- * +- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +- * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +- */ +- +-/** @file +- @brief The PortAudio API. +-*/ +- +- +-#ifdef __cplusplus +-extern "C" +-{ +-#endif /* __cplusplus */ +- +- +-/** Retrieve the release number of the currently running PortAudio build, +- eg 1900. +-*/ +-int Pa_GetVersion( void ); +- +- +-/** Retrieve a textual description of the current PortAudio build, +- eg "PortAudio V19-devel 13 October 2002". +-*/ +-const char* Pa_GetVersionText( void ); +- +- +-/** Error codes returned by PortAudio functions. +- Note that with the exception of paNoError, all PaErrorCodes are negative. +-*/ +- +-typedef int PaError; +-typedef enum PaErrorCode +-{ +- paNoError = 0, +- +- paNotInitialized = -10000, +- paUnanticipatedHostError, +- paInvalidChannelCount, +- paInvalidSampleRate, +- paInvalidDevice, +- paInvalidFlag, +- paSampleFormatNotSupported, +- paBadIODeviceCombination, +- paInsufficientMemory, +- paBufferTooBig, +- paBufferTooSmall, +- paNullCallback, +- paBadStreamPtr, +- paTimedOut, +- paInternalError, +- paDeviceUnavailable, +- paIncompatibleHostApiSpecificStreamInfo, +- paStreamIsStopped, +- paStreamIsNotStopped, +- paInputOverflowed, +- paOutputUnderflowed, +- paHostApiNotFound, +- paInvalidHostApi, +- paCanNotReadFromACallbackStream, /**< @todo review error code name */ +- paCanNotWriteToACallbackStream, /**< @todo review error code name */ +- paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ +- paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ +- paIncompatibleStreamHostApi, +- paBadBufferPtr +-} PaErrorCode; +- +- +-/** Translate the supplied PortAudio error code into a human readable +- message. +-*/ +-const char *Pa_GetErrorText( PaError errorCode ); +- +- +-/** Library initialization function - call this before using PortAudio. +- This function initialises internal data structures and prepares underlying +- host APIs for use. This function MUST be called before using any other +- PortAudio API functions. +- +- If Pa_Initialize() is called multiple times, each successful +- call must be matched with a corresponding call to Pa_Terminate(). +- Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not +- required to be fully nested. +- +- Note that if Pa_Initialize() returns an error code, Pa_Terminate() should +- NOT be called. +- +- @return paNoError if successful, otherwise an error code indicating the cause +- of failure. +- +- @see Pa_Terminate +-*/ +-PaError Pa_Initialize( void ); +- +- +-/** Library termination function - call this when finished using PortAudio. +- This function deallocates all resources allocated by PortAudio since it was +- initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has +- been called multiple times, each call must be matched with a corresponding call +- to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically +- close any PortAudio streams that are still open. +- +- Pa_Terminate() MUST be called before exiting a program which uses PortAudio. +- Failure to do so may result in serious resource leaks, such as audio devices +- not being available until the next reboot. +- +- @return paNoError if successful, otherwise an error code indicating the cause +- of failure. +- +- @see Pa_Initialize +-*/ +-PaError Pa_Terminate( void ); +- +- +- +-/** The type used to refer to audio devices. Values of this type usually +- range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice +- and paUseHostApiSpecificDeviceSpecification values. +- +- @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification +-*/ +-typedef int PaDeviceIndex; +- +- +-/** A special PaDeviceIndex value indicating that no device is available, +- or should be used. +- +- @see PaDeviceIndex +-*/ +-#define paNoDevice ((PaDeviceIndex)-1) +- +- +-/** A special PaDeviceIndex value indicating that the device(s) to be used +- are specified in the host api specific stream info structure. +- +- @see PaDeviceIndex +-*/ +-#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) +- +- +-/* Host API enumeration mechanism */ +- +-/** The type used to enumerate to host APIs at runtime. Values of this type +- range from 0 to (Pa_GetHostApiCount()-1). +- +- @see Pa_GetHostApiCount +-*/ +-typedef int PaHostApiIndex; +- +- +-/** Retrieve the number of available host APIs. Even if a host API is +- available it may have no devices available. +- +- @return A non-negative value indicating the number of available host APIs +- or, a PaErrorCode (which are always negative) if PortAudio is not initialized +- or an error is encountered. +- +- @see PaHostApiIndex +-*/ +-PaHostApiIndex Pa_GetHostApiCount( void ); +- +- +-/** Retrieve the index of the default host API. The default host API will be +- the lowest common denominator host API on the current platform and is +- unlikely to provide the best performance. +- +- @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) +- indicating the default host API index or, a PaErrorCode (which are always +- negative) if PortAudio is not initialized or an error is encountered. +-*/ +-PaHostApiIndex Pa_GetDefaultHostApi( void ); +- +- +-/** Unchanging unique identifiers for each supported host API. This type +- is used in the PaHostApiInfo structure. The values are guaranteed to be +- unique and to never change, thus allowing code to be written that +- conditionally uses host API specific extensions. +- +- New type ids will be allocated when support for a host API reaches +- "public alpha" status, prior to that developers should use the +- paInDevelopment type id. +- +- @see PaHostApiInfo +-*/ +-typedef enum PaHostApiTypeId +-{ +- paInDevelopment=0, /* use while developing support for a new host API */ +- paDirectSound=1, +- paMME=2, +- paASIO=3, +- paSoundManager=4, +- paCoreAudio=5, +- paOSS=7, +- paALSA=8, +- paAL=9, +- paBeOS=10, +- paWDMKS=11, +- paJACK=12, +- paWASAPI=13, +- paAudioScienceHPI=14 +-} PaHostApiTypeId; +- +- +-/** A structure containing information about a particular host API. */ +- +-typedef struct PaHostApiInfo +-{ +- /** this is struct version 1 */ +- int structVersion; +- /** The well known unique identifier of this host API @see PaHostApiTypeId */ +- PaHostApiTypeId type; +- /** A textual description of the host API for display on user interfaces. */ +- const char *name; +- +- /** The number of devices belonging to this host API. This field may be +- used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate +- all devices for this host API. +- @see Pa_HostApiDeviceIndexToDeviceIndex +- */ +- int deviceCount; +- +- /** The default input device for this host API. The value will be a +- device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice +- if no default input device is available. +- */ +- PaDeviceIndex defaultInputDevice; +- +- /** The default output device for this host API. The value will be a +- device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice +- if no default output device is available. +- */ +- PaDeviceIndex defaultOutputDevice; +- +-} PaHostApiInfo; +- +- +-/** Retrieve a pointer to a structure containing information about a specific +- host Api. +- +- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) +- +- @return A pointer to an immutable PaHostApiInfo structure describing +- a specific host API. If the hostApi parameter is out of range or an error +- is encountered, the function returns NULL. +- +- The returned structure is owned by the PortAudio implementation and must not +- be manipulated or freed. The pointer is only guaranteed to be valid between +- calls to Pa_Initialize() and Pa_Terminate(). +-*/ +-const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); +- +- +-/** Convert a static host API unique identifier, into a runtime +- host API index. +- +- @param type A unique host API identifier belonging to the PaHostApiTypeId +- enumeration. +- +- @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, +- a PaErrorCode (which are always negative) if PortAudio is not initialized +- or an error is encountered. +- +- The paHostApiNotFound error code indicates that the host API specified by the +- type parameter is not available. +- +- @see PaHostApiTypeId +-*/ +-PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); +- +- +-/** Convert a host-API-specific device index to standard PortAudio device index. +- This function may be used in conjunction with the deviceCount field of +- PaHostApiInfo to enumerate all devices for the specified host API. +- +- @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) +- +- @param hostApiDeviceIndex A valid per-host device index in the range +- 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) +- +- @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) +- or, a PaErrorCode (which are always negative) if PortAudio is not initialized +- or an error is encountered. +- +- A paInvalidHostApi error code indicates that the host API index specified by +- the hostApi parameter is out of range. +- +- A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter +- is out of range. +- +- @see PaHostApiInfo +-*/ +-PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, +- int hostApiDeviceIndex ); +- +- +- +-/** Structure used to return information about a host error condition. +-*/ +-typedef struct PaHostErrorInfo{ +- PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ +- long errorCode; /**< the error code returned */ +- const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ +-}PaHostErrorInfo; +- +- +-/** Return information about the last host error encountered. The error +- information returned by Pa_GetLastHostErrorInfo() will never be modified +- asyncronously by errors occurring in other PortAudio owned threads +- (such as the thread that manages the stream callback.) +- +- This function is provided as a last resort, primarily to enhance debugging +- by providing clients with access to all available error information. +- +- @return A pointer to an immutable structure constaining information about +- the host error. The values in this structure will only be valid if a +- PortAudio function has previously returned the paUnanticipatedHostError +- error code. +-*/ +-const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); +- +- +- +-/* Device enumeration and capabilities */ +- +-/** Retrieve the number of available devices. The number of available devices +- may be zero. +- +- @return A non-negative value indicating the number of available devices or, +- a PaErrorCode (which are always negative) if PortAudio is not initialized +- or an error is encountered. +-*/ +-PaDeviceIndex Pa_GetDeviceCount( void ); +- +- +-/** Retrieve the index of the default input device. The result can be +- used in the inputDevice parameter to Pa_OpenStream(). +- +- @return The default input device index for the default host API, or paNoDevice +- if no default input device is available or an error was encountered. +-*/ +-PaDeviceIndex Pa_GetDefaultInputDevice( void ); +- +- +-/** Retrieve the index of the default output device. The result can be +- used in the outputDevice parameter to Pa_OpenStream(). +- +- @return The default output device index for the defualt host API, or paNoDevice +- if no default output device is available or an error was encountered. +- +- @note +- On the PC, the user can specify a default device by +- setting an environment variable. For example, to use device #1. +-<pre> +- set PA_RECOMMENDED_OUTPUT_DEVICE=1 +-</pre> +- The user should first determine the available device ids by using +- the supplied application "pa_devs". +-*/ +-PaDeviceIndex Pa_GetDefaultOutputDevice( void ); +- +- +-/** The type used to represent monotonic time in seconds that can be used +- for syncronisation. The type is used for the outTime argument to the +- PaStreamCallback and as the result of Pa_GetStreamTime(). +- +- @see PaStreamCallback, Pa_GetStreamTime +-*/ +-typedef double PaTime; +- +- +-/** A type used to specify one or more sample formats. Each value indicates +- a possible format for sound data passed to and from the stream callback, +- Pa_ReadStream and Pa_WriteStream. +- +- The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 +- and aUInt8 are usually implemented by all implementations. +- +- The floating point representation (paFloat32) uses +1.0 and -1.0 as the +- maximum and minimum respectively. +- +- paUInt8 is an unsigned 8 bit format where 128 is considered "ground" +- +- The paNonInterleaved flag indicates that a multichannel buffer is passed +- as a set of non-interleaved pointers. +- +- @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo +- @see paFloat32, paInt16, paInt32, paInt24, paInt8 +- @see paUInt8, paCustomFormat, paNonInterleaved +-*/ +-typedef unsigned long PaSampleFormat; +- +- +-#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ +-#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ +-#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ +-#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ +-#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ +-#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ +-#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ +- +-#define paNonInterleaved ((PaSampleFormat) 0x80000000) +- +-/** A structure providing information and capabilities of PortAudio devices. +- Devices may support input, output or both input and output. +-*/ +-typedef struct PaDeviceInfo +-{ +- int structVersion; /* this is struct version 2 */ +- const char *name; +- PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ +- +- int maxInputChannels; +- int maxOutputChannels; +- +- /* Default latency values for interactive performance. */ +- PaTime defaultLowInputLatency; +- PaTime defaultLowOutputLatency; +- /* Default latency values for robust non-interactive applications (eg. playing sound files). */ +- PaTime defaultHighInputLatency; +- PaTime defaultHighOutputLatency; +- +- double defaultSampleRate; +-} PaDeviceInfo; +- +- +-/** Retrieve a pointer to a PaDeviceInfo structure containing information +- about the specified device. +- @return A pointer to an immutable PaDeviceInfo structure. If the device +- parameter is out of range the function returns NULL. +- +- @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) +- +- @note PortAudio manages the memory referenced by the returned pointer, +- the client must not manipulate or free the memory. The pointer is only +- guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). +- +- @see PaDeviceInfo, PaDeviceIndex +-*/ +-const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); +- +- +-/** Parameters for one direction (input or output) of a stream. +-*/ +-typedef struct PaStreamParameters +-{ +- /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) +- specifying the device to be used or the special constant +- paUseHostApiSpecificDeviceSpecification which indicates that the actual +- device(s) to use are specified in hostApiSpecificStreamInfo. +- This field must not be set to paNoDevice. +- */ +- PaDeviceIndex device; +- +- /** The number of channels of sound to be delivered to the +- stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). +- It can range from 1 to the value of maxInputChannels in the +- PaDeviceInfo record for the device specified by the device parameter. +- */ +- int channelCount; +- +- /** The sample format of the buffer provided to the stream callback, +- a_ReadStream() or Pa_WriteStream(). It may be any of the formats described +- by the PaSampleFormat enumeration. +- */ +- PaSampleFormat sampleFormat; +- +- /** The desired latency in seconds. Where practical, implementations should +- configure their latency based on these parameters, otherwise they may +- choose the closest viable latency instead. Unless the suggested latency +- is greater than the absolute upper limit for the device implementations +- should round the suggestedLatency up to the next practial value - ie to +- provide an equal or higher latency than suggestedLatency wherever possibe. +- Actual latency values for an open stream may be retrieved using the +- inputLatency and outputLatency fields of the PaStreamInfo structure +- returned by Pa_GetStreamInfo(). +- @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo +- */ +- PaTime suggestedLatency; +- +- /** An optional pointer to a host api specific data structure +- containing additional information for device setup and/or stream processing. +- hostApiSpecificStreamInfo is never required for correct operation, +- if not used it should be set to NULL. +- */ +- void *hostApiSpecificStreamInfo; +- +-} PaStreamParameters; +- +- +-/** Return code for Pa_IsFormatSupported indicating success. */ +-#define paFormatIsSupported (0) +- +-/** Determine whether it would be possible to open a stream with the specified +- parameters. +- +- @param inputParameters A structure that describes the input parameters used to +- open a stream. The suggestedLatency field is ignored. See PaStreamParameters +- for a description of these parameters. inputParameters must be NULL for +- output-only streams. +- +- @param outputParameters A structure that describes the output parameters used +- to open a stream. The suggestedLatency field is ignored. See PaStreamParameters +- for a description of these parameters. outputParameters must be NULL for +- input-only streams. +- +- @param sampleRate The required sampleRate. For full-duplex streams it is the +- sample rate for both input and output +- +- @return Returns 0 if the format is supported, and an error code indicating why +- the format is not supported otherwise. The constant paFormatIsSupported is +- provided to compare with the return value for success. +- +- @see paFormatIsSupported, PaStreamParameters +-*/ +-PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, +- const PaStreamParameters *outputParameters, +- double sampleRate ); +- +- +- +-/* Streaming types and functions */ +- +- +-/** +- A single PaStream can provide multiple channels of real-time +- streaming audio input and output to a client application. A stream +- provides access to audio hardware represented by one or more +- PaDevices. Depending on the underlying Host API, it may be possible +- to open multiple streams using the same device, however this behavior +- is implementation defined. Portable applications should assume that +- a PaDevice may be simultaneously used by at most one PaStream. +- +- Pointers to PaStream objects are passed between PortAudio functions that +- operate on streams. +- +- @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, +- Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, +- Pa_GetStreamTime, Pa_GetStreamCpuLoad +- +-*/ +-typedef void PaStream; +- +- +-/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() +- or Pa_OpenDefaultStream() to indicate that the stream callback will +- accept buffers of any size. +-*/ +-#define paFramesPerBufferUnspecified (0) +- +- +-/** Flags used to control the behavior of a stream. They are passed as +- parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be +- ORed together. +- +- @see Pa_OpenStream, Pa_OpenDefaultStream +- @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, +- paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags +-*/ +-typedef unsigned long PaStreamFlags; +- +-/** @see PaStreamFlags */ +-#define paNoFlag ((PaStreamFlags) 0) +- +-/** Disable default clipping of out of range samples. +- @see PaStreamFlags +-*/ +-#define paClipOff ((PaStreamFlags) 0x00000001) +- +-/** Disable default dithering. +- @see PaStreamFlags +-*/ +-#define paDitherOff ((PaStreamFlags) 0x00000002) +- +-/** Flag requests that where possible a full duplex stream will not discard +- overflowed input samples without calling the stream callback. This flag is +- only valid for full duplex callback streams and only when used in combination +- with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using +- this flag incorrectly results in a paInvalidFlag error being returned from +- Pa_OpenStream and Pa_OpenDefaultStream. +- +- @see PaStreamFlags, paFramesPerBufferUnspecified +-*/ +-#define paNeverDropInput ((PaStreamFlags) 0x00000004) +- +-/** Call the stream callback to fill initial output buffers, rather than the +- default behavior of priming the buffers with zeros (silence). This flag has +- no effect for input-only and blocking read/write streams. +- +- @see PaStreamFlags +-*/ +-#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) +- +-/** A mask specifying the platform specific bits. +- @see PaStreamFlags +-*/ +-#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) +- +-/** +- Timing information for the buffers passed to the stream callback. +-*/ +-typedef struct PaStreamCallbackTimeInfo{ +- PaTime inputBufferAdcTime; +- PaTime currentTime; +- PaTime outputBufferDacTime; +-} PaStreamCallbackTimeInfo; +- +- +-/** +- Flag bit constants for the statusFlags to PaStreamCallback. +- +- @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, +- paPrimingOutput +-*/ +-typedef unsigned long PaStreamCallbackFlags; +- +-/** In a stream opened with paFramesPerBufferUnspecified, indicates that +- input data is all silence (zeros) because no real data is available. In a +- stream opened without paFramesPerBufferUnspecified, it indicates that one or +- more zero samples have been inserted into the input buffer to compensate +- for an input underflow. +- @see PaStreamCallbackFlags +-*/ +-#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) +- +-/** In a stream opened with paFramesPerBufferUnspecified, indicates that data +- prior to the first sample of the input buffer was discarded due to an +- overflow, possibly because the stream callback is using too much CPU time. +- Otherwise indicates that data prior to one or more samples in the +- input buffer was discarded. +- @see PaStreamCallbackFlags +-*/ +-#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) +- +-/** Indicates that output data (or a gap) was inserted, possibly because the +- stream callback is using too much CPU time. +- @see PaStreamCallbackFlags +-*/ +-#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) +- +-/** Indicates that output data will be discarded because no room is available. +- @see PaStreamCallbackFlags +-*/ +-#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) +- +-/** Some of all of the output data will be used to prime the stream, input +- data may be zero. +- @see PaStreamCallbackFlags +-*/ +-#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) +- +-/** +- Allowable return values for the PaStreamCallback. +- @see PaStreamCallback +-*/ +-typedef enum PaStreamCallbackResult +-{ +- paContinue=0, +- paComplete=1, +- paAbort=2 +-} PaStreamCallbackResult; +- +- +-/** +- Functions of type PaStreamCallback are implemented by PortAudio clients. +- They consume, process or generate audio in response to requests from an +- active PortAudio stream. +- +- @param input and @param output are arrays of interleaved samples, +- the format, packing and number of channels used by the buffers are +- determined by parameters to Pa_OpenStream(). +- +- @param frameCount The number of sample frames to be processed by +- the stream callback. +- +- @param timeInfo The time in seconds when the first sample of the input +- buffer was received at the audio input, the time in seconds when the first +- sample of the output buffer will begin being played at the audio output, and +- the time in seconds when the stream callback was called. +- See also Pa_GetStreamTime() +- +- @param statusFlags Flags indicating whether input and/or output buffers +- have been inserted or will be dropped to overcome underflow or overflow +- conditions. +- +- @param userData The value of a user supplied pointer passed to +- Pa_OpenStream() intended for storing synthesis data etc. +- +- @return +- The stream callback should return one of the values in the +- PaStreamCallbackResult enumeration. To ensure that the callback continues +- to be called, it should return paContinue (0). Either paComplete or paAbort +- can be returned to finish stream processing, after either of these values is +- returned the callback will not be called again. If paAbort is returned the +- stream will finish as soon as possible. If paComplete is returned, the stream +- will continue until all buffers generated by the callback have been played. +- This may be useful in applications such as soundfile players where a specific +- duration of output is required. However, it is not necessary to utilise this +- mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also +- be used to stop the stream. The callback must always fill the entire output +- buffer irrespective of its return value. +- +- @see Pa_OpenStream, Pa_OpenDefaultStream +- +- @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call +- PortAudio API functions from within the stream callback. +-*/ +-typedef int PaStreamCallback( +- const void *input, void *output, +- unsigned long frameCount, +- const PaStreamCallbackTimeInfo* timeInfo, +- PaStreamCallbackFlags statusFlags, +- void *userData ); +- +- +-/** Opens a stream for either input, output or both. +- +- @param stream The address of a PaStream pointer which will receive +- a pointer to the newly opened stream. +- +- @param inputParameters A structure that describes the input parameters used by +- the opened stream. See PaStreamParameters for a description of these parameters. +- inputParameters must be NULL for output-only streams. +- +- @param outputParameters A structure that describes the output parameters used by +- the opened stream. See PaStreamParameters for a description of these parameters. +- outputParameters must be NULL for input-only streams. +- +- @param sampleRate The desired sampleRate. For full-duplex streams it is the +- sample rate for both input and output +- +- @param framesPerBuffer The number of frames passed to the stream callback +- function, or the preferred block granularity for a blocking read/write stream. +- The special value paFramesPerBufferUnspecified (0) may be used to request that +- the stream callback will recieve an optimal (and possibly varying) number of +- frames based on host requirements and the requested latency settings. +- Note: With some host APIs, the use of non-zero framesPerBuffer for a callback +- stream may introduce an additional layer of buffering which could introduce +- additional latency. PortAudio guarantees that the additional latency +- will be kept to the theoretical minimum however, it is strongly recommended +- that a non-zero framesPerBuffer value only be used when your algorithm +- requires a fixed number of frames per stream callback. +- +- @param streamFlags Flags which modify the behaviour of the streaming process. +- This parameter may contain a combination of flags ORed together. Some flags may +- only be relevant to certain buffer formats. +- +- @param streamCallback A pointer to a client supplied function that is responsible +- for processing and filling input and output buffers. If this parameter is NULL +- the stream will be opened in 'blocking read/write' mode. In blocking mode, +- the client can receive sample data using Pa_ReadStream and write sample data +- using Pa_WriteStream, the number of samples that may be read or written +- without blocking is returned by Pa_GetStreamReadAvailable and +- Pa_GetStreamWriteAvailable respectively. +- +- @param userData A client supplied pointer which is passed to the stream callback +- function. It could for example, contain a pointer to instance data necessary +- for processing the audio buffers. This parameter is ignored if streamCallback +- is NULL. +- +- @return +- Upon success Pa_OpenStream() returns paNoError and places a pointer to a +- valid PaStream in the stream argument. The stream is inactive (stopped). +- If a call to Pa_OpenStream() fails, a non-zero error code is returned (see +- PaError for possible error codes) and the value of stream is invalid. +- +- @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, +- Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable +-*/ +-PaError Pa_OpenStream( PaStream** stream, +- const PaStreamParameters *inputParameters, +- const PaStreamParameters *outputParameters, +- double sampleRate, +- unsigned long framesPerBuffer, +- PaStreamFlags streamFlags, +- PaStreamCallback *streamCallback, +- void *userData ); +- +- +-/** A simplified version of Pa_OpenStream() that opens the default input +- and/or output devices. +- +- @param stream The address of a PaStream pointer which will receive +- a pointer to the newly opened stream. +- +- @param numInputChannels The number of channels of sound that will be supplied +- to the stream callback or returned by Pa_ReadStream. It can range from 1 to +- the value of maxInputChannels in the PaDeviceInfo record for the default input +- device. If 0 the stream is opened as an output-only stream. +- +- @param numOutputChannels The number of channels of sound to be delivered to the +- stream callback or passed to Pa_WriteStream. It can range from 1 to the value +- of maxOutputChannels in the PaDeviceInfo record for the default output dvice. +- If 0 the stream is opened as an output-only stream. +- +- @param sampleFormat The sample format of both the input and output buffers +- provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. +- sampleFormat may be any of the formats described by the PaSampleFormat +- enumeration. +- +- @param sampleRate Same as Pa_OpenStream parameter of the same name. +- @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. +- @param streamCallback Same as Pa_OpenStream parameter of the same name. +- @param userData Same as Pa_OpenStream parameter of the same name. +- +- @return As for Pa_OpenStream +- +- @see Pa_OpenStream, PaStreamCallback +-*/ +-PaError Pa_OpenDefaultStream( PaStream** stream, +- int numInputChannels, +- int numOutputChannels, +- PaSampleFormat sampleFormat, +- double sampleRate, +- unsigned long framesPerBuffer, +- PaStreamCallback *streamCallback, +- void *userData ); +- +- +-/** Closes an audio stream. If the audio stream is active it +- discards any pending buffers as if Pa_AbortStream() had been called. +-*/ +-PaError Pa_CloseStream( PaStream *stream ); +- +- +-/** Functions of type PaStreamFinishedCallback are implemented by PortAudio +- clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback +- function. Once registered they are called when the stream becomes inactive +- (ie once a call to Pa_StopStream() will not block). +- A stream will become inactive after the stream callback returns non-zero, +- or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio +- output, if the stream callback returns paComplete, or Pa_StopStream is called, +- the stream finished callback will not be called until all generated sample data +- has been played. +- +- @param userData The userData parameter supplied to Pa_OpenStream() +- +- @see Pa_SetStreamFinishedCallback +-*/ +-typedef void PaStreamFinishedCallback( void *userData ); +- +- +-/** Register a stream finished callback function which will be called when the +- stream becomes inactive. See the description of PaStreamFinishedCallback for +- further details about when the callback will be called. +- +- @param stream a pointer to a PaStream that is in the stopped state - if the +- stream is not stopped, the stream's finished callback will remain unchanged +- and an error code will be returned. +- +- @param streamFinishedCallback a pointer to a function with the same signature +- as PaStreamFinishedCallback, that will be called when the stream becomes +- inactive. Passing NULL for this parameter will un-register a previously +- registered stream finished callback function. +- +- @return on success returns paNoError, otherwise an error code indicating the cause +- of the error. +- +- @see PaStreamFinishedCallback +-*/ +-PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); +- +- +-/** Commences audio processing. +-*/ +-PaError Pa_StartStream( PaStream *stream ); +- +- +-/** Terminates audio processing. It waits until all pending +- audio buffers have been played before it returns. +-*/ +-PaError Pa_StopStream( PaStream *stream ); +- +- +-/** Terminates audio processing immediately without waiting for pending +- buffers to complete. +-*/ +-PaError Pa_AbortStream( PaStream *stream ); +- +- +-/** Determine whether the stream is stopped. +- A stream is considered to be stopped prior to a successful call to +- Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. +- If a stream callback returns a value other than paContinue the stream is NOT +- considered to be stopped. +- +- @return Returns one (1) when the stream is stopped, zero (0) when +- the stream is running or, a PaErrorCode (which are always negative) if +- PortAudio is not initialized or an error is encountered. +- +- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive +-*/ +-PaError Pa_IsStreamStopped( PaStream *stream ); +- +- +-/** Determine whether the stream is active. +- A stream is active after a successful call to Pa_StartStream(), until it +- becomes inactive either as a result of a call to Pa_StopStream() or +- Pa_AbortStream(), or as a result of a return value other than paContinue from +- the stream callback. In the latter case, the stream is considered inactive +- after the last buffer has finished playing. +- +- @return Returns one (1) when the stream is active (ie playing or recording +- audio), zero (0) when not playing or, a PaErrorCode (which are always negative) +- if PortAudio is not initialized or an error is encountered. +- +- @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped +-*/ +-PaError Pa_IsStreamActive( PaStream *stream ); +- +- +- +-/** A structure containing unchanging information about an open stream. +- @see Pa_GetStreamInfo +-*/ +- +-typedef struct PaStreamInfo +-{ +- /** this is struct version 1 */ +- int structVersion; +- +- /** The input latency of the stream in seconds. This value provides the most +- accurate estimate of input latency available to the implementation. It may +- differ significantly from the suggestedLatency value passed to Pa_OpenStream(). +- The value of this field will be zero (0.) for output-only streams. +- @see PaTime +- */ +- PaTime inputLatency; +- +- /** The output latency of the stream in seconds. This value provides the most +- accurate estimate of output latency available to the implementation. It may +- differ significantly from the suggestedLatency value passed to Pa_OpenStream(). +- The value of this field will be zero (0.) for input-only streams. +- @see PaTime +- */ +- PaTime outputLatency; +- +- /** The sample rate of the stream in Hertz (samples per second). In cases +- where the hardware sample rate is inaccurate and PortAudio is aware of it, +- the value of this field may be different from the sampleRate parameter +- passed to Pa_OpenStream(). If information about the actual hardware sample +- rate is not available, this field will have the same value as the sampleRate +- parameter passed to Pa_OpenStream(). +- */ +- double sampleRate; +- +-} PaStreamInfo; +- +- +-/** Retrieve a pointer to a PaStreamInfo structure containing information +- about the specified stream. +- @return A pointer to an immutable PaStreamInfo structure. If the stream +- parameter invalid, or an error is encountered, the function returns NULL. +- +- @param stream A pointer to an open stream previously created with Pa_OpenStream. +- +- @note PortAudio manages the memory referenced by the returned pointer, +- the client must not manipulate or free the memory. The pointer is only +- guaranteed to be valid until the specified stream is closed. +- +- @see PaStreamInfo +-*/ +-const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); +- +- +-/** Determine the current time for the stream according to the same clock used +- to generate buffer timestamps. This time may be used for syncronising other +- events to the audio stream, for example synchronizing audio to MIDI. +- +- @return The stream's current time in seconds, or 0 if an error occurred. +- +- @see PaTime, PaStreamCallback +-*/ +-PaTime Pa_GetStreamTime( PaStream *stream ); +- +- +-/** Retrieve CPU usage information for the specified stream. +- The "CPU Load" is a fraction of total CPU time consumed by a callback stream's +- audio processing routines including, but not limited to the client supplied +- stream callback. This function does not work with blocking read/write streams. +- +- This function may be called from the stream callback function or the +- application. +- +- @return +- A floating point value, typically between 0.0 and 1.0, where 1.0 indicates +- that the stream callback is consuming the maximum number of CPU cycles possible +- to maintain real-time operation. A value of 0.5 would imply that PortAudio and +- the stream callback was consuming roughly 50% of the available CPU time. The +- return value may exceed 1.0. A value of 0.0 will always be returned for a +- blocking read/write stream, or if an error occurrs. +-*/ +-double Pa_GetStreamCpuLoad( PaStream* stream ); +- +- +-/** Read samples from an input stream. The function doesn't return until +- the entire buffer has been filled - this may involve waiting for the operating +- system to supply the data. +- +- @param stream A pointer to an open stream previously created with Pa_OpenStream. +- +- @param buffer A pointer to a buffer of sample frames. The buffer contains +- samples in the format specified by the inputParameters->sampleFormat field +- used to open the stream, and the number of channels specified by +- inputParameters->numChannels. If non-interleaved samples were requested, +- buffer is a pointer to the first element of an array of non-interleaved +- buffer pointers, one for each channel. +- +- @param frames The number of frames to be read into buffer. This parameter +- is not constrained to a specific range, however high performance applications +- will want to match this parameter to the framesPerBuffer parameter used +- when opening the stream. +- +- @return On success PaNoError will be returned, or PaInputOverflowed if input +- data was discarded by PortAudio after the previous call and before this call. +-*/ +-PaError Pa_ReadStream( PaStream* stream, +- void *buffer, +- unsigned long frames ); +- +- +-/** Write samples to an output stream. This function doesn't return until the +- entire buffer has been consumed - this may involve waiting for the operating +- system to consume the data. +- +- @param stream A pointer to an open stream previously created with Pa_OpenStream. +- +- @param buffer A pointer to a buffer of sample frames. The buffer contains +- samples in the format specified by the outputParameters->sampleFormat field +- used to open the stream, and the number of channels specified by +- outputParameters->numChannels. If non-interleaved samples were requested, +- buffer is a pointer to the first element of an array of non-interleaved +- buffer pointers, one for each channel. +- +- @param frames The number of frames to be written from buffer. This parameter +- is not constrained to a specific range, however high performance applications +- will want to match this parameter to the framesPerBuffer parameter used +- when opening the stream. +- +- @return On success PaNoError will be returned, or paOutputUnderflowed if +- additional output data was inserted after the previous call and before this +- call. +-*/ +-PaError Pa_WriteStream( PaStream* stream, +- const void *buffer, +- unsigned long frames ); +- +- +-/** Retrieve the number of frames that can be read from the stream without +- waiting. +- +- @return Returns a non-negative value representing the maximum number of frames +- that can be read from the stream without blocking or busy waiting or, a +- PaErrorCode (which are always negative) if PortAudio is not initialized or an +- error is encountered. +-*/ +-signed long Pa_GetStreamReadAvailable( PaStream* stream ); +- +- +-/** Retrieve the number of frames that can be written to the stream without +- waiting. +- +- @return Returns a non-negative value representing the maximum number of frames +- that can be written to the stream without blocking or busy waiting or, a +- PaErrorCode (which are always negative) if PortAudio is not initialized or an +- error is encountered. +-*/ +-signed long Pa_GetStreamWriteAvailable( PaStream* stream ); +- +- +-/* Miscellaneous utilities */ +- +- +-/** Retrieve the size of a given sample format in bytes. +- +- @return The size in bytes of a single sample in the specified format, +- or paSampleFormatNotSupported if the format is not supported. +-*/ +-PaError Pa_GetSampleSize( PaSampleFormat format ); +- +- +-/** Put the caller to sleep for at least 'msec' milliseconds. This function is +- provided only as a convenience for authors of portable code (such as the tests +- and examples in the PortAudio distribution.) +- +- The function may sleep longer than requested so don't rely on this for accurate +- musical timing. +-*/ +-void Pa_Sleep( long msec ); +- +- +- +-#ifdef __cplusplus +-} +-#endif /* __cplusplus */ +-#endif /* PORTAUDIO_H */ +--- a/src/wave.cpp ++++ b/src/wave.cpp +@@ -31,7 +31,10 @@ + #include <sys/time.h> + #include <time.h> + +-#include "portaudio.h" ++#ifdef USE_PORTAUDIO ++#include <portaudio.h> ++#endif ++ + #ifdef PLATFORM_WINDOWS + #include <windows.h> + #else +--- a/src/wavegen.cpp ++++ b/src/wavegen.cpp +@@ -40,7 +40,7 @@ + #endif + + #ifdef USE_PORTAUDIO +-#include "portaudio.h" ++#include <portaudio.h> + #undef USE_PORTAUDIO + // determine portaudio version by looking for a #define which is not in V18 + #ifdef paNeverDropInput diff --git a/sound/forked-daapd/Makefile b/sound/forked-daapd/Makefile index 585fa4fe1..2be205df1 100644 --- a/sound/forked-daapd/Makefile +++ b/sound/forked-daapd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=forked-daapd PKG_VERSION:=22.0 -PKG_RELEASE:=20141016 +PKG_RELEASE:=20141022 PKG_REV:=61a4da215c05b621951aa3903d7d390fd1839537 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -17,6 +17,8 @@ PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=git://github.com/ejurgensen/forked-daapd.git PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_BUILD_DEPENDS:=gperf/host PKG_FIXUP:=autoreconf PKG_USE_MIPS16:=0 PKG_INSTALL:=1 @@ -30,11 +32,11 @@ include $(INCLUDE_DIR)/package.mk define Package/forked-daapd SECTION:=sound CATEGORY:=Sound -TITLE:=Improved iTunes (DAAP) server. Support for Apple Remote and AirPlay. +TITLE:=iTunes (DAAP) server for Apple Remote and AirPlay URL:=https://github.com/ejurgensen/forked-daapd DEPENDS:=+libgpg-error +libgcrypt +libgdbm +zlib +libexpat +libunistring \ - +libevent +libdaemon +libantlr3c +confuse +glib2 +alsa-lib +libffmpeg-full \ - +mxml +libavl +avahi-daemon +libavahi-client +sqlite3-cli +libplist + +libevent2 +libdaemon +libantlr3c +confuse +glib2 +alsa-lib +libffmpeg-full \ + +mxml +libavl +avahi-daemon +libavahi-client +sqlite3-cli +libplist +libcurl endef define Package/forked-daapd/conffiles @@ -42,11 +44,8 @@ define Package/forked-daapd/conffiles endef CONFIGURE_ARGS += \ - --enable-itunes - -# Fix for libevent -TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libevent -TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib/libevent + --enable-itunes \ + --enable-lastfm TARGET_CFLAGS += $(FPIC) TARGET_LDFLAGS += -Wl,-rpath-link,$(STAGING_DIR)/usr/lib diff --git a/sound/portaudio/Makefile b/sound/portaudio/Makefile new file mode 100644 index 000000000..ffa5cfb05 --- /dev/null +++ b/sound/portaudio/Makefile @@ -0,0 +1,70 @@ +# +# 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:=portaudio +PKG_VERSION:=19_20140130 +PKG_RELEASE:=1 + +PKG_SOURCE:=pa_stable_v$(PKG_VERSION).tgz +PKG_SOURCE_URL:=http://www.portaudio.com/archives/ +PKG_MD5SUM:=7f220406902af9dca009668e198cbd23 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE.txt +PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org> + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/portaudio + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+alsa-lib +libpthread +librt + TITLE:=Portable cross-platform audio I/O + URL:=http://www.portaudio.com/ +endef + +define Package/portaudio/description + PortAudio is a free, cross-platform, open-source, audio I/O library. It lets + you write simple audio programs in 'C' or C++ that will compile and run on many + platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is + intended to promote the exchange of audio software between developers on + different platforms. Many applications use PortAudio for Audio I/O. +endef + +CONFIGURE_ARGS+= \ + --with-alsa \ + --without-asihpi \ + --without-jack \ + --with-oss \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) \ + $(PKG_INSTALL_DIR)/usr/include/portaudio.h \ + $(PKG_INSTALL_DIR)/usr/include/pa_linux_alsa.h \ + $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/libportaudio.{a,so*} \ + $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) \ + $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/portaudio-*.pc \ + $(1)/usr/lib/pkgconfig/ +endef + +define Package/portaudio/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libportaudio.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,portaudio)) diff --git a/sound/sox/Makefile b/sound/sox/Makefile index 8fa571325..eda080fa8 100644 --- a/sound/sox/Makefile +++ b/sound/sox/Makefile @@ -10,15 +10,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=sox PKG_VERSION:=14.4.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/sox PKG_MD5SUM:=ff9ca6aca972549de0e80e8e30ed379c +PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net> PKG_LICENSE:=LGPL-2.1 GPL-2.0 PKG_LICENSE_FILES:=COPYING LICENSE.LGPL LICENSE.GPL + PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -34,7 +36,6 @@ define Package/sox +libmagic +libpng +libffmpeg TITLE:=Sox is a general purpose sound converter/player/recorder URL:=http://sox.sourceforge.net/ - MAINTAINER:=Hamish Guthrie <hcg@openwrt.org> endef define Package/sox/description diff --git a/sound/sox/patches/020-ffmpeg-2.x.patch b/sound/sox/patches/020-ffmpeg-2.x.patch index 577014564..44e7ebbe9 100644 --- a/sound/sox/patches/020-ffmpeg-2.x.patch +++ b/sound/sox/patches/020-ffmpeg-2.x.patch @@ -20,7 +20,25 @@ return -1; if (enc->codec_type != AVMEDIA_TYPE_AUDIO) { lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type); -@@ -267,7 +271,11 @@ static int stopread(sox_format_t * ft) +@@ -178,7 +182,7 @@ static int startread(sox_format_t * ft) + } + + /* Get CODEC parameters */ +- if ((ret = av_find_stream_info(ffmpeg->ctxt)) < 0) { ++ if ((ret = avformat_find_stream_info(ffmpeg->ctxt, NULL)) < 0) { + lsx_fail("ffmpeg could not find CODEC parameters for %s", ft->filename); + return SOX_EOF; + } +@@ -256,7 +260,7 @@ static int stopread(sox_format_t * ft) + if (ffmpeg->audio_stream >= 0) + stream_component_close(ffmpeg, ffmpeg->audio_stream); + if (ffmpeg->ctxt) { +- av_close_input_file(ffmpeg->ctxt); ++ avformat_close_input(&ffmpeg->ctxt); + ffmpeg->ctxt = NULL; /* safety */ + } + +@@ -267,16 +271,21 @@ static int stopread(sox_format_t * ft) /* * add an audio output stream */ @@ -32,7 +50,18 @@ { AVCodecContext *c; AVStream *st; -@@ -306,7 +314,7 @@ static int open_audio(priv_t * ffmpeg, A + +- st = av_new_stream(oc, 1); ++ st = avformat_new_stream(oc, NULL); + if (!st) { + lsx_fail("ffmpeg could not alloc stream"); + return NULL; + } ++ st->id = 1; + + c = st->codec; + c->codec_id = codec_id; +@@ -306,7 +315,7 @@ static int open_audio(priv_t * ffmpeg, A } /* open it */ diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index d19161511..33af152a7 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -313,7 +313,7 @@ $(eval $(call BuildPlugin,powerdns,PowerDNS server status input,powerdns,)) $(eval $(call BuildPlugin,processes,process status input,processes,)) $(eval $(call BuildPlugin,protocols,network protocols input,protocols,)) $(eval $(call BuildPlugin,rrdtool,RRDtool output,rrdtool,+PACKAGE_collectd-mod-rrdtool:librrd1)) -$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors @BROKEN)) +$(eval $(call BuildPlugin,sensors,lm_sensors input,sensors,+PACKAGE_collectd-mod-sensors:libsensors)) $(eval $(call BuildPlugin,snmp,SNMP input,snmp,+PACKAGE_collectd-mod-snmp:libnetsnmp)) $(eval $(call BuildPlugin,syslog,syslog output,syslog,)) $(eval $(call BuildPlugin,tail,tail input,tail,)) diff --git a/utils/dump1090/Makefile b/utils/dump1090/Makefile index 12978ed40..82ce06a67 100644 --- a/utils/dump1090/Makefile +++ b/utils/dump1090/Makefile @@ -8,18 +8,23 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dump1090 -PKG_VERSION:=2014-08-22 +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:=a82df07c0c0a750d58610bf3c3ece77482f3a58c +PKG_SOURCE_VERSION:=bff92c4ad772a0a8d433f788d39dae97e00e4dbe PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com> PKG_LICENSE:=BSD-3c +PKG_CONFIG_DEPENDS:= \ + CONFIG_DUMP1090_DUMP \ + CONFIG_DUMP1090_WWW \ + CONFIG_DUMP1090_VIEW + include $(INCLUDE_DIR)/package.mk define Package/dump1090 @@ -47,14 +52,18 @@ define Package/dump1090/install $(INSTALL_DIR) $(1)/usr/bin ifneq ($(CONFIG_DUMP1090_DUMP),) - $(CP) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) files/dump1090.init $(1)/etc/init.d/dump1090 + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) files/dump1090.config $(1)/etc/config/dump1090 + $(INSTALL_BIN) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin ifneq ($(CONFIG_DUMP1090_WWW),) $(INSTALL_DIR) $(1)/usr/share/dump1090 $(CP) $(PKG_BUILD_DIR)/public_html/* $(1)/usr/share/dump1090 endif endif ifneq ($(CONFIG_DUMP1090_VIEW),) - $(CP) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin endif endef diff --git a/utils/dump1090/files/dump1090.config b/utils/dump1090/files/dump1090.config new file mode 100644 index 000000000..53d40ef7f --- /dev/null +++ b/utils/dump1090/files/dump1090.config @@ -0,0 +1,39 @@ +config dump1090 main + option disabled '1' + option respawn '1' + option device_index '' + option gain '' + option enable_agc '0' + option freq '' + option ifile '' + option raw '0' + option net '1' + 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 '' + option net_sbs_port '' + option net_bi_port '' + option net_bo_port '' + option net_ro_size '' + option net_ro_rate '' + option net_heartbeat '' + option net_buffer '' + option lat '' + option lon '' + option fix '0' + option no_fix '0' + option no_crc_check '0' + option phase_enhance '0' + option agressive '0' + option mlat '0' + option stats '0' + option stats_every '' + option onlyaddr '0' + option metric '0' + option snip '' + option debug '' + option ppm '' diff --git a/utils/dump1090/files/dump1090.init b/utils/dump1090/files/dump1090.init new file mode 100644 index 000000000..bc0755fb8 --- /dev/null +++ b/utils/dump1090/files/dump1090.init @@ -0,0 +1,92 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2014 OpenWrt.org + +START=90 +STOP=10 +USE_PROCD=1 + +append_arg() { + local cfg="$1" + local var="$2" + local opt="$3" + local def="$4" + local val + + config_get val "$cfg" "$var" + [ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}" +} + +append_bool() { + local cfg="$1" + local var="$2" + local opt="$3" + local def="$4" + local val + + config_get_bool val "$cfg" "$var" "$def" + [ "$val" = 1 ] && procd_append_param command "$opt" +} + +start_instance() { + local cfg="$1" + local aux + + config_get_bool aux "$cfg" 'disabled' '0' + [ "$aux" = 1 ] && return 1 + + procd_open_instance + + procd_set_param command /usr/bin/dump1090 + procd_append_param command "--quiet" + + append_arg "$cfg" device_index "--device-index" + append_arg "$cfg" gain "--gain" + append_bool "$cfg" enable_agc "--enable-agc" + append_arg "$cfg" freq "--freq" + append_arg "$cfg" ifile "--ifile" + append_bool "$cfg" raw "--raw" + append_bool "$cfg" net "--net" + 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" + append_arg "$cfg" net_sbs_port "--net-sbs-port" + append_arg "$cfg" net_bi_port "--net-bi-port" + append_arg "$cfg" net_bo_port "--net-bo-port" + append_arg "$cfg" net_ro_size "--net-ro-size" + append_arg "$cfg" net_ro_rate "--net-ro-rate" + append_arg "$cfg" net_heartbeat "--net-heartbeat" + append_arg "$cfg" net_buffer "--net-buffer" + append_arg "$cfg" lat "--lat" + append_arg "$cfg" lon "--lon" + append_bool "$cfg" fix "--fix" + append_bool "$cfg" no_fix "--no-fix" + append_bool "$cfg" no_crc_check "--no-crc-check" + append_bool "$cfg" phase_enhance "--phase-enhance" + append_bool "$cfg" agressive "--agressive" + append_bool "$cfg" mlat "--mlat" + append_bool "$cfg" stats "--stats" + append_arg "$cfg" stats_every "--stats-every" + append_bool "$cfg" onlyaddr "--onlyaddr" + append_bool "$cfg" metric "--metric" + append_arg "$cfg" snip "--snip" + append_arg "$cfg" debug "--debug" + append_arg "$cfg" ppm "--ppm" + + config_get_bool aux "$cfg" 'respawn' '0' + [ "$aux" = 1 ] && procd_set_param respawn + + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "dump1090" +} + +start_service() { + config_load dump1090 + config_foreach start_instance dump1090 +} diff --git a/utils/haserl/Makefile b/utils/haserl/Makefile index 5f6ca650f..44a8f41e4 100644 --- a/utils/haserl/Makefile +++ b/utils/haserl/Makefile @@ -17,6 +17,11 @@ PKG_MD5SUM:=a9decddb508944d56f71dd2f821e2ec5 PKG_MAINTAINER:=Maxim Storchak <m.storchak@gmail.com> PKG_LICENSE:=GPL-2.0 +PKG_CONFIG_DEPENDS:= \ + CONFIG_HASERL_with_lua \ + CONFIG_HASERL_shell_luac \ + CONFIG_HASERL_shell_lua \ + include $(INCLUDE_DIR)/package.mk define Package/haserl diff --git a/utils/luci-app-lxc/Makefile b/utils/luci-app-lxc/Makefile new file mode 100644 index 000000000..ffdb95843 --- /dev/null +++ b/utils/luci-app-lxc/Makefile @@ -0,0 +1,66 @@ +# +# 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:=luci-app-lxc +PKG_RELEASE:=20141012 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-lxc + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LXC management Web UI + DEPENDS:=+luci-mod-admin-full +lxc +liblxc +rpcd-mod-lxc + MAINTAINER:=Petar Koretic <petar.koretic@sartura.hr> +endef + +define Package/luci-app-lxc/description + This package will install LXC management Web UI. +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luci-app-lxc/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_BIN) \ + ./files/controller/lxc.lua \ + $(1)/usr/lib/lua/luci/controller/ + + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/ + $(INSTALL_DATA) \ + ./files/view/lxc.htm \ + $(1)/usr/lib/lua/luci/view/ + + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_BIN) \ + ./files/model/cbi/lxc.lua \ + $(1)/usr/lib/lua/luci/model/cbi/ + + $(INSTALL_DIR) $(1)/etc/config/ + $(INSTALL_DATA) \ + ./files/lxc.config \ + $(1)/etc/config/lxc + + $(INSTALL_DIR) $(1)/www + $(CP) -R \ + ./files/www/* \ + $(1)/www +endef + +$(eval $(call BuildPackage,luci-app-lxc)) diff --git a/utils/luci-app-lxc/files/controller/lxc.lua b/utils/luci-app-lxc/files/controller/lxc.lua new file mode 100644 index 000000000..ce7b53e6e --- /dev/null +++ b/utils/luci-app-lxc/files/controller/lxc.lua @@ -0,0 +1,125 @@ +--[[ + +LuCI LXC module + +Copyright (C) 2014, Cisco Systems, Inc. + +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 + +Author: Petar Koretic <petar.koretic@sartura.hr> + +]]-- + +module("luci.controller.lxc", package.seeall) + +require "ubus" +local conn = ubus.connect() +if not conn then + error("Failed to connect to ubus") +end + + +function fork_exec(command) + local pid = nixio.fork() + if pid > 0 then + return + elseif pid == 0 then + -- change to root dir + nixio.chdir("/") + + -- patch stdin, out, err to /dev/null + local null = nixio.open("/dev/null", "w+") + if null then + nixio.dup(null, nixio.stderr) + nixio.dup(null, nixio.stdout) + nixio.dup(null, nixio.stdin) + if null:fileno() > 2 then + null:close() + end + end + + -- replace with target command + nixio.exec("/bin/sh", "-c", command) + end +end + +function index() + page = node("admin", "services", "lxc") + page.target = cbi("lxc") + page.title = _("LXC Containers") + page.order = 70 + + page = entry({"admin", "services", "lxc_create"}, call("lxc_create"), nil) + page.leaf = true + + page = entry({"admin", "services", "lxc_action"}, call("lxc_action"), nil) + page.leaf = true + + page = entry({"admin", "services", "lxc_configuration_get"}, call("lxc_configuration_get"), nil) + page.leaf = true + + page = entry({"admin", "services", "lxc_configuration_set"}, call("lxc_configuration_set"), nil) + page.leaf = true + +end + +function lxc_create(lxc_name, lxc_template) + luci.http.prepare_content("text/plain") + + local uci = require("uci").cursor() + + local url = uci:get("lxc", "lxc", "url") + + if not pcall(dofile, "/etc/openwrt_release") then + return luci.http.write("1") + end + + 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) + + luci.http.write(tostring(res)) +end + +function lxc_action(lxc_action, lxc_name) + luci.http.prepare_content("application/json") + + local data, ec = conn:call("lxc", lxc_action, lxc_name and { name = lxc_name} or {} ) + + luci.http.write_json(ec and {} or data) +end + +function lxc_configuration_get(lxc_name) + luci.http.prepare_content("text/plain") + + local f = io.open("/lxc/" .. lxc_name .. "/config", "r") + local content = f:read("*all") + f:close() + + luci.http.write(content) +end + +function lxc_configuration_set(lxc_name) + luci.http.prepare_content("text/plain") + + local lxc_configuration = luci.http.formvalue("lxc_configuration") + + if lxc_configuration == nil then + return luci.http.write("1") + end + + local f, err = io.open("/lxc/" .. lxc_name .. "/config","w+") + if not f then + return luci.http.write("2") + end + + f:write(lxc_configuration) + f:close() + + luci.http.write("0") +end + diff --git a/utils/luci-app-lxc/files/lxc.config b/utils/luci-app-lxc/files/lxc.config new file mode 100644 index 000000000..5572c735f --- /dev/null +++ b/utils/luci-app-lxc/files/lxc.config @@ -0,0 +1,6 @@ +# +# lxc uci configuration +# + +config lxc 'lxc' + option url 'virtualwrt.org/containers/' diff --git a/utils/luci-app-lxc/files/model/cbi/lxc.lua b/utils/luci-app-lxc/files/model/cbi/lxc.lua new file mode 100644 index 000000000..ac0fdff33 --- /dev/null +++ b/utils/luci-app-lxc/files/model/cbi/lxc.lua @@ -0,0 +1,31 @@ +--[[ + +LuCI LXC module + +Copyright (C) 2014, Cisco Systems, Inc. + +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 + +Author: Petar Koretic <petar.koretic@sartura.hr> + +]]-- + +local fs = require "nixio.fs" + +m = Map("lxc", translate("LXC Containers")) + +if fs.access("/etc/config/lxc") then + m:section(SimpleSection).template = "lxc" + + s = m:section(TypedSection, "lxc", translate("Options")) + s.anonymous = true + s.addremove = false + + s:option(Value, "url", translate("Containers URL")) +end + +return m diff --git a/utils/luci-app-lxc/files/view/lxc.htm b/utils/luci-app-lxc/files/view/lxc.htm new file mode 100644 index 000000000..1376968e3 --- /dev/null +++ b/utils/luci-app-lxc/files/view/lxc.htm @@ -0,0 +1,441 @@ +<%# + +LuCI LXC module + +Copyright (C) 2014, Cisco Systems, Inc. + +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 + +Author: Petar Koretic <petar.koretic@sartura.hr> + +-%> + +<fieldset class="cbi-section"> + <legend><%:Available Containers%></legend> + <div class="cbi-section-node"> + <table id="t_lxc_list" class="cbi-section-table"> + <tr class="cbi-section-table-titles"> + <th class="cbi-section-table-cell"><%:Name%></th> + <th class="cbi-section-table-cell"><%:Status%></th> + <th class="cbi-section-table-cell"><%:Actions%></th> + </tr> + </table> + </div> +</fieldset> + +<fieldset class="cbi-section"> + <span id="lxc-list-output"></span> +</fieldset> + +<hr/> +<fieldset class="cbi-section"> + <legend><%:Create New Container%></legend> + <div class="cbi-section-node"> + <table id="t_lxc_create" class="cbi-section-table"> + <tr class="cbi-section-table-titles"> + <th class="cbi-section-table-cell"><%:Name%></th> + <th class="cbi-section-table-cell"><%:Template%></th> + <th class="cbi-section-table-cell"><%:Actions%></th> + </tr> + <tr id="tr_holder"> + <td> + <input type="text" id="tx_name" placeholder="<%:Enter new name%>" value='' /> + </td> + <td> + <select id="s_template" class="cbi-input-select cbi-button"> + <option value="openwrt">OpenWrt</option> + </select> + </td> + <td> + <input type="button" id="bt_create" value="<%:Create%>" onclick="lxc_create(tr_holder)" class="cbi-button cbi-button-add" /> + <span id="lxc-add-loader" style="display:inline-block; width:16px; height:16px; margin:0 5px"></span> + </td> + </tr> + </table> + </div> +</fieldset> + +<fieldset class="cbi-section"> + <span id="lxc-add-output"></span> +</fieldset> + +<hr/> + +<script type="text/javascript" src="<%=resource%>/cbi.js"></script> +<script type="text/javascript">//<![CDATA[ + + window.img = { "red" : "<%=resource%>/cbi/red.gif", "green" : "<%=resource%>/cbi/green.gif", "purple" : "<%=resource%>/cbi/purple.gif" } + window.states = { "STOPPED" : "red", "RUNNING" : "green", "FROZEN" : "purple"} + + var t_lxc_list = document.getElementById('t_lxc_list'); + var loader_html = '<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" width="16" height="16" style="vertical-align:middle" /> '; + var timeout_msg = 0 + var output_list = document.getElementById("lxc-list-output") + var output_add = document.getElementById("lxc-add-output") + var loader_add = document.getElementById("lxc-add-loader") + + function lxc_create(tr) + { + var lxc_name = tr.querySelector("#tx_name").value.trim() + var lxc_template = tr.querySelector("#s_template").value + var bt_create = tr.querySelector("#bt_create") + + if (t_lxc_list.querySelector("[data-id='" + lxc_name + "']") != null) + return info_message(output_add, "Container with that name already exists!", 4000) + + bt_create.disabled = true + output_add.innerHTML = '' + + if (!lxc_name || !lxc_name.length) + { + bt_create.disabled = false + return info_message(output_add, "Name cannot be empty!", 4000) + } + + loading(loader_add) + + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_create/' + '%h/%h'.format(lxc_name, lxc_template) , null, + function(x) + { + bt_create.disabled = false + loading(loader_add, 0) + + if (!x) + info_message(output_add, "Container creation failed!") + }) + } + + function lxc_create_template(lxc_name, lxc_state) + { + var info_row = t_lxc_list.querySelector("#empty") + if (info_row) + t_lxc_list.deleteRow(1) + + var actions = '' + actions += '<input type="button" onclick="action_handler(this)" data-action="start" value="<%:Start%>" class="cbi-button cbi-button-apply" />' + actions+= '<input type="button" onclick="action_handler(this)" data-action="stop" value="<%:Stop%>" class="cbi-button cbi-button-reset" />' + actions+= '<input type="button" onclick="action_handler(this)" data-action="destroy" value="<%:Delete%>" class="cbi-button cbi-button-remove" />' + actions+= ' <select class="cbi-input-select cbi-button" onchange="action_more_handler(this)">\ + <option selected disabled>more</option>\ + <option>configure</option>\ + <option>freeze</option>\ + <option>unfreeze</option>\ + <option>reboot</option>\ + </select>' + actions+= '<span data-loader style="display:inline-block; width:16px; height:16px; margin:0 5px"></span>' + + var row = t_lxc_list.insertRow(-1) + var cell = row.insertCell(-1) + cell.innerHTML = '%q%h%q'.format("<strong>", lxc_name, "</strong>") + cell.width = "30%" + cell.setAttribute("data-id", lxc_name) + + cell = row.insertCell(-1) + cell.width = "20%" + cell.innerHTML = "<img src='"+window.img[lxc_state]+"'/>" + + cell = row.insertCell(-1) + cell.width = "50%" + cell.innerHTML = actions + } + + function action_handler(self) + { + var action = self.getAttribute("data-action"); + + var bt_action = self + var lxc_name = self.parentNode.parentNode.children[0].getAttribute('data-id') + var status_img = self.parentNode.parentNode.querySelector('img') + var loader = self.parentNode.querySelector('[data-loader]') + + bt_action.disabled = true + + if (action == "stop") + { + loading(loader) + + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null, + function(x, ec) + { + loading(loader, 0) + bt_action.disabled = false + + if (!x || ec) + return info_message(output_list,"Action failed!") + + set_status(status_img, "red") + + }); + } + + else if (action == "start") + { + loading(loader) + + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null, + function(x, data) + { + loading(loader, 0) + bt_action.disabled = false + + //FIXME: uncomment after fixing 'lxc-start' + if (!x /*|| ec */) + return info_message(output_list,"Action failed!") + + //FIXME: uncomment after fixing 'lxc-start' + //set_status(status_img, "green") + }); + } + + else if (action == "destroy") + { + if (!confirm("This will completely remove LXC container from the disk. Are you sure? (container will be stopped if running)")) + return + + loading(loader) + + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(action, lxc_name), null, + function(x, ec) + { + loading(loader, 0) + bt_action.disabled = false + + if (!x || ec) + return info_message(output_list,"Action failed!") + + var row = self.parentNode.parentNode + row.parentNode.removeChild(row) + + }); + } + } + + function lxc_configure_handler(self) + { + var td = self.parentNode + var textarea = td.querySelector('[data-id]') + var lxc_name = textarea.getAttribute('data-id') + var lxc_configuration = textarea.value + + new XHR().post('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_set/' + lxc_name, "lxc_configuration=" + encodeURIComponent(lxc_configuration) , + function(x) + { + if (!x || x.responseText != "0") + return info_message(output_list,"Action failed!") + + info_message(output_list,"LXC configuration updated") + var row = td.parentNode + row.parentNode.removeChild(row) + }) + } + + function lxc_rename_template(lxc_name) + { + var h = '\ + <input data-id="'+ lxc_name + '" type="text" placeholder="Enter new name" /> \ + <input data-id="bt_confirm" onclick="lxc_rename_handler(this)" type="button" class="cbi-button" value="Confirm" />' + + return h + } + + function lxc_configure_template(lxc_name, lxc_configuration) + { + var h = '\ + <textarea data-id="'+ lxc_name + '" rows="20" style="width:100%">'+ lxc_configuration +'</textarea> \ + <input data-id="bt_confirm" onclick="lxc_configure_handler(this)" type="button" class="cbi-button" value="Confirm" />' + + return h + } + + function action_more_handler(self) + { + var lxc_name = self.parentNode.parentNode.querySelector('[data-id]').getAttribute('data-id') + var loader = self.parentNode.parentNode.querySelector('[data-loader]') + + var option = self.options[self.selectedIndex].text + + self.value = "more" + + switch (option) + { + case "configure": + var tr = document.createElement('tr') + var row = self.parentNode.parentNode + var next_row = row.nextSibling + if (next_row && next_row.getAttribute('data-action') !== null) + row.parentNode.removeChild(next_row) + + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_configuration_get/' + lxc_name, null, + function(x) + { + tr.innerHTML="<td colspan='" + row.cells.length + "'>" + lxc_configure_template(lxc_name, x.responseText) + "</td>" + tr.setAttribute('data-action','') + row.parentNode.insertBefore(tr, row.nextSibling) + }) + + break + + case "freeze": + var tr = self.parentNode.parentNode + var img = tr.querySelector('img') + if(img.getAttribute('src') != window.img["green"]) + return info_message(output_list,"Container is not running!") + + loading(loader) + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null, + function(x, ec) + { + loading(loader, 0) + if (!x || ec) + return info_message(output_list,"Action failed!") + + set_status(img, "purple") + }) + + break + + case "unfreeze": + var tr = self.parentNode.parentNode + var img = tr.querySelector('img') + + if(img.getAttribute('src') != window.img["purple"]) + return info_message(output_list,"Container is not frozen!") + + loading(loader) + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null, + function(x, ec) + { + loading(loader, 0) + if (!x || ec) + return info_message(output_list,"Action failed!") + + set_status(img, "green") + }) + + break + + case "reboot": + var tr = self.parentNode.parentNode + var img = tr.querySelector('img') + if(img.getAttribute('src') != window.img["green"]) + return info_message(output_list,"Container is not running!") + + if (!confirm("Are you sure?")) + return + + loading(loader) + new XHR().get('<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/' + '%h/%h'.format(option, lxc_name), null, + function(x, ec) + { + loading(loader, 0) + if (!x || ec) + return info_message(output_list,"Action failed!") + + info_message(output_list,"LXC rebooted") + }) + break + } + + } + + function set_empty(t_lxc_list) + { + if (document.getElementById('empty') !== null) + return + + var row_count = t_lxc_list.rows.length; + while(--row_count) t_lxc_list.deleteRow(row_count); + + var row = t_lxc_list.insertRow(-1); + row.id = 'empty' + var cell = row.insertCell(0); + cell.colSpan = 4; + cell.innerHTML = '<em><br />There are no containers available yet.</em>'; + } + + function lxc_list_update() + { + XHR.poll(4, '<%=luci.dispatcher.build_url("admin", "services")%>/lxc_action/list', null, + function(x, data) + { + if (!x) return; + + var lxc_count = Object.keys(data).length + if (!data || !lxc_count) + return set_empty(t_lxc_list) + + if (document.getElementById('empty') !== null) + t_lxc_list.deleteRow(1); + + var lxcs = t_lxc_list.querySelectorAll('td[data-id]') + var lxc_name_table = {} + for (var i = 0, len = lxcs.length; i < len; i++) + { + var lxc_name = lxcs[i].getAttribute('data-id') + if (!(lxc_name in data)) + { + var row = t_lxc_list.querySelector("[data-id='" + lxc_name + "']").parentNode + row.parentNode.removeChild(row) + continue + } + + lxc_name_table[lxc_name] = lxcs[i].parentNode.querySelector('img') + } + + for(var key in data) + { + var lxc_name = key + var state = window.states[data[key]] + + if (!(lxc_name in lxc_name_table)) + lxc_create_template(lxc_name, state) + + else if (state != get_status(lxc_name_table[lxc_name])) + set_status(lxc_name_table[lxc_name], state) + } + + }) + } + + function loading(elem, state) + { + state = (typeof state === 'undefined') ? 1 : state + + if (state === 1) + elem.innerHTML = loader_html + else + setTimeout(function() { elem.innerHTML = ''}, 1000) + } + + function set_status(elem, state) + { + state = (typeof state === 'undefined') ? 1 : state + + setTimeout(function() { elem.setAttribute('src', window.img[state])}, 300) + } + + function get_status(elem) + { + var src = elem.getAttribute('src') + + for (var i in img) + { + if (img[i] == src) + return i + } + } + + function info_message(output, msg, timeout) + { + timeout = timeout || 3000 + output.innerHTML = msg + clearTimeout(timeout_msg) + timeout_msg = setTimeout(function(){ output.innerHTML=""}, timeout); + } + + lxc_list_update() +//]]></script> diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif Binary files differnew file mode 100644 index 000000000..d09febf12 --- /dev/null +++ b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/green.gif diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif Binary files differnew file mode 100644 index 000000000..f0d68cc8b --- /dev/null +++ b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/purple.gif diff --git a/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif Binary files differnew file mode 100644 index 000000000..c1b39bbed --- /dev/null +++ b/utils/luci-app-lxc/files/www/luci-static/resources/cbi/red.gif diff --git a/utils/lxc/Config.in b/utils/lxc/Config.in index c52ba532e..37286bfab 100644 --- a/utils/lxc/Config.in +++ b/utils/lxc/Config.in @@ -12,4 +12,19 @@ config LXC_KERNEL_OPTIONS include cgroups, namespaces and other miscellaneous options. These options unfortunately can not be installed as a module. +config LXC_BUSYBOX_OPTIONS + bool "Enable busybox support for lxc-create tool" + default n + select BUSYBOX_CUSTOM + select BUSYBOX_CONFIG_HAVE_DOT_CONFIG + select BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ + select BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS + select BUSYBOX_CONFIG_UNXZ + select BUSYBOX_CONFIG_XZ + select BUSYBOX_CONFIG_GETOPT + select BUSYBOX_CONFIG_FEATURE_GETOPT_LONG + help + Select needed busybox options for lxc-create utility. This include XZ tar + compression, long option support for tar and built-in getopt support. + endmenu diff --git a/utils/lxc/Makefile b/utils/lxc/Makefile index 97d79835e..0f34eeafe 100644 --- a/utils/lxc/Makefile +++ b/utils/lxc/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lxc -PKG_VERSION:=1.0.5 -PKG_RELEASE:=2 +PKG_VERSION:=1.0.6 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://linuxcontainers.org/downloads/ -PKG_MD5SUM:=9d9af9e9e69a831cd50b58d91c786013 +PKG_MD5SUM:=4aad3aee84b42faa194e44091d723a3b PKG_BUILD_DEPENDS:=lua PKG_BUILD_PARALLEL:=1 @@ -33,6 +33,7 @@ LXC_SCRIPTS += \ DEPENDS_APPLETS = +libpthread +libcap +liblxc +DEPENDS_ls = +lxc-config DEPENDS_top = +lxc-lua +luafilesystem @BROKEN @@ -73,7 +74,13 @@ endef define Package/lxc-templates $(call Package/lxc/Default) TITLE:=LXC virtual machine templates - DEPENDS:= lxc @BROKEN + DEPENDS:= lxc +endef + +define Package/lxc-configs + $(call Package/lxc/Default) + TITLE:=LXC virtual machine common config files + DEPENDS:= lxc endef define Package/liblxc @@ -155,16 +162,15 @@ define Package/lxc-common/install $(INSTALL_DIR) $(1)/etc/lxc/ $(CP) \ $(PKG_INSTALL_DIR)/etc/lxc/default.conf \ - $(1)/etc/lxc/ + $(1)/etc/lxc/lxc.conf + + $(INSTALL_DIR) $(1)/lxc/ endef define Package/lxc-hooks/install $(INSTALL_DIR) $(1)/usr/share/lxc/hooks $(CP) \ - $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountcgroups \ - $(1)/usr/share/lxc/hooks/ - $(CP) \ - $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/mountecryptfsroot \ + $(PKG_INSTALL_DIR)/usr/share/lxc/hooks/* \ $(1)/usr/share/lxc/hooks/ endef @@ -175,6 +181,13 @@ define Package/lxc-templates/install $(1)/usr/share/lxc/templates/ endef +define Package/lxc-configs/install + $(INSTALL_DIR) $(1)/usr/share/lxc/config/ + $(CP) \ + $(PKG_INSTALL_DIR)/usr/share/lxc/config/* \ + $(1)/usr/share/lxc/config/ +endef + define Package/liblxc/install $(INSTALL_DIR) $(1)/usr/lib/ $(CP) \ @@ -221,9 +234,11 @@ endef $(eval $(call BuildPackage,lxc)) $(eval $(call BuildPackage,lxc-common)) $(eval $(call BuildPackage,lxc-hooks)) +$(eval $(call BuildPackage,lxc-configs)) $(eval $(call BuildPackage,lxc-templates)) $(eval $(call BuildPackage,liblxc)) $(eval $(call BuildPackage,lxc-lua)) +$(eval $(call BuildPackage,lxc-init)) $(foreach u,$(LXC_APPLETS_BIN),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/bin"))) $(foreach u,$(LXC_APPLETS_LIB),$(eval $(call GenPlugin,$(u),$(DEPENDS_APPLETS),"/usr/lib/lxc"))) $(foreach u,$(LXC_SCRIPTS),$(eval $(call GenPlugin,$(u),,"/usr/bin"))) diff --git a/utils/lxc/patches/025-remove-unsupported-option.patch b/utils/lxc/patches/025-remove-unsupported-option.patch new file mode 100644 index 000000000..f70d49d95 --- /dev/null +++ b/utils/lxc/patches/025-remove-unsupported-option.patch @@ -0,0 +1,19 @@ +--- a/templates/lxc-download.in ++++ b/templates/lxc-download.in +@@ -479,15 +479,7 @@ fi + # Unpack the rootfs + echo "Unpacking the rootfs" + +-EXCLUDES="" +-excludelist=$(relevant_file excludes) +-if [ -f "${excludelist}" ]; then +- while read line; do +- EXCLUDES="$EXCLUDES --exclude=$line" +- done < $excludelist +-fi +- +-tar --anchored ${EXCLUDES} --numeric-owner -xpJf \ ++tar --numeric-owner -xpJf \ + ${LXC_CACHE_PATH}/rootfs.tar.xz -C ${LXC_ROOTFS} + + mkdir -p ${LXC_ROOTFS}/dev/pts/ diff --git a/utils/lxc/patches/100-lxc-defconfig.patch b/utils/lxc/patches/100-lxc-defconfig.patch new file mode 100644 index 000000000..60a0f9260 --- /dev/null +++ b/utils/lxc/patches/100-lxc-defconfig.patch @@ -0,0 +1,5 @@ +--- a/config/etc/default.conf.unknown ++++ b/config/etc/default.conf.unknown +@@ -1 +1,2 @@ ++lxc.lxcpath = /lxc + lxc.network.type = empty diff --git a/utils/lxc/patches/300-fix-lxc-destroy.patch b/utils/lxc/patches/300-fix-lxc-destroy.patch new file mode 100644 index 000000000..2192c5f59 --- /dev/null +++ b/utils/lxc/patches/300-fix-lxc-destroy.patch @@ -0,0 +1,48 @@ +From bdeafb7bc4857e80dbca5192a751eedcf7b69abd Mon Sep 17 00:00:00 2001 +From: Luka Perkov <luka@openwrt.org> +Date: Mon, 27 Oct 2014 21:49:46 +0100 +Subject: [PATCH] utils: remove unnecessary check of mystat.st_dev + +The check is not needed and it breaks lxc-destroy when container is installed +on top of overlayfs. More information why this is a problem on overlayfs can be +found here: + +https://kernel.googlesource.com/pub/scm/linux/kernel/git/mszeredi/vfs/+/overlayfs.current/Documentation/filesystems/overlayfs.txt + +Signed-off-by: Luka Perkov <luka@openwrt.org> +--- + src/lxc/utils.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/src/lxc/utils.c ++++ b/src/lxc/utils.c +@@ -46,7 +46,7 @@ + + lxc_log_define(lxc_utils, lxc); + +-static int _recursive_rmdir_onedev(char *dirname, dev_t pdev) ++static int _recursive_rmdir_onedev(char *dirname) + { + struct dirent dirent, *direntp; + DIR *dir; +@@ -82,10 +82,8 @@ static int _recursive_rmdir_onedev(char + failed=1; + continue; + } +- if (mystat.st_dev != pdev) +- continue; + if (S_ISDIR(mystat.st_mode)) { +- if (_recursive_rmdir_onedev(pathname, pdev) < 0) ++ if (_recursive_rmdir_onedev(pathname) < 0) + failed=1; + } else { + if (unlink(pathname) < 0) { +@@ -119,7 +117,7 @@ extern int lxc_rmdir_onedev(char *path) + return -1; + } + +- return _recursive_rmdir_onedev(path, mystat.st_dev); ++ return _recursive_rmdir_onedev(path); + } + + static int mount_fs(const char *source, const char *target, const char *type) diff --git a/utils/lxc/patches/301-add-openwrt-common-config.patch b/utils/lxc/patches/301-add-openwrt-common-config.patch new file mode 100644 index 000000000..6736d9bac --- /dev/null +++ b/utils/lxc/patches/301-add-openwrt-common-config.patch @@ -0,0 +1,78 @@ +--- /dev/null ++++ b/config/templates/openwrt.common.conf.in +@@ -0,0 +1,56 @@ ++# Default mount entries ++lxc.mount.entry = proc proc proc nodev,noexec,nosuid 0 0 ++lxc.mount.entry = sysfs sys sysfs defaults 0 0 ++ ++# Default console settings ++lxc.devttydir = lxc ++lxc.tty = 4 ++lxc.pts = 1024 ++ ++# Default capabilities ++lxc.cap.drop = mac_admin ++lxc.cap.drop = mac_override ++lxc.cap.drop = sys_admin ++lxc.cap.drop = sys_module ++lxc.cap.drop = sys_nice ++lxc.cap.drop = sys_pacct ++lxc.cap.drop = sys_ptrace ++lxc.cap.drop = sys_rawio ++lxc.cap.drop = sys_resource ++lxc.cap.drop = sys_time ++lxc.cap.drop = sys_tty_config ++lxc.cap.drop = syslog ++lxc.cap.drop = wake_alarm ++ ++# Default cgroups - all denied except those whitelisted ++lxc.cgroup.devices.deny = a ++## /dev/null and zero ++lxc.cgroup.devices.allow = c 1:3 rwm ++lxc.cgroup.devices.allow = c 1:5 rwm ++## consoles ++lxc.cgroup.devices.allow = c 5:0 rwm ++lxc.cgroup.devices.allow = c 5:1 rwm ++## /dev/{,u}random ++lxc.cgroup.devices.allow = c 1:8 rwm ++lxc.cgroup.devices.allow = c 1:9 rwm ++## /dev/pts/* ++lxc.cgroup.devices.allow = c 5:2 rwm ++lxc.cgroup.devices.allow = c 136:* rwm ++## rtc ++lxc.cgroup.devices.allow = c 254:0 rm ++## fuse ++lxc.cgroup.devices.allow = c 10:229 rwm ++## tun ++lxc.cgroup.devices.allow = c 10:200 rwm ++## dev/tty0 ++lxc.cgroup.devices.allow = c 4:0 rwm ++## dev/tty1 ++lxc.cgroup.devices.allow = c 4:1 rwm ++ ++## To use loop devices, copy the following line to the container's ++## configuration file (uncommented). ++#lxc.cgroup.devices.allow = b 7:* rwm ++ ++# Blacklist some syscalls which are not safe in privileged ++# containers ++lxc.seccomp = /usr/share/lxc/config/common.seccomp +--- a/configure.ac ++++ b/configure.ac +@@ -579,6 +579,7 @@ AC_CONFIG_FILES([ + config/templates/ubuntu.common.conf + config/templates/ubuntu.lucid.conf + config/templates/ubuntu.userns.conf ++ config/templates/openwrt.common.conf + config/yum/Makefile + + doc/Makefile +--- a/config/templates/Makefile.am ++++ b/config/templates/Makefile.am +@@ -22,4 +22,5 @@ templatesconfig_DATA = \ + ubuntu-cloud.userns.conf \ + ubuntu.common.conf \ + ubuntu.lucid.conf \ +- ubuntu.userns.conf ++ ubuntu.userns.conf \ ++ openwrt.common.conf diff --git a/utils/mc/Config.in b/utils/mc/Config.in new file mode 100644 index 000000000..7d6abf8ec --- /dev/null +++ b/utils/mc/Config.in @@ -0,0 +1,20 @@ +menu "Configuration" + depends on PACKAGE_mc + +config MC_DIFF_VIEWER + bool "Compile with diff viewer" + default n + +config MC_EDITOR + bool "Enable internal editor" + default n + +config MC_SUBSHELL + bool "Compile in concurrent subshell" + default n + +config MC_DISABLE_VFS + bool "Disable VFS" + default y + +endmenu diff --git a/utils/mc/Makefile b/utils/mc/Makefile new file mode 100644 index 000000000..7d73e7c9f --- /dev/null +++ b/utils/mc/Makefile @@ -0,0 +1,97 @@ +# +# 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 +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 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk + +define Package/mc + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+glib2 +libncurses $(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 += \ + --enable-utf8 \ + --disable-doxygen-doc \ + --disable-vfs-sftp \ + --with-screen=ncurses \ + --without-gpm-mouse \ + --without-x \ + ac_cv_search_addwstr=no + +ifeq ($(CONFIG_MC_DIFF_VIEWER),n) +CONFIGURE_ARGS += \ + --without-diff-viewer +endif + +ifeq ($(CONFIG_MC_EDITOR),n) +CONFIGURE_ARGS += \ + --without-edit +endif + +ifeq ($(CONFIG_MC_SUBSHELL),n) +CONFIGURE_ARGS += \ + --without-subshell +endif + +ifeq ($(CONFIG_MC_DISABLE_VFS),y) +CONFIGURE_ARGS += \ + --without-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_DIFF_VIEWER),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)) diff --git a/utils/rpcd-mod-lxc/Makefile b/utils/rpcd-mod-lxc/Makefile new file mode 100644 index 000000000..ccabc39d7 --- /dev/null +++ b/utils/rpcd-mod-lxc/Makefile @@ -0,0 +1,35 @@ +# +# 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:=rpcd-mod-lxc +PKG_RELEASE=20141012 + +PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/rpcd-mod-lxc + SECTION:=libs + CATEGORY:=Libraries + TITLE:=LXC rpcd module + DEPENDS:=+rpcd +liblxc + MAINTAINER:=Luka Perkov <luka@openwrt.org> +endef + +define Build/Prepare + $(CP) ./files/* $(PKG_BUILD_DIR)/ +endef + +define Package/rpcd-mod-lxc/install + $(INSTALL_DIR) $(1)/usr/lib/rpcd + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/lxc.so $(1)/usr/lib/rpcd/ +endef + +$(eval $(call BuildPackage,rpcd-mod-lxc)) diff --git a/utils/rpcd-mod-lxc/files/CMakeLists.txt b/utils/rpcd-mod-lxc/files/CMakeLists.txt new file mode 100644 index 000000000..4a728a0bc --- /dev/null +++ b/utils/rpcd-mod-lxc/files/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 2.6) +PROJECT(rpcd-mod-lxc) +ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations) + +INCLUDE_DIRECTORIES(include) +FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) + +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib) + +SET(SOURCES lxc.c) + +ADD_LIBRARY(rpcd-mod-lxc SHARED ${SOURCES}) + +FIND_LIBRARY(lxc NAMES lxc liblxc) +TARGET_LINK_LIBRARIES(rpcd-mod-lxc ${lxc}) + +SET_TARGET_PROPERTIES(rpcd-mod-lxc PROPERTIES OUTPUT_NAME lxc PREFIX "") +INSTALL(TARGETS rpcd-mod-lxc LIBRARY DESTINATION lib) diff --git a/utils/rpcd-mod-lxc/files/lxc.c b/utils/rpcd-mod-lxc/files/lxc.c new file mode 100644 index 000000000..0d52f1677 --- /dev/null +++ b/utils/rpcd-mod-lxc/files/lxc.c @@ -0,0 +1,504 @@ +/* + * rpcd-lxc-plugin + * + * Copyright (C) 2014 Cisco Systems, Inc. + * Author: Luka Perkov <luka@openwrt.org> + * + * Permission to use, copy, modify, and/or 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 THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 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. + */ + +#include <libubus.h> + +#include <lxc/lxccontainer.h> + +#include <rpcd/plugin.h> + +static struct blob_buf buf; + +struct rpc_lxc { + /* ubus options */ + char *name; + char *config; + /* lxc container */ + struct lxc_container *container; +}; + +enum { + RPC_LXC_NAME, + RPC_LXC_CONFIG, + __RPC_LXC_MAX, +}; + +enum { + RPC_LXC_SHUTDOWN_NAME, + RPC_LXC_SHUTDOWN_CONFIG, + RPC_LXC_SHUTDOWN_TIMEOUT, + __RPC_LXC_SHUTDOWN_MAX, +}; + +enum { + RPC_LXC_RENAME_NAME, + RPC_LXC_RENAME_CONFIG, + RPC_LXC_RENAME_NEWNAME, + __RPC_LXC_RENAME_MAX, +}; + +enum { + RPC_LXC_CREATE_NAME, + RPC_LXC_CREATE_CONFIG, + RPC_LXC_CREATE_TEMPLATE, + RPC_LXC_CREATE_FLAGS, + RPC_LXC_CREATE_ARGS, + __RPC_LXC_CREATE_MAX, +}; + +static const struct blobmsg_policy rpc_lxc_min_policy[__RPC_LXC_MAX] = { + [RPC_LXC_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING }, +}; + +static const struct blobmsg_policy rpc_lxc_shutdown_policy[__RPC_LXC_SHUTDOWN_MAX] = { + [RPC_LXC_SHUTDOWN_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_SHUTDOWN_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_SHUTDOWN_TIMEOUT] = { .name = "timeout", .type = BLOBMSG_TYPE_INT32 }, +}; + +static const struct blobmsg_policy rpc_lxc_rename_policy[__RPC_LXC_RENAME_MAX] = { + [RPC_LXC_RENAME_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_RENAME_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_RENAME_NEWNAME] = { .name = "newname", .type = BLOBMSG_TYPE_STRING }, +}; + +static const struct blobmsg_policy rpc_lxc_create_policy[__RPC_LXC_CREATE_MAX] = { + [RPC_LXC_CREATE_NAME] = { .name = "name", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_CREATE_CONFIG] = { .name = "config", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_CREATE_TEMPLATE] = { .name = "template", .type = BLOBMSG_TYPE_STRING }, + [RPC_LXC_CREATE_FLAGS] = { .name = "flags", .type = BLOBMSG_TYPE_INT32 }, + [RPC_LXC_CREATE_ARGS] = { .name = "args", .type = BLOBMSG_TYPE_ARRAY }, +}; + +static struct rpc_lxc * +rpc_lxc_init(struct blob_attr *tb[__RPC_LXC_MAX]) +{ + struct rpc_lxc *l = NULL; + + l = calloc(1, sizeof(struct rpc_lxc)); + if (!l) return NULL; + + if (tb[RPC_LXC_NAME]) { + l->name = blobmsg_data(tb[RPC_LXC_NAME]); + } else { + goto error; + } + + if (tb[RPC_LXC_CONFIG]) { + l->config = blobmsg_data(tb[RPC_LXC_CONFIG]); + } else { + l->config = NULL; + } + + l->container = lxc_container_new(l->name, l->config); + if (!l->container) { + goto error; + } + + return l; +error: + free(l); + return NULL; +} + +static void +rpc_lxc_done(struct rpc_lxc *l) +{ + if (l) { + lxc_container_put(l->container); + free(l); + } + + return; +} + +static int +rpc_lxc_start(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + if (!l->container->start(l->container, 0, NULL)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + + +static int +rpc_lxc_reboot(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (!l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + if (!l->container->reboot(l->container)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_shutdown(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_SHUTDOWN_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_shutdown_policy, __RPC_LXC_SHUTDOWN_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (!l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + /* define default timeout */ + int timeout = 30; + if (tb[RPC_LXC_SHUTDOWN_TIMEOUT]) { + timeout = blobmsg_get_u32(tb[RPC_LXC_SHUTDOWN_TIMEOUT]); + } + + if (!l->container->shutdown(l->container, timeout)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_stop(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (!l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + if (!l->container->stop(l->container)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_freeze(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (!l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + if (!l->container->freeze(l->container)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_unfreeze(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (!l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + if (!l->container->unfreeze(l->container)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_rename(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_RENAME_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_rename_policy, __RPC_LXC_RENAME_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (!tb[RPC_LXC_RENAME_NEWNAME]) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + if (l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + char *newname = blobmsg_data(tb[RPC_LXC_RENAME_NEWNAME]); + if (!newname || !l->container->rename(l->container, newname)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_create(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_CREATE_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + char *template = "none"; + int flags = 0; + char **args = NULL; + + blobmsg_parse(rpc_lxc_create_policy, __RPC_LXC_CREATE_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (tb[RPC_LXC_CREATE_TEMPLATE]) + template = blobmsg_data(tb[RPC_LXC_CREATE_TEMPLATE]); + + if (tb[RPC_LXC_CREATE_FLAGS]) + flags = blobmsg_get_u32(tb[RPC_LXC_CREATE_FLAGS]); + + if (tb[RPC_LXC_CREATE_ARGS]) { + struct blob_attr *cur; + int num, rem; + + num = blobmsg_check_array(tb[RPC_LXC_CREATE_ARGS], BLOBMSG_TYPE_STRING); + + // trailing NULL is needed + args = calloc(num + 1, sizeof(char *)); + if (!args) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + num = 0; + blobmsg_for_each_attr(cur, tb[RPC_LXC_CREATE_ARGS], rem) + { + if (blobmsg_type(cur) != BLOBMSG_TYPE_STRING) + continue; + + args[num++] = (char *) blobmsg_data(cur); + } + } + + if (!l->container->create(l->container, template, NULL, NULL, flags, args)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + free(args); + return rc; +} + +static int +rpc_lxc_destroy(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__RPC_LXC_MAX]; + struct rpc_lxc *l = NULL; + int rc; + + blobmsg_parse(rpc_lxc_min_policy, __RPC_LXC_MAX, tb, blob_data(msg), blob_len(msg)); + + l = rpc_lxc_init(tb); + if (!l) return UBUS_STATUS_INVALID_ARGUMENT; + + if (l->container->is_running(l->container)) { + rc = UBUS_STATUS_UNKNOWN_ERROR; + goto out; + } + + if (!l->container->destroy(l->container)) { + rc = UBUS_STATUS_INVALID_ARGUMENT; + goto out; + } + + rc = UBUS_STATUS_OK; +out: + rpc_lxc_done(l); + return rc; +} + +static int +rpc_lxc_list(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + + blob_buf_init(&buf, 0); + + int rc; + char **names; + struct lxc_container **cret; + + rc = list_all_containers(NULL, &names, &cret); + if (rc == -1) + return UBUS_STATUS_UNKNOWN_ERROR; + + for (int i = 0; i < rc; i++) { + struct lxc_container *c = cret[i]; + blobmsg_add_string(&buf, names[i], c->state(c)); + + free(names[i]); + lxc_container_put(c); + } + + ubus_send_reply(ctx, req, buf.head); + + return UBUS_STATUS_OK; +} + +static int +rpc_lxc_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx) +{ + static const struct ubus_method lxc_methods[] = { + UBUS_METHOD("start", rpc_lxc_start, rpc_lxc_min_policy), + UBUS_METHOD("reboot", rpc_lxc_reboot, rpc_lxc_min_policy), + UBUS_METHOD("shutdown", rpc_lxc_shutdown, rpc_lxc_shutdown_policy), + UBUS_METHOD("stop", rpc_lxc_stop, rpc_lxc_min_policy), + UBUS_METHOD("freeze", rpc_lxc_freeze, rpc_lxc_min_policy), + UBUS_METHOD("unfreeze", rpc_lxc_unfreeze, rpc_lxc_min_policy), + UBUS_METHOD("rename", rpc_lxc_rename, rpc_lxc_rename_policy), + UBUS_METHOD("create", rpc_lxc_create, rpc_lxc_create_policy), + UBUS_METHOD("destroy", rpc_lxc_destroy, rpc_lxc_min_policy), + UBUS_METHOD_NOARG("list", rpc_lxc_list), + }; + + static struct ubus_object_type lxc_type = + UBUS_OBJECT_TYPE("luci-rpc-lxc", lxc_methods); + + static struct ubus_object obj = { + .name = "lxc", + .type = &lxc_type, + .methods = lxc_methods, + .n_methods = ARRAY_SIZE(lxc_methods), + }; + + return ubus_add_object(ctx, &obj); +} + +struct rpc_plugin rpc_plugin = { + .init = rpc_lxc_api_init +}; diff --git a/utils/tracertools/Makefile b/utils/tracertools/Makefile index 7b9e6611f..ad0e720ec 100644 --- a/utils/tracertools/Makefile +++ b/utils/tracertools/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tracertools -PKG_VERSION:=20140905 +PKG_VERSION:=20141022 PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org> @@ -16,7 +16,7 @@ PKG_LICENSE:=GPL-3.0 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://gitorious.org/tracertools/tracertools.git -PKG_SOURCE_VERSION:=4a6eb477a850e102f37b6f6690b0797ec664f36d +PKG_SOURCE_VERSION:=9c3c2e8b81fb8745752ee195b028a50b88dc711b PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz @@ -37,7 +37,6 @@ endef define Package/tracertools/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/tracerstat $(1)/usr/bin/ - ln -s tracerstat $(1)/usr/bin/tracerreq endef $(eval $(call BuildPackage,tracertools)) diff --git a/utils/unrar/Makefile b/utils/unrar/Makefile index 10c70cb68..82c567d5b 100644 --- a/utils/unrar/Makefile +++ b/utils/unrar/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unrar -PKG_VERSION:=5.1.7 +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:=af571529a358c972872b91792ffc0a80 +PKG_MD5SUM:=69ef5af8442cbb7dfdebe298bfb9c61a PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com> PKG_LICENSE:=UnRAR diff --git a/utils/unrar/patches/100-makefile_fixes.patch b/utils/unrar/patches/100-makefile_fixes.patch index e553b7aa9..ca82e1353 100644 --- a/utils/unrar/patches/100-makefile_fixes.patch +++ b/utils/unrar/patches/100-makefile_fixes.patch @@ -1,6 +1,5 @@ -diff -uprN a/unrar/makefile b/unrar/makefile ---- a/makefile 2014-06-12 13:36:14.723816266 +0200 -+++ b/makefile 2014-06-12 13:36:36.174531961 +0200 +--- a/makefile ++++ b/makefile @@ -2,12 +2,12 @@ # Makefile for UNIX - unrar diff --git a/utils/zoneinfo/Makefile b/utils/zoneinfo/Makefile new file mode 100644 index 000000000..8ae115b39 --- /dev/null +++ b/utils/zoneinfo/Makefile @@ -0,0 +1,242 @@ +# +# 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:=2014i +PKG_VERSION_CODE:=2014i +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:=00adeb62a0897aac5ba67da838351adb + +include $(INCLUDE_DIR)/package.mk + +define Download/tzcode + FILE=$(PKG_SOURCE_CODE) + URL=$(PKG_SOURCE_URL) + MD5SUM=7fa413158f01a961348aa6a289b6be21 +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)) |