Home | History | Annotate | Download | only in debian
      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 # be paranoid
     11 export LC_ALL=C
     12 
     13 # Allow distro-specific behaviour
     14 DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian)
     15 SYS_BLKID_VER := $(shell dpkg-query -W libblkid1 | cut -f 2 | cut -b 1)
     16 ifeq ($(SYS_BLKID_VER),2)
     17 UTIL_LINUX_NG ?= yes
     18 endif
     19 
     20 # These are used for cross-compiling and for saving the configure script
     21 # from having to guess our platform (since we know it already)
     22 DEB_HOST_ARCH   ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
     23 DEB_BUILD_ARCH   ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
     24 DEB_HOST_OS   ?= $(shell dpkg-architecture -qDEB_HOST_OS)
     25 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
     26 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
     27 
     28 # find the version for the main package, from changelog file
     29 MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
     30 # find versions for libraries going into their own packages, from their Makefile.in's,
     31 # and sonames for all libs
     32 COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
     33 COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
     34 SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
     35 SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
     36 
     37 ifneq ($(UTIL_LINUX_NG),yes)
     38 UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
     39 UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
     40 
     41 BLKID_VERSION = $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
     42 BLKID_SOVERSION = $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
     43 endif
     44 
     45 EXT2FS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
     46 E2P_SOVERSION = $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
     47 
     48 package=e2fsprogs
     49 
     50 topdir=$(shell pwd)
     51 debdir=${topdir}/debian
     52 tmpdir=${debdir}/tmp
     53 udebdir=${debdir}/e2fsprogs-udeb
     54 ifneq ($(UTIL_LINUX_NG),yes)
     55 blkidudebdir=${debdir}/libblkid1-udeb
     56 uuidudebdir=${debdir}/libuuid1-udeb
     57 endif
     58 libcomerrdir=${debdir}/libcomerr${COMERR_SOVERSION}
     59 comerrdevdir=${debdir}/comerr-dev
     60 libcomerrdbgdir=${debdir}/libcomerr2-dbg
     61 libssdir=${debdir}/libss${SS_SOVERSION}
     62 ssdevdir=${debdir}/ss-dev
     63 libssdbgdir=${debdir}/libss2-dbg
     64 ifneq ($(UTIL_LINUX_NG),yes)
     65 libblkiddir=${debdir}/libblkid${BLKID_SOVERSION}
     66 libblkiddevdir=${debdir}/libblkid-dev
     67 libblkiddbgdir=${debdir}/libblkid1-dbg
     68 libuuiddir=${debdir}/libuuid${UUID_SOVERSION}
     69 uuiddevdir=${debdir}/uuid-dev
     70 libuuiddbgdir=${debdir}/libuuid1-dbg
     71 uuidruntimedir=${debdir}/uuid-runtime
     72 uuidruntimedbgdir=${debdir}/uuid-runtime-dbg
     73 endif
     74 libext2dir=${debdir}/e2fslibs
     75 libext2devdir=${debdir}/e2fslibs-dev
     76 libext2dbgdir=${debdir}/e2fslibs-dbg
     77 maindir=${debdir}/e2fsprogs
     78 e2fsckstaticdir=${debdir}/e2fsck-static
     79 debugdir=${debdir}/e2fsprogs-dbg
     80 stdbuilddir=${debdir}/BUILD-STD
     81 bfbuilddir=${debdir}/BUILD-BF
     82 staticbuilddir=${debdir}/BUILD-STATIC
     83 mipsbuilddir=${debdir}/BUILD-MIPS
     84 mipsbuilddir64=${debdir}/BUILD-MIPS-64
     85 # docdir=${maindir}/usr/share/doc/${package}
     86 MANDIR=/usr/share/man
     87 mandir=${tmpdir}${MANDIR}
     88 
     89 UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
     90 UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
     91 
     92 ifneq ($(UTIL_LINUX_NG),yes)
     93 BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
     94 BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
     95 
     96 UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
     97 UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
     98 endif
     99 
    100 STAMPSDIR=debian/stampdir
    101 CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
    102 CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
    103 CFGSTATICSTAMP=${STAMPSDIR}/configure-static-stamp
    104 BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
    105 BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
    106 BUILDSTATICSTAMP=${STAMPSDIR}/build-static-stamp
    107 
    108 INSTALL = install
    109 INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
    110 
    111 #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
    112 #INSTALL_PROGRAM += -s
    113 #endif
    114 
    115 ifeq (${DEB_HOST_ARCH},alpha)
    116 CFLAGS += -DHAVE_NETINET_IN_H
    117 else
    118 CFLAGS += -D__NO_STRING_INLINES
    119 endif
    120 
    121 ifeq (${DEB_HOST_ARCH_OS},linux)
    122 BUILD_STATIC = build-static
    123 E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
    124 else
    125 E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
    126 endif
    127 
    128 BF_CFLAGS = -Os -fomit-frame-pointer
    129 
    130 COMMON_CONF_FLAGS =  \
    131                 --enable-elf-shlibs --infodir=/usr/share/info
    132 ifeq ($(UTIL_LINUX_NG),yes)
    133 COMMON_CONF_FLAGS += --disable-fsck --disable-libblkid \
    134 			--disable-libuuid --disable-uuidd
    135 else
    136 COMMON_CONF_FLAGS += --enable-fsck
    137 endif
    138 
    139 STD_CONF_FLAGS = --enable-compression
    140 
    141 BF_CONF_FLAGS = --disable-nls --disable-imager --disable-testio-debug \
    142 	--disable-uuidd --disable-tls \
    143 	--disable-debugfs  --disable-e2initrd-helper
    144 
    145 STATIC_CONF_FLAGS = --disable-nls --disable-imager \
    146 	--disable-uuidd --disable-tls \
    147 	--disable-e2initrd-helper
    148 
    149 MIPS_NOPIC_CONF_FLAGS = --disable-nls --disable-imager \
    150 	--disable-uuidd --disable-tls \
    151         --disable-resizer # --disable-debugfs
    152 
    153 # we can't use those flags at configure time
    154 MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
    155 MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
    156 
    157 ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
    158 ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
    159 ismips=ismips
    160 endif
    161 endif
    162 
    163 M4_ARGS=
    164 ifeq ($(UTIL_LINUX_NG),yes)
    165 M4_ARGS+=-DUTIL_LINUX_NG
    166 else
    167 M4_ARGS+=-UUTIL_LINUX_NG
    168 endif
    169 
    170 debian-files: debian/control debian/e2fsprogs.shlibs.local
    171 
    172 mrproper: clean
    173 	rm debian/control debian/e2fsprogs.shlibs.local
    174 
    175 debian/control: debian/control.in debian/rules
    176 	m4 $(M4_ARGS) < debian/control.in > $@
    177 
    178 debian/e2fsprogs.shlibs.local: debian/e2fsprogs.shlibs.local.in
    179 	m4 $(M4_ARGS) < debian/e2fsprogs.shlibs.local.in > $@
    180 
    181 ${CFGSTDSTAMP}:
    182 	dh_testdir
    183 
    184 	# Make sure we don't try to rebuild the configure scripts
    185 	find . -name configure | xargs touch
    186 
    187 	mkdir -p ${stdbuilddir}
    188 ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
    189 	cd ${stdbuilddir} && AWK=/usr/bin/awk \
    190 		${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
    191 		CFLAGS="${CFLAGS}"
    192 else
    193 	cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
    194 		${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
    195 		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
    196 		CFLAGS="${CFLAGS}"
    197 endif
    198 
    199   # specially-built MIPS libs
    200 ifneq ($(ismips),)
    201 	mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
    202 	cd ${mipsbuilddir} && AWK=/usr/bin/awk \
    203 		${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} CFLAGS="${CFLAGS}"
    204 	cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
    205 		${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} CFLAGS="${CFLAGS}"
    206 endif
    207 
    208 	mkdir -p ${STAMPSDIR}
    209 	touch ${CFGSTDSTAMP}
    210 
    211 ${CFGBFSTAMP}:
    212 	dh_testdir
    213 	rm -f config.cache
    214 
    215 	mkdir -p ${bfbuilddir}
    216 ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
    217 	cd ${bfbuilddir} && AWK=/usr/bin/awk \
    218 		${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
    219 		CFLAGS="${CFLAGS} ${BF_CFLAGS}"
    220 else
    221 	cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
    222 		${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
    223 		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
    224 		CFLAGS="${CFLAGS}"
    225 endif
    226 	mkdir -p ${STAMPSDIR}
    227 	touch ${CFGBFSTAMP}
    228 
    229 ${CFGSTATICSTAMP}:
    230 	dh_testdir
    231 	rm -f config.cache
    232 
    233 	mkdir -p ${staticbuilddir}
    234 ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
    235 	if type diet > /dev/null  2>&1 ; then \
    236 		cd ${staticbuilddir} && AWK=/usr/bin/awk \
    237 		${topdir}/configure ${STATIC_CONF_FLAGS} \
    238 		--with-diet-libc CFLAGS="${CFLAGS}"; \
    239 	else \
    240 		cd ${staticbuilddir} && AWK=/usr/bin/awk \
    241 			${topdir}/configure ${STATIC_CONF_FLAGS} \
    242 			CFLAGS="${CFLAGS}"; \
    243 	fi
    244 else
    245 	cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
    246 		${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
    247 		--build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
    248 		CFLAGS="${CFLAGS}"
    249 endif
    250 	mkdir -p ${STAMPSDIR}
    251 	touch ${CFGSTATICSTAMP}
    252 
    253 build: build-std build-bf $(BUILD_STATIC)
    254 
    255 build-std: ${BUILDSTDSTAMP}
    256 ${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
    257 	dh_testdir
    258 	$(MAKE) -C ${stdbuilddir} all
    259 	$(MAKE) -C ${stdbuilddir}/e2fsck e2fsck.static
    260 
    261 	( cd ${stdbuilddir}/doc && $(MAKE) libext2fs_abt.html )
    262 	( cd ${stdbuilddir}/lib/et && $(MAKE) com_err.info com_err_abt.html )
    263 
    264   # specially-built MIPS libs
    265 ifneq ($(ismips),)
    266 	$(MAKE) -C ${mipsbuilddir}/util
    267 	$(MAKE) -C ${mipsbuilddir} \
    268 		CFLAGS="${CFLAGS} ${MIPS_CFLAGS}" \
    269 		LIB_SUBDIRS="lib/et lib/ext2fs" libs
    270 	$(MAKE) -C ${mipsbuilddir64}/util
    271 	$(MAKE) -C ${mipsbuilddir64} \
    272 		CFLAGS="${CFLAGS} ${MIPS_CFLAGS_64}" \
    273 		LIB_SUBDIRS="lib/et lib/ext2fs" libs
    274 endif
    275 
    276 	touch ${BUILDSTDSTAMP}
    277 
    278 build-bf: ${BUILDBFSTAMP}
    279 ${BUILDBFSTAMP}: ${CFGBFSTAMP}
    280 	dh_testdir
    281 	$(MAKE) -C ${bfbuilddir} libs
    282 	$(MAKE) -C ${bfbuilddir}/e2fsck all
    283 	$(MAKE) -C ${bfbuilddir}/misc all
    284 	touch ${BUILDBFSTAMP}
    285 
    286 build-static: ${BUILDSTATICSTAMP}
    287 ${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
    288 	dh_testdir
    289 	$(MAKE) -C ${staticbuilddir} libs
    290 	$(MAKE) -C ${staticbuilddir}/e2fsck all e2fsck.static
    291 	touch ${BUILDSTATICSTAMP}
    292 
    293 clean:
    294 	dh_testdir
    295 	rm -rf ${STAMPSDIR}
    296 	[ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} distclean
    297 	[ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} distclean
    298 	[ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} distclean
    299 	rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
    300 	rm -f debian/*.substvars
    301 	dh_clean
    302 
    303 install: cleanup install-std
    304 
    305 # This rule allows to factorize the dh_clean between the 2 install rules
    306 # This must be launched before install-* (if launching them by hand, for
    307 # exemple) or results are unpredictable
    308 cleanup:
    309 	dh_testdir
    310 	dh_testroot
    311 	dh_prep
    312 
    313 install-std: DH_OPTIONS=
    314 install-std: build
    315 	dh_testdir
    316 	dh_testroot
    317 	dh_installdirs
    318 
    319 	mkdir -p ${tmpdir}/sbin
    320 	$(MAKE) -C ${stdbuilddir} install DESTDIR=${tmpdir} \
    321 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
    322   # static libs and .h files
    323 	$(MAKE) -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
    324 
    325   # statically-linked fsck
    326 	${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
    327 	cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
    328 
    329 	ln -s et/com_err.h ${tmpdir}/usr/include
    330 
    331 	dh_movefiles
    332 	test -z "`find ${tmpdir} -type f`"
    333 
    334   # specially-built MIPS libs
    335 ifneq ($(ismips),)
    336 	$(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
    337 		${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
    338 	$(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
    339 		${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
    340 endif
    341 
    342 install-udeb: DH_OPTIONS=
    343 install-udeb: build
    344 	dh_testdir
    345 	dh_testroot
    346 
    347 	$(MAKE) -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
    348 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
    349 	$(MAKE) -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
    350 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
    351 	$(MAKE) -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
    352 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
    353 	$(MAKE) -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
    354 		INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
    355 
    356 	rm -rf ${udebdir}/usr
    357 	find ${udebdir}/sbin -type f -a ! -name e2fsck \
    358 		-a ! -name mke2fs -a ! -name tune2fs \
    359 		-a ! -name resize2fs -a ! -name badblocks -print | xargs rm
    360 
    361 	(cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
    362 		ln -s e2fsck fsck.ext3 ; ln -s e2fsck fsck.ext4 ; \
    363 		ln -s mke2fs mkfs.ext2 ; ln -s mke2fs mkfs.ext3 ; \
    364 		ln -s mke2fs mkfs.ext4)
    365 
    366 ifneq ($(UTIL_LINUX_NG),yes)
    367 	mkdir -p ${blkidudebdir}/lib
    368 	mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
    369 
    370 	mkdir -p ${uuidudebdir}/lib
    371 	mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
    372 endif
    373 
    374 binary-indep: 
    375   # no arch-independant debs.
    376 
    377 binary-arch: DH_OPTIONS= -a
    378 binary-arch: install install-udeb
    379 	dh_testdir
    380 	dh_testroot
    381 
    382   # lintian overrides
    383 	for i in $$(cd debian && echo *.lintian-overrides); do \
    384 		pkg=$${i%.lintian-overrides} ;\
    385 		$(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
    386 	done
    387 
    388   # symlinks to prepare dh_installdocs run
    389 
    390 ifneq ($(UTIL_LINUX_NG),yes)
    391 	mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
    392 	mkdir -p ${debdir}/libblkid-dev/usr/share/doc
    393 	ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
    394 endif
    395 
    396 	mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
    397 	mkdir -p ${debdir}/ss-dev/usr/share/doc
    398 	ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
    399 
    400 	mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
    401 	mkdir -p ${debdir}/comerr-dev/usr/share/doc
    402 	ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
    403 
    404 ifneq ($(UTIL_LINUX_NG),yes)
    405 	mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
    406 	mkdir -p ${debdir}/uuid-dev/usr/share/doc
    407 #	ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
    408 endif
    409 
    410 	mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
    411 	mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
    412 	ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
    413 
    414 ifneq ($(UTIL_LINUX_NG),yes)
    415 	$(INSTALL) -p -m 0644 debian/libblkid.copyright \
    416 		${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
    417 endif
    418 
    419 	dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
    420 
    421   # HTML docs
    422 	$(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
    423 	$(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
    424 	   ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
    425 	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
    426 	$(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
    427 	   ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
    428 
    429   # texinfo docs
    430 	mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
    431 	$(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
    432 	   ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
    433 	$(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
    434 	   ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
    435 
    436 	$(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
    437 	$(INSTALL) -p -m 0644 lib/ss/ss_err.et \
    438 		${stdbuilddir}/lib/ext2fs/ext2_err.et \
    439 		${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
    440 	$(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
    441 	$(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
    442 		${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
    443 
    444 	dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
    445 	dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
    446 
    447 	DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
    448 		-plibcomerr${COMERR_SOVERSION} \
    449 		-plibss${SS_SOVERSION} \
    450 		-pe2fslibs -pe2fsck-static \
    451 		-pe2fsprogs-dbg -pe2fslibs-dbg \
    452 		-plibcomerr2-dbg -plibss2-dbg
    453 ifneq ($(UTIL_LINUX_NG),yes)
    454 	DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \
    455 		-puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg \
    456 		-plibblkid${BLKID_SOVERSION} -plibblkid1-dbg
    457 endif
    458 
    459 	dh_fixperms
    460 ifneq ($(ismips),)
    461 	dh_strip -k -Xlib64ext2fs-nopic.a
    462 else
    463 	dh_strip -k
    464 endif
    465 
    466 	# debug package stuff
    467 	rm -rf ${udebdir}/usr
    468 ifneq ($(UTIL_LINUX_NG),yes)
    469 	rm -rf ${blkidudebdir}/usr
    470 	rm -rf ${uuidudebdir}/usr
    471 endif
    472 
    473 	mkdir -p ${debugdir}/usr/lib
    474 	mv ${maindir}/usr/lib/debug ${debugdir}/usr/lib
    475 	rm -rf ${maindir}/usr/lib/debug
    476 	mv ${e2fsckstaticdir}/usr/lib/debug/sbin/* \
    477 		${debugdir}/usr/lib/debug
    478 	rm -rf ${e2fsckstaticdir}/usr/lib
    479 
    480 ifneq ($(UTIL_LINUX_NG),yes)
    481 	mkdir -p ${uuidruntimedbgdir}/usr/lib
    482 	mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/usr/lib
    483 	rmdir ${uuidruntimedir}/usr/lib
    484 endif
    485 
    486 	mkdir -p ${libext2dbgdir}/usr/lib
    487 	mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/usr/lib
    488 	rmdir ${libext2dir}/usr/lib
    489 
    490 	mkdir -p ${libcomerrdbgdir}/usr/lib
    491 	mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/usr/lib
    492 	rmdir ${libcomerrdir}/usr/lib
    493 
    494 	mkdir -p ${libssdbgdir}/usr/lib
    495 	mv ${libssdir}/usr/lib/debug ${libssdbgdir}/usr/lib
    496 	rmdir ${libssdir}/usr/lib
    497 
    498 ifneq ($(UTIL_LINUX_NG),yes)
    499 	mkdir -p ${libuuiddbgdir}/usr/lib
    500 	mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/usr/lib
    501 	rmdir ${libuuiddir}/usr/lib
    502 
    503 	mkdir -p ${libblkiddbgdir}/usr/lib
    504 	mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/usr/lib
    505 	rmdir ${libblkiddir}/usr/lib
    506 endif
    507 
    508 	# dpkg symbol handling
    509 ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
    510 SYMBOL_LIBS := e2fslibs libcomerr2 libss2
    511 ifneq ($(UTIL_LINUX_NG),yes)
    512 SYMBOL_LIBS += libblkid1 libuuid1
    513 endif
    514 	for i in $(SYMBOL_LIBS); \
    515 	do \
    516 		echo "Generating symbols for $$i..."; \
    517 		dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
    518 		cat debian/$$i.tmp-patch; \
    519 		patch debian/$$i.symbols < debian/$$i.tmp-patch; \
    520 		/bin/rm debian/$$i.tmp-patch; \
    521 	done
    522 endif
    523 
    524 	$(INSTALL) -p -m 0644 debian/e2fsprogs.copyright \
    525 		${debugdir}/usr/share/doc/e2fsprogs-dbg/copyright
    526 
    527 ifneq ($(UTIL_LINUX_NG),yes)
    528 	$(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \
    529 		${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright
    530 endif
    531 
    532 	$(INSTALL) -p -m 0644 debian/e2fslibs.copyright \
    533 		${libext2dbgdir}/usr/share/doc/e2fslibs-dbg/copyright
    534 
    535 	$(INSTALL) -p -m 0644 debian/libcomerr2.copyright \
    536 		${libcomerrdbgdir}/usr/share/doc/libcomerr2-dbg/copyright
    537 
    538 	$(INSTALL) -p -m 0644 debian/libss2.copyright \
    539 		${libssdbgdir}/usr/share/doc/libss2-dbg/copyright
    540 
    541 ifneq ($(UTIL_LINUX_NG),yes)
    542 	$(INSTALL) -p -m 0644 debian/libblkid.copyright \
    543 		${libblkiddbgdir}/usr/share/doc/libblkid1-dbg/copyright
    544 
    545 	$(INSTALL) -p -m 0644 debian/libuuid1.copyright \
    546 		${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright
    547 endif
    548 
    549 	dh_compress
    550 
    551 	dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
    552 	dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
    553 		-V 'libcomerr2 (>= 1.33-3)'
    554 ifneq ($(UTIL_LINUX_NG),yes)
    555 	dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
    556 	echo "udeb: libblkid 1 libblkid1-udeb" >> \
    557 		debian/libblkid1/DEBIAN/shlibs
    558 	echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
    559 endif
    560 
    561 	dh_installdeb
    562 	dh_shlibdeps -l${stdbuilddir}/lib
    563 	dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
    564 		-u"-Ldebian/e2fsprogs.shlibs.local"
    565 	dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
    566 		-u"-Ldebian/e2fsprogs-udeb.shlibs.local"
    567 
    568 	dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
    569 		-Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
    570 	DH_OPTIONS= dh_gencontrol -pcomerr-dev \
    571 	  -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
    572 	DH_OPTIONS= dh_gencontrol -pss-dev \
    573 	  -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
    574 ifneq ($(UTIL_LINUX_NG),yes)
    575 	DH_OPTIONS= dh_gencontrol -puuid-dev \
    576 	  -u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
    577 endif
    578 	dh_gencontrol	-pe2fsprogs-udeb -- -fdebian/files~
    579 ifneq ($(UTIL_LINUX_NG),yes)
    580 	dh_gencontrol	-plibblkid1-udeb -- -fdebian/files~
    581 	dh_gencontrol	-plibuuid1-udeb -- -fdebian/files~
    582 endif
    583 
    584 	dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
    585 ifneq ($(UTIL_LINUX_NG),yes)
    586 	dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
    587 	dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
    588 endif
    589 	dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
    590 	dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
    591 	dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
    592 ifneq ($(UTIL_LINUX_NG),yes)
    593 	dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
    594 	dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
    595 endif
    596 
    597 binary: binary-indep binary-arch
    598 
    599 .PHONY: binary binary-arch binary-indep clean checkroot mrproper debian-files
    600