From 977209d1d80aa2e4821c8b67703094e2aeda29e5 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 2 Apr 2021 16:12:32 +0200 Subject: [PATCH] CONTRIB: move 51Degrees to addons/51degrees Now it's much cleaner, both 51d.c and the dummy library live together and are easier to spot and maintain. The build howto probably ought to be moved there as well. Makefile, docs and MAINTAINERS were updated, as well as the github CI's build matrix, travis CI's, and coverity checks. --- .github/matrix.py | 4 ++-- .github/workflows/coverity.yml | 2 +- .travis.yml | 4 ++-- MAINTAINERS | 2 +- Makefile | 3 ++- {src => addons/51degrees}/51d.c | 0 .../src => addons/51degrees/dummy}/cityhash/city.c | 0 .../51degrees/dummy}/pattern/51Degrees.c | 0 .../51degrees/dummy}/pattern/51Degrees.h | 0 .../51d/src => addons/51degrees/dummy}/threading.c | 0 .../src => addons/51degrees/dummy}/trie/51Degrees.c | 0 .../src => addons/51degrees/dummy}/trie/51Degrees.h | 0 doc/51Degrees-device-detection.txt | 12 ++++++------ 13 files changed, 14 insertions(+), 13 deletions(-) rename {src => addons/51degrees}/51d.c (100%) rename {contrib/51d/src => addons/51degrees/dummy}/cityhash/city.c (100%) rename {contrib/51d/src => addons/51degrees/dummy}/pattern/51Degrees.c (100%) rename {contrib/51d/src => addons/51degrees/dummy}/pattern/51Degrees.h (100%) rename {contrib/51d/src => addons/51degrees/dummy}/threading.c (100%) rename {contrib/51d/src => addons/51degrees/dummy}/trie/51Degrees.c (100%) rename {contrib/51d/src => addons/51degrees/dummy}/trie/51Degrees.h (100%) diff --git a/.github/matrix.py b/.github/matrix.py index e31d8edd4..9f4e1f635 100644 --- a/.github/matrix.py +++ b/.github/matrix.py @@ -83,7 +83,7 @@ for CC in ["gcc", "clang"]: "DEVICEATLAS_SRC=contrib/deviceatlas", "USE_PROMEX=1", "USE_51DEGREES=1", - "51DEGREES_SRC=contrib/51d/src/pattern", + "51DEGREES_SRC=addons/51degrees/dummy/pattern", ], } ) @@ -149,7 +149,7 @@ matrix.append( "DEVICEATLAS_SRC=contrib/deviceatlas", "USE_PROMEX=1", "USE_51DEGREES=1", - "51DEGREES_SRC=contrib/51d/src/pattern", + "51DEGREES_SRC=addons/51degrees/dummy/pattern", ], } ) diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 4fbe295eb..7537ba3e4 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -17,7 +17,7 @@ jobs: COVERITY_SCAN_PROJECT_NAME: 'Haproxy' COVERITY_SCAN_BRANCH_PATTERN: '*' COVERITY_SCAN_NOTIFICATION_EMAIL: 'chipitsine@gmail.com' - COVERITY_SCAN_BUILD_COMMAND: "make CC=clang TARGET=linux-glibc USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_LUA=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_WURFL=1 WURFL_INC=contrib/wurfl WURFL_LIB=contrib/wurfl USE_DEVICEATLAS=1 DEVICEATLAS_SRC=contrib/deviceatlas USE_51DEGREES=1 51DEGREES_SRC=contrib/51d/src/pattern" + COVERITY_SCAN_BUILD_COMMAND: "make CC=clang TARGET=linux-glibc USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_LUA=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_WURFL=1 WURFL_INC=contrib/wurfl WURFL_LIB=contrib/wurfl USE_DEVICEATLAS=1 DEVICEATLAS_SRC=contrib/deviceatlas USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/pattern" steps: - uses: actions/checkout@v2 - name: Install apt dependencies diff --git a/.travis.yml b/.travis.yml index 80fddcaec..3d2f280bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ env: global: - FLAGS="USE_ZLIB=1 USE_PCRE=1 USE_PCRE_JIT=1 USE_LUA=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_WURFL=1 WURFL_INC=contrib/wurfl WURFL_LIB=contrib/wurfl USE_DEVICEATLAS=1 DEVICEATLAS_SRC=contrib/deviceatlas USE_51DEGREES=1" - TMPDIR=/tmp - - FIFTYONEDEGREES_SRC="contrib/51d/src/pattern" + - FIFTYONEDEGREES_SRC="addons/51degrees/dummy/pattern" - DEBUG_OPTIONS="DEBUG_STRICT=1" addons: @@ -49,7 +49,7 @@ matrix: - os: linux if: type == cron compiler: clang - env: TARGET=linux-glibc OPENSSL_VERSION=1.1.0l FIFTYONEDEGREES_SRC="contrib/51d/src/trie" CC=clang-9 + env: TARGET=linux-glibc OPENSSL_VERSION=1.1.0l FIFTYONEDEGREES_SRC="addons/51degrees/dummy/trie" CC=clang-9 name: openssl-1.1.1 | 51d trie - os: linux env: DEBUG_OPTIONS="" diff --git a/MAINTAINERS b/MAINTAINERS index 7f4881d38..144cc4253 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20,7 +20,7 @@ List of maintainers 51Degrees device identification Maintainer: Ben Shillito -Files: src/51d.c, contrib/51d, doc/51Degrees-device-detection.txt +Files: addons/51degrees, doc/51Degrees-device-detection.txt Cache Maintainer: William Lallemand diff --git a/Makefile b/Makefile index 3a295c72e..a9e8b492a 100644 --- a/Makefile +++ b/Makefile @@ -652,7 +652,7 @@ ifneq ($(USE_51DEGREES),) 51DEGREES_LIB = $(51DEGREES_SRC) OPTIONS_OBJS += $(51DEGREES_LIB)/../cityhash/city.o OPTIONS_OBJS += $(51DEGREES_LIB)/51Degrees.o -OPTIONS_OBJS += src/51d.o +OPTIONS_OBJS += addons/51degrees/51d.o OPTIONS_CFLAGS += $(if $(51DEGREES_INC),-I$(51DEGREES_INC)) ifeq ($(USE_THREAD),) OPTIONS_CFLAGS += -DFIFTYONEDEGREES_NO_THREADING @@ -1004,6 +1004,7 @@ clean: $(Q)rm -f haproxy-$(VERSION) haproxy-$(VERSION)$(SUBVERS)$(EXTRAVERSION) nohup.out gmon.out $(Q)rm -f {admin,dev,contrib}/*/*.[oas] {admin,dev,contrib}/*/*/*.[oas] {admin,dev,contrib}/*/*/*/*.[oas] $(Q)rm -f addons/promex/*.[oas] + $(Q)rm -f addons/51degrees/*.[oas] addons/51degrees/dummy/*.[oas] addons/51degrees/dummy/*/*.[oas] $(Q)rm -f admin/iprange/iprange admin/iprange/ip6range admin/halog/halog $(Q)rm -f dev/flags/flags dev/poll/poll dev/tcploop/tcploop $(Q)rm -f dev/hpack/decode dev/hpack/gen-enc dev/hpack/gen-rht diff --git a/src/51d.c b/addons/51degrees/51d.c similarity index 100% rename from src/51d.c rename to addons/51degrees/51d.c diff --git a/contrib/51d/src/cityhash/city.c b/addons/51degrees/dummy/cityhash/city.c similarity index 100% rename from contrib/51d/src/cityhash/city.c rename to addons/51degrees/dummy/cityhash/city.c diff --git a/contrib/51d/src/pattern/51Degrees.c b/addons/51degrees/dummy/pattern/51Degrees.c similarity index 100% rename from contrib/51d/src/pattern/51Degrees.c rename to addons/51degrees/dummy/pattern/51Degrees.c diff --git a/contrib/51d/src/pattern/51Degrees.h b/addons/51degrees/dummy/pattern/51Degrees.h similarity index 100% rename from contrib/51d/src/pattern/51Degrees.h rename to addons/51degrees/dummy/pattern/51Degrees.h diff --git a/contrib/51d/src/threading.c b/addons/51degrees/dummy/threading.c similarity index 100% rename from contrib/51d/src/threading.c rename to addons/51degrees/dummy/threading.c diff --git a/contrib/51d/src/trie/51Degrees.c b/addons/51degrees/dummy/trie/51Degrees.c similarity index 100% rename from contrib/51d/src/trie/51Degrees.c rename to addons/51degrees/dummy/trie/51Degrees.c diff --git a/contrib/51d/src/trie/51Degrees.h b/addons/51degrees/dummy/trie/51Degrees.h similarity index 100% rename from contrib/51d/src/trie/51Degrees.h rename to addons/51degrees/dummy/trie/51Degrees.h diff --git a/doc/51Degrees-device-detection.txt b/doc/51Degrees-device-detection.txt index f0349abaa..8c69bb19b 100644 --- a/doc/51Degrees-device-detection.txt +++ b/doc/51Degrees-device-detection.txt @@ -54,14 +54,14 @@ Trie data. Free Hash Trie data file can be obtained by signing up for a licence key at https://51degrees.com/products/store/on-premise-device-detection. For HAProxy developers who need to verify that their changes didn't affect the -51Degrees implementation, a dummy library if provided in the contrib/51d -directory. This does not function, but implements the API such that the -51Degrees module can be used (but not return any meaningful information). To -test either Pattern or Hash Trie, build with: +51Degrees implementation, a dummy library is provided in the +"addons/51degrees/dummy" directory. This does not function, but implements the +API such that the 51Degrees module can be used (but not return any meaningful +information). To test either Pattern or Hash Trie, build with: - $ make TARGET= USE_51DEGREES=1 51DEGREES_SRC=contrib/51d/src/pattern + $ make TARGET= USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/pattern or - $ make TARGET= USE_51DEGREES=1 51DEGREES_SRC=contrib/51d/src/trie + $ make TARGET= USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/trie respectively.