File: rules

package info (click to toggle)
grass 6.0.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 40,044 kB
  • ctags: 31,303
  • sloc: ansic: 321,125; tcl: 25,676; sh: 11,176; cpp: 10,098; makefile: 5,025; fortran: 1,846; yacc: 493; lex: 462; perl: 133; sed: 1
file content (178 lines) | stat: -rw-r--r-- 5,203 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
#!/usr/bin/make -f

# 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)

CFLAGS=-Wall -g

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

include /usr/share/dpatch/dpatch.make

config-stamp: patch
	dh_testdir
	# Add here commands to configure the package.
	CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
                    --prefix=/usr/lib \
                    --sysconfdir=/etc \
                    --sharedstatedir=/var \
                    --enable-socket \
                    --enable-shared \
                    --with-postgres \
                    --with-mysql \
                    --with-cxx \
                    --with-x \
                    --with-gdal \
                    --with-freetype \
                    --with-motif \
                    --with-readline \
                    --with-nls \
                    --with-glw \
                    --with-odbc \
                    --with-freetype-includes=/usr/include/freetype2 \
                    --with-tcltk-includes=/usr/include/tcl8.4 \
                    --with-postgres-includes=$(shell pg_config --includedir) \
                    --with-mysql-includes=/usr/include/mysql 

	touch config-stamp

# This target generates arch-dep stuff, unfortunately most doc requires working bins to 
# be properly generated...
build: build-stamp
build-stamp:  config-stamp
	dh_testdir

	$(MAKE) 
	chmod 755 debian/fixpaths.sh debian/fixscripts.sh

	touch build-stamp

# This target generates truly arch-indep stuff
build-indep: build-indep-stamp
build-indep-stamp: config-stamp
	dh_testdir

	$(MAKE) htmldocs

	touch build-indep-stamp

clean: clean-patched unpatch
clean-patched:
	dh_testdir
	dh_testroot

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

	rm -f lib/proj/nad2bin
	rm -f tools/timer/main.o
	rm -f raster/r.le/r.le.setup/polytocell/*.o
	rm -f raster/r.terraflow/IOStream/lib/src/libiostream.a
	rm -f debian/grass60.1
	rm -f error.log
	# clean doxygen documentation (programming man)
	rm -rf doxygenhtml lib/vector/html lib/db/html lib/gis/html \
		lib/vector/latex lib/db/latex lib/gis/latex 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# install grass core into debian/tmp
	$(MAKE) strip
	$(MAKE) install INST_DIR=$(CURDIR)/debian/tmp/usr/lib/grass \
		PREFIX=$(CURDIR)/debian/tmp/usr/lib/grass \
		BINDIR=$(CURDIR)/debian/tmp/usr/bin

	# fix all the braindead scripts
	debian/fixscripts.sh

	# fix links
	debian/fixpaths.sh $(CURDIR)/debian/tmp debian/tmp
	
	# delete extra license file
	rm -f debian/tmp/usr/lib/grass/etc/license
    
	# change section from 1 to .1grass 
	mv debian/tmp/usr/lib/grass/man/man1/grass6.1 debian/grass60.1
	for m in debian/tmp/usr/lib/grass/man/man1/*.1; do n=`basename $$m .1`; mv $$m debian/tmp/usr/lib/grass/man/man1/$$n.1grass; done
	for m in debian/tmp/usr/lib/grass/man/man1/*.1grass; do sed -i -e 's/^.TH \(.*\) 1/.TH \1 1grass/' $$m; done

	# install lintian overrides
	# install -m 644 debian/grass.lintian-overrides debian/grass/usr/share/lintian/overrides/grass

	# install module makefile	
	install -m 644 include/Make/Module.make debian/libgrass-dev/usr/lib/grass/include/Make/Module.make

install-indep: build-indep
	dh_testdir -i
	dh_testroot -i
	install -m 644  -d debian/tmp
	install -m 644  -d debian/tmp/programming-manual/vector/html \
			   debian/tmp/programming-manual/db/html \
			   debian/tmp/programming-manual/gis/html
			   
	install -m 644 lib/vector/html/* debian/tmp/programming-manual/vector/html
	install -m 644 lib/db/html/* debian/tmp/programming-manual/db/html
	install -m 644 lib/gis/html/* debian/tmp/programming-manual/gis/html

# Build architecture-independent files here.
binary-indep: install install-indep 
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i CHANGES
	dh_installdocs -i
	dh_install --sourcedir=debian/tmp -i
	dh_link -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: install
	dh_testdir -a
	dh_testroot  -a
	dh_installchangelogs -a CHANGES
	dh_installdocs  -a
	dh_installexamples  -a
	dh_install --sourcedir=debian/tmp -a
	dh_installman -pgrass debian/grass60.1 -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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