CONTRIB: move src/wurfl.c and contrib/wurfl to addons/wurfl

Both the source file and the dummy library are now at the same place.
Maybe the build howto could be moved there as well to make things even
cleaner.

The Makefile, MAINTAINERS, doc, and vtest matrix were updated.
This commit is contained in:
Willy Tarreau 2021-04-02 16:39:44 +02:00
parent f8d9ec57f0
commit 57610c694e
11 changed files with 16 additions and 15 deletions

8
.github/matrix.py vendored
View File

@ -77,8 +77,8 @@ for CC in ["gcc", "clang"]:
"USE_OPENSSL=1",
"USE_SYSTEMD=1",
"USE_WURFL=1",
"WURFL_INC=contrib/wurfl",
"WURFL_LIB=contrib/wurfl",
"WURFL_INC=addons/wurfl/dummy",
"WURFL_LIB=addons/wurfl/dummy",
"USE_DEVICEATLAS=1",
"DEVICEATLAS_SRC=addons/deviceatlas/dummy",
"USE_PROMEX=1",
@ -143,8 +143,8 @@ matrix.append(
"USE_OPENSSL=1",
"USE_SYSTEMD=1",
"USE_WURFL=1",
"WURFL_INC=contrib/wurfl",
"WURFL_LIB=contrib/wurfl",
"WURFL_INC=addons/wurfl/dummy",
"WURFL_LIB=addons/wurfl/dummy",
"USE_DEVICEATLAS=1",
"DEVICEATLAS_SRC=addons/deviceatlas/dummy",
"USE_PROMEX=1",

View File

@ -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=addons/deviceatlas/dummy USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/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=addons/wurfl/dummy WURFL_LIB=addons/wurfl/dummy USE_DEVICEATLAS=1 DEVICEATLAS_SRC=addons/deviceatlas/dummy USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/pattern"
steps:
- uses: actions/checkout@v2
- name: Install apt dependencies
@ -33,7 +33,7 @@ jobs:
# quoting into account.
sed -i 's/^DEBUG =$/DEBUG = -DDEBUG_STRICT=1 -DDEBUG_USE_ABORT=1/' Makefile
- name: Build WURFL
run: make -C contrib/wurfl
run: make -C addons/wurfl/dummy
- name: Run Coverity Scan
env:
COVERITY_SCAN_TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}

View File

@ -78,7 +78,7 @@ jobs:
run: env ${{ matrix.ssl }} scripts/build-ssl.sh
- name: Build WURFL
if: ${{ contains(matrix.FLAGS, 'USE_WURFL=1') }}
run: make -C contrib/wurfl
run: make -C addons/wurfl/dummy
- name: Compile HAProxy with ${{ matrix.CC }}
run: |
make -j$(nproc) all \

View File

@ -11,7 +11,7 @@ branches:
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=addons/deviceatlas/dummy USE_51DEGREES=1"
- 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=addons/wurfl/dummy WURFL_LIB=addons/wurfl/dummy USE_DEVICEATLAS=1 DEVICEATLAS_SRC=addons/deviceatlas/dummy USE_51DEGREES=1"
- TMPDIR=/tmp
- FIFTYONEDEGREES_SRC="addons/51degrees/dummy/pattern"
- DEBUG_OPTIONS="DEBUG_STRICT=1"
@ -60,7 +60,7 @@ matrix:
- os: linux
if: type == cron
compiler: clang
env: TARGET=linux-glibc FLAGS="USE_SLZ=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_LUA=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_WURFL=1 WURFL_INC=contrib/wurfl WURFL_LIB=contrib/wurfl USE_51DEGREES=1" CC=clang-9
env: TARGET=linux-glibc FLAGS="USE_SLZ=1 USE_PCRE2=1 USE_PCRE2_JIT=1 USE_LUA=1 USE_OPENSSL=1 USE_SYSTEMD=1 USE_WURFL=1 WURFL_INC=addons/wurfl/dummy WURFL_LIB=addons/wurfl/dummy USE_51DEGREES=1" CC=clang-9
before_script:
- git clone https://github.com/wtarreau/libslz
- cd libslz && make && make PREFIX=${HOME}/opt install && cd ..
@ -81,7 +81,7 @@ install:
script:
- if [ "${CC%-*}" = "clang" ]; then export FLAGS="$FLAGS USE_OBSOLETE_LINKER=1" DEBUG_CFLAGS="-g -fsanitize=address" LDFLAGS="-fsanitize=address" ASAN_OPTIONS="log_path=asan.log"; fi
- make -C contrib/wurfl
- make -C addons/wurfl/dummy
- make -j3 CC=$CC CPU_CFLAGS.generic="-O1" V=1 ERR=1 TARGET=$TARGET $FLAGS DEBUG_CFLAGS="$DEBUG_CFLAGS" LDFLAGS="$LDFLAGS" ADDLIB="$ADDLIB" SSL_LIB="$SSL_LIB" SSL_INC="$SSL_INC" SLZ_LIB="$SLZ_LIB" SLZ_INC="$SLZ_INC" 51DEGREES_SRC="$FIFTYONEDEGREES_SRC" EXTRA_OBJS="$EXTRA_OBJS" $DEBUG_OPTIONS
- ./haproxy -vv
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ldd haproxy; fi

View File

@ -127,7 +127,7 @@ Note: William is the referent regarding Prometheus. He should be consulted for
ScientiaMobile WURFL Device Detection
Maintainer: Paul Borile, Massimiliano Bellomi <wurfl-haproxy-support@scientiamobile.com>
Files: src/wurfl.c, contrib/wurfl, doc/WURFL-device-detection.txt
Files: addons/wurfl, doc/WURFL-device-detection.txt
SPOE
Maintainer: Christopher Faulet <cfaulet@haproxy.com>

View File

@ -669,7 +669,7 @@ ifneq ($(USE_WURFL),)
WURFL_SRC =
WURFL_INC = $(WURFL_SRC)
WURFL_LIB = $(WURFL_SRC)
OPTIONS_OBJS += src/wurfl.o
OPTIONS_OBJS += addons/wurfl/wurfl.o
OPTIONS_CFLAGS += $(if $(WURFL_INC),-I$(WURFL_INC))
ifneq ($(WURFL_DEBUG),)
OPTIONS_CFLAGS += -DWURFL_DEBUG
@ -1006,6 +1006,7 @@ clean:
$(Q)rm -f addons/promex/*.[oas]
$(Q)rm -f addons/51degrees/*.[oas] addons/51degrees/dummy/*.[oas] addons/51degrees/dummy/*/*.[oas]
$(Q)rm -f addons/deviceatlas/*.[oas] addons/deviceatlas/dummy/*.[oas]
$(Q)rm -f addons/wurfl/*.[oas] addons/wurfl/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

View File

@ -19,13 +19,13 @@ Optionally WURFL_DEBUG=1 may be set to increase logs verbosity
For HAProxy developers who need to verify that their changes didn't accidentally
break the WURFL code, it is possible to build a dummy library provided in the
contrib/wurfl directory and to use it as an alternative for the full library.
addons/wurfl/dummy directory and to use it as an alternative for the full library.
This will not provide the full functionalities, it will just allow haproxy to
start with a wurfl configuration, which generally is enough to validate API
changes :
$ make -C contrib/wurfl
$ make TARGET=<target> USE_WURFL=1 WURFL_INC=$PWD/contrib/wurfl WURFL_LIB=$PWD/contrib/wurfl
$ make -C addons/wurfl/dummy
$ make TARGET=<target> USE_WURFL=1 WURFL_INC=$PWD/addons/wurfl/dummy WURFL_LIB=$PWD/addons/wurfl/dummy
These are the supported WURFL directives (see doc/configuration.txt) :
- wurfl-data-file <path to WURFL data file>