blob: 4448418f2f1c010f52a3f5bbacb793b8d3815848 [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)
17DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
18DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000019
20# find the version for the main package, from changelog file
Theodore Ts'o56eb4d42004-09-17 19:54:22 -040021MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
Theodore Ts'oe5b16432002-08-17 21:11:29 -040022# find versions for libraries going into their own packages, from their Makefile.in's,
23# and sonames for all libs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000024COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040025COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000026SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040027SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000028UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040029UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
Theodore Ts'o6fe7d112003-03-16 19:58:25 -050030BLKID_VERSION = $(shell grep ELF_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
31BLKID_SOVERSION = $(shell grep ELF_SO_VERSION lib/blkid/Makefile.in | cut '-d ' -f3)
Theodore Ts'oe5b16432002-08-17 21:11:29 -040032EXT2FS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ext2fs/Makefile.in | cut '-d ' -f3)
33E2P_SOVERSION = $(shell grep ELF_SO_VERSION lib/e2p/Makefile.in | cut '-d ' -f3)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000034
35package=e2fsprogs
36
37topdir=$(shell pwd)
38debdir=${topdir}/debian
Theodore Ts'ob90b8262001-06-15 22:54:34 +000039tmpdir=${debdir}/tmp
Theodore Ts'odd198d62002-10-31 03:44:35 -050040udebdir=${debdir}/e2fsprogs-udeb
Theodore Ts'o417781a2003-04-10 00:18:56 -040041blkidudebdir=${debdir}/libblkid1-udeb
Theodore Ts'oe254d052003-12-07 01:57:04 -050042uuidudebdir=${debdir}/libuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +000043maindir=${debdir}/e2fsprogs
Theodore Ts'o79786212001-06-22 23:05:23 -040044stdbuilddir=${debdir}/BUILD-STD
45bfbuilddir=${debdir}/BUILD-BF
Theodore Ts'oe5b16432002-08-17 21:11:29 -040046mipsbuilddir=${debdir}/BUILD-MIPS
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050047mipsbuilddir64=${debdir}/BUILD-MIPS-64
Theodore Ts'ob90b8262001-06-15 22:54:34 +000048# docdir=${maindir}/usr/share/doc/${package}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000049MANDIR=/usr/share/man
Theodore Ts'ob90b8262001-06-15 22:54:34 +000050mandir=${tmpdir}${MANDIR}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000051
Theodore Ts'odd198d62002-10-31 03:44:35 -050052UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
53UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
54
Theodore Ts'o417781a2003-04-10 00:18:56 -040055BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
56BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
57
Theodore Ts'oe254d052003-12-07 01:57:04 -050058UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
59UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
60
Theodore Ts'o541d1732002-02-23 21:23:26 -050061STAMPSDIR=debian/stampdir
62CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
63CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
64BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
65BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
66
Theodore Ts'of77704e2006-11-11 22:32:35 -050067CCOPTS = -g
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000068
Theodore Ts'o1893e712001-05-21 02:48:41 +000069INSTALL = install
Theodore Ts'ob1e22d52005-12-29 09:16:00 -050070INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
Theodore Ts'o1893e712001-05-21 02:48:41 +000071
Theodore Ts'o1d658a12003-08-21 01:53:07 -040072ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
73CCOPTS += -O2
Theodore Ts'o1893e712001-05-21 02:48:41 +000074endif
75ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
76INSTALL_PROGRAM += -s
77endif
78
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000079ifeq (${DEB_HOST_ARCH},alpha)
80CCOPTS += -DHAVE_NETINET_IN_H
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000081else
82CCOPTS += -D__NO_STRING_INLINES
83endif
84
Theodore Ts'o79786212001-06-22 23:05:23 -040085BF_CCOPTS = -Os -fomit-frame-pointer
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +000086
Theodore Ts'o79786212001-06-22 23:05:23 -040087COMMON_CONF_FLAGS = \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -050088 --enable-elf-shlibs --enable-dynamic-e2fsck \
Theodore Ts'o35b73e92004-09-19 07:52:05 -040089 --infodir=/usr/share/info --enable-fsck
Theodore Ts'o79786212001-06-22 23:05:23 -040090
Theodore Ts'od2d0d792006-03-08 17:42:40 -050091STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression \
92 --enable-blkid-devmapper
Theodore Ts'o79786212001-06-22 23:05:23 -040093
94BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
Theodore Ts'o62775dc2003-05-08 10:39:50 -040095 --disable-nls --disable-swapfs --disable-imager \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -050096 --disable-debugfs --disable-e2initrd-helper
Theodore Ts'o79786212001-06-22 23:05:23 -040097
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -040098MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
99 --disable-nls \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400100 --disable-swapfs --disable-imager \
Theodore Ts'odd198d62002-10-31 03:44:35 -0500101 --disable-resizer # --disable-debugfs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500102
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400103# we can't use those flags at configure time
104MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500105MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400106
107ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
108ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
109ismips=ismips
110endif
111endif
112
Theodore Ts'o541d1732002-02-23 21:23:26 -0500113${CFGSTDSTAMP}:
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000114 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500115
Theodore Ts'o41b6ae62004-09-24 10:07:05 -0400116 # Make sure we don't try to rebuild the configure scripts
117 find . -name configure | xargs touch
118
Theodore Ts'o79786212001-06-22 23:05:23 -0400119 mkdir -p ${stdbuilddir}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000120ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500121 cd ${stdbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400122 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000123else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500124 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400125 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000126 --build=$(DEB_BUILD_GNU_TYPE) $(DEB_HOST_GNU_TYPE)
127endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400128
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500129 # specially-built MIPS libs
130ifneq ($(ismips),)
131 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
132 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
133 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
134 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
135 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
136endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400137
Theodore Ts'o541d1732002-02-23 21:23:26 -0500138 mkdir -p ${STAMPSDIR}
139 touch ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400140
Theodore Ts'o541d1732002-02-23 21:23:26 -0500141${CFGBFSTAMP}:
Theodore Ts'o79786212001-06-22 23:05:23 -0400142 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500143 rm -f config.cache
144
Theodore Ts'o79786212001-06-22 23:05:23 -0400145 mkdir -p ${bfbuilddir}
146ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500147 cd ${bfbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400148 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS}
149else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500150 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400151 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
152 --build=$(DEB_BUILD_GNU_TYPE) $(DEB_HOST_GNU_TYPE)
153endif
Theodore Ts'o541d1732002-02-23 21:23:26 -0500154 mkdir -p ${STAMPSDIR}
155 touch ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400156
157build: build-std build-bf
158
Theodore Ts'o541d1732002-02-23 21:23:26 -0500159build-std: ${BUILDSTDSTAMP}
160${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400161 dh_testdir
162 make -C ${stdbuilddir} all
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400163
Theodore Ts'o79786212001-06-22 23:05:23 -0400164 ( cd ${stdbuilddir}/doc && \
165 texi2html -split_chapter ${topdir}/doc/libext2fs.texinfo )
166 ( cd ${stdbuilddir}/lib/et && make com_err.info && \
167 texi2html -split_chapter -expandinfo ${topdir}/lib/et/com_err.texinfo )
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400168
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500169 # specially-built MIPS libs
170ifneq ($(ismips),)
171 make -C ${mipsbuilddir}/util
172 make -C ${mipsbuilddir} \
173 CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \
174 LIB_SUBDIRS="lib/et lib/ext2fs" libs
175 make -C ${mipsbuilddir64}/util
176 make -C ${mipsbuilddir64} \
177 CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \
178 LIB_SUBDIRS="lib/et lib/ext2fs" libs
179endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400180
Theodore Ts'o541d1732002-02-23 21:23:26 -0500181 touch ${BUILDSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400182
Theodore Ts'o541d1732002-02-23 21:23:26 -0500183build-bf: ${BUILDBFSTAMP}
184${BUILDBFSTAMP}: ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400185 dh_testdir
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400186 make -C ${bfbuilddir} libs
187 make -C ${bfbuilddir}/e2fsck all
188 make -C ${bfbuilddir}/misc all
Theodore Ts'o541d1732002-02-23 21:23:26 -0500189 touch ${BUILDBFSTAMP}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000190
191clean:
192 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500193 rm -rf ${STAMPSDIR}
Theodore Ts'o79786212001-06-22 23:05:23 -0400194 -make -C ${stdbuilddir} -i distclean
195 -make -C ${bfbuilddir} -i distclean
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500196 rm -rf ${stdbuilddir} ${bfbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
Theodore Ts'o8c5829f2005-07-21 19:32:36 -0500197 rm -f doc/libext2fs/*.html lib/et/com_err/*.html debian/*.substvars
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000198 dh_clean
199
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400200install: cleanup install-std
Theodore Ts'o79786212001-06-22 23:05:23 -0400201
202# This rule allows to factorize the dh_clean between the 2 install rules
203# This must be launched before install-* (if launching them by hand, for
204# exemple) or results are unpredictable
205cleanup:
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000206 dh_testdir
207 dh_testroot
208 dh_clean -k
Theodore Ts'o79786212001-06-22 23:05:23 -0400209
210install-std: DH_OPTIONS=
211install-std: build
212 dh_testdir
213 dh_testroot
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000214 dh_installdirs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000215
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000216 mkdir -p ${tmpdir}/sbin
Theodore Ts'o79786212001-06-22 23:05:23 -0400217 make -C ${stdbuilddir} install DESTDIR=${tmpdir} \
218 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
219 # static libs and .h files
220 make -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000221
Theodore Ts'o1893e712001-05-21 02:48:41 +0000222 # statically-linked fsck
Theodore Ts'o79786212001-06-22 23:05:23 -0400223 ${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400224 cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000225
Theodore Ts'o020c5472003-04-10 00:01:19 -0400226 ln -s et/com_err.h ${tmpdir}/usr/include
227
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400228 dh_movefiles
229 test -z `find ${tmpdir} -type f`
230
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500231 # specially-built MIPS libs
232ifneq ($(ismips),)
233 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
234 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
235 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
236 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
237endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400238
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400239install-udeb: DH_OPTIONS=
240install-udeb: build
Theodore Ts'o79786212001-06-22 23:05:23 -0400241 dh_testdir
242 dh_testroot
Theodore Ts'o79786212001-06-22 23:05:23 -0400243
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400244 make -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400245 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400246 make -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
247 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
248 make -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
249 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500250 make -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
251 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o79786212001-06-22 23:05:23 -0400252
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400253 rm -rf ${udebdir}/usr
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400254 find ${udebdir}/sbin -type f -a ! -name e2fsck \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500255 -a ! -name mke2fs -a ! -name tune2fs \
256 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400257
258 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
259 ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
260 ln -s mke2fs mkfs.ext3)
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400261
Theodore Ts'o417781a2003-04-10 00:18:56 -0400262 mkdir -p ${blkidudebdir}/lib
263 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
Theodore Ts'o79786212001-06-22 23:05:23 -0400264
Theodore Ts'oe254d052003-12-07 01:57:04 -0500265 mkdir -p ${uuidudebdir}/lib
266 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
267
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000268binary-indep:
269 # no arch-independant debs.
270
271binary-arch: DH_OPTIONS= -a
Theodore Ts'odd198d62002-10-31 03:44:35 -0500272binary-arch: install install-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000273 dh_testdir
274 dh_testroot
275
Theodore Ts'o541d1732002-02-23 21:23:26 -0500276 # lintian overrides
277 for i in $$(cd debian && echo *.lintian-overrides); do \
278 pkg=$${i%.lintian-overrides} ;\
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500279 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
Theodore Ts'o541d1732002-02-23 21:23:26 -0500280 done
Theodore Ts'o79786212001-06-22 23:05:23 -0400281
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400282 # mkinitrd script
Theodore Ts'o1d658a12003-08-21 01:53:07 -0400283 mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500284 $(INSTALL) -p -o root -g root -m 0755 debian/initrd-tools.e2fsprogs \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400285 debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
286
287 # initrd script
288 mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500289 $(INSTALL) -p -o root -g root -m 0755 debian/initrd.ext3-add-journal \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400290 debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
291
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400292
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000293 # symlinks to prepare dh_installdocs run
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000294
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500295 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
296 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
297 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
298
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400299 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
300 mkdir -p ${debdir}/ss-dev/usr/share/doc
301 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
302
303 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
304 mkdir -p ${debdir}/comerr-dev/usr/share/doc
305 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
306
307 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
308 mkdir -p ${debdir}/uuid-dev/usr/share/doc
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400309# ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400310
311 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
312 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
313 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000314
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500315 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500316 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
317
Theodore Ts'oe254d052003-12-07 01:57:04 -0500318 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000319
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000320 # HTML docs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500321 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
322 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/libext2fs/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400323 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500324 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
325 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/com_err/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400326 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000327
328 # texinfo docs
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400329 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500330 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400331 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500332 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400333 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000334
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500335 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
336 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400337 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
338 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500339 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
340 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400341 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
342
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500343 $(INSTALL) -d ${debdir}/uuid-dev/usr/share/doc/libuuid${UUID_SOVERSION}
Theodore Ts'obfc1a742006-10-02 13:31:10 -0400344 if test -f /etc/lsb-release && \
345 grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
346 $(INSTALL) -p -m 0644 doc/draft-leach-uuids-guids-01.txt \
347 ${debdir}/uuid-dev/usr/share/doc/libuuid${UUID_SOVERSION}; \
348 fi
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000349
Theodore Ts'o541d1732002-02-23 21:23:26 -0500350 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
Theodore Ts'o79786212001-06-22 23:05:23 -0400351 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000352
Theodore Ts'oec3bb412006-10-04 09:12:35 -0400353 DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
354 -plibblkid${BLKID_SOVERSION} -plibcomerr${COMERR_SOVERSION} \
355 -plibss${SS_SOVERSION} -plibuuid${UUID_SOVERSION} \
356 -pe2fslibs -puuid-dev -pe2fsck-static
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000357
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500358ifneq ($(ismips),)
359 dh_strip -Xlib64ext2fs-nopic.a
360else
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000361 dh_strip
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500362endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000363
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000364 dh_compress
365 dh_fixperms
366
Theodore Ts'oe254d052003-12-07 01:57:04 -0500367 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400368 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
369 -V 'libcomerr2 (>= 1.33-3)'
Theodore Ts'o7512f132006-03-29 19:03:38 -0500370 echo "udeb: libblkid 1 libblkid1-udeb" >> \
371 debian/libblkid1/DEBIAN/shlibs
372 echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500373
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000374 dh_installdeb
Theodore Ts'oa0010282006-03-30 01:03:17 -0500375 rm debian/e2fsprogs-udeb/DEBIAN/conffiles
Theodore Ts'o79786212001-06-22 23:05:23 -0400376 dh_shlibdeps -l${stdbuilddir}/lib
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400377 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
378 -u"-Ldebian/e2fsprogs.shlibs.local"
Theodore Ts'o7a15db22003-07-29 22:15:33 -0400379 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
380 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000381
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400382 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
Theodore Ts'oe254d052003-12-07 01:57:04 -0500383 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000384 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
385 -u '-v${COMERR_VERSION}-${MAIN_VERSION}'
386 DH_OPTIONS= dh_gencontrol -pss-dev \
387 -u '-v${SS_VERSION}-${MAIN_VERSION}'
388 DH_OPTIONS= dh_gencontrol -puuid-dev \
389 -u '-v${UUID_VERSION}-${MAIN_VERSION}'
390
Theodore Ts'oe254d052003-12-07 01:57:04 -0500391 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
392 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'odd198d62002-10-31 03:44:35 -0500393
394 # udeb stuff
395 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
396 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
397 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000398
Theodore Ts'o417781a2003-04-10 00:18:56 -0400399 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
400 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
401 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
402
Theodore Ts'oe254d052003-12-07 01:57:04 -0500403 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
404 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
405 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
406
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000407binary: binary-indep binary-arch
408
409.PHONY: binary binary-arch binary-indep clean checkroot