4 # Invoke each target with `./debian/rules <target>'. All targets should be
5 # invoked with the package root as the current directory.
7 # The `binary' target must be run as root, as it needs to install files with
10 -include debian
/rules.custom
12 export DEB_BUILD_MAINT_OPTIONS ?
= hardening
=+all
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
2>/dev
/null
)
26 # Allow distro-specific behaviour
27 DISTRO
:=$(shell sed
-ne
'/DISTRIB_ID/s/.*=//p' /etc
/lsb-release
2>/dev
/null || echo Debian
)
30 DH_VERSION
:= $(shell dpkg-query
-W
-f
'$${Version}' debhelper
)
33 USE_DBGSYM ?
= $(shell if dpkg
--compare-versions
$(DH_VERSION
) ">=" 9.20160114 ; then echo yes
; fi
)
35 ifeq ($(USE_DBGSYM
),yes
)
36 dh_strip_args
= -p
$(1) --dbgsym-migration
='$(1)-dbg (<= 1.43-1)'
37 dh_strip_args2
= -p
$(1) --dbgsym-migration
='$(2)-dbg (<= 1.43-1)'
39 dh_strip_args
= -p
$(1) --dbg-package
=$(1)-dbg
40 dh_strip_args2
= -p
$(1) --dbg-package
=$(2)-dbg
42 # find the version for the main package, from changelog file
43 MAIN_VERSION
= $(shell head
-n
1 debian
/changelog | cut
'-d ' -f
2 | sed
's/[()]//g')
44 # find versions for libraries going into their own packages, from their Makefile.in's,
45 # and sonames for all libs
46 COMERR_VERSION ?
= $(shell grep ELF_VERSION lib
/et
/Makefile.in | cut
'-d ' -f3
)
47 COMERR_SOVERSION ?
= $(shell grep ELF_SO_VERSION lib
/et
/Makefile.in | cut
'-d ' -f3
)
48 SS_VERSION ?
= $(shell grep ELF_VERSION lib
/ss
/Makefile.in | cut
'-d ' -f3
)
49 SS_SOVERSION ?
= $(shell grep ELF_SO_VERSION lib
/ss
/Makefile.in | cut
'-d ' -f3
)
51 ifneq ($(UTIL_LINUX_NG
),yes
)
52 UUID_VERSION ?
= $(shell grep ELF_VERSION lib
/uuid
/Makefile.in | cut
'-d ' -f3
)
53 UUID_SOVERSION ?
= $(shell grep ELF_SO_VERSION lib
/uuid
/Makefile.in | cut
'-d ' -f3
)
55 BLKID_VERSION ?
= $(shell grep ELF_VERSION lib
/blkid
/Makefile.in | cut
'-d ' -f3
)
56 BLKID_SOVERSION ?
= $(shell grep ELF_SO_VERSION lib
/blkid
/Makefile.in | cut
'-d ' -f3
)
59 EXT2FS_SOVERSION ?
= $(shell grep ELF_SO_VERSION lib
/ext2fs
/Makefile.in | cut
'-d ' -f3
)
60 E2P_SOVERSION ?
= $(shell grep ELF_SO_VERSION lib
/e2p
/Makefile.in | cut
'-d ' -f3
)
64 topdir ?
= $(shell pwd
)
65 debdir ?
= ${topdir}/debian
66 tmpdir ?
= ${debdir}/tmp
67 udebdir ?
= ${debdir}/e2fsprogs-udeb
68 ifneq ($(UTIL_LINUX_NG
),yes
)
69 blkidudebdir ?
= ${debdir}/libblkid1-udeb
70 uuidudebdir ?
= ${debdir}/libuuid1-udeb
72 libcomerrdir ?
= ${debdir}/libcomerr
${COMERR_SOVERSION}
73 comerrdevdir ?
= ${debdir}/comerr-dev
74 libcomerrdbgdir ?
= ${debdir}/libcomerr2-dbg
75 libssdir ?
= ${debdir}/libss
${SS_SOVERSION}
76 ssdevdir ?
= ${debdir}/ss-dev
77 libssdbgdir ?
= ${debdir}/libss2-dbg
78 ifneq ($(UTIL_LINUX_NG
),yes
)
79 libblkiddir ?
= ${debdir}/libblkid
${BLKID_SOVERSION}
80 libblkiddevdir ?
= ${debdir}/libblkid-dev
81 libblkiddbgdir ?
= ${debdir}/libblkid1-dbg
82 libuuiddir ?
= ${debdir}/libuuid
${UUID_SOVERSION}
83 uuiddevdir ?
= ${debdir}/uuid-dev
84 libuuiddbgdir ?
= ${debdir}/libuuid1-dbg
85 uuidruntimedir ?
= ${debdir}/uuid-runtime
86 uuidruntimedbgdir ?
= ${debdir}/uuid-runtime-dbg
88 libext2dir ?
= ${debdir}/e2fslibs
89 libext2devdir ?
= ${debdir}/e2fslibs-dev
90 libext2dbgdir ?
= ${debdir}/e2fslibs-dbg
91 maindir ?
= ${debdir}/e2fsprogs
92 e2fsckstaticdir ?
= ${debdir}/e2fsck-static
93 debugdir ?
= ${debdir}/e2fsprogs-dbg
94 stdbuilddir ?
= ${debdir}/BUILD-STD
95 staticbuilddir ?
= ${debdir}/BUILD-STATIC
96 mipsbuilddir ?
= ${debdir}/BUILD-MIPS
97 mipsbuilddir64 ?
= ${debdir}/BUILD-MIPS-64
98 # docdir ?= ${maindir}/usr/share/doc/${package}
99 MANDIR ?
= /usr
/share
/man
100 mandir ?
= ${tmpdir}${MANDIR}
102 UDEB_NAME ?
= $(package
)-udeb_
$(MAIN_VERSION
)_
$(DEB_HOST_ARCH
).udeb
103 UDEB_PRIORITY ?
= $(shell grep
'^Package: e2fsprogs-udeb' debian
/control.in
-A
10 | grep ^Priority
: | cut
-d
' ' -f
2)
105 ifneq ($(UTIL_LINUX_NG
),yes
)
106 BLKID_UDEB_NAME ?
= libblkid1-udeb_
$(MAIN_VERSION
)_
$(DEB_HOST_ARCH
).udeb
107 BLKID_UDEB_PRIORITY ?
= $(shell grep
'^Package: libblkid1-udeb' debian
/control.in
-A
10 | grep ^Priority
: | cut
-d
' ' -f
2)
109 UUID_UDEB_NAME ?
= libuuid1-udeb_
$(MAIN_VERSION
)_
$(DEB_HOST_ARCH
).udeb
110 UUID_UDEB_PRIORITY ?
= $(shell grep
'^Package: libuuid1-udeb' debian
/control.in
-A
10 | grep ^Priority
: | cut
-d
' ' -f
2)
113 STAMPSDIR ?
= debian
/stampdir
114 CFGSTDSTAMP ?
= ${STAMPSDIR}/configure-std-stamp
115 CFGBFSTAMP ?
= ${STAMPSDIR}/configure-bf-stamp
116 CFGSTATICSTAMP ?
= ${STAMPSDIR}/configure-static-stamp
117 BUILDSTDSTAMP ?
= ${STAMPSDIR}/build-std-stamp
118 BUILDBFSTAMP ?
= ${STAMPSDIR}/build-bf-stamp
119 BUILDSTATICSTAMP ?
=${STAMPSDIR}/build-static-stamp
122 INSTALL_PROGRAM ?
= $(INSTALL
) -p
-o root
-g root
-m
0755
124 #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
125 #INSTALL_PROGRAM += -s
128 ifneq (,$(findstring update-symbols
,$(DEB_BUILD_OPTIONS
)))
129 SYMBOL_LIBS
:= e2fslibs libcomerr2 libss2
130 ifneq ($(UTIL_LINUX_NG
),yes
)
131 SYMBOL_LIBS
+= libblkid1 libuuid1
135 DEFAULT_CFLAGS ?
= -g
-O2
136 DEFAULT_LDFLAGS ?
= -Wl
,-Bsymbolic-functions
138 CFLAGS ?
= $(shell if dpkg-buildflags
> /dev
/null
2>&1 ; then \
139 DEB_BUILD_MAINT_OPTIONS
=$(DEB_BUILD_MAINT_OPTIONS
) \
140 dpkg-buildflags
--get CFLAGS
; else echo
$(DEFAULT_CFLAGS
) ; fi
)
141 LDFLAGS ?
= $(shell if dpkg-buildflags
> /dev
/null
2>&1 ; then \
142 DEB_BUILD_MAINT_OPTIONS
=$(DEB_BUILD_MAINT_OPTIONS
) \
143 dpkg-buildflags
--get LDFLAGS
; else echo
$(DEFAULT_LDFLAGS
) ; fi
)
144 CPPFLAGS ?
= $(shell if dpkg-buildflags
> /dev
/null
2>&1 ; then \
145 DEB_BUILD_MAINT_OPTIONS
=$(DEB_BUILD_MAINT_OPTIONS
) \
146 dpkg-buildflags
--get CPPFLAGS
; fi
)
148 ifeq (${DEB_HOST_ARCH},alpha
)
149 CFLAGS
+= -DHAVE_NETINET_IN_H
151 CFLAGS
+= -D__NO_STRING_INLINES
154 ifneq (${DEB_HOST_ARCH_OS},linux
)
158 ifeq ($(SKIP_STATIC
),yes
)
160 E2FSCK_STATIC
= ${stdbuilddir}/e2fsck
/e2fsck.static
162 BUILD_STATIC
= build-static
163 E2FSCK_STATIC
= ${staticbuilddir}/e2fsck
/e2fsck.static
166 CFLAGS_SHLIB
= $(filter-out -fPIE
-fpie
-pie
,$(CFLAGS
))
167 CFLAGS_STLIB
= $(filter-out -fPIE
-fpie
-pie
,$(CFLAGS
))
168 LDFLAGS_SHLIB
= $(filter-out -fPIE
-fpie
-pie
,$(LDFLAGS
))
169 LDFLAGS_STATIC
= $(filter-out -fPIE
-fpie
-pie
,$(LDFLAGS
))
171 ifneq ($(SKIP_UDEB
),)
175 ifeq ($(SKIP_BF
),yes
)
177 bfbuilddir ?
= ${stdbuilddir}
180 bfbuilddir ?
= ${debdir}/BUILD-BF
183 BF_CFLAGS
= -Os
-fomit-frame-pointer
185 ifeq ($(UTIL_LINUX_NG
),yes
)
186 UTIL_CONF_FLAGS ?
= --disable-fsck
--disable-libblkid \
187 --disable-libuuid
--disable-uuidd
189 UTIL_CONF_FLAGS ?
= --enable-fsck
--enable-libblkid \
190 --enable-libuuid
--enable-uuidd
193 ifeq ($(DEB_BUILD_GNU_SYSTEM
), gnu
)
194 UTIL_CONF_FLAGS
+= --disable-fuse2fs
197 ifneq ($(strip $(DEB_HOST_MULTIARCH
)),)
198 MULTIARCH_CONF ?
= --with-multiarch
=$(DEB_HOST_MULTIARCH
)
199 # This doesn't work yet because gdb and lintian don't expect and/or
200 # don't work with /usr/lib/<triplet>/debug
201 #USRLIB = /usr/lib/$(DEB_HOST_MULTIARCH)
207 BACKTRACE_CONF_FLAGS ?
= $(shell if
${debdir}/scripts
/test-backtrace
; then echo
--disable-backtrace
; fi
)
209 COMMON_CONF_FLAGS
= --disable-e2initrd-helper
--enable-quota \
210 --infodir=/usr
/share
/info --enable-symlink-install \
211 $(MULTIARCH_CONF
) $(BACKTRACE_CONF_FLAGS
) $(UTIL_CONF_FLAGS
)
213 STD_CONF_FLAGS ?
= --enable-elf-shlibs
215 BF_CONF_FLAGS ?
= --enable-elf-shlibs
--disable-nls
--disable-imager \
216 --disable-testio-debug
--disable-uuidd
--disable-tls
--disable-debugfs
218 STATIC_CONF_FLAGS ?
= --disable-nls
--disable-imager \
219 --disable-uuidd
--disable-tls
221 MIPS_NOPIC_CONF_FLAGS ?
= --disable-nls
--disable-imager \
222 --disable-uuidd
--disable-tls \
223 --disable-resizer
# --disable-debugfs
225 # we can't use those flags at configure time
226 MIPS_CFLAGS ?
= -G
0 -fno-pic
-mno-abicalls
227 MIPS_CFLAGS_64 ?
= -mabi
=64 -G
0 -fno-pic
-mno-abicalls
229 ifeq ($(DEB_BUILD_ARCH
),$(DEB_HOST_ARCH
))
230 ifneq (,$(findstring $(DEB_BUILD_ARCH
),mips mipsel
))
238 ifeq ($(USE_DBGSYM
),yes
)
239 M4_ARGS
+=-DUSE_DBGSYM
241 DBG_PACKAGES
+= -pe2fsprogs-dbg
-pe2fslibs-dbg
-plibcomerr2-dbg
-plibss2-dbg
242 M4_ARGS
+=-UUSE_DBGSYM
245 ifeq ($(UTIL_LINUX_NG
),yes
)
246 M4_ARGS
+=-DUTIL_LINUX_NG
248 DBG_PACKAGES
+= -puuid-runtime-dbg
-plibuuid1-dbg
-plibblkid1-dbg
249 M4_ARGS
+=-UUTIL_LINUX_NG
252 ifneq ($(strip $(DEB_HOST_MULTIARCH
)),)
253 M4_ARGS
+=-DDO_MULTIARCH
255 M4_ARGS
+=-UDO_MULTIARCH
258 ifneq ($(BUILD_E2FSCK_STATIC
),no
)
259 M4_ARGS
+=-DE2FSCK_STATIC
261 M4_ARGS
+=-UE2FSCK_STATIC
265 INSTALL_UDEB
= install-udeb
271 FILES_FIXUP
= libcomerr2.files comerr-dev.files libss2.files ss-dev.files \
272 libuuid1.files uuid-dev.files libblkid1.files libblkid-dev.files \
273 e2fslibs.files e2fslibs-dev.files
275 debian-files
: debian
/control debian
/e2fsprogs.shlibs.local
276 ifeq ($(strip $(DEB_HOST_MULTIARCH
)),)
277 for i in
$(FILES_FIXUP
); do \
278 sed
-e
's;lib/\*/;lib/;' debian
/$$i.in
> debian
/$$i; \
281 for i in
$(FILES_FIXUP
); do cp debian
/$$i.in debian
/$$i; done
285 rm debian
/control debian
/e2fsprogs.shlibs.local
287 debian
/control
: debian
/control.in debian
/rules
288 m4
$(M4_ARGS
) < debian
/control.in | grep
-v ^REMOVE_ME
$$ > $@
290 debian
/e2fsprogs.shlibs.local
: debian
/e2fsprogs.shlibs.local.in
291 m4
$(M4_ARGS
) < debian
/e2fsprogs.shlibs.local.in
> $@
296 # Make sure we don't try to rebuild the configure scripts
297 find .
-name configure | xargs touch
299 mkdir
-p
${stdbuilddir}
300 ifeq ($(DEB_BUILD_ARCH
),$(DEB_HOST_ARCH
))
301 cd
${stdbuilddir} && AWK
=/usr
/bin
/awk \
302 ${topdir}/configure
${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
303 ${EXTRA_CONF_FLAGS} CFLAGS
="${CFLAGS}" CPPFLAGS
="$(CPPFLAGS)" \
304 LDFLAGS
="$(LDFLAGS)" CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
305 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
306 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
307 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
309 cd
${stdbuilddir} && AWK
=/usr
/bin
/awk CC
="${DEB_HOST_GNU_TYPE}-gcc" \
310 ${topdir}/configure
${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
311 ${EXTRA_CONF_FLAGS} --build
=$(DEB_BUILD_GNU_TYPE
) \
312 --host
=$(DEB_HOST_GNU_TYPE
) CFLAGS
="${CFLAGS}" \
313 CPPFLAGS
="$(CPPFLAGS)" CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
314 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
315 LDFLAGS
="$(LDFLAGS)" \
316 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
317 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
320 # specially-built MIPS libs
322 mkdir
-p
${mipsbuilddir} ${mipsbuilddir64}
323 cd
${mipsbuilddir} && AWK
=/usr
/bin
/awk \
324 ${topdir}/configure
${COMMON_CONF_FLAGS} \
325 ${MIPS_NOPIC_CONF_FLAGS} CFLAGS
="${CFLAGS}" \
326 CPPFLAGS
="$(CPPFLAGS)" LDFLAGS
="$(LDFLAGS)" \
327 CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
328 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
329 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
330 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
331 cd
${mipsbuilddir64} && AWK
=/usr
/bin
/awk \
332 ${topdir}/configure
${COMMON_CONF_FLAGS} \
333 ${MIPS_NOPIC_CONF_FLAGS} CFLAGS
="${CFLAGS}" \
334 CPPFLAGS
="$(CPPFLAGS)" LDFLAGS
="$(LDFLAGS)" \
335 CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
336 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
337 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
338 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
341 mkdir
-p
${STAMPSDIR}
348 mkdir
-p
${bfbuilddir}
349 ifeq ($(DEB_BUILD_ARCH
),$(DEB_HOST_ARCH
))
350 cd
${bfbuilddir} && AWK
=/usr
/bin
/awk \
351 ${topdir}/configure
${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
352 ${EXTRA_CONF_FLAGS} CFLAGS
="${CFLAGS} ${BF_CFLAGS}" \
353 CPPFLAGS
="$(CPPFLAGS)" LDFLAGS
="$(LDFLAGS)" \
354 CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
355 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
356 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
357 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
359 cd
${bfbuilddir} && AWK
=/usr
/bin
/awk CC
="${DEB_HOST_GNU_TYPE}-gcc" \
360 ${topdir}/configure
${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
361 ${EXTRA_CONF_FLAGS} --build
=$(DEB_BUILD_GNU_TYPE
) \
362 --host
=$(DEB_HOST_GNU_TYPE
) CFLAGS
="${CFLAGS}" \
363 CPPFLAGS
="$(CPPFLAGS)" LDFLAGS
="$(LDFLAGS)" \
364 CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
365 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
366 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
367 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
369 mkdir
-p
${STAMPSDIR}
376 mkdir
-p
${staticbuilddir}
377 ifeq ($(DEB_BUILD_ARCH
),$(DEB_HOST_ARCH
))
378 cd
${staticbuilddir} && AWK
=/usr
/bin
/awk
${topdir}/configure \
379 ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} ${EXTRA_CONF_FLAGS} \
380 CFLAGS
="${CFLAGS}" CPPFLAGS
="$(CPPFLAGS)" LDFLAGS
="$(LDFLAGS)" \
381 CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
382 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
383 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
384 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
386 cd
${staticbuilddir} && AWK
=/usr
/bin
/awk CC
="${DEB_HOST_GNU_TYPE}-gcc" \
387 ${topdir}/configure
${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
388 ${EXTRA_CONF_FLAGS} --build
=$(DEB_BUILD_GNU_TYPE
) \
389 --host
=$(DEB_HOST_GNU_TYPE
) CFLAGS
="${CFLAGS}" \
390 CPPFLAGS
="$(CPPFLAGS)" LDFLAGS
="$(LDFLAGS)" \
391 CFLAGS_SHLIB
="$(CFLAGS_SHLIB)" \
392 CFLAGS_STLIB
="$(CFLAGS_STLIB)" \
393 LDFLAGS_SHLIB
="$(LDFLAGS_SHLIB)" \
394 LDFLAGS_STATIC
="$(LDFLAGS_STATIC)"
396 mkdir
-p
${STAMPSDIR}
397 touch
${CFGSTATICSTAMP}
401 build
: build-std
$(BUILD_BF
) $(BUILD_STATIC
)
403 build-std
: ${BUILDSTDSTAMP}
404 ${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
406 if which dh_update_autotools_config
> /dev
/null
2>&1 ; then \
407 dh_update_autotools_config
;\
409 $(MAKE
) -C
${stdbuilddir} V
=1 all
410 ifneq ($(BUILD_E2FSCK_STATIC
),no
)
411 $(MAKE
) -C
${stdbuilddir}/e2fsck V
=1 e2fsck.static
413 if
! test -d debian
/orig-gmo
; then \
414 mkdir debian
/orig-gmo
; \
415 mv po
/*.gmo po
/*.po debian
/orig-gmo
; \
416 cp debian
/orig-gmo
/*.po po
; \
418 $(MAKE
) -C
${stdbuilddir}/po V
=1 update-gmo
420 ( cd
${stdbuilddir}/doc
&& $(MAKE
) V
=1 libext2fs.html
)
421 ( cd
${stdbuilddir}/lib
/et
&& $(MAKE
) V
=1 com_err.
info com_err.html
)
423 # specially-built MIPS libs
425 $(MAKE
) -C
${mipsbuilddir}/util V
=1
426 $(MAKE
) -C
${mipsbuilddir} V
=1 \
427 CFLAGS
="${CFLAGS} ${MIPS_CFLAGS}" \
428 LIB_SUBDIRS
="lib/et lib/ext2fs" libs
429 $(MAKE
) -C
${mipsbuilddir64}/util V
=1
430 $(MAKE
) -C
${mipsbuilddir64} V
=1 \
431 CFLAGS
="${CFLAGS} ${MIPS_CFLAGS_64}" \
432 LIB_SUBDIRS
="lib/et lib/ext2fs" libs
435 touch
${BUILDSTDSTAMP}
437 build-bf
: ${BUILDBFSTAMP}
438 ${BUILDBFSTAMP}: ${CFGBFSTAMP}
440 $(MAKE
) -C
${bfbuilddir} V
=1 libs
441 $(MAKE
) -C
${bfbuilddir}/e2fsck V
=1 all
442 $(MAKE
) -C
${bfbuilddir}/misc V
=1 all
443 $(MAKE
) -C
${bfbuilddir}/resize V
=1 all
444 touch
${BUILDBFSTAMP}
446 build-static
: ${BUILDSTATICSTAMP}
447 ${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
449 $(MAKE
) -C
${staticbuilddir} V
=1 libs
450 ifneq ($(BUILD_E2FSCK_STATIC
),no
)
451 $(MAKE
) -C
${staticbuilddir}/e2fsck V
=1 e2fsck.static
453 touch
${BUILDSTATICSTAMP}
457 if
test -d debian
/orig-gmo
; then \
458 rm -f po
/*.gmo po
/*.po
; \
459 mv debian
/orig-gmo
/* po
; \
460 rmdir debian
/orig-gmo
; \
463 [ ! -f
${stdbuilddir}/Makefile
] ||
$(MAKE
) -C
${stdbuilddir} V
=1 distclean
464 [ ! -f
${bfbuilddir}/Makefile
] ||
$(MAKE
) -C
${bfbuilddir} V
=1 distclean
465 [ ! -f
${staticbuilddir}/Makefile
] ||
$(MAKE
) -C
${staticbuilddir} V
=1 distclean
466 rm -rf
${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
467 rm -f debian
/*.substvars
470 install: cleanup install-std
472 # This rule allows to factorize the dh_clean between the 2 install rules
473 # This must be launched before install-* (if launching them by hand, for
474 # exemple) or results are unpredictable
480 install-std
: DH_OPTIONS
=
486 mkdir
-p
${tmpdir}/sbin
487 $(MAKE
) -C
${stdbuilddir} V
=1 install DESTDIR
=${tmpdir} \
488 INSTALL_PROGRAM
="${INSTALL_PROGRAM}" LDCONFIG
=true
489 # static libs and .h files
490 $(MAKE
) -C
${stdbuilddir} V
=1 install-libs DESTDIR
=${tmpdir} LDCONFIG
=true
492 ifneq ($(BUILD_E2FSCK_STATIC
),no
)
493 # statically-linked fsck
494 ${INSTALL_PROGRAM} $(E2FSCK_STATIC
) ${tmpdir}/sbin
495 cp
${mandir}/man8
/e2fsck
.8 ${mandir}/man8
/e2fsck.static
.8
498 ifeq ($(DEB_BUILD_GNU_SYSTEM
), gnu
)
499 ${INSTALL} -m
0644 misc
/mke2fs-hurd.conf
${tmpdir}/etc
/mke2fs.conf
503 test -z
"`find ${tmpdir} -type f`"
505 # specially-built MIPS libs
507 $(INSTALL
) -p
-m
0644 ${mipsbuilddir}/lib
/libext2fs.a \
508 ${debdir}/e2fslibs-dev
/usr
/lib
/libext2fs-nopic.a
509 $(INSTALL
) -p
-m
0644 ${mipsbuilddir64}/lib
/libext2fs.a \
510 ${debdir}/e2fslibs-dev
/usr
/lib
/lib64ext2fs-nopic.a
513 install-udeb
: DH_OPTIONS
=
518 $(MAKE
) -C
${bfbuilddir} V
=1 install-shlibs-libs-recursive DESTDIR
=${udebdir} \
519 INSTALL_PROGRAM
="${INSTALL_PROGRAM}" LDCONFIG
=true
520 $(MAKE
) -C
${bfbuilddir}/e2fsck V
=1 install DESTDIR
=${udebdir} \
521 INSTALL_PROGRAM
="${INSTALL_PROGRAM}" LDCONFIG
=true
522 $(MAKE
) -C
${bfbuilddir}/misc V
=1 install DESTDIR
=${udebdir} \
523 INSTALL_PROGRAM
="${INSTALL_PROGRAM}" LDCONFIG
=true
524 $(MAKE
) -C
${bfbuilddir}/resize V
=1 install DESTDIR
=${udebdir} \
525 INSTALL_PROGRAM
="${INSTALL_PROGRAM}" LDCONFIG
=true
527 rm -rf
${udebdir}/usr
528 find
${udebdir}/sbin
-type f
-a
! -name e2fsck \
529 -a
! -name mke2fs
-a
! -name tune2fs \
530 -a
! -name resize2fs
-a
! -name badblocks
-print | xargs
rm
532 (cd
${udebdir}/sbin
; ln
-sf e2fsck fsck.ext2
; \
533 ln
-sf e2fsck fsck.ext3
; ln
-sf e2fsck fsck.ext4
; \
534 ln
-sf mke2fs mkfs.ext2
; ln
-sf mke2fs mkfs.ext3
; \
535 ln
-sf mke2fs mkfs.ext4
)
537 ifneq ($(UTIL_LINUX_NG
),yes
)
538 mkdir
-p
${blkidudebdir}/lib
539 mv
${udebdir}/lib
/libblkid.
* ${blkidudebdir}/lib
541 mkdir
-p
${uuidudebdir}/lib
542 mv
${udebdir}/lib
/libuuid.
* ${uuidudebdir}/lib
546 # no arch-independant debs.
548 binary-arch
: DH_OPTIONS
= -a
549 binary-arch
: install $(INSTALL_UDEB
)
555 # symlinks to prepare dh_installdocs run
557 ifneq ($(UTIL_LINUX_NG
),yes
)
558 mkdir
-p
${debdir}/libblkid
${BLKID_SOVERSION}/usr
/share
/doc
/libblkid
${BLKID_SOVERSION}
559 mkdir
-p
${debdir}/libblkid-dev
/usr
/share
/doc
560 ln
-sf libblkid
${BLKID_SOVERSION} ${debdir}/libblkid-dev
/usr
/share
/doc
/libblkid-dev
563 mkdir
-p
${debdir}/libss
${SS_SOVERSION}/usr
/share
/doc
/libss
${SS_SOVERSION}
564 mkdir
-p
${debdir}/ss-dev
/usr
/share
/doc
565 ln
-sf libss
${SS_SOVERSION} ${debdir}/ss-dev
/usr
/share
/doc
/ss-dev
567 mkdir
-p
${debdir}/libcomerr
${COMERR_SOVERSION}/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}
568 mkdir
-p
${debdir}/comerr-dev
/usr
/share
/doc
569 ln
-sf libcomerr
${COMERR_SOVERSION} ${debdir}/comerr-dev
/usr
/share
/doc
/comerr-dev
571 ifneq ($(UTIL_LINUX_NG
),yes
)
572 mkdir
-p
${debdir}/libuuid
${UUID_SOVERSION}/usr
/share
/doc
/libuuid
${UUID_SOVERSION}
573 mkdir
-p
${debdir}/uuid-dev
/usr
/share
/doc
574 # ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
577 mkdir
-p
${debdir}/e2fslibs
/usr
/share
/doc
/e2fslibs
578 mkdir
-p
${debdir}/e2fslibs-dev
/usr
/share
/doc
579 ln
-sf e2fslibs
${debdir}/e2fslibs-dev
/usr
/share
/doc
/e2fslibs-dev
581 ifneq ($(UTIL_LINUX_NG
),yes
)
582 $(INSTALL
) -p
-m
0644 debian
/libblkid.copyright \
583 ${debdir}/libblkid
${BLKID_SOVERSION}/usr
/share
/doc
/libblkid
${BLKID_SOVERSION}/copyright
586 dh_installdocs
-Ne2fsprogs-udeb
-Nlibblkid1-udeb
-Nlibuuid1-udeb
589 $(INSTALL
) -d
${debdir}/e2fslibs-dev
/usr
/share
/doc
/e2fslibs
/html-info
/
590 $(INSTALL
) -p
-m
0644 ${stdbuilddir}/doc
/*.html \
591 ${debdir}/e2fslibs-dev
/usr
/share
/doc
/e2fslibs
/html-info
/
592 $(INSTALL
) -d
${debdir}/comerr-dev
/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}/html-info
/
593 $(INSTALL
) -p
-m
0644 ${stdbuilddir}/lib
/et
/*.html \
594 ${debdir}/comerr-dev
/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}/html-info
/
597 mkdir
-p
${debdir}/comerr-dev
/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}
598 $(INSTALL
) -p
-m
0644 ${topdir}/doc
/libext2fs.texinfo \
599 ${debdir}/e2fslibs-dev
/usr
/share
/doc
/e2fslibs
/libext2fs.texi
600 $(INSTALL
) -p
-m
0644 ${topdir}/lib
/et
/com_err.texinfo \
601 ${debdir}/comerr-dev
/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}/com_err.texi
603 $(INSTALL
) -d
${debdir}/comerr-dev
/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}/examples
604 $(INSTALL
) -p
-m
0644 lib
/ss
/ss_err.et \
605 ${stdbuilddir}/lib
/ext2fs
/ext2_err.et \
606 ${debdir}/comerr-dev
/usr
/share
/doc
/libcomerr
${COMERR_SOVERSION}/examples
607 $(INSTALL
) -d
${debdir}/ss-dev
/usr
/share
/doc
/libss
${SS_SOVERSION}/examples
608 $(INSTALL
) -p
-m
0644 debugfs
/debug_cmds.ct \
609 ${debdir}/ss-dev
/usr
/share
/doc
/libss
${SS_SOVERSION}/examples
611 dh_installinfo
-pcomerr-dev
${stdbuilddir}/lib
/et
/com_err.
info
612 dh_installinfo
-pe2fslibs-dev
${stdbuilddir}/doc
/libext2fs.
info
616 dh_strip
$(call dh_strip_args
,e2fsprogs
)
617 ifneq ($(BUILD_E2FSCK_STATIC
),no
)
618 dh_strip
$(call dh_strip_args2
,e2fsck-static
,e2fsprogs
)
621 dh_strip
$(call dh_strip_args
,e2fslibs
) -Xlib64ext2fs-nopic.a
623 dh_strip
$(call dh_strip_args
,e2fslibs
)
625 dh_strip
$(call dh_strip_args
,libss
${SS_SOVERSION})
626 dh_strip
$(call dh_strip_args
,libcomerr
${COMERR_SOVERSION})
627 ifneq ($(UTIL_LINUX_NG
),yes
)
628 dh_strip
$(call dh_strip_args
,libblkid
${BLKID_SOVERSION})
629 dh_strip
$(call dh_strip_args
,libuuid
${UUID_SOVERSION})
633 # dpkg symbol handling
634 for i in
$(SYMBOL_LIBS
); \
636 echo
"Generating symbols for $$i..."; \
637 dpkg-gensymbols
-p
$$i -Pdebian
/$$i > debian
/$$i.tmp-patch
; \
638 cat debian
/$$i.tmp-patch
; \
639 patch debian
/$$i.symbols
< debian
/$$i.tmp-patch
; \
640 /bin
/rm debian
/$$i.tmp-patch
; \
645 dh_makeshlibs
--add-udeb
=e2fsprogs-udeb
647 ifneq ($(UTIL_LINUX_NG
),yes
)
648 echo
"udeb: libblkid 1 libblkid1-udeb" >> \
649 debian
/libblkid1
/DEBIAN
/shlibs
650 echo
"udeb: libuuid 1 libuuid1-udeb" >> debian
/libuuid1
/DEBIAN
/shlibs
655 dh_shlibdeps
-l
${stdbuilddir}/lib
656 dh_shlibdeps
-pe2fsprogs
-l
${stdbuilddir}/lib \
657 -u
"-Ldebian/e2fsprogs.shlibs.local"
659 dh_shlibdeps
-pe2fsprogs-udeb
-l
${stdbuilddir}/lib \
660 -u
"-Ldebian/e2fsprogs-udeb.shlibs.local"
662 dh_shlibdeps
-pfuse2fs
-l
${stdbuilddir}/lib \
663 -u
"-Ldebian/e2fsprogs.shlibs.local"
665 dh_gencontrol
-Ncomerr-dev
-Nss-dev
-Nuuid-dev \
666 -Ne2fsprogs-udeb
-Nlibblkid1-udeb
-Nlibuuid1-udeb
667 DH_OPTIONS
= dh_gencontrol
-pcomerr-dev \
668 -u
'-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
669 DH_OPTIONS
= dh_gencontrol
-pss-dev \
670 -u
'-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
671 ifneq ($(UTIL_LINUX_NG
),yes
)
672 DH_OPTIONS
= dh_gencontrol
-puuid-dev \
673 -u
'-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
676 dh_gencontrol
-pe2fsprogs-udeb
-- -fdebian
/files~
677 ifneq ($(UTIL_LINUX_NG
),yes
)
678 dh_gencontrol
-plibblkid1-udeb
-- -fdebian
/files~
679 dh_gencontrol
-plibuuid1-udeb
-- -fdebian
/files~
684 dpkg-distaddfile
$(UDEB_NAME
) debian-installer
$(UDEB_PRIORITY
)
685 ifneq ($(UTIL_LINUX_NG
),yes
)
686 dpkg-distaddfile
$(BLKID_UDEB_NAME
) debian-installer
$(BLKID_UDEB_PRIORITY
)
687 dpkg-distaddfile
$(UUID_UDEB_NAME
) debian-installer
$(UUID_UDEB_PRIORITY
)
693 binary
: binary-indep binary-arch
695 .PHONY
: binary binary-arch binary-indep
clean checkroot mrproper \
696 debug_flags debian-files
699 @echo CFLAGS is
$(CFLAGS
)
700 @echo LDFLAGS is
$(LDFLAGS
)
701 @echo CPPFLAGS is
$(CPPFLAGS
)