File: rules

package info (click to toggle)
mysql 3.23.49-8.13
  • links: PTS
  • area: main
  • in suites: woody
  • size: 65,624 kB
  • ctags: 45,242
  • sloc: ansic: 255,722; cpp: 86,801; perl: 26,117; tcl: 19,882; sh: 18,775; asm: 4,001; yacc: 2,626; makefile: 2,494; java: 2,300; awk: 1,484; sed: 428
file content (215 lines) | stat: -rwxr-xr-x 5,893 bytes parent folder | download
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter and based on the
# original RPM scripts from TcX.

export DH_VERBOSE=1
export DH_COMPAT=3

PWD=$(shell pwd)
TMP=$(PWD)/debian/tmp/

ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)

ifeq ($(findstring $(ARCH),i386 sparc),$(ARCH))
    USE_ASSEMBLER=--enable-assembler 
endif

ifeq ($(findstring $(ARCH), arm),$(ARCH))
    FOMIT_FRAME_POINTER=
else
    FOMIT_FRAME_POINTER=-fomit-frame-pointer
endif

# trying to raise stability on i386. See #116631
# don't use it on ia64
ifeq ($(findstring $(ARCH),i386),$(ARCH))
  FNO_EXCEPTIONS=-fno-exceptions
endif

# disabled others until someone proves the opposide (these architecures
# are lacking "thread mutex" support in db3. Problem known to upstream.
ifeq ($(findstring $(ARCH),sparc alpha i386 m68k),$(ARCH))
    USE_BDB=--with-berkeley-db
endif

		
build: build-stamp
build-stamp:
	dh_testdir

	# CXX must be g++ because c++ does not find
	#   /usr/lib/gcc-lib/libstc+++.so
	sh -c  'PATH=$${MYSQL_BUILD_PATH:-"/bin:/usr/bin"} \
	    	CC=$${MYSQL_BUILD_CC:-gcc} \
	    	CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O2 $(FOMIT_FRAME_POINTER) -g "} \
	    	CC=$${MYSQL_BUILD_CC:-g++} \
	    	CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O2 $(FOMIT_FRAME_POINTER) -g \
	          -felide-constructors $(FNO_EXCEPTIONS) -fno-rtti"} && set && \
	    ./configure \
		--prefix=/usr \
	        --exec-prefix=/usr \
	        --libexecdir=/usr/sbin \
	        --datadir=/usr/share \
	        --sysconfdir=/etc/mysql \
	        --localstatedir=/var/lib/mysql \
	        --includedir=/usr/include \
	        --infodir=/usr/share/info \
	        --mandir=/usr/share/man \
	        --enable-shared \
	        --with-libwrap \
	        $(USE_ASSEMBLER) \
		$(USE_BDB) \
		--with-innodb \
		--enable-static \
		--enable-shared \
		--enable-local-infile \
		--with-raid \
		--enable-thread-safe-client \
		--without-readline \
		--with-unix-socket-path=/var/run/mysqld/mysqld.sock \
	       	--with-mysqld-user=mysql \
	        --without-bench \
		--with-client-ldflags=-lstdc++ \
		--with-extra-charsets=all \
	&& $(MAKE)'
	
	#	--with-debug \

	touch build-stamp

clean:
	dh_testdir 
	dh_testroot
	rm -f build-stamp
	
	if [ ! -r Makefile ]; then ./configure --with-innodb --with-berkeley-db; fi
	rm -f config.log config.cache libtool
	-make distclean

	# clean up mysql
	find sql/share/ -name "*.sys" | xargs --no-run-if-empty rm
	find libmysql_r -type l | xargs --no-run-if-empty rm
	rm -f sql/mini_client_errors.c
	rm -f mit-pthreads/config.status
	rm -f client/log_event.cc client/log_event.h	
	rm -f Docs/manual_*.html
	# clean up innobase
	find innobase/ -name "*.a" | xargs --no-run-if-empty rm
	rm -f innobase/config.cache
	# clean up bdb
	rm -f bdb/build_unix/config.cache
	rm -f mit-pthreads/config.status
	
	dh_clean -v

	
install:
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	#	rm -rf $(TMP)

	# make install (trailing slash needed for innobase)
	$(MAKE) install DESTDIR=$(TMP)/

	# libmysqlclient: move shared libraries
	mv $(TMP)/usr/lib/mysql/* $(TMP)/usr/lib
	perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libmysqlclient.la
	perl -pi -e 's#/usr/lib/mysql#/usr/lib#' $(TMP)/usr/lib/libmysqlclient_r.la

	# bah... how ugly
	mv $(PWD)/debian/libs/* $(TMP)/usr/lib/mysql/
	rmdir $(PWD)/debian/libs

	# libmysqlclient-dev: forgotten header file since 3.23.25?
	cp include/my_config.h $(TMP)/usr/include/mysql/
	cp include/my_dir.h $(TMP)/usr/include/mysql/

	# mysql-common: We now provide our own config file.
	install -d $(TMP)/etc/mysql
	install -m 0644 debian/additions/my.cnf $(TMP)/etc/mysql/my.cnf

	# mysql-doc: create an index.html
	install -d $(TMP)/usr/share/doc/mysql-doc
	ln -sf manual_toc.html $(TMP)/usr/share/doc/mysql-doc/index.html
	cp Docs/manual_*.html $(TMP)/usr/share/doc/mysql-doc/
	pod2man scripts/mysqlhotcopy $(TMP)/usr/share/man/man1/mysqlhotcopy.1

	# mysql-server
	for i in workstation server; do \
		install -d -m 0750 $(TMP)/etc/logcheck/ignore.d.$$i; \
		install -m 0640 debian/mysql-server.logcheck.ignore \
	            $(TMP)/etc/logcheck/ignore.d.$$i/mysql-server; \
	done
	install -m 0755 scripts/safe_mysqld $(TMP)/usr/bin/safe_mysqld
	mkdir -p $(TMP)/usr/share/doc/mysql-server/examples
	mv $(TMP)/usr/share/mysql/*cnf 	    $(TMP)/usr/share/doc/mysql-server/examples/
	mv $(TMP)/usr/share/mysql/*.spec    $(TMP)/usr/share/doc/mysql-server/
	rm $(TMP)/usr/share/mysql/mi_test_all*
	rm $(TMP)/usr/share/mysql/mysql-log-rotate
	rm $(TMP)/usr/share/mysql/mysql.server
	rm $(TMP)/usr/share/mysql/binary-configure
	rm $(TMP)/usr/share/mysql/make_binary_distribution

	dh_movefiles
	
# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdebconf -i
	dh_installdocs -i
		rm -f debian/mysql-doc/usr/share/doc/mysql-doc/Flags/*.txt
	dh_installexamples -i
	dh_installmenu -i
	dh_installlogrotate -i
	dh_installinit -i
	dh_installcron -i 
	dh_installman -i
	dh_installinfo -i
	dh_undocumented -i
	dh_installchangelogs -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_perl -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i
	
# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir 
	dh_testroot

	dh_installdebconf -a
	dh_installdocs -a
	dh_installexamples -a
	dh_installmenu -a
	dh_installlogrotate -a
	dh_installinit -a --init-script=mysql
	dh_installcron -a 
	dh_installman -a
	dh_installinfo -a
	dh_undocumented -a
	dh_installchangelogs -a
	dh_strip -a
	dh_link -a	# .so muss nach .so.1.2.3 installier werden!
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a
	dh_installdeb -a
	dh_perl -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary:	binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary