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.
diff --git a/.github/matrix.py b/.github/matrix.py
index e31d8ed..9f4e1f6 100644
--- a/.github/matrix.py
+++ b/.github/matrix.py
@@ -83,7 +83,7 @@
                 "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 @@
             "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 4fbe295..7537ba3 100644
--- a/.github/workflows/coverity.yml
+++ b/.github/workflows/coverity.yml
@@ -17,7 +17,7 @@
       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 80fddca..3d2f280 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,7 +13,7 @@
   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 @@
   - 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 7f4881d..144cc42 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20,7 +20,7 @@
 
 51Degrees device identification
 Maintainer: Ben Shillito <ben@51degrees.com>
-Files: src/51d.c, contrib/51d, doc/51Degrees-device-detection.txt
+Files: addons/51degrees, doc/51Degrees-device-detection.txt
 
 Cache
 Maintainer: William Lallemand <wlallemand@haproxy.com>
diff --git a/Makefile b/Makefile
index 3a295c7..a9e8b49 100644
--- a/Makefile
+++ b/Makefile
@@ -652,7 +652,7 @@
 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 @@
 	$(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 f0349ab..8c69bb1 100644
--- a/doc/51Degrees-device-detection.txt
+++ b/doc/51Degrees-device-detection.txt
@@ -54,14 +54,14 @@
 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=<target> USE_51DEGREES=1 51DEGREES_SRC=contrib/51d/src/pattern
+    $ make TARGET=<target> USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/pattern
 or
-    $ make TARGET=<target> USE_51DEGREES=1 51DEGREES_SRC=contrib/51d/src/trie
+    $ make TARGET=<target> USE_51DEGREES=1 51DEGREES_SRC=addons/51degrees/dummy/trie
 
 respectively.