File: rules

package info (click to toggle)
gdal 1.3.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 37,640 kB
  • ctags: 38,948
  • sloc: cpp: 303,891; ansic: 136,081; sh: 8,216; python: 6,215; java: 2,991; perl: 1,532; makefile: 674; xml: 185; php: 24
file content (126 lines) | stat: -rwxr-xr-x 3,305 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
#!/usr/bin/make -f
# -*- makefile -*-
#
# debian package by Alessandro Amici 2002-2003.
# Based on: GNU copyright 1997 to 1999 by Joey Hess.

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

# dpatch targets
include /usr/share/dpatch/dpatch.make

PYVERS=$(shell pyversions -v -r debian/control)
PYDEF=$(shell pyversions -dv)

configure: configure-stamp
configure-stamp: patch-stamp
	dh_testdir

	for V in $(PYVERS); do \
		PYTHON=/usr/bin/python$$V ./configure --prefix=/usr \
			--mandir=\$$\{prefix\}/share/man \
			--with-threads \
			--with-grass=no \
			--with-geotiff=internal \
			--with-jasper \
			--with-netcdf \
			--with-xerces \
			--with-geos \
			--with-mysql; \
		mv GDALmake.opt GDALmake.opt-$$V; \
	done

	# Patch the generated libtool to avoid passing -rpath when linking,
	# and to explicitly link libraries against the libraries they
	# depend on.
	sed < libtool > libtool-2 \
	-e 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' \
	-e '/^archive_cmds="/s/"$$/ \\$$deplibs"/' \
	-e 's/^hardcode_into_libs.*$$/hardcode_into_libs=no/'
	mv libtool-2 libtool
	chmod 755 libtool 

	touch configure-stamp

build: configure-stamp build-stamp
build-stamp: 
	dh_testdir

	cp `ls GDALmake.opt-*|tail -1` GDALmake.opt
	$(MAKE) lib-target apps-target
	$(MAKE) docs

	touch build-stamp

clean: clean-unpatched unpatch
clean-unpatched:
	# reminiscence to old procedure of building man pages, will now created
	# by doxygen. This rm will be deleted in further releases of gdal
	sh -c "if (test -d man/man1) then rm -r man/man1; fi"

	dh_testdir
	dh_testroot

	-$(MAKE) distclean
	rm -f GDALmake.opt-*

	dh_clean build-stamp configure-stamp

install: 
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Save gdal-config for next use
	cp apps/gdal-config-inst $(CURDIR)/debian/gdal-config.build

	for V in $(PYVERS); do \
		cp GDALmake.opt-$$V GDALmake.opt; \
		(cd pymod && $(MAKE) clean); \
		$(MAKE) py-target; \
		$(MAKE) install prefix=$(CURDIR)/debian/tmp/usr \
			INST_PYMOD="\$$(prefix)"`awk -F '/usr' '/INST_PYMOD/ {print $$2}' GDALmake.opt` ; \
	done

	$(MAKE) install-docs prefix=$(CURDIR)/debian/tmp/usr \
		"INST_DOCS=\$$(prefix)/share/doc/libgdal-doc"\
		"INST_MAN=\$$(prefix)/share/man"

	# Restore build-time gdal-config
	cp $(CURDIR)/debian/gdal-config.build $(CURDIR)/debian/tmp/usr/bin/gdal-config && \
		rm -f $(CURDIR)/debian/gdal-config.build

	# To reach compatibility with window-version which puts gdal-header
	# files into /usr/include/gdal. I don't want to place headerfiles directly
	# into /usr/include/gdal to avoid incompatibility with older debian
	# package versions
	ln -fs . `pwd`/debian/tmp/usr/include/gdal

binary-common: 
	dh_testdir
	dh_testroot
	dh_movefiles
	dh_installdocs
	dh_installchangelogs NEWS
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_pycentral
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps -L libgdal1-1.3.2 -l debian/libgdal1-1.3.2/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary-indep: build install
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

binary: binary-arch binary-indep
.PHONY: build clean binary-arch binary-indep binary-common binary install patch unpatch clean-unpatched