blob: 6b55b909d36218f5e6ea4862da22206480e827b7 [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
Theodore Ts'o686c4c12009-08-23 10:09:36 -040014DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian)
15SYS_BLKID_VER := $(shell dpkg-query -W libblkid1 | cut -f 2 | cut -b 1)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040016ifeq ($(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'o55e00a22011-09-18 23:53:23 -040027DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000028
29# find the version for the main package, from changelog file
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040030MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
Theodore Ts'oe5b16432002-08-17 21:11:29 -040031# find versions for libraries going into their own packages, from their Makefile.in's,
32# and sonames for all libs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000033COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040034COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000035SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040036SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040037
38ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000039UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040040UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040041
Theodore Ts'o6fe7d112003-03-16 19:58:25 -050042BLKID_VERSION = $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
43BLKID_SOVERSION = $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
Theodore Ts'o95f65c32009-07-18 22:14:58 -040044endif
45
Theodore Ts'oe5b16432002-08-17 21:11:29 -040046EXT2FS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
47E2P_SOVERSION = $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000048
49package=e2fsprogs
50
51topdir=$(shell pwd)
52debdir=${topdir}/debian
Theodore Ts'ob90b8262001-06-15 22:54:34 +000053tmpdir=${debdir}/tmp
Theodore Ts'odd198d62002-10-31 03:44:35 -050054udebdir=${debdir}/e2fsprogs-udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040055ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -040056blkidudebdir=${debdir}/libblkid1-udeb
Theodore Ts'oe254d052003-12-07 01:57:04 -050057uuidudebdir=${debdir}/libuuid1-udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040058endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040059libcomerrdir=${debdir}/libcomerr${COMERR_SOVERSION}
60comerrdevdir=${debdir}/comerr-dev
61libcomerrdbgdir=${debdir}/libcomerr2-dbg
62libssdir=${debdir}/libss${SS_SOVERSION}
63ssdevdir=${debdir}/ss-dev
64libssdbgdir=${debdir}/libss2-dbg
Theodore Ts'o95f65c32009-07-18 22:14:58 -040065ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040066libblkiddir=${debdir}/libblkid${BLKID_SOVERSION}
67libblkiddevdir=${debdir}/libblkid-dev
68libblkiddbgdir=${debdir}/libblkid1-dbg
69libuuiddir=${debdir}/libuuid${UUID_SOVERSION}
70uuiddevdir=${debdir}/uuid-dev
71libuuiddbgdir=${debdir}/libuuid1-dbg
72uuidruntimedir=${debdir}/uuid-runtime
73uuidruntimedbgdir=${debdir}/uuid-runtime-dbg
Theodore Ts'o95f65c32009-07-18 22:14:58 -040074endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040075libext2dir=${debdir}/e2fslibs
76libext2devdir=${debdir}/e2fslibs-dev
77libext2dbgdir=${debdir}/e2fslibs-dbg
Theodore Ts'ob90b8262001-06-15 22:54:34 +000078maindir=${debdir}/e2fsprogs
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -040079e2fsckstaticdir=${debdir}/e2fsck-static
80debugdir=${debdir}/e2fsprogs-dbg
Theodore Ts'o79786212001-06-22 23:05:23 -040081stdbuilddir=${debdir}/BUILD-STD
82bfbuilddir=${debdir}/BUILD-BF
Theodore Ts'oa827a2a2007-12-31 17:17:39 -050083staticbuilddir=${debdir}/BUILD-STATIC
Theodore Ts'oe5b16432002-08-17 21:11:29 -040084mipsbuilddir=${debdir}/BUILD-MIPS
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050085mipsbuilddir64=${debdir}/BUILD-MIPS-64
Theodore Ts'ob90b8262001-06-15 22:54:34 +000086# docdir=${maindir}/usr/share/doc/${package}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000087MANDIR=/usr/share/man
Theodore Ts'ob90b8262001-06-15 22:54:34 +000088mandir=${tmpdir}${MANDIR}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000089
Theodore Ts'odd198d62002-10-31 03:44:35 -050090UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040091UDEB_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 -050092
Theodore Ts'o95f65c32009-07-18 22:14:58 -040093ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -040094BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040095BLKID_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 -040096
Theodore Ts'oe254d052003-12-07 01:57:04 -050097UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
Theodore Ts'o95f65c32009-07-18 22:14:58 -040098UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control.in -A 10 | grep ^Priority: | cut -d ' ' -f 2)
99endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500100
Theodore Ts'o541d1732002-02-23 21:23:26 -0500101STAMPSDIR=debian/stampdir
102CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
103CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500104CFGSTATICSTAMP=${STAMPSDIR}/configure-static-stamp
Theodore Ts'o541d1732002-02-23 21:23:26 -0500105BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
106BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500107BUILDSTATICSTAMP=${STAMPSDIR}/build-static-stamp
Theodore Ts'o541d1732002-02-23 21:23:26 -0500108
Theodore Ts'o1893e712001-05-21 02:48:41 +0000109INSTALL = install
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500110INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
Theodore Ts'o1893e712001-05-21 02:48:41 +0000111
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400112#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
113#INSTALL_PROGRAM += -s
114#endif
Theodore Ts'o1893e712001-05-21 02:48:41 +0000115
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000116ifeq (${DEB_HOST_ARCH},alpha)
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400117CFLAGS += -DHAVE_NETINET_IN_H
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000118else
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400119CFLAGS += -D__NO_STRING_INLINES
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000120endif
121
Samuel Thibault3e416082007-08-14 11:25:45 +0200122ifeq (${DEB_HOST_ARCH_OS},linux)
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500123BUILD_STATIC = build-static
124E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
125else
126E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
Samuel Thibault3e416082007-08-14 11:25:45 +0200127endif
128
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400129BF_CFLAGS = -Os -fomit-frame-pointer
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000130
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400131COMMON_CONF_FLAGS = --disable-e2initrd-helper --enable-elf-shlibs \
132 --infodir=/usr/share/info
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400133ifeq ($(UTIL_LINUX_NG),yes)
134COMMON_CONF_FLAGS += --disable-fsck --disable-libblkid \
135 --disable-libuuid --disable-uuidd
136else
137COMMON_CONF_FLAGS += --enable-fsck
138endif
Theodore Ts'o79786212001-06-22 23:05:23 -0400139
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400140ifneq ($(strip $(DEB_HOST_MULTIARCH)),)
141MULTIARCH_CONF = --with-multiarch=$(DEB_HOST_MULTIARCH)
142# This doesn't work yet because gdb and lintian don't expect and/or
143# don't work with /usr/lib/<triplet>/debug
144#USRLIB = /usr/lib/$(DEB_HOST_MULTIARCH)
145USRLIB = /usr/lib
146else
147USRLIB = /usr/lib
148endif
149
150STD_CONF_FLAGS = --enable-symlink-install $(MULTIARCH_CONF)
Theodore Ts'o79786212001-06-22 23:05:23 -0400151
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400152BF_CONF_FLAGS = --disable-nls --disable-imager --disable-testio-debug \
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400153 --disable-uuidd --disable-tls --disable-debugfs
Theodore Ts'o79786212001-06-22 23:05:23 -0400154
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400155STATIC_CONF_FLAGS = --disable-nls --disable-imager \
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400156 --disable-uuidd --disable-tls
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500157
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400158MIPS_NOPIC_CONF_FLAGS = --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
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400179ifneq ($(strip $(DEB_HOST_MULTIARCH)),)
180M4_ARGS+=-DDO_MULTIARCH
181else
182M4_ARGS+=-UDO_MULTIARCH
183endif
184
185FILES_FIXUP= libcomerr2.files comerr-dev.files libss2.files ss-dev.files \
186 libuuid1.files uuid-dev.files libblkid1.files libblkid-dev.files \
187 e2fslibs.files e2fslibs-dev.files
188
Theodore Ts'oe54e7002010-06-03 11:50:42 -0400189debian-files: debian/control debian/e2fsprogs.shlibs.local
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400190ifeq ($(strip $(DEB_HOST_MULTIARCH)),)
191 for i in $(FILES_FIXUP); do \
192 sed -e 's;lib/\*/;lib/;' debian/$$i.in > debian/$$i; \
193 done
194else
195 for i in $(FILES_FIXUP); do cp debian/$$i.in debian/$$i; done
196endif
Theodore Ts'oe54e7002010-06-03 11:50:42 -0400197
198mrproper: clean
199 rm debian/control debian/e2fsprogs.shlibs.local
200
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400201debian/control: debian/control.in debian/rules
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400202 m4 $(M4_ARGS) < debian/control.in | grep -v ^REMOVE_ME$$ > $@
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400203
Theodore Ts'oe54e7002010-06-03 11:50:42 -0400204debian/e2fsprogs.shlibs.local: debian/e2fsprogs.shlibs.local.in
205 m4 $(M4_ARGS) < debian/e2fsprogs.shlibs.local.in > $@
206
Theodore Ts'o541d1732002-02-23 21:23:26 -0500207${CFGSTDSTAMP}:
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000208 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500209
Theodore Ts'o41b6ae62004-09-24 10:07:05 -0400210 # Make sure we don't try to rebuild the configure scripts
211 find . -name configure | xargs touch
212
Theodore Ts'o79786212001-06-22 23:05:23 -0400213 mkdir -p ${stdbuilddir}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000214ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500215 cd ${stdbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400216 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
217 CFLAGS="${CFLAGS}"
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000218else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500219 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400220 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400221 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
222 CFLAGS="${CFLAGS}"
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000223endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400224
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500225 # specially-built MIPS libs
226ifneq ($(ismips),)
227 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
228 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400229 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} CFLAGS="${CFLAGS}"
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500230 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400231 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS} CFLAGS="${CFLAGS}"
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500232endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400233
Theodore Ts'o541d1732002-02-23 21:23:26 -0500234 mkdir -p ${STAMPSDIR}
235 touch ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400236
Theodore Ts'o541d1732002-02-23 21:23:26 -0500237${CFGBFSTAMP}:
Theodore Ts'o79786212001-06-22 23:05:23 -0400238 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500239 rm -f config.cache
240
Theodore Ts'o79786212001-06-22 23:05:23 -0400241 mkdir -p ${bfbuilddir}
242ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500243 cd ${bfbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400244 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
245 CFLAGS="${CFLAGS} ${BF_CFLAGS}"
Theodore Ts'o79786212001-06-22 23:05:23 -0400246else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500247 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400248 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400249 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
250 CFLAGS="${CFLAGS}"
Theodore Ts'o79786212001-06-22 23:05:23 -0400251endif
Theodore Ts'o541d1732002-02-23 21:23:26 -0500252 mkdir -p ${STAMPSDIR}
253 touch ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400254
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500255${CFGSTATICSTAMP}:
256 dh_testdir
257 rm -f config.cache
258
259 mkdir -p ${staticbuilddir}
260ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'o4f2e8f12008-01-27 17:20:44 -0500261 if type diet > /dev/null 2>&1 ; then \
Theodore Ts'o3218dc92008-09-12 09:26:45 -0400262 cd ${staticbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400263 ${topdir}/configure ${STATIC_CONF_FLAGS} \
Theodore Ts'o025d1e72010-03-15 00:14:46 -0400264 --with-diet-libc CFLAGS="${CFLAGS}"; \
Theodore Ts'o3218dc92008-09-12 09:26:45 -0400265 else \
266 cd ${staticbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400267 ${topdir}/configure ${STATIC_CONF_FLAGS} \
Theodore Ts'o025d1e72010-03-15 00:14:46 -0400268 CFLAGS="${CFLAGS}"; \
Theodore Ts'o4f2e8f12008-01-27 17:20:44 -0500269 fi
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500270else
271 cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
272 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400273 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) \
Theodore Ts'o025d1e72010-03-15 00:14:46 -0400274 CFLAGS="${CFLAGS}"
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500275endif
276 mkdir -p ${STAMPSDIR}
277 touch ${CFGSTATICSTAMP}
278
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400279build-arch: build
280build-indep: build
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500281build: build-std build-bf $(BUILD_STATIC)
Theodore Ts'o79786212001-06-22 23:05:23 -0400282
Theodore Ts'o541d1732002-02-23 21:23:26 -0500283build-std: ${BUILDSTDSTAMP}
284${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400285 dh_testdir
Theodore Ts'o26d68912008-01-01 16:23:38 -0500286 $(MAKE) -C ${stdbuilddir} all
Theodore Ts'o7e8fe322008-01-27 17:43:10 -0500287 $(MAKE) -C ${stdbuilddir}/e2fsck e2fsck.static
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400288
Theodore Ts'o4534f8b2009-11-29 20:19:10 -0500289 ( cd ${stdbuilddir}/doc && $(MAKE) libext2fs_abt.html )
290 ( cd ${stdbuilddir}/lib/et && $(MAKE) com_err.info com_err_abt.html )
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400291
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500292 # specially-built MIPS libs
293ifneq ($(ismips),)
Theodore Ts'o26d68912008-01-01 16:23:38 -0500294 $(MAKE) -C ${mipsbuilddir}/util
295 $(MAKE) -C ${mipsbuilddir} \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400296 CFLAGS="${CFLAGS} ${MIPS_CFLAGS}" \
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500297 LIB_SUBDIRS="lib/et lib/ext2fs" libs
Theodore Ts'o26d68912008-01-01 16:23:38 -0500298 $(MAKE) -C ${mipsbuilddir64}/util
299 $(MAKE) -C ${mipsbuilddir64} \
Theodore Ts'o0b5b9f92009-09-06 21:28:47 -0400300 CFLAGS="${CFLAGS} ${MIPS_CFLAGS_64}" \
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500301 LIB_SUBDIRS="lib/et lib/ext2fs" libs
302endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400303
Theodore Ts'o541d1732002-02-23 21:23:26 -0500304 touch ${BUILDSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400305
Theodore Ts'o541d1732002-02-23 21:23:26 -0500306build-bf: ${BUILDBFSTAMP}
307${BUILDBFSTAMP}: ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400308 dh_testdir
Theodore Ts'o26d68912008-01-01 16:23:38 -0500309 $(MAKE) -C ${bfbuilddir} libs
310 $(MAKE) -C ${bfbuilddir}/e2fsck all
311 $(MAKE) -C ${bfbuilddir}/misc all
Theodore Ts'o541d1732002-02-23 21:23:26 -0500312 touch ${BUILDBFSTAMP}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000313
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500314build-static: ${BUILDSTATICSTAMP}
315${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
316 dh_testdir
Theodore Ts'o26d68912008-01-01 16:23:38 -0500317 $(MAKE) -C ${staticbuilddir} libs
Theodore Ts'o7e8fe322008-01-27 17:43:10 -0500318 $(MAKE) -C ${staticbuilddir}/e2fsck all e2fsck.static
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500319 touch ${BUILDSTATICSTAMP}
320
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000321clean:
322 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500323 rm -rf ${STAMPSDIR}
Theodore Ts'o26d68912008-01-01 16:23:38 -0500324 [ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} distclean
325 [ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} distclean
326 [ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} distclean
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500327 rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
Theodore Ts'o4534f8b2009-11-29 20:19:10 -0500328 rm -f debian/*.substvars
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000329 dh_clean
330
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400331install: cleanup install-std
Theodore Ts'o79786212001-06-22 23:05:23 -0400332
333# This rule allows to factorize the dh_clean between the 2 install rules
334# This must be launched before install-* (if launching them by hand, for
335# exemple) or results are unpredictable
336cleanup:
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000337 dh_testdir
338 dh_testroot
Theodore Ts'oef797132009-04-20 08:12:15 -0400339 dh_prep
Theodore Ts'o79786212001-06-22 23:05:23 -0400340
341install-std: DH_OPTIONS=
342install-std: build
343 dh_testdir
344 dh_testroot
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000345 dh_installdirs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000346
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000347 mkdir -p ${tmpdir}/sbin
Theodore Ts'o26d68912008-01-01 16:23:38 -0500348 $(MAKE) -C ${stdbuilddir} install DESTDIR=${tmpdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400349 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
350 # static libs and .h files
Theodore Ts'o26d68912008-01-01 16:23:38 -0500351 $(MAKE) -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000352
Theodore Ts'o1893e712001-05-21 02:48:41 +0000353 # statically-linked fsck
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500354 ${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400355 cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
Theodore Ts'o8f9d7082011-09-19 13:39:38 -0400356 # remove static quota library for now
357 rm ${tmpdir}/usr/include/quota/mkquota.h
358 find ${tmpdir}/usr/lib -name quota.pc -o -name libquota.a | xargs rm
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000359
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400360 dh_movefiles
Theodore Ts'o15fdc402010-05-26 11:01:06 -0400361 test -z "`find ${tmpdir} -type f`"
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400362
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500363 # specially-built MIPS libs
364ifneq ($(ismips),)
365 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
366 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
367 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
368 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
369endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400370
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400371install-udeb: DH_OPTIONS=
372install-udeb: build
Theodore Ts'o79786212001-06-22 23:05:23 -0400373 dh_testdir
374 dh_testroot
Theodore Ts'o79786212001-06-22 23:05:23 -0400375
Theodore Ts'o26d68912008-01-01 16:23:38 -0500376 $(MAKE) -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400377 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o26d68912008-01-01 16:23:38 -0500378 $(MAKE) -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400379 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o26d68912008-01-01 16:23:38 -0500380 $(MAKE) -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400381 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o26d68912008-01-01 16:23:38 -0500382 $(MAKE) -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500383 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o79786212001-06-22 23:05:23 -0400384
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400385 rm -rf ${udebdir}/usr
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400386 find ${udebdir}/sbin -type f -a ! -name e2fsck \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500387 -a ! -name mke2fs -a ! -name tune2fs \
388 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400389
390 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
Theodore Ts'o517be2d2010-05-17 19:38:31 -0400391 ln -s e2fsck fsck.ext3 ; ln -s e2fsck fsck.ext4 ; \
392 ln -s mke2fs mkfs.ext2 ; ln -s mke2fs mkfs.ext3 ; \
393 ln -s mke2fs mkfs.ext4)
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400394
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400395ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -0400396 mkdir -p ${blkidudebdir}/lib
397 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
Theodore Ts'o79786212001-06-22 23:05:23 -0400398
Theodore Ts'oe254d052003-12-07 01:57:04 -0500399 mkdir -p ${uuidudebdir}/lib
400 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400401endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500402
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000403binary-indep:
404 # no arch-independant debs.
405
406binary-arch: DH_OPTIONS= -a
Theodore Ts'odd198d62002-10-31 03:44:35 -0500407binary-arch: install install-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000408 dh_testdir
409 dh_testroot
410
Theodore Ts'o541d1732002-02-23 21:23:26 -0500411 # lintian overrides
412 for i in $$(cd debian && echo *.lintian-overrides); do \
413 pkg=$${i%.lintian-overrides} ;\
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500414 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
Theodore Ts'o541d1732002-02-23 21:23:26 -0500415 done
Theodore Ts'o79786212001-06-22 23:05:23 -0400416
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000417 # symlinks to prepare dh_installdocs run
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000418
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400419ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500420 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
421 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
422 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400423endif
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500424
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400425 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
426 mkdir -p ${debdir}/ss-dev/usr/share/doc
427 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
428
429 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
430 mkdir -p ${debdir}/comerr-dev/usr/share/doc
431 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
432
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400433ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400434 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
435 mkdir -p ${debdir}/uuid-dev/usr/share/doc
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400436# ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400437endif
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400438
439 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
440 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
441 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000442
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400443ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500444 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500445 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400446endif
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500447
Theodore Ts'oe254d052003-12-07 01:57:04 -0500448 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000449
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000450 # HTML docs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500451 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'o4534f8b2009-11-29 20:19:10 -0500452 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400453 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500454 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4534f8b2009-11-29 20:19:10 -0500455 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400456 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000457
458 # texinfo docs
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400459 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500460 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400461 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500462 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400463 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000464
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500465 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
466 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400467 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
468 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500469 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
470 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400471 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
472
Theodore Ts'o541d1732002-02-23 21:23:26 -0500473 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
Theodore Ts'o79786212001-06-22 23:05:23 -0400474 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000475
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400476 DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400477 -plibcomerr${COMERR_SOVERSION} \
478 -plibss${SS_SOVERSION} \
479 -pe2fslibs -pe2fsck-static \
480 -pe2fsprogs-dbg -pe2fslibs-dbg \
481 -plibcomerr2-dbg -plibss2-dbg
482ifneq ($(UTIL_LINUX_NG),yes)
483 DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \
Theodore Ts'o1be2ce02009-09-01 20:27:29 -0400484 -puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg \
485 -plibblkid${BLKID_SOVERSION} -plibblkid1-dbg
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400486endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000487
Theodore Ts'oa3f464f2007-07-04 14:51:18 -0400488 dh_fixperms
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500489ifneq ($(ismips),)
Theodore Ts'o30f142e2008-07-15 11:38:33 -0400490 dh_strip -k -Xlib64ext2fs-nopic.a
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500491else
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400492 dh_strip -k
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500493endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000494
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400495 # debug package stuff
496 rm -rf ${udebdir}/usr
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400497ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400498 rm -rf ${blkidudebdir}/usr
499 rm -rf ${uuidudebdir}/usr
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400500endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400501
Theodore Ts'o20d79492011-09-25 15:40:24 -0400502ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400503 mkdir -p ${debugdir}/$(USRLIB)
504 mv ${maindir}/usr/lib/debug ${debugdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400505 rm -rf ${maindir}/usr/lib/debug
506 mv ${e2fsckstaticdir}/usr/lib/debug/sbin/* \
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400507 ${debugdir}/$(USRLIB)/debug
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400508 rm -rf ${e2fsckstaticdir}/usr/lib
509
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400510ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400511 mkdir -p ${uuidruntimedbgdir}/$(USRLIB)
512 mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400513 rmdir ${uuidruntimedir}/usr/lib
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400514endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400515
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400516 mkdir -p ${libext2dbgdir}/$(USRLIB)
517 mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400518 rmdir ${libext2dir}/usr/lib
519
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400520 mkdir -p ${libcomerrdbgdir}/$(USRLIB)
521 mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400522 rmdir ${libcomerrdir}/usr/lib
523
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400524 mkdir -p ${libssdbgdir}/$(USRLIB)
525 mv ${libssdir}/usr/lib/debug ${libssdbgdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400526 rmdir ${libssdir}/usr/lib
527
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400528ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400529 mkdir -p ${libuuiddbgdir}/$(USRLIB)
530 mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400531 rmdir ${libuuiddir}/usr/lib
532
Theodore Ts'o55e00a22011-09-18 23:53:23 -0400533 mkdir -p ${libblkiddbgdir}/$(USRLIB)
534 mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/$(USRLIB)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400535 rmdir ${libblkiddir}/usr/lib
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400536endif
Theodore Ts'o20d79492011-09-25 15:40:24 -0400537endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400538
Theodore Ts'o649bd282008-08-25 00:00:35 -0400539 # dpkg symbol handling
540ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400541SYMBOL_LIBS := e2fslibs libcomerr2 libss2
542ifneq ($(UTIL_LINUX_NG),yes)
543SYMBOL_LIBS += libblkid1 libuuid1
544endif
545 for i in $(SYMBOL_LIBS); \
Theodore Ts'o649bd282008-08-25 00:00:35 -0400546 do \
547 echo "Generating symbols for $$i..."; \
548 dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
549 cat debian/$$i.tmp-patch; \
550 patch debian/$$i.symbols < debian/$$i.tmp-patch; \
551 /bin/rm debian/$$i.tmp-patch; \
552 done
553endif
554
Theodore Ts'o3c643f82011-09-25 01:20:41 -0400555 for i in e2fsprogs e2fsprogs-dbg e2fslibs e2fslibs-dbg; do \
556 $(INSTALL) -p -m 0644 debian/copyright \
557 ${debdir}/$$i/usr/share/doc/$$i/copyright; \
558 done
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400559
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400560ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400561 $(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \
562 ${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400563endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400564
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400565 $(INSTALL) -p -m 0644 debian/libcomerr2.copyright \
566 ${libcomerrdbgdir}/usr/share/doc/libcomerr2-dbg/copyright
567
568 $(INSTALL) -p -m 0644 debian/libss2.copyright \
569 ${libssdbgdir}/usr/share/doc/libss2-dbg/copyright
570
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400571ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400572 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
573 ${libblkiddbgdir}/usr/share/doc/libblkid1-dbg/copyright
574
575 $(INSTALL) -p -m 0644 debian/libuuid1.copyright \
576 ${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400577endif
Theodore Ts'ofbcb3a82008-07-07 09:43:26 -0400578
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000579 dh_compress
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000580
Theodore Ts'oe254d052003-12-07 01:57:04 -0500581 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400582 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
583 -V 'libcomerr2 (>= 1.33-3)'
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400584ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'oa1788522007-03-04 08:17:18 -0500585 dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
Theodore Ts'o7512f132006-03-29 19:03:38 -0500586 echo "udeb: libblkid 1 libblkid1-udeb" >> \
587 debian/libblkid1/DEBIAN/shlibs
588 echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400589endif
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500590
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000591 dh_installdeb
Theodore Ts'o79786212001-06-22 23:05:23 -0400592 dh_shlibdeps -l${stdbuilddir}/lib
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400593 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
594 -u"-Ldebian/e2fsprogs.shlibs.local"
Theodore Ts'o7a15db22003-07-29 22:15:33 -0400595 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
596 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000597
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400598 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
Theodore Ts'oe254d052003-12-07 01:57:04 -0500599 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000600 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
Theodore Ts'od8a1a672008-01-30 07:20:54 -0500601 -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000602 DH_OPTIONS= dh_gencontrol -pss-dev \
Theodore Ts'od8a1a672008-01-30 07:20:54 -0500603 -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400604ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000605 DH_OPTIONS= dh_gencontrol -puuid-dev \
Theodore Ts'od8a1a672008-01-30 07:20:54 -0500606 -u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400607endif
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400608 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400609ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400610 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
611 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400612endif
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000613
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400614 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400615ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'obf5498c2008-09-04 22:49:15 -0400616 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
617 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400618endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500619 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
620 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'odd198d62002-10-31 03:44:35 -0500621 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400622ifneq ($(UTIL_LINUX_NG),yes)
Theodore Ts'o417781a2003-04-10 00:18:56 -0400623 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
Theodore Ts'oe254d052003-12-07 01:57:04 -0500624 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
Theodore Ts'o95f65c32009-07-18 22:14:58 -0400625endif
Theodore Ts'oe254d052003-12-07 01:57:04 -0500626
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000627binary: binary-indep binary-arch
628
Theodore Ts'oe54e7002010-06-03 11:50:42 -0400629.PHONY: binary binary-arch binary-indep clean checkroot mrproper debian-files