-
Notifications
You must be signed in to change notification settings - Fork 1
/
rules
executable file
·100 lines (83 loc) · 3.48 KB
/
rules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/usr/bin/make -f
# -*- makefile -*-
MARIADB_CONNECTOR_C := mariadb-connector-c-3.3.1-src.tar.gz
MARIADB_CONNECTOR_C_MD5 := bd8090528becf9a788f78ed14bb90764
MARIADB_CONNECTOR_C_URL := https://dlm.mariadb.com/2319728/Connectors/c/connector-c-3.3.1/$(MARIADB_CONNECTOR_C)
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1
# Uncomment this to change the hardening options
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
CMAKE = cmake
CMAKE_JOBS =
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
CMAKE_JOBS += -j$(NUMJOBS)
endif
export MAKEFLAGS
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
%:
dh $@ --with autoreconf
vendor/$(MARIADB_CONNECTOR_C):
mkdir -p vendor/
if wget -O vendor/$(MARIADB_CONNECTOR_C) "$(MARIADB_CONNECTOR_C_URL)"; then \
ret=$$(md5sum vendor/$(MARIADB_CONNECTOR_C)); \
if ! test $${ret% *} = $(MARIADB_CONNECTOR_C_MD5); then \
echo "MD5 mismatch: $${ret% *} <> $(MARIADB_CONNECTOR_C_MD5)" >&2; \
$(RM) vendor/$(MARIADB_CONNECTOR_C); \
false; \
fi; \
fi
vendor/mariadb-connector-c: vendor/$(MARIADB_CONNECTOR_C)
mkdir -p vendor/mariadb-connector-c
if ! tar --strip-components=1 -C vendor/mariadb-connector-c -zxf vendor/$(MARIADB_CONNECTOR_C); then \
$(RM) -r vendor/mariadb-connector-c; \
false; \
fi
.PHONY: mariadb-connector-c
mariadb-connector-c: vendor/mariadb-connector-c
# Let the connector-odbc trigger the compilation. Should
# hopefully pass all our harden flags along as well.
#cd vendor/mariadb-connector-c/cmake && cmake ..
#cd vendor/mariadb-connector-c/cmake && make
#cp -a vendor/mariadb-connector-c/cmake/include/mariadb_version.h vendor/mariadb-connector-c/include/
libmariadb: mariadb-connector-c
# Since 3.0.4/3.0.5/3.0.6 connector-odbc expects connector-c to
# be in the libmariadb subdir. Previously the paths were passed
# with MARIADB_* vars.
ln -s vendor/mariadb-connector-c libmariadb
# CMAKE_BUILD_TYPE=RELWITHDEBINFO for debug symbols
# CMAKE_INSTALL_PREFIX=/usr
# CMAKE_INSTALL_COMPONENT=ODBCLibs to only install the static maodbc.so
# DEB=1 for debian layout
# CONC_WITH_UNIT_TESTS=OFF passed to connector-c, disabling unit tests
# WITH_SSL=OPENSSL to force openssl
# MARIADB_LINK_DYNAMIC=OFF to force static linking of libmariadb3
# ALL_PLUGINS_STATIC=ON
override_dh_auto_configure: libmariadb
$(CMAKE) . \
-DCMAKE_BUILD_TYPE=RELWITHDEBINFO \
-DCMAKE_INSTALL_PREFIX=/usr \
-DDEB=1 \
-DCONC_WITH_UNIT_TESTS=OFF \
-DWITH_SSL=OPENSSL \
-DMARIADB_LINK_DYNAMIC=OFF \
-DALL_PLUGINS_STATIC=ON
override_dh_auto_build:
$(CMAKE) --build . --config RelWithDebInfo --verbose $(CMAKE_JOBS) --
override_dh_auto_install:
#dh_auto_install --
#make install DESTDIR=...
DESTDIR=$(CURDIR)/debian/libmaodbc \
cmake -DCMAKE_INSTALL_COMPONENT=ODBCLibs -P cmake_install.cmake
DESTDIR=$(CURDIR)/debian/libmaodbc \
cmake -DCMAKE_INSTALL_COMPONENT=Documentation -P cmake_install.cmake
mv $(CURDIR)/debian/libmaodbc/usr/share/doc/mariadb-connector-odbc \
$(CURDIR)/debian/libmaodbc/usr/share/doc/libmaodbc
mkdir -p $(CURDIR)/debian/libmaodbc/usr/lib/$(DEB_HOST_MULTIARCH)/odbc
mv $(CURDIR)/debian/libmaodbc/usr/lib/$(DEB_HOST_MULTIARCH)/libmaodbc.so \
$(CURDIR)/debian/libmaodbc/usr/lib/$(DEB_HOST_MULTIARCH)/odbc/
ln -s libmaodbc.so \
$(CURDIR)/debian/libmaodbc/usr/lib/$(DEB_HOST_MULTIARCH)/odbc/libmyodbc.so
override_dh_shlibdeps:
dh_shlibdeps -- -v