blob: 1ba79ff2831e13926afde648b1462ff912907368 [file] [log] [blame]
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +00001#! /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
11export LC_ALL=C
12
Theodore Ts'o95f65c32009-07-18 22:14:58 -040013# Allow distro-specific behaviour
14DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release || echo Debian)
15SYS_BLKID_VER :=$(shell dpkg-query -W -f '${version}\n' libblkid1 | cut -b 1)
16ifeq ($(SYS_BLKID_VER),2)
17UTIL_LINUX_NG ?= yes
18endif
19
Theodore Ts'of85cc2a2003-07-26 00:48:08 -040020# These are used for cross-compiling and for saving the configure script
21# from having to guess our platform (since we know it already)
22DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
23DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
Samuel Thibault3e416082007-08-14 11:25:45 +020024DEB_HOST_OS ?= $(shell dpkg-architecture -qDEB_HOST_OS)
Theodore Ts'of85cc2a2003-07-26 00:48:08 -040025DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
26DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000027
28# find the version for the main package, from changelog file
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040029MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
Theodore Ts'oe5b16432002-08-17 21:11:29 -040030# find versions for libraries going into their own packages, from their Makefile.in's,
31# and sonames for all libs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000032COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040033COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000034SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040035SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040036
37ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000038UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040039UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040040
Theodore Ts'o6fe7d112003-03-16 19:58:25 -050041BLKID_VERSION = $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
42BLKID_SOVERSION = $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040043endif
44
Theodore Ts'oe5b16432002-08-17 21:11:29 -040045EXT2FS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
46E2P_SOVERSION = $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000047
48package=e2fsprogs
49
50topdir=$(shell pwd)
51debdir=${topdir}/debian
Theodore Ts'ob90b8262001-06-15 22:54:34 +000052tmpdir=${debdir}/tmp
Theodore Ts'odd198d62002-10-31 03:44:35 -050053udebdir=${debdir}/e2fsprogs-udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040054ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -040055blkidudebdir=${debdir}/libblkid1-udeb
Theodore Ts'oe254d052003-12-07 01:57:04 -050056uuidudebdir=${debdir}/libuuid1-udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040057endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040058libcomerrdir=${debdir}/libcomerr${COMERR_SOVERSION}
59comerrdevdir=${debdir}/comerr-dev
60libcomerrdbgdir=${debdir}/libcomerr2-dbg
61libssdir=${debdir}/libss${SS_SOVERSION}
62ssdevdir=${debdir}/ss-dev
63libssdbgdir=${debdir}/libss2-dbg
Theodore Ts'o95f65c32009-07-18 22:14:58 -040064ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040065libblkiddir=${debdir}/libblkid${BLKID_SOVERSION}
66libblkiddevdir=${debdir}/libblkid-dev
67libblkiddbgdir=${debdir}/libblkid1-dbg
68libuuiddir=${debdir}/libuuid${UUID_SOVERSION}
69uuiddevdir=${debdir}/uuid-dev
70libuuiddbgdir=${debdir}/libuuid1-dbg
71uuidruntimedir=${debdir}/uuid-runtime
72uuidruntimedbgdir=${debdir}/uuid-runtime-dbg
Theodore Ts'o95f65c32009-07-18 22:14:58 -040073endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040074libext2dir=${debdir}/e2fslibs
75libext2devdir=${debdir}/e2fslibs-dev
76libext2dbgdir=${debdir}/e2fslibs-dbg
Theodore Ts'ob90b8262001-06-15 22:54:34 +000077maindir=${debdir}/e2fsprogs
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040078e2fsckstaticdir=${debdir}/e2fsck-static
79debugdir=${debdir}/e2fsprogs-dbg
Theodore Ts'o79786212001-06-22 23:05:23 -040080stdbuilddir=${debdir}/BUILD-STD
81bfbuilddir=${debdir}/BUILD-BF
Theodore Ts'oa827a2a2007-12-31 17:17:39 -050082staticbuilddir=${debdir}/BUILD-STATIC
Theodore Ts'oe5b16432002-08-17 21:11:29 -040083mipsbuilddir=${debdir}/BUILD-MIPS
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050084mipsbuilddir64=${debdir}/BUILD-MIPS-64
Theodore Ts'ob90b8262001-06-15 22:54:34 +000085# docdir=${maindir}/usr/share/doc/${package}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000086MANDIR=/usr/share/man
Theodore Ts'ob90b8262001-06-15 22:54:34 +000087mandir=${tmpdir}${MANDIR}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000088
Theodore Ts'odd198d62002-10-31 03:44:35 -050089UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040090UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
Theodore Ts'odd198d62002-10-31 03:44:35 -050091
Theodore Ts'o95f65c32009-07-18 22:14:58 -040092ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -040093BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040094BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
Theodore Ts'o417781a2003-04-10 00:18:56 -040095
Theodore Ts'oe254d052003-12-07 01:57:04 -050096UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040097UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
98endif
Theodore Ts'oe254d052003-12-07 01:57:04 -050099
Theodore Ts'o541d1732002-02-23 21:23:26 -0500100STAMPSDIR=debian/stampdir
101CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
102CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500103CFGSTATICSTAMP=${STAMPSDIR}/configure-static-stamp
Theodore Ts'o541d1732002-02-23 21:23:26 -0500104BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
105BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500106BUILDSTATICSTAMP=${STAMPSDIR}/build-static-stamp
Theodore Ts'o541d1732002-02-23 21:23:26 -0500107
Theodore Ts'of77704e2006-11-11 22:32:35 -0500108CCOPTS = -g
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000109
Theodore Ts'o1893e712001-05-21 02:48:41 +0000110INSTALL = install
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500111INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
Theodore Ts'o1893e712001-05-21 02:48:41 +0000112
Theodore Ts'o1d658a12003-08-21 01:53:07 -0400113ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
114CCOPTS += -O2
Theodore Ts'o1893e712001-05-21 02:48:41 +0000115endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400116#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
117#INSTALL_PROGRAM += -s
118#endif
Theodore Ts'o1893e712001-05-21 02:48:41 +0000119
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000120ifeq (${DEB_HOST_ARCH},alpha)
121CCOPTS += -DHAVE_NETINET_IN_H
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000122else
123CCOPTS += -D__NO_STRING_INLINES
124endif
125
Samuel Thibault3e416082007-08-14 11:25:45 +0200126ifeq (${DEB_HOST_ARCH_OS},linux)
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500127BUILD_STATIC = build-static
128E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
129else
130E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
Samuel Thibault3e416082007-08-14 11:25:45 +0200131endif
132
Theodore Ts'o79786212001-06-22 23:05:23 -0400133BF_CCOPTS = -Os -fomit-frame-pointer
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000134
Theodore Ts'o79786212001-06-22 23:05:23 -0400135COMMON_CONF_FLAGS = \
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400136 --enable-elf-shlibs --infodir=/usr/share/info
137ifeq ($(UTIL_LINUX_NG),yes)
138COMMON_CONF_FLAGS += --disable-fsck --disable-libblkid \
139 --disable-libuuid --disable-uuidd
140else
141COMMON_CONF_FLAGS += --enable-fsck
142endif
Theodore Ts'o79786212001-06-22 23:05:23 -0400143
Theodore Ts'o7515a742008-08-26 23:56:00 -0400144STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression
Theodore Ts'o79786212001-06-22 23:05:23 -0400145
146BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
Theodore Ts'oaf773652008-09-01 11:27:27 -0400147 --disable-nls --disable-imager --disable-testio-debug \
Theodore Ts'o61a679d2007-12-31 11:20:01 -0500148 --disable-uuidd --disable-tls \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500149 --disable-debugfs --disable-e2initrd-helper
Theodore Ts'o79786212001-06-22 23:05:23 -0400150
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500151STATIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
152 --disable-nls --disable-imager \
153 --disable-uuidd --disable-tls \
154 --disable-e2initrd-helper \
Theodore Ts'o4f2e8f12008-01-27 17:20:44 -0500155 --with-ccopts=-fno-stack-protector
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500156
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400157MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
Theodore Ts'ofef2b382008-01-01 12:41:35 -0500158 --disable-nls --disable-imager \
Theodore Ts'o61a679d2007-12-31 11:20:01 -0500159 --disable-uuidd --disable-tls \
Theodore Ts'odd198d62002-10-31 03:44:35 -0500160 --disable-resizer # --disable-debugfs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500161
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400162# we can't use those flags at configure time
163MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500164MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400165
166ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
167ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
168ismips=ismips
169endif
170endif
171
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400172M4_ARGS=
173ifeq ($(UTIL_LINUX_NG),yes)
174M4_ARGS+=-DUTIL_LINUX_NG
175else
176M4_ARGS+=-UUTIL_LINUX_NG
177endif
178
179debian/control: debian/control.in debian/rules
180 m4 $(M4_ARGS) < debian/control.in > $@
181
Theodore Ts'o541d1732002-02-23 21:23:26 -0500182${CFGSTDSTAMP}:
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000183 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500184
Theodore Ts'o41b6ae62004-09-24 10:07:05 -0400185 # Make sure we don't try to rebuild the configure scripts
186 find . -name configure | xargs touch
187
Theodore Ts'o79786212001-06-22 23:05:23 -0400188 mkdir -p ${stdbuilddir}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000189ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500190 cd ${stdbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400191 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000192else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500193 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400194 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
Theodore Ts'oa6ea47a2007-12-15 20:34:41 -0500195 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000196endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400197
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500198 # specially-built MIPS libs
199ifneq ($(ismips),)
200 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
201 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
202 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
203 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
204 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
205endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400206
Theodore Ts'o541d1732002-02-23 21:23:26 -0500207 mkdir -p ${STAMPSDIR}
208 touch ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400209
Theodore Ts'o541d1732002-02-23 21:23:26 -0500210${CFGBFSTAMP}:
Theodore Ts'o79786212001-06-22 23:05:23 -0400211 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500212 rm -f config.cache
213
Theodore Ts'o79786212001-06-22 23:05:23 -0400214 mkdir -p ${bfbuilddir}
215ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500216 cd ${bfbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400217 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS}
218else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500219 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400220 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
Theodore Ts'oa6ea47a2007-12-15 20:34:41 -0500221 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
Theodore Ts'o79786212001-06-22 23:05:23 -0400222endif
Theodore Ts'o541d1732002-02-23 21:23:26 -0500223 mkdir -p ${STAMPSDIR}
224 touch ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400225
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500226${CFGSTATICSTAMP}:
227 dh_testdir
228 rm -f config.cache
229
230 mkdir -p ${staticbuilddir}
231ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'o4f2e8f12008-01-27 17:20:44 -0500232 if type diet > /dev/null 2>&1 ; then \
Theodore Ts'o3218dc92008-09-12 09:26:45 -0400233 cd ${staticbuilddir} && AWK=/usr/bin/awk \
234 ${topdir}/configure ${STATIC_CONF_FLAGS} \
235 --with-diet-libc; \
236 else \
237 cd ${staticbuilddir} && AWK=/usr/bin/awk \
238 ${topdir}/configure ${STATIC_CONF_FLAGS}; \
Theodore Ts'o4f2e8f12008-01-27 17:20:44 -0500239 fi
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500240else
241 cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
242 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
243 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
244endif
245 mkdir -p ${STAMPSDIR}
246 touch ${CFGSTATICSTAMP}
247
248build: build-std build-bf $(BUILD_STATIC)
Theodore Ts'o79786212001-06-22 23:05:23 -0400249
Theodore Ts'o541d1732002-02-23 21:23:26 -0500250build-std: ${BUILDSTDSTAMP}
251${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400252 dh_testdir
Theodore Ts'o26d68912008-01-01 16:23:38 -0500253 $(MAKE) -C ${stdbuilddir} all
Theodore Ts'o7e8fe322008-01-27 17:43:10 -0500254 $(MAKE) -C ${stdbuilddir}/e2fsck e2fsck.static
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400255
Theodore Ts'o79786212001-06-22 23:05:23 -0400256 ( cd ${stdbuilddir}/doc && \
257 texi2html -split_chapter ${topdir}/doc/libext2fs.texinfo )
Theodore Ts'o26d68912008-01-01 16:23:38 -0500258 ( cd ${stdbuilddir}/lib/et && $(MAKE) com_err.info && \
Theodore Ts'o79786212001-06-22 23:05:23 -0400259 texi2html -split_chapter -expandinfo ${topdir}/lib/et/com_err.texinfo )
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400260
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500261 # specially-built MIPS libs
262ifneq ($(ismips),)
Theodore Ts'o26d68912008-01-01 16:23:38 -0500263 $(MAKE) -C ${mipsbuilddir}/util
264 $(MAKE) -C ${mipsbuilddir} \
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500265 CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \
266 LIB_SUBDIRS="lib/et lib/ext2fs" libs
Theodore Ts'o26d68912008-01-01 16:23:38 -0500267 $(MAKE) -C ${mipsbuilddir64}/util
268 $(MAKE) -C ${mipsbuilddir64} \
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500269 CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \
270 LIB_SUBDIRS="lib/et lib/ext2fs" libs
271endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400272
Theodore Ts'o541d1732002-02-23 21:23:26 -0500273 touch ${BUILDSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400274
Theodore Ts'o541d1732002-02-23 21:23:26 -0500275build-bf: ${BUILDBFSTAMP}
276${BUILDBFSTAMP}: ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400277 dh_testdir
Theodore Ts'o26d68912008-01-01 16:23:38 -0500278 $(MAKE) -C ${bfbuilddir} libs
279 $(MAKE) -C ${bfbuilddir}/e2fsck all
280 $(MAKE) -C ${bfbuilddir}/misc all
Theodore Ts'o541d1732002-02-23 21:23:26 -0500281 touch ${BUILDBFSTAMP}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000282
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500283build-static: ${BUILDSTATICSTAMP}
284${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
285 dh_testdir
Theodore Ts'o26d68912008-01-01 16:23:38 -0500286 $(MAKE) -C ${staticbuilddir} libs
Theodore Ts'o7e8fe322008-01-27 17:43:10 -0500287 $(MAKE) -C ${staticbuilddir}/e2fsck all e2fsck.static
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500288 touch ${BUILDSTATICSTAMP}
289
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000290clean:
291 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500292 rm -rf ${STAMPSDIR}
Theodore Ts'o26d68912008-01-01 16:23:38 -0500293 [ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} distclean
294 [ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} distclean
295 [ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} distclean
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500296 rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
Theodore Ts'o8c5829f2005-07-21 19:32:36 -0500297 rm -f doc/libext2fs/*.html lib/et/com_err/*.html debian/*.substvars
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000298 dh_clean
299
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400300install: cleanup install-std
Theodore Ts'o79786212001-06-22 23:05:23 -0400301
302# This rule allows to factorize the dh_clean between the 2 install rules
303# This must be launched before install-* (if launching them by hand, for
304# exemple) or results are unpredictable
305cleanup:
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000306 dh_testdir
307 dh_testroot
Theodore Ts'oef797132009-04-20 08:12:15 -0400308 dh_prep
Theodore Ts'o79786212001-06-22 23:05:23 -0400309
310install-std: DH_OPTIONS=
311install-std: build
312 dh_testdir
313 dh_testroot
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000314 dh_installdirs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000315
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000316 mkdir -p ${tmpdir}/sbin
Theodore Ts'o26d68912008-01-01 16:23:38 -0500317 $(MAKE) -C ${stdbuilddir} install DESTDIR=${tmpdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400318 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
319 # static libs and .h files
Theodore Ts'o26d68912008-01-01 16:23:38 -0500320 $(MAKE) -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000321
Theodore Ts'o1893e712001-05-21 02:48:41 +0000322 # statically-linked fsck
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500323 ${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400324 cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000325
Theodore Ts'o020c5472003-04-10 00:01:19 -0400326 ln -s et/com_err.h ${tmpdir}/usr/include
327
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400328 dh_movefiles
329 test -z `find ${tmpdir} -type f`
330
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500331 # specially-built MIPS libs
332ifneq ($(ismips),)
333 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
334 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
335 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
336 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
337endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400338
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400339install-udeb: DH_OPTIONS=
340install-udeb: build
Theodore Ts'o79786212001-06-22 23:05:23 -0400341 dh_testdir
342 dh_testroot
Theodore Ts'o79786212001-06-22 23:05:23 -0400343
Theodore Ts'o26d68912008-01-01 16:23:38 -0500344 $(MAKE) -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400345 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o26d68912008-01-01 16:23:38 -0500346 $(MAKE) -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400347 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o26d68912008-01-01 16:23:38 -0500348 $(MAKE) -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400349 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o26d68912008-01-01 16:23:38 -0500350 $(MAKE) -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500351 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o79786212001-06-22 23:05:23 -0400352
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400353 rm -rf ${udebdir}/usr
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400354 find ${udebdir}/sbin -type f -a ! -name e2fsck \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500355 -a ! -name mke2fs -a ! -name tune2fs \
356 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400357
358 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
359 ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
Theodore Ts'o3a4ec2b2009-01-19 21:05:49 -0500360 ln -s mke2fs mkfs.ext3 ; ln -s mke2fs mkfs.ext4)
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400361
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400362ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -0400363 mkdir -p ${blkidudebdir}/lib
364 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
Theodore Ts'o79786212001-06-22 23:05:23 -0400365
Theodore Ts'oe254d052003-12-07 01:57:04 -0500366 mkdir -p ${uuidudebdir}/lib
367 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400368endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500369
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000370binary-indep:
371 # no arch-independant debs.
372
373binary-arch: DH_OPTIONS= -a
Theodore Ts'odd198d62002-10-31 03:44:35 -0500374binary-arch: install install-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000375 dh_testdir
376 dh_testroot
377
Theodore Ts'o541d1732002-02-23 21:23:26 -0500378 # lintian overrides
379 for i in $$(cd debian && echo *.lintian-overrides); do \
380 pkg=$${i%.lintian-overrides} ;\
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500381 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
Theodore Ts'o541d1732002-02-23 21:23:26 -0500382 done
Theodore Ts'o79786212001-06-22 23:05:23 -0400383
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400384 # mkinitrd script
Theodore Ts'o1d658a12003-08-21 01:53:07 -0400385 mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500386 $(INSTALL) -p -o root -g root -m 0755 debian/initrd-tools.e2fsprogs \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400387 debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
388
389 # initrd script
390 mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500391 $(INSTALL) -p -o root -g root -m 0755 debian/initrd.ext3-add-journal \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400392 debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
393
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400394
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000395 # symlinks to prepare dh_installdocs run
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000396
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400397ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500398 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
399 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
400 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400401endif
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500402
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400403 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
404 mkdir -p ${debdir}/ss-dev/usr/share/doc
405 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
406
407 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
408 mkdir -p ${debdir}/comerr-dev/usr/share/doc
409 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
410
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400411ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400412 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
413 mkdir -p ${debdir}/uuid-dev/usr/share/doc
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400414# ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400415endif
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400416
417 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
418 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
419 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000420
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400421ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500422 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500423 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400424endif
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500425
Theodore Ts'oe254d052003-12-07 01:57:04 -0500426 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000427
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000428 # HTML docs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500429 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
430 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/libext2fs/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400431 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500432 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
433 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/com_err/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400434 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000435
436 # texinfo docs
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400437 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500438 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400439 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500440 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400441 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000442
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500443 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
444 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400445 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
446 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500447 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
448 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400449 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
450
Theodore Ts'o60702c22007-09-22 20:42:04 -0400451 if test -f /etc/lsb-release && \
452 grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
453 $(INSTALL) -p -m 0644 e2fsck/e2fsck.conf.ubuntu \
454 ${debdir}/e2fsprogs/etc/e2fsck.conf; \
455 fi
456
Theodore Ts'o541d1732002-02-23 21:23:26 -0500457 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
Theodore Ts'o79786212001-06-22 23:05:23 -0400458 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000459
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400460 DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400461 -plibcomerr${COMERR_SOVERSION} \
462 -plibss${SS_SOVERSION} \
463 -pe2fslibs -pe2fsck-static \
464 -pe2fsprogs-dbg -pe2fslibs-dbg \
465 -plibcomerr2-dbg -plibss2-dbg
466ifneq ($(UTIL_LINUX_NG),yes)
467 DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \
468 -puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg
469endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000470
Theodore Ts'oa3f464f2007-07-04 14:51:18 -0400471 dh_fixperms
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500472ifneq ($(ismips),)
Theodore Ts'o30f142e2008-07-15 11:38:33 -0400473 dh_strip -k -Xlib64ext2fs-nopic.a
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500474else
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400475 dh_strip -k
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500476endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000477
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400478 # debug package stuff
479 rm -rf ${udebdir}/usr
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400480ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400481 rm -rf ${blkidudebdir}/usr
482 rm -rf ${uuidudebdir}/usr
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400483endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400484
485 mkdir -p ${debugdir}/usr/lib
486 mv ${maindir}/usr/lib/debug ${debugdir}/usr/lib
487 rm -rf ${maindir}/usr/lib/debug
488 mv ${e2fsckstaticdir}/usr/lib/debug/sbin/* \
489 ${debugdir}/usr/lib/debug
490 rm -rf ${e2fsckstaticdir}/usr/lib
491
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400492ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400493 mkdir -p ${uuidruntimedbgdir}/usr/lib
494 mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/usr/lib
495 rmdir ${uuidruntimedir}/usr/lib
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400496endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400497
498 mkdir -p ${libext2dbgdir}/usr/lib
499 mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/usr/lib
500 rmdir ${libext2dir}/usr/lib
501
502 mkdir -p ${libcomerrdbgdir}/usr/lib
503 mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/usr/lib
504 rmdir ${libcomerrdir}/usr/lib
505
506 mkdir -p ${libssdbgdir}/usr/lib
507 mv ${libssdir}/usr/lib/debug ${libssdbgdir}/usr/lib
508 rmdir ${libssdir}/usr/lib
509
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400510ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400511 mkdir -p ${libuuiddbgdir}/usr/lib
512 mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/usr/lib
513 rmdir ${libuuiddir}/usr/lib
514
515 mkdir -p ${libblkiddbgdir}/usr/lib
516 mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/usr/lib
517 rmdir ${libblkiddir}/usr/lib
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400518endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400519
Theodore Ts'o649bd282008-08-25 00:00:35 -0400520 # dpkg symbol handling
521ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400522SYMBOL_LIBS := e2fslibs libcomerr2 libss2
523ifneq ($(UTIL_LINUX_NG),yes)
524SYMBOL_LIBS += libblkid1 libuuid1
525endif
526 for i in $(SYMBOL_LIBS); \
Theodore Ts'o649bd282008-08-25 00:00:35 -0400527 do \
528 echo "Generating symbols for $$i..."; \
529 dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
530 cat debian/$$i.tmp-patch; \
531 patch debian/$$i.symbols < debian/$$i.tmp-patch; \
532 /bin/rm debian/$$i.tmp-patch; \
533 done
534endif
535
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400536 $(INSTALL) -p -m 0644 debian/e2fsprogs.copyright \
537 ${debugdir}/usr/share/doc/e2fsprogs-dbg/copyright
538
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400539ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400540 $(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \
541 ${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400542endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400543
544 $(INSTALL) -p -m 0644 debian/e2fslibs.copyright \
545 ${libext2dbgdir}/usr/share/doc/e2fslibs-dbg/copyright
546
547 $(INSTALL) -p -m 0644 debian/libcomerr2.copyright \
548 ${libcomerrdbgdir}/usr/share/doc/libcomerr2-dbg/copyright
549
550 $(INSTALL) -p -m 0644 debian/libss2.copyright \
551 ${libssdbgdir}/usr/share/doc/libss2-dbg/copyright
552
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400553ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400554 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
555 ${libblkiddbgdir}/usr/share/doc/libblkid1-dbg/copyright
556
557 $(INSTALL) -p -m 0644 debian/libuuid1.copyright \
558 ${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400559endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400560
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000561 dh_compress
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000562
Theodore Ts'oe254d052003-12-07 01:57:04 -0500563 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400564 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
565 -V 'libcomerr2 (>= 1.33-3)'
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400566ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'oa1788522007-03-04 08:17:18 -0500567 dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
Theodore Ts'o7512f132006-03-29 19:03:38 -0500568 echo "udeb: libblkid 1 libblkid1-udeb" >> \
569 debian/libblkid1/DEBIAN/shlibs
570 echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400571endif
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500572
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000573 dh_installdeb
Theodore Ts'o79786212001-06-22 23:05:23 -0400574 dh_shlibdeps -l${stdbuilddir}/lib
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400575 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
576 -u"-Ldebian/e2fsprogs.shlibs.local"
Theodore Ts'o7a15db22003-07-29 22:15:33 -0400577 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
578 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000579
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400580 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
Theodore Ts'oe254d052003-12-07 01:57:04 -0500581 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000582 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
Theodore Ts'od8a1a672008-01-30 07:20:54 -0500583 -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000584 DH_OPTIONS= dh_gencontrol -pss-dev \
Theodore Ts'od8a1a672008-01-30 07:20:54 -0500585 -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400586ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000587 DH_OPTIONS= dh_gencontrol -puuid-dev \
Theodore Ts'od8a1a672008-01-30 07:20:54 -0500588 -u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400589endif
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400590 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400591ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400592 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
593 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400594endif
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000595
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400596 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400597ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400598 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
599 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400600endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500601 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
602 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'odd198d62002-10-31 03:44:35 -0500603 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400604ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -0400605 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
Theodore Ts'oe254d052003-12-07 01:57:04 -0500606 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400607endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500608
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000609binary: binary-indep binary-arch
610
611.PHONY: binary binary-arch binary-indep clean checkroot