include $(TOPDIR)/rules.mk
PKG_NAME:=youtube-dl
-PKG_VERSION:=2017.02.17
+PKG_VERSION:=2017.06.05
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://yt-dl.org/downloads/$(PKG_VERSION)/
-PKG_MD5SUM:=d38dbe099af22eb9af35b0e8b274dc4e
+PKG_HASH:=7ca5143fb2b5d41a9752a4c866cac3f2f261174e
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_LICENSE:=Unlicense
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
+PKG_BUILD_DEPENDS:=python/host
include $(INCLUDE_DIR)/package.mk
define Package/youtube-dl/install
$(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/youtube-dl $(1)/usr/bin/
+
+ python -m compileall $(PKG_BUILD_DIR)/youtube_dl/
+ cd $(PKG_BUILD_DIR) && zip --quiet youtube-dl-c.zip youtube_dl/*.pyc youtube_dl/*/*.pyc
+ cd $(PKG_BUILD_DIR) && zip --quiet --junk-paths youtube-dl-c.zip youtube_dl/__main__.pyc
+ echo '#!/usr/bin/env python' > $(PKG_BUILD_DIR)/youtube-dl-c
+ cat $(PKG_BUILD_DIR)/youtube-dl-c.zip >> $(PKG_BUILD_DIR)/youtube-dl-c
+
+ $(INSTALL_BIN) -T $(PKG_BUILD_DIR)/youtube-dl-c $(1)/usr/bin/youtube-dl
endef
$(eval $(call BuildPackage,youtube-dl))
include $(TOPDIR)/rules.mk
PKG_NAME:=adblock
-PKG_VERSION:=2.6.4
+PKG_VERSION:=2.7.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
PKG_MAINTAINER:=Dirk Brenken <dev@brenken.org>
* => daily updates, approx. 1.500 entries
* [openphish](https://openphish.com)
* => numerous updates on the same day, approx. 1.800 entries
- * [palevo tracker](https://palevotracker.abuse.ch)
- * => daily updates, approx. 15 entries
* [ransomware tracker](https://ransomwaretracker.abuse.ch)
* => daily updates, approx. 150 entries
* [reg_cn](https://easylist-downloads.adblockplus.org/easylistchina+easylist.txt)
* query function to quickly identify blocked (sub-)domains, e.g. for whitelisting
* optional: force dns requests to local resolver
* optional: force overall sort / duplicate removal for low memory devices (handle with care!)
-* optional: automatic block list backup & restore, backups will be (de-)compressed and restored on the fly in case of any runtime error
+* optional: 'manual mode' to re-use blocklist backups during startup, get fresh lists only via manual reload or restart action
+* optional: automatic block list backup & restore, they will be used in case of download errors or during startup in manual mode
* optional: add new adblock sources on your own via uci config
## Prerequisites
* adb\_triggerdelay => additional trigger delay in seconds before adblock processing starts (default: '2')
* adb\_forcedns => force dns requests to local resolver (default: '0', disabled)
* adb\_forcesrt => force overall sort on low memory devices with less than 64 MB RAM (default: '0', disabled)
+ * adb\_manmode => do not automatically update blocklists during startup, use blocklist backups instead (default: '0', disabled)
## Examples
**change default dns backend to 'unbound':**
option adb_src_rset '{FS=\"/\"} \$3 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$3)}'
option adb_src_desc 'focus on phishing, numerous updates on the same day, approx. 1.800 entries'
-config source 'palevo'
- option enabled '0'
- option adb_src 'https://palevotracker.abuse.ch/blocklists.php?download=domainblocklist'
- option adb_src_rset '\$1 ~/^([A-Za-z0-9_-]+\.){1,}[A-Za-z]+/{print tolower(\$1)}'
- option adb_src_desc 'focus on palevo worm, daily updates, approx. 15 entries'
-
config source 'ransomware'
option enabled '0'
option adb_src 'https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt'
#
LC_ALL=C
PATH="/usr/sbin:/usr/bin:/sbin:/bin"
-adb_ver="2.6.4"
+adb_ver="2.7.0"
adb_sysver="$(ubus -S call system board | jsonfilter -e '@.release.description')"
adb_enabled=1
adb_debug=0
+adb_minfree=2
+adb_manmode=0
adb_forcesrt=0
adb_forcedns=0
adb_backup=0
{
local services dns_up cnt=0
- # source in system library
+ # source in system libraries
#
if [ -r "/lib/functions.sh" ] && [ -r "/usr/share/libubox/jshn.sh" ]
then
#
f_dnsrestart()
{
- local cnt=0
+ local dns_up mem_free cnt=0
"/etc/init.d/${adb_dns}" restart >/dev/null 2>&1
while [ ${cnt} -le 10 ]
do
- adb_dnsup="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@.${adb_dns}.instances.*.running")"
- if [ "${adb_dnsup}" = "true" ]
+ dns_up="$(ubus -S call service list "{\"name\":\"${adb_dns}\"}" | jsonfilter -l1 -e "@.${adb_dns}.instances.*.running")"
+ if [ "${dns_up}" = "true" ]
then
- break
+ mem_free="$(awk '/^MemFree/ {print int($2/1000)}' "/proc/meminfo")"
+ if [ ${mem_free} -ge ${adb_minfree} ]
+ then
+ return 0
+ fi
fi
cnt=$((cnt+1))
sleep 1
done
+ return 1
}
# f_list: backup/restore/remove block lists
fi
adb_rc=${?}
;;
+ format)
+ if [ -s "${adb_tmpdir}/tmp.whitelist" ]
+ then
+ grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpfile}" | eval "${adb_dnsformat}" > "${adb_dnsfile}"
+ else
+ eval "${adb_dnsformat}" "${adb_tmpfile}" > "${adb_dnsfile}"
+ fi
+ adb_rc=${?}
+ ;;
esac
f_log "debug" "name: ${src_name}, mode: ${mode}, count: ${cnt}, in_rc: ${in_rc}, out_rc: ${adb_rc}"
}
f_rmdns
f_dnsrestart
fi
- exit 255
+ exit 1
fi
fi
}
#
f_main()
{
- local enabled url cnt sum_cnt=0 mem_total=0
- local src_name src_rset shalla_archive
- mem_total="$(awk '$1 ~ /^MemTotal/ {printf $2}' "/proc/meminfo" 2>/dev/null)"
+ local src_name src_rset shalla_archive enabled url cnt sum_cnt=0
+ local mem_total="$(awk '/^MemTotal/ {print int($2/1000)}' "/proc/meminfo")"
f_log "info " "start adblock processing ..."
- f_log "debug" "action: ${adb_action}, backup: ${adb_backup}, dns: ${adb_dns}, fetch: ${adb_fetchinfo}, memory: ${mem_total}, force srt/dns: ${adb_forcesrt}/${adb_forcedns}"
+ f_log "debug" "action: ${adb_action}, manual_mode:${adb_manmode}, backup: ${adb_backup}, dns: ${adb_dns}, fetch: ${adb_fetchinfo}, mem_total: ${mem_total}, force_srt/_dns: ${adb_forcesrt}/${adb_forcedns}"
> "${adb_rtfile}"
for src_name in ${adb_sources}
do
continue
fi
+ # manual mode
+ #
+ if [ ${adb_manmode} -eq 1 ] && [ -z "${adb_action}" ]
+ then
+ adb_rc=4
+ f_list restore
+ if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
+ then
+ f_list format
+ continue
+ fi
+ fi
+
# download block list
#
if [ "${src_name}" = "blacklist" ]
then
- cat "${url}" 2>/dev/null > "${adb_tmpload}"
+ cat "${url}" > "${adb_tmpload}"
adb_rc=${?}
elif [ "${src_name}" = "shalla" ]
then
shalla_archive="${adb_tmpdir}/shallalist.tar.gz"
- "${adb_fetch}" ${adb_fetchparm} "${shalla_archive}" "${url}" 2>/dev/null
+ "${adb_fetch}" ${adb_fetchparm} "${shalla_archive}" "${url}"
adb_rc=${?}
if [ ${adb_rc} -eq 0 ]
then
rm -f "${shalla_archive}"
rm -rf "${adb_tmpdir}/BL"
else
- "${adb_fetch}" ${adb_fetchparm} "${adb_tmpload}" "${url}" 2>/dev/null
+ "${adb_fetch}" ${adb_fetchparm} "${adb_tmpload}" "${url}"
adb_rc=${?}
fi
#
if [ ${adb_rc} -eq 0 ] && [ -s "${adb_tmpfile}" ]
then
- if [ -s "${adb_tmpdir}/tmp.whitelist" ]
- then
- grep -vf "${adb_tmpdir}/tmp.whitelist" "${adb_tmpfile}" 2>/dev/null | eval "${adb_dnsformat}" > "${adb_dnsfile}"
- else
- eval "${adb_dnsformat}" "${adb_tmpfile}" > "${adb_dnsfile}"
- fi
- adb_rc=${?}
+ f_list format
if [ ${adb_rc} -ne 0 ]
then
f_list remove
#
for src_name in $(ls -dASr "${adb_tmpdir}/${adb_dnsprefix}"* 2>/dev/null)
do
- if [ ${mem_total} -ge 64000 ] || [ ${adb_forcesrt} -eq 1 ]
+ if [ ${mem_total} -ge 64 ] || [ ${adb_forcesrt} -eq 1 ]
then
if [ -s "${adb_tmpdir}/blocklist.overall" ]
then
chown "${adb_dns}":"${adb_dns}" "${adb_dnsdir}/${adb_dnsprefix}"* 2>/dev/null
f_rmtemp
f_dnsrestart
- if [ "${adb_dnsup}" = "true" ]
+ if [ ${?} -eq 0 ]
then
json_init
json_add_object "data"
define Package/bind-dnssec
$(call Package/bind/Default)
- TITLE+= administration tools (dnssec-keygen and dnssec-signzone only)
+ TITLE+= administration tools (dnssec-keygen, dnssec-settime and dnssec-signzone only)
endef
define Package/bind-host
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/host $(1)/usr/bin/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkconf $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/named-checkzone $(1)/usr/sbin/
define Package/bind-dnssec/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-keygen $(1)/usr/sbin/
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-settime $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dnssec-signzone $(1)/usr/sbin/
endef
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_pub $(1)/usr/bin/mosquitto_pub
$(INSTALL_BIN) $(PKG_BUILD_DIR)/client/mosquitto_sub $(1)/usr/bin/mosquitto_sub
endef
-Package/mosquitto-client-nossl/install = $(Package/mosquitto-client/install)
+Package/mosquitto-client-nossl/install = $(Package/mosquitto-client-ssl/install)
# This installs files into ./staging_dir/. so that you can cross compile from the host
define Build/InstallDev