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