File: rules

package info (click to toggle)
kdewebdev 1%3A3.3.2-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 33,200 kB
  • ctags: 13,047
  • sloc: cpp: 165,029; sh: 9,033; perl: 3,315; makefile: 1,618; xml: 497; ansic: 83
file content (233 lines) | stat: -rwxr-xr-x 6,269 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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#!/usr/bin/make -f
# 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

# This is the debhelper compatibility version to use.
export DH_COMPAT=4

# This has to be exported to make some magic below work.
export DH_OPTIONS

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

INSTALL_DIR = install -p -d -o root -g root -m 755
INSTALL_FILE = install -p -o root -g root -m 644

objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -g
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

ifeq ($(DEB_BUILD_GNU_TYPE),i386-linux)
  # Uncomment the following 2 lines to enable i686 optimziation
  # You may want to tweak the settings to your likings
  #export CFLAGS=-O3 -march=i686 -ffast-math -finline-functions
  #export CXXFLAGS=-O3 -march=i686 -ffast-math -finline-functions
endif

-include debian/debiandirs

debian/debiandirs: admin/debianrules
	perl -w admin/debianrules echodirs > debian/debiandirs

configure: configure-stamp
configure-stamp:
	dh_testdir

	# Make absolutely sure these aren't left around from the .orig.tar.gz.
	-rm -f debian/kxsldbg.shlibs
	-rm -f debian/quanta.doc-base debian/kxsldbg.doc-base

	# Apply Debian specific patches
	if test ! -f patch-stamp; then \
		for patch in $(CURDIR)/debian/patches/*.diff ;\
		do \
			echo APPLYING PATCH\: $${patch##*/};\
			patch -p1 < $$patch ;\
		done ;\
		touch patch-stamp ;\
	fi

	# KDE CVS does not have aclocal.m4 or configure
	if test ! -f configure; then \
		$(MAKE) -f admin/Makefile.common ;\
	fi

	# ensure configure is executable
	chmod +x configure

	# make build directory
	mkdir $(objdir)

	# run configure with build tree $(objdir)
	cd $(objdir) && \
	XSLDBG_DOCS_DIR=/usr/share/doc/xsldbg \
	../configure $(configkde) --disable-docs-macro

	touch configure-stamp

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

	cd $(objdir) && \
	$(MAKE)

	touch build-stamp

debian-clean:
	dh_testdir
	dh_testroot

	dh_clean

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp debian/debiandirs

	# Remove Debian specific patches
	if test -f patch-stamp; then \
		for patch in $(CURDIR)/debian/patches/*.diff ;\
		do \
			echo REMOVING PATCH\: $${patch##*/};\
			patch -p1 -R < $$patch ;\
		done ;\
		rm -f patch-stamp ;\
	fi

	# Remove build tree
	rm -rf $(objdir)

	# if Makefile exists run distclean
	if test -f Makefile; then \
		$(MAKE) distclean; \
	fi

	if test -d CVS; then \
		$(MAKE) -f admin/Makefile.common cvs-clean ;\
	fi

	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	cd $(objdir) && \
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

	# Generate HTML docs.
	for i in `find debian/tmp -name "index.docbook"`; do \
	  ( cd `dirname $$i`; meinproc `basename $$i` ); \
	done

	# Split into separate binary packages.
	dh_install --sourcedir=debian/tmp --list-missing

	# Remove unwanted CVS dirs in the kommander examples.
	rm -rf `find debian/kommander/usr/share/doc -type d -name CVS`

	# Install standard documentation links.
	for pkg in `dh_listpackages`; do \
	  if test -d debian/$$pkg/usr/share/doc/kde/HTML/en/$$pkg; then \
	    dh_link -p$$pkg usr/share/doc/kde/HTML/en/$$pkg \
	      usr/share/doc/$$pkg/html; \
	  fi; \
	done

	# Install linda and lintian overrides.
	for pkg in `dh_listpackages`; do \
	  if test -e debian/$$pkg.override; then \
	    $(INSTALL_DIR) debian/$$pkg/usr/share/lintian/overrides; \
	    $(INSTALL_FILE) debian/$$pkg.override \
	      debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
	  fi; \
	  if test -e debian/$$pkg.linda; then \
	    $(INSTALL_DIR) debian/$$pkg/usr/share/linda/overrides; \
	    $(INSTALL_FILE) debian/$$pkg.linda \
	      debian/$$pkg/usr/share/linda/overrides/$$pkg; \
	  fi; \
	done

# This single target is used to build all the packages, all at once, or
# one at a time. So keep in mind: any options passed to commands here will
# affect _all_ packages. Anything you want to only affect one package
# should be put in another target, such as the install target.
binary-common:
	dh_testdir
	dh_testroot

	# Install the correct upstream changelogs.
	for pkg in `dh_listpackages`; do \
	  case "$$pkg" in \
	    kfilereplace | kimagemapeditor | klinkstatus | kommander | quanta ) \
	      DH_OPTIONS='' dh_installchangelogs -p$$pkg $$pkg/ChangeLog ;; \
	    kommander-dev ) \
	      DH_OPTIONS='' dh_installchangelogs -p$$pkg kommander/ChangeLog ;; \
	    quanta-data ) \
	      DH_OPTIONS='' dh_installchangelogs -p$$pkg quanta/ChangeLog ;; \
	    * ) \
	      DH_OPTIONS='' dh_installchangelogs -p$$pkg ;; \
	  esac; \
	done

	dh_installdocs
	dh_installexamples
	dh_installman
	dh_installmenu
	dh_installmime
	dh_strip
	dh_link
	dh_compress -X.docbook -X.css -X-license -X.dcl -X.bz2 -X.kmdr
	dh_fixperms
	dh_makeshlibs -V
	dh_installdeb
	dh_perl

	# Run dh_shlibdeps with package-specific library search paths.
	for pkg in `dh_listpackages`; do \
	  echo "Checking dependencies for $$pkg..."; \
	  case "$$pkg" in \
	    kommander ) \
	      DH_OPTIONS='' dh_shlibdeps -p$$pkg \
	        -ldebian/$$pkg/usr/lib:debian/libkommander0/usr/lib ;; \
	    kxsldbg ) \
	      DH_OPTIONS='' dh_shlibdeps -p$$pkg \
	        -ldebian/$$pkg/usr/lib:debian/$$pkg/usr/lib/kde3 ;; \
	    * ) \
	      DH_OPTIONS='' dh_shlibdeps -p$$pkg ;; \
	  esac; \
	done

	dh_gencontrol
	dh_md5sums
	dh_builddeb

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

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

# Any other binary targets build just one binary package at a time.
binary-%: build install
	$(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*

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