File: rules

package info (click to toggle)
pgadmin3 1.20.0~beta2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 73,704 kB
  • ctags: 18,591
  • sloc: cpp: 193,786; ansic: 18,736; sh: 5,154; pascal: 1,120; yacc: 927; makefile: 516; lex: 421; xml: 126; perl: 40
file content (276 lines) | stat: -rwxr-xr-x 7,468 bytes parent folder | download | duplicates (7)
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

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

# <rip>
# #       This piece of code ripped from doc-linux-fr debian package
# #       We use this to generate our hacked .orig.tar.gz by invoking
# #       manually the "orig" target
TGZ = tar -z
TBZ2 = tar -j
source = $(shell dpkg-parsechangelog | grep '^Source:' | sed 's/^Source: //')
src_version = $(shell dpkg-parsechangelog | grep '^Version:' | \
	sed 's/^Version: *//')
upstream = $(shell dpkg-parsechangelog | grep '^Version:' | \
	sed -e 's/^Version: //' -e 's/-.*//')
# </rip>


pkg=pgadmin3
pkg-data=$(pkg)-data

#
#
orig: clean
	$(TGZ) -C .. --exclude $(source)-$(upstream)/debian \
		--exclude $(source)-$(upstream)/pkg/debian  -cvf \
		../$(source)_$(upstream).orig.tar.gz $(source)-$(upstream)

#
doPgA3Wx=localwx
_PGA3_WXVERSION = 2.7.0-1
_PGA3_WXSNAPBASE = wxWidgets
_PGA3_WXTAR = $(shell pwd)/wxWidgets-$(_PGA3_WXVERSION).tar.gz
_PGA3_WXDEST = $(shell pwd)/$(_PGA3_WXSNAPBASE)-$(_PGA3_WXVERSION)
_PGA3_WXTOP = $(_PGA3_WXDEST)/$(_PGA3_WXSNAPBASE)-$(_PGA3_WXVERSION)
_PGA3_WXLOCALINST = $(_PGA3_WXTOP)/localinst
_PGA3_WXCONFIG ?= wx-config
#


# The name of the wxWidgets config script we invoke later in configure
_PGA3_WXCONFIG ?= wx-config

# A hack to get it compile without errors concerning MNU_NEW
_pgsql_inc:="$(shell pg_config --includedir) -I./include"

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

CFLAGS = -Wall -g
CXXFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
	CXXFLAGS += -O0
else
	CFLAGS += -O2
	CXXFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

# Backed out MIPS specific part of the patch from Thiemo Seufer (see #274090)
#ifneq (,$(filter mips mipsel,$(DEB_BUILD_ARCH)))
	#CFLAGS += -Wa,-xgot
	#CXXFLAGS += -Wa,-xgot
#endif




# Build a new .orig.tar.gz.
orig: clean

	$(TGZ) -C .. --exclude $(source)-$(upstream)/debian \
		--exclude $(source)-$(upstream)/pkg/debian  -cvf \
		../$(source)_$(upstream).orig.tar.gz $(source)-$(upstream)

# Here goes the wxWidgets untar/configure/build
$(doPgA3Wx)-clean:
	[ -d $(_PGA3_WXDEST) ] && rm -rf $(_PGA3_WXDEST) || true
	-rm $(doPgA3Wx)-stamp
	-rm $(doPgA3Wx)-untar-stamp
	-rm $(doPgA3Wx)-configure-stamp
	-rm $(doPgA3Wx)-build-stamp
	-rm $(doPgA3Wx)-install-stamp
                                                                                                                             
$(doPgA3Wx): $(doPgA3Wx)-stamp

$(doPgA3Wx)-stamp: $(doPgA3Wx)-untar $(doPgA3Wx)-configure $(doPgA3Wx)-build $(doPgA3Wx)-install
	touch $@

$(doPgA3Wx)-untar: $(doPgA3Wx)-untar-stamp

$(doPgA3Wx)-untar-stamp:
	mkdir -p $(_PGA3_WXDEST)
	cd $(_PGA3_WXDEST) && $(TGZ) -xf $(_PGA3_WXTAR)
	# Here we eventually apply wxWindows patches
	cat debian/wxWidgets.patch | ( cd $(_PGA3_WXTOP) && patch -p0 )
	touch $@

$(doPgA3Wx)-configure: $(doPgA3Wx)-configure-stamp

$(doPgA3Wx)-configure-stamp:
	cd $(_PGA3_WXTOP) && \
	./configure --build=$(DEB_BUILD_GNU_TYPE) \
	--prefix=$(_PGA3_WXLOCALINST) \
	--mandir=\$${prefix}/share/man \
	--infodir=\$${prefix}/share/info \
	--with-gtk --enable-gtk2 --enable-unicode \
	--enable-debug \
	--disable-shared
	touch $@

$(doPgA3Wx)-build: $(doPgA3Wx)-build-stamp

$(doPgA3Wx)-build-stamp:
	cd $(_PGA3_WXTOP) && $(MAKE)
	cd $(_PGA3_WXTOP)/contrib/ && $(MAKE)
	touch $@

$(doPgA3Wx)-install: $(doPgA3Wx)-install-stamp

$(doPgA3Wx)-install-stamp:
	cd $(_PGA3_WXTOP) && $(MAKE) install
	cd $(_PGA3_WXTOP)/contrib/ && $(MAKE) install
	touch $@


# Here goes the pgAdmin3 stuff

config.status: configure $(doPgA3Wx)
	dh_testdir
	# Add here commands to configure the package.
	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--disable-dependency-tracking \
		--with-wx=$(_PGA3_WXLOCALINST) \
		--with-wx-config=$(_PGA3_WXCONFIG) \
		--with-pgsql-include=$(_pgsql_inc) \
		--enable-gtk2 \
		--enable-unicode \
		--enable-debug --enable-static --with-libxml2=/usr --with-libxslt=/usr

build: build-stamp

build-stamp: config.status
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)
	#/usr/bin/docbook-to-man debian/pgadmin3.sgml > pgadmin3.1

	touch build-stamp

clean: $(doPgA3Wx)-clean
	dh_testdir
	dh_testroot
	rm -f build-stamp 

	# Add here commands to clean up after the build process.
	-$(MAKE) clean
	-$(MAKE) distclean
	-rm config.status
	-rm config.cache
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


	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

	# Add here commands to install the package into debian/pgadmin3.
	# Finally install all in debian/tmp. Files are dispatched into packages by dh_install
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	[ ! -f TODO.txt ] && echo "Please consult: http://www.pgadmin.org/development/todo.php" > TODO.txt || true

	# move pgadmin3.mo files to locales directory
	# this part was written by Andreas Tille <tille@debian.org>
	for loc in `find debian/tmp -name $(pkg).mo` ; do \
	   LOC=`echo $${loc} | sed "s?.*pgadmin3/i18n/\(.*\)/$(pkg).mo?\1?"` ; \
	   mkdir -p debian/$(pkg)/usr/share/locale/$${LOC}/LC_MESSAGES ; \
	   mv $${loc} debian/$(pkg)/usr/share/locale/$${LOC}/LC_MESSAGES/. ; \
	done
	
	# moved dh_install here as it is common to indep and arch
	# by being there dh_install can warn about forgotten files as it is
	# acting on both pgadmin3 and pgadmin3-data packages. (RE)
	# (note that we could also use --fail-missing instead of --list-mising)
	dh_install --list-missing


# binary-arch/binary-indep
# in another 'make' thread.
spec-binary-indep:
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	# dh_installexamples
	#dh_install
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
spec-binary-arch:
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
	#dh_install --list-missing
	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_python
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

	#make -f debian/rules $(doPgA3Wx)-clean

# Build architecture independant packages using the common target.
binary-indep: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-i spec-binary-indep

# Build architecture dependant packages using the common target.
binary-arch: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-a spec-binary-arch

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