From 75a885d4252040f4ee88b05ed5f1f3ada6ed3681 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 22 Feb 2020 14:42:08 +0800 Subject: [PATCH 1/2] luci-app-dnspod: remove out-of-date package --- package/lean/luci-app-dnspod/Makefile | 51 ------ package/lean/luci-app-dnspod/files/dnspod.sh | 169 ------------------ .../files/root/etc/config/dnspod | 7 - .../files/root/etc/init.d/dnspod | 18 -- .../usr/lib/lua/luci/controller/dnspod.lua | 5 - .../usr/lib/lua/luci/model/cbi/dnspod.lua | 32 ---- .../luci-app-ssr-plus/po/zh-cn/ssr-plus.po | 2 +- 7 files changed, 1 insertion(+), 283 deletions(-) delete mode 100644 package/lean/luci-app-dnspod/Makefile delete mode 100755 package/lean/luci-app-dnspod/files/dnspod.sh delete mode 100644 package/lean/luci-app-dnspod/files/root/etc/config/dnspod delete mode 100755 package/lean/luci-app-dnspod/files/root/etc/init.d/dnspod delete mode 100644 package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/controller/dnspod.lua delete mode 100644 package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/model/cbi/dnspod.lua diff --git a/package/lean/luci-app-dnspod/Makefile b/package/lean/luci-app-dnspod/Makefile deleted file mode 100644 index 6d55ff6c6a..0000000000 --- a/package/lean/luci-app-dnspod/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-dnspod -PKG_VERSION=1.0 -PKG_RELEASE:=1 - -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk - -define Package/luci-app-dnspod - SECTION:=luci - CATEGORY:=LuCI - SUBMENU:=3. Applications - TITLE:=Auto DNS for dnspod - PKGARCH:=all - DEPENDS:= +curl +libcurl -endef - -define Package/luci-app-dnspod/description - auto get pub ip,dnspod ddns,must include curl with ssl -endef - -define Build/Prepare -endef - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/luci-app-dnspod/install - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi - $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller - - $(INSTALL_CONF) ./files/root/etc/config/dnspod $(1)/etc/config/dnspod - $(INSTALL_BIN) ./files/root/etc/init.d/dnspod $(1)/etc/init.d/dnspod - $(INSTALL_DATA) ./files/root/usr/lib/lua/luci/model/cbi/dnspod.lua $(1)/usr/lib/lua/luci/model/cbi/dnspod.lua - $(INSTALL_DATA) ./files/root/usr/lib/lua/luci/controller/dnspod.lua $(1)/usr/lib/lua/luci/controller/dnspod.lua - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) ./files/dnspod.sh $(1)/usr/sbin -endef - -$(eval $(call BuildPackage,luci-app-dnspod)) - - - diff --git a/package/lean/luci-app-dnspod/files/dnspod.sh b/package/lean/luci-app-dnspod/files/dnspod.sh deleted file mode 100755 index de0772999d..0000000000 --- a/package/lean/luci-app-dnspod/files/dnspod.sh +++ /dev/null @@ -1,169 +0,0 @@ -#!/bin/bash -#written by Michael Qu -#greennyreborn@gmail.com - -#dnspod api token -token=`uci get dnspod.base_arg.login_token` - -#域名 -domain=`uci get dnspod.base_arg.main_domain 2>/dev/null` - - -#需要更新的子域名,只允许一个 -#由于*linux会被脚本解析为当前目录下的所有文件,所以请填写\* -# sub_domain='\*' -sub_domain=`uci get dnspod.base_arg.sub_domain 2>/dev/null` -if [ $sub_domain = "\*" ]; then - sub_domain="*" -fi - -#check for changed ip every 300 seconds -wait=300 -wait_second=`uci get dnspod.base_arg.wait_second 2>/dev/null` -if [[ $wait_second =~ ^[1-9][0-9]*$ ]]; then - wait=$wait_second -fi - -#外网ip获取命令 -command=`uci get dnspod.base_arg.command_to_get_ip 2>/dev/null` -if [ -z "$command" ]; then - command='curl -s whatismyip.akamai.com' -fi - -#检查curl是否安装 -curl_status=`which curl 2>/dev/null` -[ -n "$curl_status" ] || { echo "curl is not installed";exit 3; } - -os=$(uname -a | egrep -io 'openwrt' | tr [A-Z] [a-z]) - -API_url="https://dnsapi.cn" -LOG_FILE="/tmp/dnspod.log" -MAX_LOG_SIZE=`expr 1 * 1024 * 1024` # 默认最大限制1M -PROGRAM=$(basename $0) - -format='json' -lang='en' -record_type='A' -common_options="login_token=$token&format=${format}&lang=${lang}" - -is_svc=0 -last_modified_ip= - -getFileSize() { - local file=$1 - wc -c $file | awk '{print $1}' -} - -clearLog() { - local file_size=$(getFileSize $LOG_FILE) - if [ $file_size -gt $MAX_LOG_SIZE ]; then - echo "" > $LOG_FILE - printMsg "Log file [$LOG_FILE], size: [$file_size bytes]." - printMsg "Exceeds max log size [$MAX_LOG_SIZE]. Clear the log." - fi -} - -printMsg() { - local time=$(date "+%Y-%m-%d %H:%M:%S") - local msg="$1" - if [ $is_svc -eq 1 ]; then - echo "$time: $msg" >> $LOG_FILE - # logger -t ${PROGRAM} "${msg}" - else - echo "$time: $msg" - fi -} - -getIp() { -# curl -s http://checkip.dyndns.com | sed -n 's/.*: \([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\).*/\1/p' - eval $command -} - -execAPI() { - local action="$1" - local extra_options="$2" - - eval "curl -k -X POST \"${API_url}/${action}\" -d \"${common_options}&${extra_options}\"" -} - -getRecordList() { - local extra_options="domain=$domain" - echo $(execAPI "Record.List" "$extra_options") - exit -} - -updateRecord() { - local ip=$1 - local record_list=`getRecordList` - local old_ip=`jsonfilter -s "$record_list" -e "@.records[@.name='$sub_domain'].value"` - local id=`jsonfilter -s "$record_list" -e "@.records[@.name='$sub_domain'].id"` - printMsg "Change record: $sub_domain.$domain from $old_ip to $ip" - - local extra_options="domain=$domain&record_id=$id&value=$ip&record_type=A&record_line_id=0&sub_domain=$sub_domain" - local response=$(execAPI "Record.Modify" "$extra_options") - - local code=`jsonfilter -s "$response" -e "@.status.code"` - if [ "$code" == "1" ]; then - last_modified_ip=$ip - fi - local message=`jsonfilter -s "$response" -e "@.status.message"` - printMsg "response: $message" - -} - -checkip() { - local wan_ip=$1 - printMsg "old ip: [$last_modified_ip], new ip: [$wan_ip]" - if [ "$wan_ip" != "$last_modified_ip" ]; then - return 8 - else - return 3 - fi -} - -execSvc() { - local ip - #check that whether the network is ok - while [ 1 ];do - ip=$(getIp) - if [ -n "$ip" ]; then - printMsg "WAN IP: ${ip}" - break; - else - printMsg "Can't get wan ip" - sleep 30 - fi - done - - while [ 1 ];do - clearLog - ip=$(getIp) - checkip $ip - if [ $? -eq 8 ]; then - updateRecord $ip - #updateTunnelBroker - fi - sleep $wait - done -} - -execUpdate() { - local ip=`getIp` - printMsg "WAN IP: ${ip}" - updateRecord $ip -} - -case $1 in - --svc) - is_svc=1; - clearLog; - printMsg "Start in Service mode, check in every $wait seconds"; - printMsg "domain: ${domain}, sub_domain: ${sub_domain}"; - printMsg "Use command: [$command] to get wan ip"; - execSvc;; - *) - is_svc=0; - printMsg "Start update record, domain: ${domain}, sub_domain: ${sub_domain}"; - printMsg "Use command: [$command] to get wan ip"; - execUpdate;; -esac diff --git a/package/lean/luci-app-dnspod/files/root/etc/config/dnspod b/package/lean/luci-app-dnspod/files/root/etc/config/dnspod deleted file mode 100644 index 00876ecfc5..0000000000 --- a/package/lean/luci-app-dnspod/files/root/etc/config/dnspod +++ /dev/null @@ -1,7 +0,0 @@ -config base_arg "base_arg" - option main_domain '' - option sub_domain '' - option login_token '' - option wait_second '' - option command_to_get_ip 'curl -s whatismyip.akamai.com' - diff --git a/package/lean/luci-app-dnspod/files/root/etc/init.d/dnspod b/package/lean/luci-app-dnspod/files/root/etc/init.d/dnspod deleted file mode 100755 index 036fa308ed..0000000000 --- a/package/lean/luci-app-dnspod/files/root/etc/init.d/dnspod +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common -START=80 - -start() -{ - /usr/sbin/dnspod.sh --svc & -} - -stop() -{ - ps | grep dnspod.sh | grep -v 'grep' | awk '{print $1}' | xargs kill -} - -run_reboot() -{ - stop - start -} diff --git a/package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/controller/dnspod.lua b/package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/controller/dnspod.lua deleted file mode 100644 index 56517f10f8..0000000000 --- a/package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/controller/dnspod.lua +++ /dev/null @@ -1,5 +0,0 @@ -module("luci.controller.dnspod", package.seeall) - -function index() - entry({"admin", "network", "dnspod"}, cbi("dnspod"), _("动态DNSPOD"), 100) -end diff --git a/package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/model/cbi/dnspod.lua b/package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/model/cbi/dnspod.lua deleted file mode 100644 index 437fd9076c..0000000000 --- a/package/lean/luci-app-dnspod/files/root/usr/lib/lua/luci/model/cbi/dnspod.lua +++ /dev/null @@ -1,32 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2010 Jo-Philipp Wich - -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 -]]-- - -require("luci.sys") - -m = Map("dnspod", translate("动态DNSPOD"), translate("配置动态DNSPOD")) - -s = m:section(TypedSection, "base_arg", "") -s.addremove = false -s.anonymous = true - -email = s:option(Value, "login_token", translate("DNSPOD Token"), "格式: ID,Token") -main = s:option(Value, "main_domain", translate("主域名"), "想要解析的主域名,例如:baidu.com") -sub = s:option(Value, "sub_domain", translate("子域名"), "想要解析的子域名,只允许填写一个。如果想解析*子域名,请填写 \\*") -wait = s:option(Value, "wait_second", translate("更新周期(s)"), "请填写数字,默认为300s") -command = s:option(Value, "command_to_get_ip", translate("外网ip获取命令"), "默认为 curl -s whatismyip.akamai.com") - -local apply = luci.http.formvalue("cbi.apply") -if apply then - io.popen("/etc/init.d/dnspod restart &") -end - -return m diff --git a/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po b/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po index 4dfe6366c0..ceecde26cf 100644 --- a/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po +++ b/package/lean/luci-app-ssr-plus/po/zh-cn/ssr-plus.po @@ -47,7 +47,7 @@ msgid "Server Address" msgstr "服务器地址" msgid "Server Port" -msgstr "服务器端口" +msgstr "端口" msgid "Local Port" msgstr "本地端口" From b67976c246ed3b73d0b38267ad349b8cbe642410 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 22 Feb 2020 16:00:57 +0800 Subject: [PATCH 2/2] readline: curses link --- package/lean/samba4/Makefile | 2 +- package/libs/readline/Makefile | 35 ++++++++----------- .../readline/patches/001-curses-link.patch | 16 +++++++++ .../readline/patches/001-install_perm.patch | 11 ------ 4 files changed, 31 insertions(+), 33 deletions(-) create mode 100644 package/libs/readline/patches/001-curses-link.patch delete mode 100644 package/libs/readline/patches/001-install_perm.patch diff --git a/package/lean/samba4/Makefile b/package/lean/samba4/Makefile index 8c8961cc45..7e312f05dc 100644 --- a/package/lean/samba4/Makefile +++ b/package/lean/samba4/Makefile @@ -431,4 +431,4 @@ $(eval $(call BuildPackage,samba4-libs)) $(eval $(call BuildPackage,samba4-server)) $(eval $(call BuildPackage,samba4-client)) $(eval $(call BuildPackage,samba4-admin)) -$(eval $(call BuildPackage,samba4-utils)) +$(eval $(call BuildPackage,samba4-utils)) \ No newline at end of file diff --git a/package/libs/readline/Makefile b/package/libs/readline/Makefile index ca3a468637..ddf05986a5 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/readline/Makefile @@ -8,19 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=readline -PKG_VERSION:=7.0 +PKG_VERSION:=8.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/readline -PKG_HASH:=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 +PKG_HASH:=e339f51971478d369f8a053a330a190781acb9864cf4c541060f12078948e461 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:gnu:readline PKG_BUILD_PARALLEL:=1 -PKG_FIXUP:=autoreconf PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -30,45 +29,39 @@ define Package/libreadline SECTION:=libs CATEGORY:=Libraries TITLE:=Command lines edition library + DEPENDS:=+libncursesw URL:=http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html - ABI_VERSION:=$(PKG_VERSION) + ABI_VERSION:=8 endef define Package/libreadline/description - The Readline library provides a set of functions for use by applications - that allow users to edit command lines as they are typed in. Both Emacs - and vi editing modes are available. The Readline library includes - additional functions to maintain a list of previously-entered command - lines, to recall and perhaps reedit those lines, and perform csh-like + The Readline library provides a set of functions for use by applications + that allow users to edit command lines as they are typed in. Both Emacs + and vi editing modes are available. The Readline library includes + additional functions to maintain a list of previously-entered command + lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands. endef -# prevent "autoreconf" from removing "aclocal.m4" -PKG_REMOVE_FILES:= - -CONFIGURE_ARGS += \ - --enable-shared \ - --enable-static \ - --with-curses \ +CONFIGURE_ARGS += --with-curses --disable-install-examples CONFIGURE_VARS += \ bash_cv_wcwidth_broken=no \ bash_cv_func_sigsetjmp=yes \ -TARGET_CPPFLAGS:=-I. -I.. $(TARGET_CPPFLAGS) - TARGET_CFLAGS += $(FPIC) define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/readline $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{a,so,so.7,so.7.0} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{a,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/readline.pc $(1)/usr/lib/pkgconfig/ endef define Package/libreadline/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{so,so.7,so.7.0} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.so.* $(1)/usr/lib/ endef $(eval $(call HostBuild)) diff --git a/package/libs/readline/patches/001-curses-link.patch b/package/libs/readline/patches/001-curses-link.patch new file mode 100644 index 0000000000..dc18931517 --- /dev/null +++ b/package/libs/readline/patches/001-curses-link.patch @@ -0,0 +1,16 @@ +link readline directly to ncurses since it needs symbols from it + +upstream readline does this on purpose (no direct linking), but +it doesn't make much sense in a Linux world + +--- a/support/shobj-conf ++++ b/support/shobj-conf +@@ -42,7 +42,7 @@ SHOBJ_XLDFLAGS= + SHOBJ_LIBS= + + SHLIB_XLDFLAGS= +-SHLIB_LIBS= ++SHLIB_LIBS=-lncurses + + SHLIB_DOT='.' + SHLIB_LIBPREF='lib' diff --git a/package/libs/readline/patches/001-install_perm.patch b/package/libs/readline/patches/001-install_perm.patch deleted file mode 100644 index 951ff73e5b..0000000000 --- a/package/libs/readline/patches/001-install_perm.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/support/shlib-install -+++ b/support/shlib-install -@@ -73,7 +73,7 @@ fi - case "$host_os" in - hpux*|darwin*|macosx*|linux*|solaris2*) - if [ -z "$uninstall" ]; then -- chmod 555 ${INSTALLDIR}/${LIBNAME} -+ chmod +x ${INSTALLDIR}/${LIBNAME} - fi ;; - cygwin*|mingw*) - IMPLIBNAME=`echo ${LIBNAME} \