diff options
| author | Stan Grishin <stangri@melmac.ca> | 2022-10-24 23:11:29 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-24 23:11:29 -0700 |
| commit | bd342a9f7204270011a260a4c599fc00de4b2ed3 (patch) | |
| tree | a041a9789169b4ed282c879203c6366a426bb09a /net/https-dns-proxy | |
| parent | bca4e4b99ad0904fb9e0c2361c0e95c6322a8cd9 (diff) | |
| parent | 61ca2f4d16464a34e638806bd3b9d801d6446b35 (diff) | |
Merge pull request #19699 from stangri/master-https-dns-proxy
https-dns-proxy: add version information to binary
Diffstat (limited to 'net/https-dns-proxy')
| -rw-r--r-- | net/https-dns-proxy/Makefile | 4 | ||||
| -rwxr-xr-x | net/https-dns-proxy/files/https-dns-proxy.init | 4 | ||||
| -rw-r--r-- | net/https-dns-proxy/patches/010-cmakelists-remove-cflags.patch (renamed from net/https-dns-proxy/patches/010-fix-cmakelists.patch) | 0 | ||||
| -rw-r--r-- | net/https-dns-proxy/patches/020-cmakelists-add-version.patch | 51 | ||||
| -rw-r--r-- | net/https-dns-proxy/test.sh | 2 |
5 files changed, 56 insertions, 5 deletions
diff --git a/net/https-dns-proxy/Makefile b/net/https-dns-proxy/Makefile index 5d60de344..cbd8094e4 100644 --- a/net/https-dns-proxy/Makefile +++ b/net/https-dns-proxy/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=https-dns-proxy PKG_VERSION:=2022-10-15 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/aarond10/https_dns_proxy/ @@ -16,7 +16,7 @@ PKG_LICENSE_FILES:=LICENSE include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -CMAKE_OPTIONS += -DCLANG_TIDY_EXE= +CMAKE_OPTIONS += -DCLANG_TIDY_EXE= -DGIT_VERSION=$(PKG_VERSION)-$(PKG_RELEASE) define Package/https-dns-proxy SECTION:=net diff --git a/net/https-dns-proxy/files/https-dns-proxy.init b/net/https-dns-proxy/files/https-dns-proxy.init index 1b1045d18..401c5ff40 100755 --- a/net/https-dns-proxy/files/https-dns-proxy.init +++ b/net/https-dns-proxy/files/https-dns-proxy.init @@ -262,7 +262,7 @@ service_triggers() { local wan wan6 i local wan6_trigger config_load "$packageName" - config_get_bool wan6_trigger 'config' 'wan6_trigger' '0' + config_get_bool wan6_trigger 'config' 'wan6_trigger' '0' . /lib/functions/network.sh network_flush_cache network_find_wan wan @@ -272,7 +272,7 @@ service_triggers() { wan6="${wan6:-wan6}" fi for i in "$wan" "$wan6"; do - [ -n "$i" ] && procd_add_interface_trigger "interface.*" "$i" "/etc/init.d/${packageName}" start + [ -n "$i" ] && procd_add_interface_trigger "interface.*" "$i" "/etc/init.d/${packageName}" restart done procd_add_config_trigger "config.change" "$packageName" "/etc/init.d/${packageName}" reload } diff --git a/net/https-dns-proxy/patches/010-fix-cmakelists.patch b/net/https-dns-proxy/patches/010-cmakelists-remove-cflags.patch index a765a5bbd..a765a5bbd 100644 --- a/net/https-dns-proxy/patches/010-fix-cmakelists.patch +++ b/net/https-dns-proxy/patches/010-cmakelists-remove-cflags.patch diff --git a/net/https-dns-proxy/patches/020-cmakelists-add-version.patch b/net/https-dns-proxy/patches/020-cmakelists-add-version.patch new file mode 100644 index 000000000..8debfe94f --- /dev/null +++ b/net/https-dns-proxy/patches/020-cmakelists-add-version.patch @@ -0,0 +1,51 @@ +From 2ca80486ba6a4e5acbdf0ff581d9754af17fa33b Mon Sep 17 00:00:00 2001 +From: baranyaib90 <5031516+baranyaib90@users.noreply.github.com> +Date: Mon, 24 Oct 2022 22:53:37 +0200 +Subject: [PATCH] Allow external setting of GIT_VERSION + +--- + CMakeLists.txt | 34 ++++++++++++++++++---------------- + 1 file changed, 18 insertions(+), 16 deletions(-) + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -36,22 +36,24 @@ endif() + + # VERSION + +-find_package(Git) +-if(Git_FOUND) +- execute_process( +- COMMAND "${GIT_EXECUTABLE}" show --date=format:%Y.%m.%d --format=%ad-%h --no-patch +- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" +- OUTPUT_VARIABLE GIT_VERSION +- OUTPUT_STRIP_TRAILING_WHITESPACE) +- message(STATUS "Version: ${GIT_VERSION}") ++if(NOT GIT_VERSION) ++ find_package(Git) ++ if(Git_FOUND) ++ execute_process( ++ COMMAND "${GIT_EXECUTABLE}" show --date=format:%Y.%m.%d --format=%ad-%h --no-patch ++ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" ++ OUTPUT_VARIABLE GIT_VERSION ++ OUTPUT_STRIP_TRAILING_WHITESPACE) ++ message(STATUS "Version: ${GIT_VERSION}") + +- # May not update version in some cases (example: git commit --amend) +- set_property(GLOBAL APPEND +- PROPERTY CMAKE_CONFIGURE_DEPENDS +- "${CMAKE_SOURCE_DIR}/.git/index") +-else() +- set(GIT_VERSION "UNKNOWN") +- message(WARNING "Could not find git command! Version is set to: ${GIT_VERSION}") ++ # May not update version in some cases (example: git commit --amend) ++ set_property(GLOBAL APPEND ++ PROPERTY CMAKE_CONFIGURE_DEPENDS ++ "${CMAKE_SOURCE_DIR}/.git/index") ++ else() ++ set(GIT_VERSION "UNKNOWN") ++ message(WARNING "Could not find git command! Version is set to: ${GIT_VERSION}") ++ endif() + endif() + + # LIBRARY DEPENDENCIES diff --git a/net/https-dns-proxy/test.sh b/net/https-dns-proxy/test.sh index 45469ed96..443b747a0 100644 --- a/net/https-dns-proxy/test.sh +++ b/net/https-dns-proxy/test.sh @@ -1,3 +1,3 @@ #!/bin/sh -/etc/init.d/"$1" version 2>&1 | grep "$2" +/etc/init.d/"$1" version 2>&1 | grep "$2" && "$1" -V 2>&1 | grep "$2" |
