forked from ottok/mariadb-10.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrules
executable file
·158 lines (127 loc) · 5.77 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/make -f
export DH_VERBOSE=1
# enable Debian Hardening
# see: https://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ARCH_OS := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
BUILDDIR := builddir
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEBVERSION := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }' | sed 's/^.*-//' )
DEB_SOURCE_PACKAGE ?= $(strip $(shell egrep '^Source: ' debian/control | cut -f 2 -d ':'))
DEB_VERSION ?= $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION ?= $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION ?= $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
DEB_UPSTREAM_VERSION_MAJOR_MINOR := $(shell echo $(DEB_UPSTREAM_VERSION) | sed -r -n 's/^([0-9]+\.[0-9]+).*/\1/p')
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DISTRIBUTION := $(shell lsb_release -i -s)
RELEASE := $(shell lsb_release -r -s)
TMP:=$(CURDIR)/debian/tmp
CC := $(DEB_HOST_GNU_TYPE)-gcc
CXX := $(DEB_HOST_GNU_TYPE)-g++
# Parallel build support as advised
# at https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j $(NUMJOBS)
endif
ifneq (,$(filter $(ARCH), i386 kfreebsd-i386 hurd-i386))
TAOCRYPT_OPT="-DTAOCRYPT_DISABLE_X86ASM"
endif
# Skip TokuDB if arch is not amd64
ifneq ($(ARCH), amd64)
CMAKEFLAGS += -DWITHOUT_TOKUDB=true
endif
# Completely disable TokuDB as it fails to build on some platforms and
# upstream developers do not seem to have fixing those on their roadmap
# See https://lists.launchpad.net/maria-developers/msg08390.html
CMAKEFLAGS += -DWITHOUT_TOKUDB=true
# Add support for verbose builds
MAKEFLAGS += VERBOSE=1
MAKE_TEST_TARGET:=test-force
ifneq ($(findstring fulltest,$(DEB_BUILD_OPTIONS)),)
# Presets related to test-bt are not guarenteed to work in MariaDB as there
# are hard-coded MTR lines insted. See MDEV-8244 for implementation status
# of new test presets.
MAKE_TEST_TARGET:=test-bt
endif
override_dh_auto_clean:
@echo "RULES.$@"
dh_testdir
dh_testroot
[ ! -d mysql-test/var ] || rm -rf mysql-test/var
rm -rf $(BUILDDIR)
debconf-updatepo # Update po-files when clean runs before each build
override_dh_prep:
# Don't clean /tmp/ away, it is needed by all binary packages
override_dh_auto_configure:
@echo "RULES.$@"
dh_testdir
mkdir -p $(BUILDDIR) && cd $(BUILDDIR) && \
sh -c 'PATH=$${MYSQL_BUILD_PATH:-"/usr/local/bin:/usr/bin:/bin"} \
CC=${CC} \
CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O3 -fno-strict-aliasing"} \
CXX=${CXX} \
CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -felide-constructors -fno-exceptions -fno-rtti -fno-strict-aliasing ${TAOCRYPT_OPT}"} \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
$(CMAKEFLAGS) \
-DWITH_SSL=bundled \
-DCOMPILATION_COMMENT="$(DISTRIBUTION) $(RELEASE)" \
-DMYSQL_SERVER_SUFFIX="-$(DEBVERSION)" \
-DSYSTEM_TYPE="debian-$(DEB_BUILD_GNU_SYSTEM)" \
-DCMAKE_SYSTEM_PROCESSOR=$(DEB_BUILD_ARCH) \
-DBUILD_CONFIG=mysql_release \
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \
-DINSTALL_PLUGINDIR=lib/mysql/plugin \
-DINSTALL_MYSQLTESTDIR=share/mysql/mysql-test \
-DDEB=$(DISTRIBUTION) ..'
touch $@
# This is needed, otherwise 'make test' will run before binaries have been built
override_dh_auto_build:
@echo "RULES.$@"
cd $(BUILDDIR) && $(MAKE)
touch $@
override_dh_auto_test:
@echo "RULES.$@"
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
cd $(BUILDDIR) && $(MAKE) $(MAKE_TEST_TARGET)
endif
override_dh_auto_install:
@echo "RULES.$@"
dh_testdir
dh_testroot
# If TokuDB plugin was built add it to the server install list.
[ ! -f $(BUILDDIR)/storage/tokudb/ha_tokudb.so ] || echo 'usr/lib/mysql/plugin/ha_tokudb.so\netc/mysql/conf.d/tokudb.cnf\nusr/bin/tokuftdump\nusr/share/doc/mariadb-server-10.0/README-TOKUDB\nusr/share/doc/mariadb-server-10.0/README.md' >> debian/mariadb-server-10.0.install
# If Mroonga plugin was built add it to the server install list.
[ ! -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || echo 'usr/lib/mysql/plugin/ha_mroonga.so' >> debian/mariadb-server-10.0.install
# If libthrift-dev was available (manually installed, as it is
# not in Debian) and ha_cassandra.so was thus built add it to
# the server install list.
[ ! -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || echo 'usr/lib/mysql/plugin/ha_cassandra.so' >> debian/mariadb-server-10.0.install
# make install
cd $(BUILDDIR) && $(MAKE) install DESTDIR=$(TMP)
# nm numeric soft is not enough, therefore extra sort in command
# to satisfy Debian reproducible build requirements
nm --defined-only $(BUILDDIR)/sql/mysqld | LC_ALL=C sort | gzip -n -9 > $(TMP)/usr/share/doc/mariadb-server-10.0/mysqld.sym.gz
# rename and install AppArmor profile
install -D -m 644 debian/apparmor-profile $(TMP)/etc/apparmor.d/usr.sbin.mysqld
# rename and install Apport hook
install -D -m 644 debian/mariadb-server-10.0.py $(TMP)/usr/share/apport/package-hooks/source_mariadb-10.0.py
touch $@
override_dh_installlogrotate-arch:
dh_installlogrotate --name mysql-server
# Start mysql at sequence number 19 before 20 where apache, proftpd etc gets
# started which might depend on a running database server.
override_dh_installinit-arch:
dh_installinit --name=mysql -- defaults 19 21
override_dh_installcron-arch:
dh_installcron --name mysql-server
get-orig-source:
uscan --force-download --verbose
%:
dh $@ --parallel
# vim: ts=8