blob: 11db3450926152e1081a8220e096068efa21aea7 [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'of85cc2a2003-07-26 00:48:08 -040013# These are used for cross-compiling and for saving the configure script
14# from having to guess our platform (since we know it already)
15DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
16DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
Samuel Thibault3e416082007-08-14 11:25:45 +020017DEB_HOST_OS ?= $(shell dpkg-architecture -qDEB_HOST_OS)
Theodore Ts'of85cc2a2003-07-26 00:48:08 -040018DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000020
21# find the version for the main package, from changelog file
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040022MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
Theodore Ts'oe5b16432002-08-17 21:11:29 -040023# find versions for libraries going into their own packages, from their Makefile.in's,
24# and sonames for all libs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000025COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040026COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000027SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040028SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000029UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040030UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'o6fe7d112003-03-16 19:58:25 -050031BLKID_VERSION = $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
32BLKID_SOVERSION = $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040033EXT2FS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
34E2P_SOVERSION = $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000035
36package=e2fsprogs
37
38topdir=$(shell pwd)
39debdir=${topdir}/debian
Theodore Ts'ob90b8262001-06-15 22:54:34 +000040tmpdir=${debdir}/tmp
Theodore Ts'odd198d62002-10-31 03:44:35 -050041udebdir=${debdir}/e2fsprogs-udeb
Theodore Ts'o417781a2003-04-10 00:18:56 -040042blkidudebdir=${debdir}/libblkid1-udeb
Theodore Ts'oe254d052003-12-07 01:57:04 -050043uuidudebdir=${debdir}/libuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +000044maindir=${debdir}/e2fsprogs
Theodore Ts'o79786212001-06-22 23:05:23 -040045stdbuilddir=${debdir}/BUILD-STD
46bfbuilddir=${debdir}/BUILD-BF
Theodore Ts'oa827a2a2007-12-31 17:17:39 -050047staticbuilddir=${debdir}/BUILD-STATIC
Theodore Ts'oe5b16432002-08-17 21:11:29 -040048mipsbuilddir=${debdir}/BUILD-MIPS
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050049mipsbuilddir64=${debdir}/BUILD-MIPS-64
Theodore Ts'ob90b8262001-06-15 22:54:34 +000050# docdir=${maindir}/usr/share/doc/${package}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000051MANDIR=/usr/share/man
Theodore Ts'ob90b8262001-06-15 22:54:34 +000052mandir=${tmpdir}${MANDIR}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000053
Theodore Ts'odd198d62002-10-31 03:44:35 -050054UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
55UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
56
Theodore Ts'o417781a2003-04-10 00:18:56 -040057BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
58BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
59
Theodore Ts'oe254d052003-12-07 01:57:04 -050060UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
61UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
62
Theodore Ts'o541d1732002-02-23 21:23:26 -050063STAMPSDIR=debian/stampdir
64CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
65CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
Theodore Ts'oa827a2a2007-12-31 17:17:39 -050066CFGSTATICSTAMP=${STAMPSDIR}/configure-static-stamp
Theodore Ts'o541d1732002-02-23 21:23:26 -050067BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
68BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
Theodore Ts'oa827a2a2007-12-31 17:17:39 -050069BUILDSTATICSTAMP=${STAMPSDIR}/build-static-stamp
Theodore Ts'o541d1732002-02-23 21:23:26 -050070
Theodore Ts'of77704e2006-11-11 22:32:35 -050071CCOPTS = -g
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000072
Theodore Ts'o1893e712001-05-21 02:48:41 +000073INSTALL = install
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050074INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
Theodore Ts'o1893e712001-05-21 02:48:41 +000075
Theodore Ts'o1d658a12003-08-21 01:53:07 -040076ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
77CCOPTS += -O2
Theodore Ts'o1893e712001-05-21 02:48:41 +000078endif
79ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
80INSTALL_PROGRAM += -s
81endif
82
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000083ifeq (${DEB_HOST_ARCH},alpha)
84CCOPTS += -DHAVE_NETINET_IN_H
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000085else
86CCOPTS += -D__NO_STRING_INLINES
87endif
88
Samuel Thibault3e416082007-08-14 11:25:45 +020089ifeq (${DEB_HOST_ARCH_OS},linux)
90DEVMAPPER = --enable-blkid-devmapper
Theodore Ts'oa827a2a2007-12-31 17:17:39 -050091BUILD_STATIC = build-static
92E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
93else
94E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
Samuel Thibault3e416082007-08-14 11:25:45 +020095endif
96
Theodore Ts'o79786212001-06-22 23:05:23 -040097BF_CCOPTS = -Os -fomit-frame-pointer
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000098
Theodore Ts'o79786212001-06-22 23:05:23 -040099COMMON_CONF_FLAGS = \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -0500100 --enable-elf-shlibs --enable-dynamic-e2fsck \
Theodore Ts'o35b73e92004-09-19 07:52:05 -0400101 --infodir=/usr/share/info --enable-fsck
Theodore Ts'o79786212001-06-22 23:05:23 -0400102
Theodore Ts'od2d0d792006-03-08 17:42:40 -0500103STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression \
Samuel Thibault3e416082007-08-14 11:25:45 +0200104 ${DEVMAPPER}
Theodore Ts'o79786212001-06-22 23:05:23 -0400105
106BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400107 --disable-nls --disable-swapfs --disable-imager \
Theodore Ts'o61a679d2007-12-31 11:20:01 -0500108 --disable-uuidd --disable-tls \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500109 --disable-debugfs --disable-e2initrd-helper
Theodore Ts'o79786212001-06-22 23:05:23 -0400110
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500111STATIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
112 --disable-nls --disable-imager \
113 --disable-uuidd --disable-tls \
114 --disable-e2initrd-helper \
115 --with-diet-libc --with-ccopts=-fno-stack-protector
116
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400117MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
118 --disable-nls \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400119 --disable-swapfs --disable-imager \
Theodore Ts'o61a679d2007-12-31 11:20:01 -0500120 --disable-uuidd --disable-tls \
Theodore Ts'odd198d62002-10-31 03:44:35 -0500121 --disable-resizer # --disable-debugfs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500122
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400123# we can't use those flags at configure time
124MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500125MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400126
127ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
128ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
129ismips=ismips
130endif
131endif
132
Theodore Ts'o541d1732002-02-23 21:23:26 -0500133${CFGSTDSTAMP}:
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000134 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500135
Theodore Ts'o41b6ae62004-09-24 10:07:05 -0400136 # Make sure we don't try to rebuild the configure scripts
137 find . -name configure | xargs touch
138
Theodore Ts'o79786212001-06-22 23:05:23 -0400139 mkdir -p ${stdbuilddir}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000140ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500141 cd ${stdbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400142 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000143else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500144 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400145 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
Theodore Ts'oa6ea47a2007-12-15 20:34:41 -0500146 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000147endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400148
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500149 # specially-built MIPS libs
150ifneq ($(ismips),)
151 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
152 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
153 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
154 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
155 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
156endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400157
Theodore Ts'o541d1732002-02-23 21:23:26 -0500158 mkdir -p ${STAMPSDIR}
159 touch ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400160
Theodore Ts'o541d1732002-02-23 21:23:26 -0500161${CFGBFSTAMP}:
Theodore Ts'o79786212001-06-22 23:05:23 -0400162 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500163 rm -f config.cache
164
Theodore Ts'o79786212001-06-22 23:05:23 -0400165 mkdir -p ${bfbuilddir}
166ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500167 cd ${bfbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400168 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS}
169else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500170 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400171 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
Theodore Ts'oa6ea47a2007-12-15 20:34:41 -0500172 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
Theodore Ts'o79786212001-06-22 23:05:23 -0400173endif
Theodore Ts'o541d1732002-02-23 21:23:26 -0500174 mkdir -p ${STAMPSDIR}
175 touch ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400176
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500177${CFGSTATICSTAMP}:
178 dh_testdir
179 rm -f config.cache
180
181 mkdir -p ${staticbuilddir}
182ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
183 cd ${staticbuilddir} && AWK=/usr/bin/awk \
184 ${topdir}/configure ${STATIC_CONF_FLAGS}
185else
186 cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
187 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
188 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
189endif
190 mkdir -p ${STAMPSDIR}
191 touch ${CFGSTATICSTAMP}
192
193build: build-std build-bf $(BUILD_STATIC)
Theodore Ts'o79786212001-06-22 23:05:23 -0400194
Theodore Ts'o541d1732002-02-23 21:23:26 -0500195build-std: ${BUILDSTDSTAMP}
196${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400197 dh_testdir
198 make -C ${stdbuilddir} all
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400199
Theodore Ts'o79786212001-06-22 23:05:23 -0400200 ( cd ${stdbuilddir}/doc && \
201 texi2html -split_chapter ${topdir}/doc/libext2fs.texinfo )
202 ( cd ${stdbuilddir}/lib/et && make com_err.info && \
203 texi2html -split_chapter -expandinfo ${topdir}/lib/et/com_err.texinfo )
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400204
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500205 # specially-built MIPS libs
206ifneq ($(ismips),)
207 make -C ${mipsbuilddir}/util
208 make -C ${mipsbuilddir} \
209 CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \
210 LIB_SUBDIRS="lib/et lib/ext2fs" libs
211 make -C ${mipsbuilddir64}/util
212 make -C ${mipsbuilddir64} \
213 CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \
214 LIB_SUBDIRS="lib/et lib/ext2fs" libs
215endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400216
Theodore Ts'o541d1732002-02-23 21:23:26 -0500217 touch ${BUILDSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400218
Theodore Ts'o541d1732002-02-23 21:23:26 -0500219build-bf: ${BUILDBFSTAMP}
220${BUILDBFSTAMP}: ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400221 dh_testdir
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400222 make -C ${bfbuilddir} libs
223 make -C ${bfbuilddir}/e2fsck all
224 make -C ${bfbuilddir}/misc all
Theodore Ts'o541d1732002-02-23 21:23:26 -0500225 touch ${BUILDBFSTAMP}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000226
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500227build-static: ${BUILDSTATICSTAMP}
228${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
229 dh_testdir
230 make -C ${staticbuilddir} libs
231 make -C ${staticbuilddir}/e2fsck all
232 touch ${BUILDSTATICSTAMP}
233
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000234clean:
235 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500236 rm -rf ${STAMPSDIR}
Theodore Ts'oa648ea62007-07-08 21:36:12 -0400237 [ ! -f ${stdbuilddir}/Makefile ] || make -C ${stdbuilddir} distclean
238 [ ! -f ${bfbuilddir}/Makefile ] || make -C ${bfbuilddir} distclean
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500239 [ ! -f ${staticbuilddir}/Makefile ] || make -C ${staticbuilddir} distclean
240 rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
Theodore Ts'o8c5829f2005-07-21 19:32:36 -0500241 rm -f doc/libext2fs/*.html lib/et/com_err/*.html debian/*.substvars
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000242 dh_clean
243
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400244install: cleanup install-std
Theodore Ts'o79786212001-06-22 23:05:23 -0400245
246# This rule allows to factorize the dh_clean between the 2 install rules
247# This must be launched before install-* (if launching them by hand, for
248# exemple) or results are unpredictable
249cleanup:
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000250 dh_testdir
251 dh_testroot
252 dh_clean -k
Theodore Ts'o79786212001-06-22 23:05:23 -0400253
254install-std: DH_OPTIONS=
255install-std: build
256 dh_testdir
257 dh_testroot
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000258 dh_installdirs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000259
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000260 mkdir -p ${tmpdir}/sbin
Theodore Ts'o79786212001-06-22 23:05:23 -0400261 make -C ${stdbuilddir} install DESTDIR=${tmpdir} \
262 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
263 # static libs and .h files
264 make -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000265
Theodore Ts'o1893e712001-05-21 02:48:41 +0000266 # statically-linked fsck
Theodore Ts'oa827a2a2007-12-31 17:17:39 -0500267 ${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400268 cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000269
Theodore Ts'o020c5472003-04-10 00:01:19 -0400270 ln -s et/com_err.h ${tmpdir}/usr/include
271
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400272 dh_movefiles
273 test -z `find ${tmpdir} -type f`
274
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500275 # specially-built MIPS libs
276ifneq ($(ismips),)
277 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
278 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
279 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
280 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
281endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400282
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400283install-udeb: DH_OPTIONS=
284install-udeb: build
Theodore Ts'o79786212001-06-22 23:05:23 -0400285 dh_testdir
286 dh_testroot
Theodore Ts'o79786212001-06-22 23:05:23 -0400287
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400288 make -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400289 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400290 make -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
291 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
292 make -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
293 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500294 make -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
295 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o79786212001-06-22 23:05:23 -0400296
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400297 rm -rf ${udebdir}/usr
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400298 find ${udebdir}/sbin -type f -a ! -name e2fsck \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500299 -a ! -name mke2fs -a ! -name tune2fs \
300 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400301
302 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
303 ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
304 ln -s mke2fs mkfs.ext3)
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400305
Theodore Ts'o417781a2003-04-10 00:18:56 -0400306 mkdir -p ${blkidudebdir}/lib
307 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
Theodore Ts'o79786212001-06-22 23:05:23 -0400308
Theodore Ts'oe254d052003-12-07 01:57:04 -0500309 mkdir -p ${uuidudebdir}/lib
310 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
311
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000312binary-indep:
313 # no arch-independant debs.
314
315binary-arch: DH_OPTIONS= -a
Theodore Ts'odd198d62002-10-31 03:44:35 -0500316binary-arch: install install-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000317 dh_testdir
318 dh_testroot
319
Theodore Ts'o541d1732002-02-23 21:23:26 -0500320 # lintian overrides
321 for i in $$(cd debian && echo *.lintian-overrides); do \
322 pkg=$${i%.lintian-overrides} ;\
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500323 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
Theodore Ts'o541d1732002-02-23 21:23:26 -0500324 done
Theodore Ts'o79786212001-06-22 23:05:23 -0400325
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400326 # mkinitrd script
Theodore Ts'o1d658a12003-08-21 01:53:07 -0400327 mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500328 $(INSTALL) -p -o root -g root -m 0755 debian/initrd-tools.e2fsprogs \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400329 debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
330
331 # initrd script
332 mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500333 $(INSTALL) -p -o root -g root -m 0755 debian/initrd.ext3-add-journal \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400334 debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
335
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400336
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000337 # symlinks to prepare dh_installdocs run
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000338
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500339 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
340 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
341 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
342
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400343 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
344 mkdir -p ${debdir}/ss-dev/usr/share/doc
345 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
346
347 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
348 mkdir -p ${debdir}/comerr-dev/usr/share/doc
349 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
350
351 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
352 mkdir -p ${debdir}/uuid-dev/usr/share/doc
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400353# ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400354
355 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
356 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
357 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000358
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500359 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500360 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
361
Theodore Ts'oe254d052003-12-07 01:57:04 -0500362 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000363
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000364 # HTML docs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500365 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
366 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/libext2fs/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400367 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500368 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
369 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/com_err/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400370 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000371
372 # texinfo docs
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400373 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500374 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400375 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500376 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400377 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000378
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500379 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
380 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400381 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
382 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500383 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
384 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400385 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
386
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500387 $(INSTALL) -d ${debdir}/uuid-dev/usr/share/doc/libuuid${UUID_SOVERSION}
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000388
Theodore Ts'o60702c22007-09-22 20:42:04 -0400389 if test -f /etc/lsb-release && \
390 grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
391 $(INSTALL) -p -m 0644 e2fsck/e2fsck.conf.ubuntu \
392 ${debdir}/e2fsprogs/etc/e2fsck.conf; \
393 fi
394
Theodore Ts'o541d1732002-02-23 21:23:26 -0500395 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
Theodore Ts'o79786212001-06-22 23:05:23 -0400396 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000397
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400398 DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
399 -plibblkid${BLKID_SOVERSION} -plibcomerr${COMERR_SOVERSION} \
400 -plibss${SS_SOVERSION} -plibuuid${UUID_SOVERSION} \
Theodore Ts'o740837d2007-12-16 17:21:38 -0500401 -pe2fslibs -puuid-dev -puuid-runtime -pe2fsck-static
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000402
Theodore Ts'oa3f464f2007-07-04 14:51:18 -0400403 dh_fixperms
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500404ifneq ($(ismips),)
405 dh_strip -Xlib64ext2fs-nopic.a
406else
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000407 dh_strip
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500408endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000409
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000410 dh_compress
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000411
Theodore Ts'oe254d052003-12-07 01:57:04 -0500412 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400413 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
414 -V 'libcomerr2 (>= 1.33-3)'
Theodore Ts'oa1788522007-03-04 08:17:18 -0500415 dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
Theodore Ts'o7512f132006-03-29 19:03:38 -0500416 echo "udeb: libblkid 1 libblkid1-udeb" >> \
417 debian/libblkid1/DEBIAN/shlibs
418 echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500419
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000420 dh_installdeb
Theodore Ts'oa0010282006-03-30 01:03:17 -0500421 rm debian/e2fsprogs-udeb/DEBIAN/conffiles
Theodore Ts'o79786212001-06-22 23:05:23 -0400422 dh_shlibdeps -l${stdbuilddir}/lib
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400423 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
424 -u"-Ldebian/e2fsprogs.shlibs.local"
Theodore Ts'o7a15db22003-07-29 22:15:33 -0400425 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
426 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000427
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400428 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
Theodore Ts'oe254d052003-12-07 01:57:04 -0500429 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000430 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
431 -u '-v${COMERR_VERSION}-${MAIN_VERSION}'
432 DH_OPTIONS= dh_gencontrol -pss-dev \
433 -u '-v${SS_VERSION}-${MAIN_VERSION}'
434 DH_OPTIONS= dh_gencontrol -puuid-dev \
435 -u '-v${UUID_VERSION}-${MAIN_VERSION}'
436
Theodore Ts'oe254d052003-12-07 01:57:04 -0500437 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
438 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'odd198d62002-10-31 03:44:35 -0500439
440 # udeb stuff
441 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
442 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
443 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000444
Theodore Ts'o417781a2003-04-10 00:18:56 -0400445 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
446 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
447 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
448
Theodore Ts'oe254d052003-12-07 01:57:04 -0500449 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
450 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
451 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
452
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000453binary: binary-indep binary-arch
454
455.PHONY: binary binary-arch binary-indep clean checkroot