Merge pull request #16358 from jamesmacwhite/21.02-stubby-0.4.0

[21.02] stubby: version 0.4.0
This commit is contained in:
Rosen Penev 2021-08-18 02:01:11 -07:00 committed by GitHub
commit a551032404
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 46 deletions

View file

@ -5,21 +5,18 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=stubby
PKG_VERSION:=0.3.0
PKG_RELEASE:=1
PKG_VERSION:=0.4.0
PKG_RELEASE:=3
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/getdnsapi/$(PKG_NAME)
PKG_SOURCE_VERSION:=v$(PKG_VERSION)
PKG_MIRROR_HASH:=f1585aa6881bf39c2c8f99df045d5739bb78403417a1e827644cb202fa4280f0
PKG_MIRROR_HASH:=bc5f604da1b70287a6c3d89eac2e13ce8bca52840e7b72ab098a3deeb9935082
PKG_MAINTAINER:=Jonathan Underwood <jonathan.underwood@gmail.com>
PKG_MAINTAINER:=
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=COPYING
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@ -48,6 +45,11 @@ define Package/stubby/conffiles
/etc/config/stubby
endef
define Build/Prepare
$(call Build/Prepare/Default)
rm $(PKG_BUILD_DIR)/cmake/modules/FindLibidn2.cmake $(PKG_BUILD_DIR)/cmake/modules/FindLibunbound.cmake
endef
define Package/stubby/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/stubby $(1)/usr/sbin/stubby

View file

@ -266,9 +266,12 @@ service_triggers()
trigger="$(uci_get stubby global trigger)"
delay="$(uci_get stubby global triggerdelay "2")"
if [ "$trigger" != "none" ] && [ "$trigger" != "timed" ]; then
PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
procd_add_interface_trigger "interface.*.up" "$trigger" "$stubby_init" start
fi
PROCD_RELOAD_DELAY=$((${delay:-2} * 1000))
for trigger_item in $trigger
do
procd_add_interface_trigger "interface.*.up" "$trigger_item" "$stubby_init" start
done
procd_add_reload_trigger "stubby"
}

View file

@ -1,35 +0,0 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,14 +115,26 @@ install(FILES AUTHORS COPYING ChangeLog
# Ensure the file gets CRLF line endings on Windows.
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/stubby.yml INPUT ${CMAKE_CURRENT_SOURCE_DIR}/stubby.yml.example)
-# Copy to destination iff no destination file exists.
+
+# Copy stubby.yml to destination iff no destination file exists.
+# This is complicated by (a) not being able to use generators, due to
+# CMake minimum version requirement, and (b) to account for DESTDIR.
+# And in the latter case, if we're adding DESTDIR to the start of the
+# path, we must on Windows remove any initial drive letter. That's what
+# INSTALL appears to do.
install(CODE "\
- set(targetdir ${STUBBYCONFDIR})\n\
- if (\$ENV{DESTDIR})\n\
- set(targetdir \$ENV{DESTDIR}/\${targetdir})\n\
+ set(targetdir \"${STUBBYCONFDIR}\")\n\
+ set(destdir \"\$ENV{DESTDIR}\")\n\
+ if (destdir)\n\
+ string(REGEX REPLACE \"^([A-Z]:)?/(.*)\" \"\\\\2\" newtarget \"\${targetdir}\")\n\
+ if (newtarget)\n\
+ set(targetdir \"\${newtarget}\")\n\
+ endif ()\n\
+ set(targetdir \"\${destdir}/\${newtarget}\")\n\
endif ()\n\
- if (NOT EXISTS \${targetdir}/stubby.yml)\n\
- file(COPY ${CMAKE_CURRENT_BINARY_DIR}/stubby.yml DESTINATION \${targetdir})\n\
+ if (NOT EXISTS \"\${targetdir}/stubby.yml\")\n\
+ file(COPY \"${CMAKE_CURRENT_BINARY_DIR}/stubby.yml\" DESTINATION \"\${targetdir}\")\n\
+ message(\"-- Installing: \${targetdir}/stubby.yml\")\n\
endif ()")
if (APPLE)