File: rules

package info (click to toggle)
qdbm 1.8.78-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,988 kB
  • sloc: ansic: 31,454; cpp: 3,623; perl: 2,167; java: 2,079; ruby: 1,690; makefile: 1,323; sh: 396
file content (215 lines) | stat: -rwxr-xr-x 7,197 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
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# work-around for upstream build that thinks $(HOME) belongs in the
# include path for all builds!
export HOME=$(CURDIR)/junkhome

# shared library versions, option 1
major=14
xmajor=3

# 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)
DEB_BUILD_GNU_CPU   ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

PERL_LIB := $(shell perl -MConfig -e 'print substr($$Config{vendorarch},1)' )

export CFLAGS = -Wall -g $(shell getconf LFS_CFLAGS)

ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	WITH_TESTS =
else
	WITH_TESTS = y
endif

ifneq (,$(findstring nojava,$(DEB_BUILD_PROFILES)))
	WITH_JAVA = 
else
	WITH_JAVA = y
endif

CONFIGURE_VARS = CFLAGS="$(CFLAGS)" CPPFLAGS=""
CONFIGURE_SWITCHES = --host=$(DEB_HOST_GNU_TYPE) \
	--build=$(DEB_BUILD_GNU_TYPE) \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
	--includedir=\$${prefix}/include/qdbm \
	--enable-pthread --enable-zlib --enable-iconv

JAVA_HOME = /usr/lib/jvm/default-java
CONFIGURE_VARS += JAVA_HOME="$(JAVA_HOME)"
DEFAULT_JAVA ?= $(shell readlink -f $(JAVA_HOME)/bin/java)
ifneq (,$(filter /usr/bin/%gij%, $(DEFAULT_JAVA)))
CONFIGURE_VARS += JAVAC="gcj-wrapper" JAR="fastjar"
CONFIGURE_SWITCHES += --with-gcj
endif

build: build-arch build-indep
build-arch: build-stamp
ifneq "$(WITH_JAVA)" ""
build-arch: build-java-stamp
endif
build-indep: build-arch
build-stamp:
	dh_testdir
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
	cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
	cp -f /usr/share/misc/config.guess config.guess
endif
	autoconf
	mkdir with-gdbm && cp qdbm.* *ake* config* *.c *.h with-gdbm/
	$(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES) --disable-gdbm
	$(MAKE)
ifneq "$(WITH_TESTS)" ""
	$(MAKE) check
endif
	#cd with-gdbm && $(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES)
	#cd with-gdbm &&	$(MAKE) && $(MAKE) check
	cd cgi && $(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES)
	cd cgi && $(MAKE)
	cd plus && $(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES)
	cd plus && $(MAKE)
ifneq "$(WITH_TESTS)" ""
	cd plus && $(MAKE) check
endif
	cd perl && $(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES)
	cd perl && $(MAKE)
ifneq "$(WITH_TESTS)" ""
	cd perl && $(MAKE) check
endif
	touch build-stamp

#build-ruby-stamp: build-stamp
#	cd ruby && $(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES)
#	export RUBY=/usr/bin/ruby && cd ruby && $(MAKE)
#ifneq "$(WITH_TESTS)" ""
#	export RUBY=/usr/bin/ruby && cd ruby && $(MAKE) check
#endif
#	touch build-ruby-stamp

build-java-stamp: build-stamp
	cd java && CC=gcc $(CONFIGURE_VARS) ./configure $(CONFIGURE_SWITCHES)
	cd java && $(MAKE)
	touch build-java-stamp

clean:
	dh_testdir
	dh_testroot
	# Add here commands to clean up after the build process.
	-cd java && $(MAKE) distclean
	-cd ruby && $(MAKE) distclean
	-cd perl && $(MAKE) distclean
	-cd plus && $(MAKE) distclean
	-cd cgi && $(MAKE) distclean
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -rf ruby19 config.sub config.guess *-stamp with-gdbm debian/tmp-gdbm
	dh_clean

install: install-stamp install-ruby-stamp
ifneq "$(WITH_JAVA)" ""
install: install-java-stamp
endif
install-stamp: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	# Add here commands to install the package into debian/tmp
	$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr MYHEADDIR=$(CURDIR)/debian/libqdbm-dev/usr/include/qdbm
	# cgi
	cd cgi && install -m 755 *.cgi $(CURDIR)/debian/qdbm-cgi/usr/lib/cgi-bin
	cd cgi && install -m 644 *.conf $(CURDIR)/debian/qdbm-cgi/etc/qdbm
	# plus
	cd plus && $(MAKE) install prefix=$(CURDIR)/debian/libxqdbm$(xmajor)c2/usr MYHEADDIR=$(CURDIR)/debian/libxqdbm-dev/usr/include/qdbm
	mv $(CURDIR)/debian/libxqdbm$(xmajor)c2/usr/bin/* $(CURDIR)/debian/qdbm-util/usr/bin/
	mv $(CURDIR)/debian/libxqdbm$(xmajor)c2/usr/lib/libxqdbm.a $(CURDIR)/debian/libxqdbm-dev/usr/lib/
	mv $(CURDIR)/debian/libxqdbm$(xmajor)c2/usr/lib/libxqdbm.so $(CURDIR)/debian/libxqdbm-dev/usr/lib/
	# perl
	cd perl && $(MAKE) install DESTDIR=$(CURDIR)/debian/libqdbm-perl
	chmod +w $(CURDIR)/debian/libqdbm-perl/$(PERL_LIB)/auto/*/*.so
	mv $(CURDIR)/debian/libqdbm-perl/usr/bin/* $(CURDIR)/debian/libqdbm-perl/usr/share/doc/libqdbm-perl/examples
	# fix rpath issue
	chrpath -d $(CURDIR)/debian/tmp/usr/bin/*
	chrpath -d $(CURDIR)/debian/tmp/usr/lib/*.so
	#chrpath -d $(CURDIR)/with-gdbm/*.so
	chrpath -d $(CURDIR)/debian/qdbm-cgi/usr/lib/cgi-bin/*.cgi
	chrpath -d $(CURDIR)/debian/libqdbm-perl/$(PERL_LIB)/auto/*/*.so
	dh_install --sourcedir=$(CURDIR)/debian/tmp
	#mkdir -p $(CURDIR)/debian/libqdbm14-gdbm/usr/lib
	#cp -Rf $(CURDIR)/with-gdbm/libqdbm.so.* $(CURDIR)/debian/libqdbm14-gdbm/usr/lib/
	rm -f $(CURDIR)/debian/qdbm-util/usr/bin/*test
	find $(CURDIR)/debian -type d -empty -delete
	touch install-stamp

install-ruby-stamp: install-stamp
	dh_ruby --install
	touch install-ruby-stamp

install-java-stamp: install-stamp build-java-stamp
	dh_installdirs -plibqdbm-java
	cd java && $(MAKE) install DESTDIR=$(CURDIR)/debian/libqdbm-java
	cp -L $(CURDIR)/debian/libqdbm-java/usr/lib/libjqdbm.so $(CURDIR)/debian/libqdbm-java/usr/lib/jni/libjqdbm.so
	mv $(CURDIR)/debian/libqdbm-java/usr/lib/qdbm.jar $(CURDIR)/debian/libqdbm-java/usr/share/qdbm/lib/
	rm -f $(CURDIR)/debian/libqdbm-java/usr/lib/libjqdbm.so*
	rm -rf $(CURDIR)/debian/*/usr/share/qdbm/java
	touch install-java-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i ChangeLog
	dh_installdocs -i
	dh_installdocs -A debian/NEWS.Debian
	dh_installexamples -i
#	dh_installman -i
	dh_link -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
	dh_perl -i
#	dh_makeshlibs -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a ChangeLog
	dh_installdocs -a
	dh_installexamples -a
	dh_installman -a
	rm -f $(CURDIR)/debian/qdbm-util/usr/share/man/man1/*test
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_perl -plibqdbm-perl
	dh_makeshlibs -a -X libqdbm-java -V
	dh_installdeb -a
	dh_shlibdeps -a -l debian/libqdbm$(major)/usr/lib:debian/libxqdbm$(xmajor)c2/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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