• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /usr/bin/make -f
2# -*- makefile -*-
3#
4# Invoke each target with `./debian/rules <target>'.  All targets should be
5# invoked with the package root as the current directory.
6#
7# The `binary' target must be run as root, as it needs to install files with
8# specific ownerships.
9
10.PHONY: binary binary-arch binary-indep build build-arch build-indep \
11	build-bf build-std install install-udeb \
12	clean checkroot mrproper debug_flags debian-files
13
14export DEB_BUILD_MAINT_OPTIONS ?= hardening=+all
15
16# be paranoid
17export LC_ALL ?= C
18
19# These are used for cross-compiling and for saving the configure script
20# from having to guess our platform (since we know it already)
21DEB_HOST_ARCH		?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
22DEB_BUILD_ARCH		?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
23DEB_HOST_OS		?= $(shell dpkg-architecture -qDEB_HOST_OS)
24DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
25DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
26DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
27DEB_HOST_ARCH_OS	?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
28
29# Allow distro-specific behaviour
30DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian)
31
32ifeq ($(DEB_HOST_ARCH_OS), hurd)
33SKIP_FUSE2FS=yes
34endif
35
36ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
37SKIP_FUSE2FS=yes
38endif
39
40ifneq ($(filter pkg.e2fsprogs.no-static-e2fsck,$(DEB_BUILD_PROFILES)),)
41SKIP_E2FSCK_STATIC=yes
42endif
43
44ifneq ($(filter noudeb,$(DEB_BUILD_PROFILES)),)
45SKIP_UDEB=yes
46endif
47
48DH_VERSION := $(shell dpkg-query -W -f '$${Version}' debhelper)
49
50USE_DH9 ?= $(shell if dpkg --compare-versions $(DH_VERSION) lt 11 ; then echo yes ; fi)
51
52# USE_DBGSYM :=
53USE_DBGSYM ?= $(shell if dpkg --compare-versions $(DH_VERSION) ">=" 9.20160114 ; then echo yes ; fi)
54
55ifeq ($(USE_DBGSYM),yes)
56dh_strip_args = -p$(1) --dbgsym-migration='$(1)-dbg (<= 1.43-1)'
57dh_strip_args2 = -p$(1) --dbgsym-migration='$(2)-dbg (<= 1.43-1)'
58else
59dh_strip_args = -p$(1) --dbg-package=$(1)-dbg
60dh_strip_args2 = -p$(1) --dbg-package=$(2)-dbg
61DBG_PACKAGES += -pe2fsprogs-dbg -plibext2fs-dbg -plibcom-err2-dbg -plibss2-dbg
62export DEB_BUILD_PROFILES += pkg.e2fsprogs.legacy-dbg
63endif
64
65# find the version for the main package, from changelog file
66MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
67# find versions for libraries going into their own packages, from their Makefile.in's,
68# and sonames for all libs
69COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
70COMERR_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
71SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
72SS_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
73
74EXT2FS_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
75E2P_SOVERSION ?= $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
76
77package		?= e2fsprogs
78
79topdir		?= $(shell pwd)
80debdir		?= ${topdir}/debian
81tmpdir		?= ${debdir}/tmp
82udebdir		?= ${debdir}/e2fsprogs-udeb
83libcomerrdir	?= ${debdir}/libcom-err${COMERR_SOVERSION}
84comerrdevdir	?= ${debdir}/comerr-dev
85libcomerrdbgdir	?= ${debdir}/libcom-err2-dbg
86libssdir	?= ${debdir}/libss${SS_SOVERSION}
87ssdevdir	?= ${debdir}/ss-dev
88libssdbgdir	?= ${debdir}/libss2-dbg
89libext2dir	?= ${debdir}/libext2fs2
90libext2devdir	?= ${debdir}/libext2fs-dev
91libext2dbgdir	?= ${debdir}/libext2fs2-dbg
92maindir		?= ${debdir}/e2fsprogs
93e2fsckstaticdir	?= ${debdir}/e2fsck-static
94debugdir	?= ${debdir}/e2fsprogs-dbg
95stdbuilddir	?= ${debdir}/BUILD-STD
96# docdir	?= ${maindir}/usr/share/doc/${package}
97MANDIR		?= /usr/share/man
98mandir		?= ${tmpdir}${MANDIR}
99
100UDEB_NAME 	?= $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
101UDEB_PRIORITY	?= $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
102
103STAMPSDIR	?= debian/stampdir
104CFGDH		?= ${STAMPSDIR}/configure-dh
105CFGSTDSTAMP	?= ${STAMPSDIR}/configure-std-stamp
106CFGBFSTAMP	?= ${STAMPSDIR}/configure-bf-stamp
107BUILDSTDSTAMP	?= ${STAMPSDIR}/build-std-stamp
108BUILDBFSTAMP	?= ${STAMPSDIR}/build-bf-stamp
109
110INSTALL ?= install
111INSTALL_PROGRAM ?= $(INSTALL) -p -o root -g root -m 0755
112
113#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
114#INSTALL_PROGRAM += -s
115#endif
116
117ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
118SYMBOL_LIBS := libext2fs libcomerr2 libss2
119endif
120
121DEFAULT_CFLAGS ?= -g -O2
122DEFAULT_LDFLAGS ?= -Wl,-Bsymbolic-functions
123
124CFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
125	DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
126	dpkg-buildflags --get CFLAGS; else echo $(DEFAULT_CFLAGS) ; fi)
127LDFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
128	DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
129	dpkg-buildflags --get LDFLAGS; else echo $(DEFAULT_LDFLAGS) ; fi)
130CPPFLAGS ?= $(shell if dpkg-buildflags > /dev/null 2>&1 ; then \
131	DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \
132	dpkg-buildflags --get CPPFLAGS; fi)
133
134ifeq (${DEB_HOST_ARCH},alpha)
135CFLAGS += -DHAVE_NETINET_IN_H
136else
137CFLAGS += -D__NO_STRING_INLINES
138endif
139
140E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
141
142CFLAGS_SHLIB = $(CFLAGS)
143CFLAGS_STLIB = $(CFLAGS)
144LDFLAGS_SHLIB = $(LDFLAGS)
145LDFLAGS_STATIC = $(filter-out -fPIE -fpie -pie,$(LDFLAGS))
146
147ifneq ($(SKIP_UDEB),)
148SKIP_BF ?= yes
149endif
150
151ifeq ($(SKIP_BF),yes)
152BUILD_BF =
153bfbuilddir	?= ${stdbuilddir}
154else
155BUILD_BF = build-bf
156bfbuilddir	?= ${debdir}/BUILD-BF
157endif
158
159BF_CFLAGS = -Os -fomit-frame-pointer
160
161UTIL_CONF_FLAGS ?= --disable-fsck --disable-libblkid \
162			--disable-libuuid --disable-uuidd
163
164ifneq ($(SKIP_FUSE2FS),)
165UTIL_CONF_FLAGS +=  --disable-fuse2fs
166endif
167
168BACKTRACE_CONF_FLAGS ?= $(shell if ${debdir}/scripts/test-backtrace ; then echo --disable-backtrace ; fi)
169
170COMMON_CONF_FLAGS = --enable-lto --disable-ubsan --disable-addrsan \
171	--disable-threadsan --disable-e2initrd-helper \
172	--infodir=/usr/share/info  --enable-symlink-install \
173	--with-multiarch=$(DEB_HOST_MULTIARCH) \
174	$(BACKTRACE_CONF_FLAGS) $(UTIL_CONF_FLAGS)
175
176STD_CONF_FLAGS ?= --enable-elf-shlibs
177
178BF_CONF_FLAGS ?= --enable-elf-shlibs --disable-nls --disable-imager \
179	--disable-testio-debug --disable-uuidd --disable-tls \
180	--disable-tdb --disable-debugfs
181
182DBG_PACKAGES=
183
184ifeq ($(SKIP_UDEB),)
185INSTALL_UDEB = install-udeb
186endif
187
188debian-files:
189ifneq ($(USE_DBGSYM),yes)
190	if test ! -f debian/control.save; then \
191		mv debian/control debian/control.save ; \
192		cat debian/control.save debian/control.legacy-dbg \
193			>> debian/control ; \
194	fi
195endif
196
197mrproper: clean
198	if test -f debian/control.save; then \
199		mv debian/control.save debian/control ; \
200	fi
201
202${CFGDH}:
203ifeq ($(USE_DH9),yes)
204	mv debian/compat debian/compat.save
205	echo 9 > debian/compat
206	mv debian/e2fsprogs.postinst debian/e2fsprogs.postinst.save
207	cp debian/e2fsprogs.postinst.dh9 debian/e2fsprogs.postinst
208	cp debian/e2fsprogs.postrm.dh9 debian/e2fsprogs.postrm
209endif
210	mkdir -p ${STAMPSDIR}
211	touch ${CFGDH}
212
213${CFGSTDSTAMP}: ${CFGDH}
214	dh_testdir
215	if which dh_update_autotools_config > /dev/null 2>&1 ; then \
216		dh_update_autotools_config ;\
217	fi
218
219	# Make sure we don't try to rebuild the configure scripts
220	find . -name configure | xargs touch
221
222	mkdir -p ${stdbuilddir}
223ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
224	cd ${stdbuilddir} && AWK=/usr/bin/awk \
225		../../configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
226		${EXTRA_CONF_FLAGS} CFLAGS="${CFLAGS}" CPPFLAGS="$(CPPFLAGS)" \
227		LDFLAGS="$(LDFLAGS)" CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
228		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
229		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
230		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
231else
232	cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
233		../../configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
234		${EXTRA_CONF_FLAGS} --build=$(DEB_BUILD_GNU_TYPE) \
235		--host=$(DEB_HOST_GNU_TYPE) CFLAGS="${CFLAGS}" \
236		CPPFLAGS="$(CPPFLAGS)" CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
237		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
238		LDFLAGS="$(LDFLAGS)" \
239		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
240		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
241endif
242
243	mkdir -p ${STAMPSDIR}
244	touch ${CFGSTDSTAMP}
245
246${CFGBFSTAMP}: ${CFGDH}
247	dh_testdir
248	if which dh_update_autotools_config > /dev/null 2>&1 ; then \
249		dh_update_autotools_config ;\
250	fi
251	rm -f config.cache
252
253	mkdir -p ${bfbuilddir}
254ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
255	cd ${bfbuilddir} && AWK=/usr/bin/awk \
256		../../configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
257		${EXTRA_CONF_FLAGS} CFLAGS="${CFLAGS} ${BF_CFLAGS}" \
258		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
259		CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
260		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
261		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
262		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
263else
264	cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
265		../../configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
266		${EXTRA_CONF_FLAGS} --build=$(DEB_BUILD_GNU_TYPE) \
267		--host=$(DEB_HOST_GNU_TYPE) CFLAGS="${CFLAGS}" \
268		CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \
269		CFLAGS_SHLIB="$(CFLAGS_SHLIB)" \
270		CFLAGS_STLIB="$(CFLAGS_STLIB)" \
271		LDFLAGS_SHLIB="$(LDFLAGS_SHLIB)" \
272		LDFLAGS_STATIC="$(LDFLAGS_STATIC)"
273endif
274	mkdir -p ${STAMPSDIR}
275	touch ${CFGBFSTAMP}
276
277build-arch: build
278build-indep: build
279build: build-std $(BUILD_BF)
280
281build-std: ${BUILDSTDSTAMP}
282${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
283	dh_testdir
284	$(MAKE) -C ${stdbuilddir} V=1 all
285ifneq ($(SKIP_E2FSCK_STATIC),yes)
286	$(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
287endif
288	if ! test -d debian/orig-gmo ; then \
289		mkdir debian/orig-gmo ; \
290		mv po/*.gmo po/*.po debian/orig-gmo ; \
291		cp debian/orig-gmo/*.po po ; \
292	fi
293	$(MAKE) -C ${stdbuilddir}/po V=1 update-gmo
294
295	( cd ${stdbuilddir}/doc && $(MAKE) V=1 libext2fs.html )
296	( cd ${stdbuilddir}/lib/et && $(MAKE) V=1 com_err.info com_err.html )
297	cat $(shell /bin/ls -1 ./doc/RelNotes/*.txt | tac) | \
298		gzip -9n > ${stdbuilddir}/NEWS.gz
299
300	touch ${BUILDSTDSTAMP}
301
302build-bf: ${BUILDBFSTAMP}
303${BUILDBFSTAMP}: ${CFGBFSTAMP}
304	dh_testdir
305	$(MAKE) -C ${bfbuilddir} V=1 libs
306	$(MAKE) -C ${bfbuilddir}/e2fsck V=1 all
307	$(MAKE) -C ${bfbuilddir}/misc V=1 all
308	$(MAKE) -C ${bfbuilddir}/resize V=1 all
309	touch ${BUILDBFSTAMP}
310
311clean:
312	dh_testdir
313	if test -d debian/orig-gmo ; then \
314		rm -f po/*.gmo po/*.po ; \
315		mv debian/orig-gmo/* po ; \
316		rmdir debian/orig-gmo ; \
317	fi
318	if test -f debian/compat.save; then \
319		mv debian/compat.save debian/compat ; \
320	fi
321	if test -f debian/e2fsprogs.postinst.save; then \
322		mv debian/e2fsprogs.postinst.save debian/e2fsprogs.postinst ; \
323	fi
324	if test -f debian/e2fsprogs.postrm; then \
325		rm -f debian/e2fsprogs.postrm ; \
326	fi
327	rm -rf ${STAMPSDIR}
328	[ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} V=1 distclean
329	[ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} V=1 distclean
330	[ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} V=1 distclean
331	rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir}
332	rm -f debian/*.substvars
333	dh_clean
334
335install: build
336	dh_testdir
337	dh_testroot
338	dh_prep
339	dh_installdirs
340
341	mkdir -p ${tmpdir}/sbin
342	$(MAKE) -C ${stdbuilddir} V=1 install DESTDIR=${tmpdir} \
343		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
344  # static libs and .h files
345	$(MAKE) -C ${stdbuilddir} V=1 install-libs DESTDIR=${tmpdir} LDCONFIG=true
346
347ifneq ($(SKIP_E2FSCK_STATIC),yes)
348  # statically-linked fsck
349	${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
350	cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
351endif
352
353ifeq ($(DEB_HOST_ARCH_OS), hurd)
354	${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
355endif
356
357	dh_install -p e2fsprogs --sourcedir=${stdbuilddir} NEWS.gz \
358		usr/share/doc/e2fsprogs
359	dh_movefiles
360	test -z "`find ${tmpdir} -type f`"
361
362install-udeb: build
363	dh_testdir
364	dh_testroot
365
366	$(MAKE) -C ${bfbuilddir} V=1 install-shlibs-libs-recursive DESTDIR=${udebdir} \
367		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
368	$(MAKE) -C ${bfbuilddir}/e2fsck V=1 install DESTDIR=${udebdir} \
369		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
370	$(MAKE) -C ${bfbuilddir}/misc V=1 install DESTDIR=${udebdir} \
371		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
372	$(MAKE) -C ${bfbuilddir}/resize V=1 install DESTDIR=${udebdir} \
373		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
374
375	rm -rf ${udebdir}/usr
376	find ${udebdir}/sbin -type f -a ! -name e2fsck \
377		-a ! -name mke2fs -a ! -name tune2fs \
378		-a ! -name resize2fs -a ! -name badblocks -print | xargs rm
379
380	(cd ${udebdir}/sbin; ln -sf e2fsck fsck.ext2 ; \
381		ln -sf e2fsck fsck.ext3 ; ln -sf e2fsck fsck.ext4 ; \
382		ln -sf mke2fs mkfs.ext2 ; ln -sf mke2fs mkfs.ext3 ; \
383		ln -sf mke2fs mkfs.ext4)
384
385binary-indep: install
386	dh_testdir
387	dh_testroot
388	dh_lintian -i
389	dh_installdocs -i
390	dh_installchangelogs -i
391	dh_fixperms -i
392	dh_compress -i
393	dh_installdeb -i
394	dh_gencontrol -i
395	dh_md5sums -i
396	dh_builddeb -i
397
398binary-arch: install $(INSTALL_UDEB)
399	dh_testdir
400	dh_testroot
401
402	dh_lintian -a
403
404  # symlinks to prepare dh_installdocs run
405
406	mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
407	mkdir -p ${debdir}/ss-dev/usr/share/doc
408
409	mkdir -p ${debdir}/libcom-err${COMERR_SOVERSION}/usr/share/doc/libcom-err${COMERR_SOVERSION}
410	mkdir -p ${debdir}/comerr-dev/usr/share/doc
411
412	mkdir -p ${debdir}/libext2fs2/usr/share/doc/libext2fs
413	mkdir -p ${debdir}/libext2fs-dev/usr/share/doc
414
415	dh_installdocs -a -Ne2fsprogs-udeb
416
417  # HTML docs
418	$(INSTALL) -d ${debdir}/libext2fs-dev/usr/share/doc/libext2fs/html-info/
419	$(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
420	   ${debdir}/libext2fs-dev/usr/share/doc/libext2fs/html-info/
421	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/comerr-dev/html-info/
422	$(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
423	   ${debdir}/comerr-dev/usr/share/doc/comerr-dev/html-info/
424
425  # texinfo docs
426	mkdir -p ${debdir}/comerr-dev/usr/share/doc/comerr-dev
427	$(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
428	   ${debdir}/libext2fs-dev/usr/share/doc/libext2fs/libext2fs.texi
429	$(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
430	   ${debdir}/comerr-dev/usr/share/doc/comerr-dev/com_err.texi
431
432	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/comerr-dev/examples
433	$(INSTALL) -p -m 0644 lib/ss/ss_err.et \
434		${stdbuilddir}/lib/ext2fs/ext2_err.et \
435		${debdir}/comerr-dev/usr/share/doc/comerr-dev/examples
436	$(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/ss-dev/examples
437	$(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
438		${debdir}/ss-dev/usr/share/doc/ss-dev/examples
439
440	dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
441	dh_installinfo -plibext2fs-dev ${stdbuilddir}/doc/libext2fs.info
442
443	dh_installchangelogs -a
444	dh_fixperms -a
445	dh_strip $(call dh_strip_args,e2fsprogs)
446ifneq ($(SKIP_E2FSCK_STATIC),yes)
447	dh_strip $(call dh_strip_args2,e2fsck-static,e2fsprogs)
448endif
449	dh_strip $(call dh_strip_args,libext2fs2)
450	dh_strip $(call dh_strip_args,libss${SS_SOVERSION})
451	dh_strip $(call dh_strip_args,libcom-err${COMERR_SOVERSION})
452	dh_strip -a
453
454	# dpkg symbol handling
455	for i in $(SYMBOL_LIBS); \
456	do \
457		echo "Generating symbols for $$i..."; \
458		dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
459		cat debian/$$i.tmp-patch; \
460		patch debian/$$i.symbols < debian/$$i.tmp-patch; \
461		/bin/rm debian/$$i.tmp-patch; \
462	done
463
464	dh_compress -a
465
466	dh_makeshlibs -a --add-udeb=e2fsprogs-udeb
467ifneq ($(USE_DH9),yes)
468	dh_installsystemd -p e2fsprogs
469endif
470	$(INSTALL) -D -p -m644 debian/e2fsprogs-udeb.lintian-overrides \
471	    debian/e2fsprogs-udeb/usr/share/lintian/overrides/e2fsprogs-udeb
472	dh_installdeb -a
473	dh_shlibdeps -a -l${stdbuilddir}/lib
474	dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
475		-u"-Ldebian/e2fsprogs.shlibs.local"
476ifeq ($(SKIP_UDEB),)
477	dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
478		-u"-Ldebian/e2fsprogs-udeb.shlibs.local"
479endif
480ifeq ($(SKIP_FUSE2FS),)
481	dh_shlibdeps -pfuse2fs -l${stdbuilddir}/lib \
482		-u"-Ldebian/e2fsprogs.shlibs.local"
483endif
484
485	dh_gencontrol -a -Ncomerr-dev -Nss-dev -Ne2fsprogs-udeb
486	dh_gencontrol -pcomerr-dev \
487	  -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
488	dh_gencontrol -pss-dev \
489	  -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
490ifeq ($(SKIP_UDEB),)
491	dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
492endif
493
494ifeq ($(SKIP_UDEB),)
495	dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
496endif
497	dh_md5sums -a
498	dh_builddeb -a
499
500binary: binary-indep binary-arch
501
502debug_flags:
503	@echo CFLAGS is $(CFLAGS)
504	@echo LDFLAGS is $(LDFLAGS)
505	@echo CPPFLAGS is $(CPPFLAGS)
506