File: rules

package info (click to toggle)
e2fsprogs 1.44.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 34,744 kB
  • sloc: ansic: 124,569; sh: 5,980; makefile: 5,344; awk: 523; yacc: 288; sed: 207; perl: 170; python: 23
file content (478 lines) | stat: -rwxr-xr-x 15,631 bytes parent folder | download | duplicates (3)
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
#! /usr/bin/make -f
# -*- makefile -*-
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownerships.

.PHONY: binary binary-arch binary-indep build build-arch build-indep \
	build-bf build-std install install-udeb \
	clean checkroot mrproper debug_flags debian-files

export DEB_BUILD_MAINT_OPTIONS ?= hardening=+all

# be paranoid
export LC_ALL ?= C

# 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_ARCH		?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH		?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_HOST_OS		?= $(shell dpkg-architecture -qDEB_HOST_OS)
DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH_OS	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

# Allow distro-specific behaviour
DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian)

ifeq ($(DEB_HOST_ARCH_OS), hurd)
SKIP_FUSE2FS=yes
endif

ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
SKIP_FUSE2FS=yes
endif

ifneq ($(filter pkg.e2fsprogs.no-static-e2fsck,$(DEB_BUILD_PROFILES)),)
SKIP_E2FSCK_STATIC=yes
endif

ifneq ($(filter noudeb,$(DEB_BUILD_PROFILES)),)
SKIP_UDEB=yes
endif

DH_VERSION := $(shell dpkg-query -W -f '$${Version}' debhelper)

# USE_DBGSYM :=
USE_DBGSYM ?= $(shell if dpkg --compare-versions $(DH_VERSION) ">=" 9.20160114 ; then echo yes ; fi)

ifeq ($(USE_DBGSYM),yes)
dh_strip_args = -p$(1) --dbgsym-migration='$(1)-dbg (<= 1.43-1)'
dh_strip_args2 = -p$(1) --dbgsym-migration='$(2)-dbg (<= 1.43-1)'
else
dh_strip_args = -p$(1) --dbg-package=$(1)-dbg
dh_strip_args2 = -p$(1) --dbg-package=$(2)-dbg
DBG_PACKAGES += -pe2fsprogs-dbg -plibext2fs-dbg -plibcom-err2-dbg -plibss2-dbg
export DEB_BUILD_PROFILES += pkg.e2fsprogs.legacy-dbg
endif

# find the version for the main package, from changelog file
MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
# find versions for libraries going into their own packages, from their Makefile.in's,
# and sonames for all libs
COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
COMERR_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
SS_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)

EXT2FS_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
E2P_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)

package		?= e2fsprogs

topdir		?= $(shell pwd)
debdir		?= ${topdir}/debian
tmpdir		?= ${debdir}/tmp
udebdir		?= ${debdir}/e2fsprogs-udeb
libcomerrdir	?= ${debdir}/libcom-err${COMERR_SOVERSION}
comerrdevdir	?= ${debdir}/comerr-dev
libcomerrdbgdir	?= ${debdir}/libcom-err2-dbg
libssdir	?= ${debdir}/libss${SS_SOVERSION}
ssdevdir	?= ${debdir}/ss-dev
libssdbgdir	?= ${debdir}/libss2-dbg
libext2dir	?= ${debdir}/libext2fs2
libext2devdir	?= ${debdir}/libext2fs-dev
libext2dbgdir	?= ${debdir}/libext2fs2-dbg
maindir		?= ${debdir}/e2fsprogs
e2fsckstaticdir	?= ${debdir}/e2fsck-static
debugdir	?= ${debdir}/e2fsprogs-dbg
stdbuilddir	?= ${debdir}/BUILD-STD
# docdir	?= ${maindir}/usr/share/doc/${package}
MANDIR		?= /usr/share/man
mandir		?= ${tmpdir}${MANDIR}

UDEB_NAME 	?= $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
UDEB_PRIORITY	?= $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)

STAMPSDIR	?= debian/stampdir
CFGSTDSTAMP	?= ${STAMPSDIR}/configure-std-stamp
CFGBFSTAMP	?= ${STAMPSDIR}/configure-bf-stamp
BUILDSTDSTAMP	?= ${STAMPSDIR}/build-std-stamp
BUILDBFSTAMP	?= ${STAMPSDIR}/build-bf-stamp

INSTALL ?= install
INSTALL_PROGRAM ?= $(INSTALL) -p -o root -g root -m 0755

#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
#INSTALL_PROGRAM += -s
#endif

ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
SYMBOL_LIBS := libext2fs libcomerr2 libss2
endif

DEFAULT_CFLAGS ?= -g -O2
DEFAULT_LDFLAGS ?= -Wl,-Bsymbolic-functions

CFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
	DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
	dpkg-buildflags --get CFLAGS; else echo $(DEFAULT_CFLAGS) ; fi)
LDFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
	DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
	dpkg-buildflags --get LDFLAGS; else echo $(DEFAULT_LDFLAGS) ; fi)
CPPFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
	DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
	dpkg-buildflags --get CPPFLAGS; fi)

ifeq (${DEB_HOST_ARCH},alpha)
CFLAGS += -DHAVE_NETINET_IN_H
else
CFLAGS += -D__NO_STRING_INLINES
endif

E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static

CFLAGS_SHLIB = $(CFLAGS)
CFLAGS_STLIB = $(CFLAGS)
LDFLAGS_SHLIB = $(LDFLAGS)
LDFLAGS_STATIC = $(filter-out -fPIE -fpie -pie,$(LDFLAGS))

ifneq ($(SKIP_UDEB),)
SKIP_BF ?= yes
endif

ifeq ($(SKIP_BF),yes)
BUILD_BF =
bfbuilddir	?= ${stdbuilddir}
else
BUILD_BF = build-bf
bfbuilddir	?= ${debdir}/BUILD-BF
endif

BF_CFLAGS = -Os -fomit-frame-pointer

UTIL_CONF_FLAGS ?= --disable-fsck --disable-libblkid \
			--disable-libuuid --disable-uuidd

ifneq ($(SKIP_FUSE2FS),)
UTIL_CONF_FLAGS +=  --disable-fuse2fs
endif

BACKTRACE_CONF_FLAGS ?= $(shell if ${debdir}/scripts/test-backtrace ; then echo --disable-backtrace ; fi)

COMMON_CONF_FLAGS = --disable-e2initrd-helper \
	--infodir=/usr/share/info  --enable-symlink-install \
	--with-multiarch=$(DEB_HOST_MULTIARCH) \
	$(BACKTRACE_CONF_FLAGS) $(UTIL_CONF_FLAGS)

STD_CONF_FLAGS ?= --enable-elf-shlibs

BF_CONF_FLAGS ?= --enable-elf-shlibs --disable-nls --disable-imager \
	--disable-testio-debug --disable-uuidd --disable-tls \
	--disable-tdb --disable-debugfs

DBG_PACKAGES=

ifeq ($(SKIP_UDEB),)
INSTALL_UDEB = install-udeb
endif

debian-files:
ifneq ($(USE_DBGSYM),yes)
	if test ! -f debian/control.save; then \
		mv debian/control debian/control.save ; \
		cat debian/control.save debian/control.legacy-dbg \
			>> debian/control ; \
	fi
endif

mrproper: clean
	if test -f debian/control.save; then \
		mv debian/control.save debian/control ; \
	fi

${CFGSTDSTAMP}:
	dh_testdir
	if which dh_update_autotools_config > /dev/null 2>&1 ; then \
		dh_update_autotools_config ;\
	fi

	# Make sure we don't try to rebuild the configure scripts
	find . -name configure | xargs touch

	mkdir -p ${stdbuilddir}
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	cd ${stdbuilddir} && AWK=/usr/bin/awk \
		../../configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
		${EXTRA_CONF_FLAGS} CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" \
		LDFLAGS="$(LDFLAGS)" CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
else
	cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
		../../configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
		${EXTRA_CONF_FLAGS} --build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) CFLAGS="${CFLAGS}" \
		CPPFLAGS="$(CPPFLAGS)" CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
		LDFLAGS="$(LDFLAGS)" \
		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
endif

	mkdir -p ${STAMPSDIR}
	touch ${CFGSTDSTAMP}

${CFGBFSTAMP}:
	dh_testdir
	if which dh_update_autotools_config > /dev/null 2>&1 ; then \
		dh_update_autotools_config ;\
	fi
	rm -f config.cache

	mkdir -p ${bfbuilddir}
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
	cd ${bfbuilddir} && AWK=/usr/bin/awk \
		../../configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
		${EXTRA_CONF_FLAGS} CFLAGS="${CFLAGS} ${BF_CFLAGS}" \
		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
		CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
else
	cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
		../../configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
		${EXTRA_CONF_FLAGS} --build=$(DEB_BUILD_GNU_TYPE) \
		--host=$(DEB_HOST_GNU_TYPE) CFLAGS="${CFLAGS}" \
		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
		CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
endif
	mkdir -p ${STAMPSDIR}
	touch ${CFGBFSTAMP}

build-arch: build
build-indep: build
build: build-std $(BUILD_BF)

build-std: ${BUILDSTDSTAMP}
${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
	dh_testdir
	$(MAKE) -C ${stdbuilddir} V=1 all
ifneq ($(SKIP_E2FSCK_STATIC),yes)
	$(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
endif
	if ! test -d debian/orig-gmo ; then \
		mkdir debian/orig-gmo ; \
		mv po/*.gmo po/*.po debian/orig-gmo ; \
		cp debian/orig-gmo/*.po po ; \
	fi
	$(MAKE) -C ${stdbuilddir}/po V=1 update-gmo

	( cd ${stdbuilddir}/doc && $(MAKE) V=1 libext2fs.html )
	( cd ${stdbuilddir}/lib/et && $(MAKE) V=1 com_err.info com_err.html )

	touch ${BUILDSTDSTAMP}

build-bf: ${BUILDBFSTAMP}
${BUILDBFSTAMP}: ${CFGBFSTAMP}
	dh_testdir
	$(MAKE) -C ${bfbuilddir} V=1 libs
	$(MAKE) -C ${bfbuilddir}/e2fsck V=1 all
	$(MAKE) -C ${bfbuilddir}/misc V=1 all
	$(MAKE) -C ${bfbuilddir}/resize V=1 all
	touch ${BUILDBFSTAMP}

clean:
	dh_testdir
	if test -d debian/orig-gmo ; then \
		rm -f po/*.gmo po/*.po ; \
		mv debian/orig-gmo/* po ; \
		rmdir debian/orig-gmo ; \
	fi
	rm -rf ${STAMPSDIR}
	[ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} V=1 distclean
	[ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} V=1 distclean
	[ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} V=1 distclean
	rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir}
	rm -f debian/*.substvars
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	mkdir -p ${tmpdir}/sbin
	$(MAKE) -C ${stdbuilddir} V=1 install DESTDIR=${tmpdir} \
		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
  # static libs and .h files
	$(MAKE) -C ${stdbuilddir} V=1 install-libs DESTDIR=${tmpdir} LDCONFIG=true

ifneq ($(SKIP_E2FSCK_STATIC),yes)
  # statically-linked fsck
	${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
	cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
endif

ifeq ($(DEB_HOST_ARCH_OS), hurd)
	${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
endif

	dh_movefiles
	test -z "`find ${tmpdir} -type f`"

install-udeb: build
	dh_testdir
	dh_testroot

	$(MAKE) -C ${bfbuilddir} V=1 install-shlibs-libs-recursive DESTDIR=${udebdir} \
		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
	$(MAKE) -C ${bfbuilddir}/e2fsck V=1 install DESTDIR=${udebdir} \
		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
	$(MAKE) -C ${bfbuilddir}/misc V=1 install DESTDIR=${udebdir} \
		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
	$(MAKE) -C ${bfbuilddir}/resize V=1 install DESTDIR=${udebdir} \
		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true

	rm -rf ${udebdir}/usr
	find ${udebdir}/sbin -type f -a ! -name e2fsck \
		-a ! -name mke2fs -a ! -name tune2fs \
		-a ! -name resize2fs -a ! -name badblocks -print | xargs rm

	(cd ${udebdir}/sbin; ln -sf e2fsck fsck.ext2 ; \
		ln -sf e2fsck fsck.ext3 ; ln -sf e2fsck fsck.ext4 ; \
		ln -sf mke2fs mkfs.ext2 ; ln -sf mke2fs mkfs.ext3 ; \
		ln -sf mke2fs mkfs.ext4)

binary-indep: install
	dh_testdir
	dh_testroot
	dh_lintian -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_fixperms -i
	dh_compress -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: install $(INSTALL_UDEB)
	dh_testdir
	dh_testroot

	dh_lintian -a

  # symlinks to prepare dh_installdocs run

	mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
	mkdir -p ${debdir}/ss-dev/usr/share/doc
	ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev

	mkdir -p ${debdir}/libcom-err${COMERR_SOVERSION}/usr/share/doc/libcom-err${COMERR_SOVERSION}
	mkdir -p ${debdir}/comerr-dev/usr/share/doc
	ln -sf libcom-err${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev

	mkdir -p ${debdir}/libext2fs2/usr/share/doc/libext2fs
	mkdir -p ${debdir}/libext2fs-dev/usr/share/doc
	ln -sf libext2fs2 ${debdir}/libext2fs-dev/usr/share/doc/libext2fs-dev

	dh_installdocs -a -Ne2fsprogs-udeb

  # HTML docs
	$(INSTALL) -d ${debdir}/libext2fs-dev/usr/share/doc/libext2fs/html-info/
	$(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
	   ${debdir}/libext2fs-dev/usr/share/doc/libext2fs/html-info/
	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcom-err${COMERR_SOVERSION}/html-info/
	$(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
	   ${debdir}/comerr-dev/usr/share/doc/libcom-err${COMERR_SOVERSION}/html-info/

  # texinfo docs
	mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcom-err${COMERR_SOVERSION}
	$(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
	   ${debdir}/libext2fs-dev/usr/share/doc/libext2fs/libext2fs.texi
	$(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
	   ${debdir}/comerr-dev/usr/share/doc/libcom-err${COMERR_SOVERSION}/com_err.texi

	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcom-err${COMERR_SOVERSION}/examples
	$(INSTALL) -p -m 0644 lib/ss/ss_err.et \
		${stdbuilddir}/lib/ext2fs/ext2_err.et \
		${debdir}/comerr-dev/usr/share/doc/libcom-err${COMERR_SOVERSION}/examples
	$(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
	$(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
		${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples

	dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
	dh_installinfo -plibext2fs-dev ${stdbuilddir}/doc/libext2fs.info

	dh_installchangelogs -a
	dh_fixperms -a
	dh_strip $(call dh_strip_args,e2fsprogs)
ifneq ($(SKIP_E2FSCK_STATIC),yes)
	dh_strip $(call dh_strip_args2,e2fsck-static,e2fsprogs)
endif
	dh_strip $(call dh_strip_args,libext2fs2)
	dh_strip $(call dh_strip_args,libss${SS_SOVERSION})
	dh_strip $(call dh_strip_args,libcom-err${COMERR_SOVERSION})
	dh_strip -a

	# dpkg symbol handling
	for i in $(SYMBOL_LIBS); \
	do \
		echo "Generating symbols for $$i..."; \
		dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
		cat debian/$$i.tmp-patch; \
		patch debian/$$i.symbols < debian/$$i.tmp-patch; \
		/bin/rm debian/$$i.tmp-patch; \
	done

	dh_compress -a

	dh_makeshlibs -a --add-udeb=e2fsprogs-udeb

	$(INSTALL) -D -p -m644 debian/e2fsprogs-udeb.lintian-overrides \
	    debian/e2fsprogs-udeb/usr/share/lintian/overrides/e2fsprogs-udeb
	dh_installdeb -a
	dh_shlibdeps -a -l${stdbuilddir}/lib
	dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
		-u"-Ldebian/e2fsprogs.shlibs.local"
ifeq ($(SKIP_UDEB),)
	dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
		-u"-Ldebian/e2fsprogs-udeb.shlibs.local"
endif
ifeq ($(SKIP_FUSE2FS),)
	dh_shlibdeps -pfuse2fs -l${stdbuilddir}/lib \
		-u"-Ldebian/e2fsprogs.shlibs.local"
endif

	dh_gencontrol -a -Ncomerr-dev -Nss-dev -Ne2fsprogs-udeb
	dh_gencontrol -pcomerr-dev \
	  -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
	dh_gencontrol -pss-dev \
	  -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
ifeq ($(SKIP_UDEB),)
	dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
endif

ifeq ($(SKIP_UDEB),)
	dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
endif
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch

debug_flags:
	@echo CFLAGS is $(CFLAGS)
	@echo LDFLAGS is $(LDFLAGS)
	@echo CPPFLAGS is $(CPPFLAGS)