blob: 5360bcef4b73a8a7fc160c6bf17a88d13d1e557a [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'o1d658a12003-08-21 01:53:07 -040067CCOPTS = -g -fsigned-char
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'o62775dc2003-05-08 10:39:50 -040091STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression
Theodore Ts'o79786212001-06-22 23:05:23 -040092
93BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
Theodore Ts'o62775dc2003-05-08 10:39:50 -040094 --disable-nls --disable-swapfs --disable-imager \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -050095 --disable-debugfs --disable-e2initrd-helper
Theodore Ts'o79786212001-06-22 23:05:23 -040096
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -040097MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
98 --disable-nls \
Theodore Ts'oe5b16432002-08-17 21:11:29 -040099 --disable-swapfs --disable-imager \
Theodore Ts'odd198d62002-10-31 03:44:35 -0500100 --disable-resizer # --disable-debugfs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500101
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400102# we can't use those flags at configure time
103MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500104MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400105
106ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
107ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
108ismips=ismips
109endif
110endif
111
Theodore Ts'o541d1732002-02-23 21:23:26 -0500112${CFGSTDSTAMP}:
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000113 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500114
Theodore Ts'o41b6ae62004-09-24 10:07:05 -0400115 # Make sure we don't try to rebuild the configure scripts
116 find . -name configure | xargs touch
117
Theodore Ts'o79786212001-06-22 23:05:23 -0400118 mkdir -p ${stdbuilddir}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000119ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500120 cd ${stdbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400121 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000122else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500123 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400124 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000125 --build=$(DEB_BUILD_GNU_TYPE) $(DEB_HOST_GNU_TYPE)
126endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400127
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500128 # specially-built MIPS libs
129ifneq ($(ismips),)
130 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
131 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
132 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
133 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
134 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
135endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400136
Theodore Ts'o541d1732002-02-23 21:23:26 -0500137 mkdir -p ${STAMPSDIR}
138 touch ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400139
Theodore Ts'o541d1732002-02-23 21:23:26 -0500140${CFGBFSTAMP}:
Theodore Ts'o79786212001-06-22 23:05:23 -0400141 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500142 rm -f config.cache
143
Theodore Ts'o79786212001-06-22 23:05:23 -0400144 mkdir -p ${bfbuilddir}
145ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500146 cd ${bfbuilddir} && AWK=/usr/bin/awk \
Theodore Ts'o79786212001-06-22 23:05:23 -0400147 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS}
148else
Theodore Ts'obe5a72d2005-03-17 01:16:34 -0500149 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
Theodore Ts'o79786212001-06-22 23:05:23 -0400150 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
151 --build=$(DEB_BUILD_GNU_TYPE) $(DEB_HOST_GNU_TYPE)
152endif
Theodore Ts'o541d1732002-02-23 21:23:26 -0500153 mkdir -p ${STAMPSDIR}
154 touch ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400155
156build: build-std build-bf
157
Theodore Ts'o541d1732002-02-23 21:23:26 -0500158build-std: ${BUILDSTDSTAMP}
159${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400160 dh_testdir
161 make -C ${stdbuilddir} all
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400162
Theodore Ts'o79786212001-06-22 23:05:23 -0400163 ( cd ${stdbuilddir}/doc && \
164 texi2html -split_chapter ${topdir}/doc/libext2fs.texinfo )
165 ( cd ${stdbuilddir}/lib/et && make com_err.info && \
166 texi2html -split_chapter -expandinfo ${topdir}/lib/et/com_err.texinfo )
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400167
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500168 # specially-built MIPS libs
169ifneq ($(ismips),)
170 make -C ${mipsbuilddir}/util
171 make -C ${mipsbuilddir} \
172 CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \
173 LIB_SUBDIRS="lib/et lib/ext2fs" libs
174 make -C ${mipsbuilddir64}/util
175 make -C ${mipsbuilddir64} \
176 CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \
177 LIB_SUBDIRS="lib/et lib/ext2fs" libs
178endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400179
Theodore Ts'o541d1732002-02-23 21:23:26 -0500180 touch ${BUILDSTDSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400181
Theodore Ts'o541d1732002-02-23 21:23:26 -0500182build-bf: ${BUILDBFSTAMP}
183${BUILDBFSTAMP}: ${CFGBFSTAMP}
Theodore Ts'o79786212001-06-22 23:05:23 -0400184 dh_testdir
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400185 make -C ${bfbuilddir} libs
186 make -C ${bfbuilddir}/e2fsck all
187 make -C ${bfbuilddir}/misc all
Theodore Ts'o541d1732002-02-23 21:23:26 -0500188 touch ${BUILDBFSTAMP}
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000189
190clean:
191 dh_testdir
Theodore Ts'o541d1732002-02-23 21:23:26 -0500192 rm -rf ${STAMPSDIR}
Theodore Ts'o79786212001-06-22 23:05:23 -0400193 -make -C ${stdbuilddir} -i distclean
194 -make -C ${bfbuilddir} -i distclean
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500195 rm -rf ${stdbuilddir} ${bfbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
Theodore Ts'o8c5829f2005-07-21 19:32:36 -0500196 rm -f doc/libext2fs/*.html lib/et/com_err/*.html debian/*.substvars
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000197 dh_clean
198
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400199install: cleanup install-std
Theodore Ts'o79786212001-06-22 23:05:23 -0400200
201# This rule allows to factorize the dh_clean between the 2 install rules
202# This must be launched before install-* (if launching them by hand, for
203# exemple) or results are unpredictable
204cleanup:
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000205 dh_testdir
206 dh_testroot
207 dh_clean -k
Theodore Ts'o79786212001-06-22 23:05:23 -0400208
209install-std: DH_OPTIONS=
210install-std: build
211 dh_testdir
212 dh_testroot
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000213 dh_installdirs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000214
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000215 mkdir -p ${tmpdir}/sbin
Theodore Ts'o79786212001-06-22 23:05:23 -0400216 make -C ${stdbuilddir} install DESTDIR=${tmpdir} \
217 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
218 # static libs and .h files
219 make -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000220
Theodore Ts'o1893e712001-05-21 02:48:41 +0000221 # statically-linked fsck
Theodore Ts'o79786212001-06-22 23:05:23 -0400222 ${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
Theodore Ts'o1893e712001-05-21 02:48:41 +0000223 ln -s e2fsck.8.gz ${mandir}/man8/e2fsck.static.8.gz
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000224
Theodore Ts'o020c5472003-04-10 00:01:19 -0400225 ln -s et/com_err.h ${tmpdir}/usr/include
226
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400227 dh_movefiles
228 test -z `find ${tmpdir} -type f`
229
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500230 # specially-built MIPS libs
231ifneq ($(ismips),)
232 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
233 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
234 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
235 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
236endif
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400237
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400238install-udeb: DH_OPTIONS=
239install-udeb: build
Theodore Ts'o79786212001-06-22 23:05:23 -0400240 dh_testdir
241 dh_testroot
Theodore Ts'o79786212001-06-22 23:05:23 -0400242
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400243 make -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
Theodore Ts'o79786212001-06-22 23:05:23 -0400244 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400245 make -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
246 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
247 make -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
248 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500249 make -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
250 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
Theodore Ts'o79786212001-06-22 23:05:23 -0400251
Theodore Ts'o62775dc2003-05-08 10:39:50 -0400252 rm -rf ${udebdir}/usr
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400253 find ${udebdir}/sbin -type f -a ! -name e2fsck \
Theodore Ts'o8a8a12c2005-12-10 22:56:21 -0500254 -a ! -name mke2fs -a ! -name tune2fs \
255 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
Theodore Ts'oe3075ae2003-07-12 16:28:09 -0400256
257 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
258 ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
259 ln -s mke2fs mkfs.ext3)
Theodore Ts'o2a4c77b2002-09-24 01:30:00 -0400260
Theodore Ts'o417781a2003-04-10 00:18:56 -0400261 mkdir -p ${blkidudebdir}/lib
262 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
Theodore Ts'o79786212001-06-22 23:05:23 -0400263
Theodore Ts'oe254d052003-12-07 01:57:04 -0500264 mkdir -p ${uuidudebdir}/lib
265 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
266
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000267binary-indep:
268 # no arch-independant debs.
269
270binary-arch: DH_OPTIONS= -a
Theodore Ts'odd198d62002-10-31 03:44:35 -0500271binary-arch: install install-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000272 dh_testdir
273 dh_testroot
274
Theodore Ts'o541d1732002-02-23 21:23:26 -0500275 # lintian overrides
276 for i in $$(cd debian && echo *.lintian-overrides); do \
277 pkg=$${i%.lintian-overrides} ;\
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500278 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
Theodore Ts'o541d1732002-02-23 21:23:26 -0500279 done
Theodore Ts'o79786212001-06-22 23:05:23 -0400280
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400281 # mkinitrd script
Theodore Ts'o1d658a12003-08-21 01:53:07 -0400282 mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500283 $(INSTALL) -p -o root -g root -m 0755 debian/initrd-tools.e2fsprogs \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400284 debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
285
286 # initrd script
287 mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500288 $(INSTALL) -p -o root -g root -m 0755 debian/initrd.ext3-add-journal \
Theodore Ts'oe2de6b92004-04-11 16:25:56 -0400289 debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
290
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400291
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000292 # symlinks to prepare dh_installdocs run
293 mkdir -p ${debdir}/e2fsck-static/usr/share/doc/
294 ln -sf e2fsprogs ${debdir}/e2fsck-static/usr/share/doc/e2fsck-static
295
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500296 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
297 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
298 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
299
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400300 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
301 mkdir -p ${debdir}/ss-dev/usr/share/doc
302 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
303
304 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
305 mkdir -p ${debdir}/comerr-dev/usr/share/doc
306 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
307
308 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
309 mkdir -p ${debdir}/uuid-dev/usr/share/doc
310 ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
311
312 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
313 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
314 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000315
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500316 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500317 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
318
Theodore Ts'oe254d052003-12-07 01:57:04 -0500319 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000320
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000321 # HTML docs
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500322 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
323 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/libext2fs/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400324 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500325 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
326 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/com_err/*.html \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400327 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000328
329 # texinfo docs
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400330 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500331 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400332 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500333 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
Theodore Ts'oe5b16432002-08-17 21:11:29 -0400334 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000335
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500336 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
337 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400338 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
339 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500340 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
341 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400342 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
343
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500344 $(INSTALL) -d ${debdir}/uuid-dev/usr/share/doc/libuuid${UUID_SOVERSION}
345 $(INSTALL) -p -m 0644 doc/draft-leach-uuids-guids-01.txt \
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400346 ${debdir}/uuid-dev/usr/share/doc/libuuid${UUID_SOVERSION}
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000347
Theodore Ts'o541d1732002-02-23 21:23:26 -0500348 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
Theodore Ts'o79786212001-06-22 23:05:23 -0400349 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000350
Theodore Ts'o9bf19712003-07-23 09:55:39 -0400351 DH_OPTIONS= dh_installchangelogs -pe2fsprogs -plibblkid${BLKID_SOVERSION}
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400352 DH_OPTIONS= dh_installchangelogs -pe2fsprogs -plibcomerr${COMERR_SOVERSION}
353 DH_OPTIONS= dh_installchangelogs -pe2fsprogs -plibss${SS_SOVERSION}
354 DH_OPTIONS= dh_installchangelogs -pe2fsprogs -plibuuid${UUID_SOVERSION}
355 DH_OPTIONS= dh_installchangelogs -pe2fsprogs -pe2fslibs
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000356
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500357ifneq ($(ismips),)
358 dh_strip -Xlib64ext2fs-nopic.a
359else
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000360 dh_strip
Theodore Ts'ob1e22d52005-12-29 09:16:00 -0500361endif
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000362
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000363 dh_compress
364 dh_fixperms
365
Theodore Ts'oe254d052003-12-07 01:57:04 -0500366 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400367 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
368 -V 'libcomerr2 (>= 1.33-3)'
Theodore Ts'o6fe7d112003-03-16 19:58:25 -0500369
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000370 dh_installdeb
Theodore Ts'o79786212001-06-22 23:05:23 -0400371 dh_shlibdeps -l${stdbuilddir}/lib
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400372 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
373 -u"-Ldebian/e2fsprogs.shlibs.local"
Theodore Ts'o7a15db22003-07-29 22:15:33 -0400374 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
375 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000376
Theodore Ts'o151c86a2003-07-25 07:03:00 -0400377 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
Theodore Ts'oe254d052003-12-07 01:57:04 -0500378 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'ob90b8262001-06-15 22:54:34 +0000379 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
380 -u '-v${COMERR_VERSION}-${MAIN_VERSION}'
381 DH_OPTIONS= dh_gencontrol -pss-dev \
382 -u '-v${SS_VERSION}-${MAIN_VERSION}'
383 DH_OPTIONS= dh_gencontrol -puuid-dev \
384 -u '-v${UUID_VERSION}-${MAIN_VERSION}'
385
Theodore Ts'oe254d052003-12-07 01:57:04 -0500386 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
387 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
Theodore Ts'odd198d62002-10-31 03:44:35 -0500388
389 # udeb stuff
390 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
391 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
392 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000393
Theodore Ts'o417781a2003-04-10 00:18:56 -0400394 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
395 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
396 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
397
Theodore Ts'oe254d052003-12-07 01:57:04 -0500398 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
399 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
400 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
401
Theodore Ts'o4d8f08f2001-05-09 04:51:07 +0000402binary: binary-indep binary-arch
403
404.PHONY: binary binary-arch binary-indep clean checkroot