blob: d7576628ce80f0bd676b37367242f843de88a284 [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'oe5b16432002-08-17 21:11:29 -040047mipsbuilddir=${debdir}/BUILD-MIPS
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050048mipsbuilddir64=${debdir}/BUILD-MIPS-64
Theodore Ts'ob90b8262001-06-15 22:54:34 +000049# docdir=${maindir}/usr/share/doc/${package}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000050MANDIR=/usr/share/man
Theodore Ts'ob90b8262001-06-15 22:54:34 +000051mandir=${tmpdir}${MANDIR}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000052
Theodore Ts'odd198d62002-10-31 03:44:35 -050053UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
54UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
55
Theodore Ts'o417781a2003-04-10 00:18:56 -040056BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
57BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
58
Theodore Ts'oe254d052003-12-07 01:57:04 -050059UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
60UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
61
Theodore Ts'o541d1732002-02-23 21:23:26 -050062STAMPSDIR=debian/stampdir
63CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
64CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
65BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
66BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
67
Theodore Ts'of77704e2006-11-11 22:32:35 -050068CCOPTS = -g
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000069
Theodore Ts'o1893e712001-05-21 02:48:41 +000070INSTALL = install
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050071INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
Theodore Ts'o1893e712001-05-21 02:48:41 +000072
Theodore Ts'o1d658a12003-08-21 01:53:07 -040073ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
74CCOPTS += -O2
Theodore Ts'o1893e712001-05-21 02:48:41 +000075endif
76ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
77INSTALL_PROGRAM += -s
78endif
79
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000080ifeq (${DEB_HOST_ARCH},alpha)
81CCOPTS += -DHAVE_NETINET_IN_H
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000082else
83CCOPTS += -D__NO_STRING_INLINES
84endif
85
Samuel Thibault3e416082007-08-14 11:25:45 +020086ifeq (${DEB_HOST_ARCH_OS},linux)
87DEVMAPPER = --enable-blkid-devmapper
88endif
89
Theodore Ts'o79786212001-06-22 23:05:23 -040090BF_CCOPTS = -Os -fomit-frame-pointer
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000091
Theodore Ts'o79786212001-06-22 23:05:23 -040092COMMON_CONF_FLAGS = \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -050093 --enable-elf-shlibs --enable-dynamic-e2fsck \
Theodore Ts'o35b73e92004-09-19 07:52:05 -040094 --infodir=/usr/share/info --enable-fsck
Theodore Ts'o79786212001-06-22 23:05:23 -040095
Theodore Ts'od2d0d792006-03-08 17:42:40 -050096STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression \
Samuel Thibault3e416082007-08-14 11:25:45 +020097 ${DEVMAPPER}
Theodore Ts'o79786212001-06-22 23:05:23 -040098
99BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400100 --disable-nls --disable-swapfs --disable-imager \
Theodore Ts'o61a679d2007-12-31 11:20:01 -0500101 --disable-uuidd --disable-tls \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500102 --disable-debugfs --disable-e2initrd-helper
Theodore Ts'o79786212001-06-22 23:05:23 -0400103
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400104MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
105 --disable-nls \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400106 --disable-swapfs --disable-imager \
Theodore Ts'o61a679d2007-12-31 11:20:01 -0500107 --disable-uuidd --disable-tls \
Theodore Ts'odd198d62002-10-31 03:44:35 -0500108 --disable-resizer # --disable-debugfs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500109
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400110# we can't use those flags at configure time
111MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500112MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400113
114ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
115ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
116ismips=ismips
117endif
118endif
119
Theodore Ts'o541d1732002-02-23 21:23:26 -0500120${CFGSTDSTAMP}:
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000121 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500122
Theodore Ts'o41b6ae62004-09-24 10:07:05 -0400123 # Make sure we don't try to rebuild the configure scripts
124 find . -name configure | xargs touch
125
Theodore Ts'o79786212001-06-22 23:05:23 -0400126 mkdir -p ${stdbuilddir}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000127ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500128 cd ${stdbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400129 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000130else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500131 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400132 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
Theodore Ts'oa6ea47a2007-12-15 20:34:41 -0500133 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000134endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400135
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500136 # specially-built MIPS libs
137ifneq ($(ismips),)
138 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
139 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
140 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
141 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
142 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
143endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400144
Theodore Ts'o541d1732002-02-23 21:23:26 -0500145 mkdir -p ${STAMPSDIR}
146 touch ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400147
Theodore Ts'o541d1732002-02-23 21:23:26 -0500148${CFGBFSTAMP}:
Theodore Ts'o79786212001-06-22 23:05:23 -0400149 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500150 rm -f config.cache
151
Theodore Ts'o79786212001-06-22 23:05:23 -0400152 mkdir -p ${bfbuilddir}
153ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500154 cd ${bfbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400155 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS}
156else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500157 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400158 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
Theodore Ts'oa6ea47a2007-12-15 20:34:41 -0500159 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
Theodore Ts'o79786212001-06-22 23:05:23 -0400160endif
Theodore Ts'o541d1732002-02-23 21:23:26 -0500161 mkdir -p ${STAMPSDIR}
162 touch ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400163
164build: build-std build-bf
165
Theodore Ts'o541d1732002-02-23 21:23:26 -0500166build-std: ${BUILDSTDSTAMP}
167${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400168 dh_testdir
169 make -C ${stdbuilddir} all
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400170
Theodore Ts'o79786212001-06-22 23:05:23 -0400171 ( cd ${stdbuilddir}/doc && \
172 texi2html -split_chapter ${topdir}/doc/libext2fs.texinfo )
173 ( cd ${stdbuilddir}/lib/et && make com_err.info && \
174 texi2html -split_chapter -expandinfo ${topdir}/lib/et/com_err.texinfo )
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400175
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500176 # specially-built MIPS libs
177ifneq ($(ismips),)
178 make -C ${mipsbuilddir}/util
179 make -C ${mipsbuilddir} \
180 CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \
181 LIB_SUBDIRS="lib/et lib/ext2fs" libs
182 make -C ${mipsbuilddir64}/util
183 make -C ${mipsbuilddir64} \
184 CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \
185 LIB_SUBDIRS="lib/et lib/ext2fs" libs
186endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400187
Theodore Ts'o541d1732002-02-23 21:23:26 -0500188 touch ${BUILDSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400189
Theodore Ts'o541d1732002-02-23 21:23:26 -0500190build-bf: ${BUILDBFSTAMP}
191${BUILDBFSTAMP}: ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400192 dh_testdir
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400193 make -C ${bfbuilddir} libs
194 make -C ${bfbuilddir}/e2fsck all
195 make -C ${bfbuilddir}/misc all
Theodore Ts'o541d1732002-02-23 21:23:26 -0500196 touch ${BUILDBFSTAMP}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000197
198clean:
199 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500200 rm -rf ${STAMPSDIR}
Theodore Ts'oa648ea62007-07-08 21:36:12 -0400201 [ ! -f ${stdbuilddir}/Makefile ] || make -C ${stdbuilddir} distclean
202 [ ! -f ${bfbuilddir}/Makefile ] || make -C ${bfbuilddir} distclean
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500203 rm -rf ${stdbuilddir} ${bfbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
Theodore Ts'o8c5829f2005-07-21 19:32:36 -0500204 rm -f doc/libext2fs/*.html lib/et/com_err/*.html debian/*.substvars
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000205 dh_clean
206
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400207install: cleanup install-std
Theodore Ts'o79786212001-06-22 23:05:23 -0400208
209# This rule allows to factorize the dh_clean between the 2 install rules
210# This must be launched before install-* (if launching them by hand, for
211# exemple) or results are unpredictable
212cleanup:
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000213 dh_testdir
214 dh_testroot
215 dh_clean -k
Theodore Ts'o79786212001-06-22 23:05:23 -0400216
217install-std: DH_OPTIONS=
218install-std: build
219 dh_testdir
220 dh_testroot
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000221 dh_installdirs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000222
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000223 mkdir -p ${tmpdir}/sbin
Theodore Ts'o79786212001-06-22 23:05:23 -0400224 make -C ${stdbuilddir} install DESTDIR=${tmpdir} \
225 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
226 # static libs and .h files
227 make -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000228
Theodore Ts'o1893e712001-05-21 02:48:41 +0000229 # statically-linked fsck
Theodore Ts'o79786212001-06-22 23:05:23 -0400230 ${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400231 cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000232
Theodore Ts'o020c5472003-04-10 00:01:19 -0400233 ln -s et/com_err.h ${tmpdir}/usr/include
234
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400235 dh_movefiles
236 test -z `find ${tmpdir} -type f`
237
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500238 # specially-built MIPS libs
239ifneq ($(ismips),)
240 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
241 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
242 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
243 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
244endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400245
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400246install-udeb: DH_OPTIONS=
247install-udeb: build
Theodore Ts'o79786212001-06-22 23:05:23 -0400248 dh_testdir
249 dh_testroot
Theodore Ts'o79786212001-06-22 23:05:23 -0400250
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400251 make -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400252 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400253 make -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
254 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
255 make -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
256 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500257 make -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
258 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o79786212001-06-22 23:05:23 -0400259
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400260 rm -rf ${udebdir}/usr
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400261 find ${udebdir}/sbin -type f -a ! -name e2fsck \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500262 -a ! -name mke2fs -a ! -name tune2fs \
263 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400264
265 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
266 ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
267 ln -s mke2fs mkfs.ext3)
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400268
Theodore Ts'o417781a2003-04-10 00:18:56 -0400269 mkdir -p ${blkidudebdir}/lib
270 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
Theodore Ts'o79786212001-06-22 23:05:23 -0400271
Theodore Ts'oe254d052003-12-07 01:57:04 -0500272 mkdir -p ${uuidudebdir}/lib
273 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
274
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000275binary-indep:
276 # no arch-independant debs.
277
278binary-arch: DH_OPTIONS= -a
Theodore Ts'odd198d62002-10-31 03:44:35 -0500279binary-arch: install install-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000280 dh_testdir
281 dh_testroot
282
Theodore Ts'o541d1732002-02-23 21:23:26 -0500283 # lintian overrides
284 for i in $$(cd debian && echo *.lintian-overrides); do \
285 pkg=$${i%.lintian-overrides} ;\
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500286 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
Theodore Ts'o541d1732002-02-23 21:23:26 -0500287 done
Theodore Ts'o79786212001-06-22 23:05:23 -0400288
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400289 # mkinitrd script
Theodore Ts'o1d658a12003-08-21 01:53:07 -0400290 mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500291 $(INSTALL) -p -o root -g root -m 0755 debian/initrd-tools.e2fsprogs \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400292 debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
293
294 # initrd script
295 mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500296 $(INSTALL) -p -o root -g root -m 0755 debian/initrd.ext3-add-journal \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400297 debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
298
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400299
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000300 # symlinks to prepare dh_installdocs run
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000301
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500302 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
303 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
304 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
305
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400306 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
307 mkdir -p ${debdir}/ss-dev/usr/share/doc
308 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
309
310 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
311 mkdir -p ${debdir}/comerr-dev/usr/share/doc
312 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
313
314 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
315 mkdir -p ${debdir}/uuid-dev/usr/share/doc
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400316# ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400317
318 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
319 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
320 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000321
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500322 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500323 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
324
Theodore Ts'oe254d052003-12-07 01:57:04 -0500325 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000326
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000327 # HTML docs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500328 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
329 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/libext2fs/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400330 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500331 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
332 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/com_err/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400333 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000334
335 # texinfo docs
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400336 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500337 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400338 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500339 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400340 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000341
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500342 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
343 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400344 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
345 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500346 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
347 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400348 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
349
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500350 $(INSTALL) -d ${debdir}/uuid-dev/usr/share/doc/libuuid${UUID_SOVERSION}
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000351
Theodore Ts'o60702c22007-09-22 20:42:04 -0400352 if test -f /etc/lsb-release && \
353 grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
354 $(INSTALL) -p -m 0644 e2fsck/e2fsck.conf.ubuntu \
355 ${debdir}/e2fsprogs/etc/e2fsck.conf; \
356 fi
357
Theodore Ts'o541d1732002-02-23 21:23:26 -0500358 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
Theodore Ts'o79786212001-06-22 23:05:23 -0400359 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000360
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400361 DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
362 -plibblkid${BLKID_SOVERSION} -plibcomerr${COMERR_SOVERSION} \
363 -plibss${SS_SOVERSION} -plibuuid${UUID_SOVERSION} \
Theodore Ts'o740837d2007-12-16 17:21:38 -0500364 -pe2fslibs -puuid-dev -puuid-runtime -pe2fsck-static
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000365
Theodore Ts'oa3f464f2007-07-04 14:51:18 -0400366 dh_fixperms
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500367ifneq ($(ismips),)
368 dh_strip -Xlib64ext2fs-nopic.a
369else
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000370 dh_strip
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500371endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000372
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000373 dh_compress
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000374
Theodore Ts'oe254d052003-12-07 01:57:04 -0500375 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400376 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
377 -V 'libcomerr2 (>= 1.33-3)'
Theodore Ts'oa1788522007-03-04 08:17:18 -0500378 dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
Theodore Ts'o7512f132006-03-29 19:03:38 -0500379 echo "udeb: libblkid 1 libblkid1-udeb" >> \
380 debian/libblkid1/DEBIAN/shlibs
381 echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500382
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000383 dh_installdeb
Theodore Ts'oa0010282006-03-30 01:03:17 -0500384 rm debian/e2fsprogs-udeb/DEBIAN/conffiles
Theodore Ts'o79786212001-06-22 23:05:23 -0400385 dh_shlibdeps -l${stdbuilddir}/lib
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400386 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
387 -u"-Ldebian/e2fsprogs.shlibs.local"
Theodore Ts'o7a15db22003-07-29 22:15:33 -0400388 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
389 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000390
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400391 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
Theodore Ts'oe254d052003-12-07 01:57:04 -0500392 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000393 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
394 -u '-v${COMERR_VERSION}-${MAIN_VERSION}'
395 DH_OPTIONS= dh_gencontrol -pss-dev \
396 -u '-v${SS_VERSION}-${MAIN_VERSION}'
397 DH_OPTIONS= dh_gencontrol -puuid-dev \
398 -u '-v${UUID_VERSION}-${MAIN_VERSION}'
399
Theodore Ts'oe254d052003-12-07 01:57:04 -0500400 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
401 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'odd198d62002-10-31 03:44:35 -0500402
403 # udeb stuff
404 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
405 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
406 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000407
Theodore Ts'o417781a2003-04-10 00:18:56 -0400408 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
409 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
410 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
411
Theodore Ts'oe254d052003-12-07 01:57:04 -0500412 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
413 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
414 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
415
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000416binary: binary-indep binary-arch
417
418.PHONY: binary binary-arch binary-indep clean checkroot