File: rules

package info (click to toggle)
libdbi-drivers 0.9.0-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,212 kB
  • ctags: 1,953
  • sloc: ansic: 18,980; sh: 10,942; xml: 2,759; makefile: 577
file content (154 lines) | stat: -rwxr-xr-x 4,002 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f
# -*- Makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

export DEB_BUILD_MAINT_OPTIONS = hardening=+relro
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

#ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
#	CFLAGS += -g
#endif
CFLAGS += -g -Wall

DESTDIR=$(CURDIR)/debian/tmp

config.status:
	dh_testdir
	dh_autoreconf
	if [ ! -d debian/upstream-config-sub-and-guess ] ; then \
		mkdir debian/upstream-config-sub-and-guess ; \
		cp config.sub debian/upstream-config-sub-and-guess ; \
		cp config.guess debian/upstream-config-sub-and-guess ; \
	fi
	# upgrade to more recent version before starting the configure process
	cp /usr/share/misc/config.sub .
	cp /usr/share/misc/config.guess .
	./autogen.sh
	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
		--with-dbi-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--prefix=/usr \
		--libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/ \
		--with-pgsql \
		--with-mysql \
		--with-mysql-incdir=/usr/include/$(DEB_HOST_MULTIARCH) \
		--with-mysql-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-sqlite \
		--with-sqlite-incdir=/usr/include/$(DEB_HOST_MULTIARCH) \
		--with-sqlite-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-sqlite3 \
		--with-sqlite3-incdir=/usr/include/$(DEB_HOST_MULTIARCH) \
		--with-sqlite3-libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-freetds \
		-with-freetds-dir=/usr \
		--enable-docs
# This is for the moment removed until the upstream fixes the problems with
# the new API: --with-firebird


build-arch: build
build-indep: build

build: build-stamp test-stamp
build-stamp:  config.status
	dh_testdir

	$(MAKE)

	touch build-stamp

mytst:
	ls $(MYSQLTMPDIR)


test-stamp: build-stamp
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) -C tests test_dbi

	# Testing sqlite and sqlite3
	mkdir -p $(CURDIR)/debian/sqlite3tests
	( echo i; \
		echo n; \
		echo ./drivers/sqlite3/.libs; \
		echo sqlite3; \
		echo $(CURDIR)/debian/sqlite3tests; \
		echo libdbitest; ) | ./tests/test_dbi
	rm -rf $(CURDIR)/debian/sqlite3tests

	mkdir -p $(CURDIR)/debian/sqlitetests
	-( echo i; \
		echo n; \
		echo ./drivers/sqlite/.libs; \
		echo sqlite; \
		echo $(CURDIR)/debian/sqlitetests; \
		echo libdbitest; ) | ./tests/test_dbi
	rm -rf $(CURDIR)/debian/sqlitetests

	# Testing MySQL and Postgress
	chmod +x ./debian/test_mysql.sh
	./debian/test_mysql.sh
ifneq (gnu,$(DEB_HOST_GNU_SYSTEM))
	chmod +x ./debian/test_pgsql.sh
	./debian/test_pgsql.sh
endif
	touch test-stamp
endif

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp test-stamp
	rm -f libdbd-sqlite3.debhelper.log
	[ ! -f Makefile ] || $(MAKE) distclean
	if [ -d debian/upstream-config-sub-and-guess ] ; then \
		cp debian/upstream-config-sub-and-guess/config.sub . ; \
		cp debian/upstream-config-sub-and-guess/config.guess . ; \
		rm -rf debian/upstream-config-sub-and-guess ; \
	fi

	rm -f config.log doc/include/Makefile doc/Makefile
	dh_clean
	dh_autoreconf_clean
	# We need to deapply-all here, because of dh_autoreconf_clean that
	# might do the opposite work as expected.
	rm -f debian/*.log

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) install prefix=$(DESTDIR)/usr \
		libdir=$(DESTDIR)/usr/lib/$(DEB_HOST_MULTIARCH)/dbd/
	sed -i "/dependency_libs/ s/'.*'/''/" \
		`find $(DESTDIR)/usr/lib/ -name '*.la'`

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_install
	dh_installchangelogs ChangeLog
	dh_link
	dh_strip
	dh_compress -X .pdf
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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