]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - debian/rules
mke2fs: Add strings.h include for strcasecmp() declaration
[thirdparty/e2fsprogs.git] / debian / rules
CommitLineData
4d8f08f4
TT
1#! /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
f85cc2a8
TT
13# 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)
3e41608a 17DEB_HOST_OS ?= $(shell dpkg-architecture -qDEB_HOST_OS)
f85cc2a8
TT
18DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
19DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
4d8f08f4
TT
20
21# find the version for the main package, from changelog file
56eb4d47 22MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
e5b16437
TT
23# find versions for libraries going into their own packages, from their Makefile.in's,
24# and sonames for all libs
4d8f08f4 25COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
e5b16437 26COMERR_SOVERSION = $(shell grep ELF_SO_VERSION lib/et/Makefile.in | cut '-d ' -f3)
4d8f08f4 27SS_VERSION = $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
e5b16437 28SS_SOVERSION = $(shell grep ELF_SO_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
4d8f08f4 29UUID_VERSION = $(shell grep ELF_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
e5b16437 30UUID_SOVERSION = $(shell grep ELF_SO_VERSION lib/uuid/Makefile.in | cut '-d ' -f3)
6fe7d115
TT
31BLKID_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)
e5b16437
TT
33EXT2FS_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)
4d8f08f4
TT
35
36package=e2fsprogs
37
38topdir=$(shell pwd)
39debdir=${topdir}/debian
b90b826b 40tmpdir=${debdir}/tmp
dd198d68 41udebdir=${debdir}/e2fsprogs-udeb
417781af 42blkidudebdir=${debdir}/libblkid1-udeb
e254d05b 43uuidudebdir=${debdir}/libuuid1-udeb
fbcb3a85
TT
44libcomerrdir=${debdir}/libcomerr${COMERR_SOVERSION}
45comerrdevdir=${debdir}/comerr-dev
46libcomerrdbgdir=${debdir}/libcomerr2-dbg
47libssdir=${debdir}/libss${SS_SOVERSION}
48ssdevdir=${debdir}/ss-dev
49libssdbgdir=${debdir}/libss2-dbg
50libblkiddir=${debdir}/libblkid${BLKID_SOVERSION}
51libblkiddevdir=${debdir}/libblkid-dev
52libblkiddbgdir=${debdir}/libblkid1-dbg
53libuuiddir=${debdir}/libuuid${UUID_SOVERSION}
54uuiddevdir=${debdir}/uuid-dev
55libuuiddbgdir=${debdir}/libuuid1-dbg
56uuidruntimedir=${debdir}/uuid-runtime
57uuidruntimedbgdir=${debdir}/uuid-runtime-dbg
58libext2dir=${debdir}/e2fslibs
59libext2devdir=${debdir}/e2fslibs-dev
60libext2dbgdir=${debdir}/e2fslibs-dbg
b90b826b 61maindir=${debdir}/e2fsprogs
fbcb3a85
TT
62e2fsckstaticdir=${debdir}/e2fsck-static
63debugdir=${debdir}/e2fsprogs-dbg
79786216
TT
64stdbuilddir=${debdir}/BUILD-STD
65bfbuilddir=${debdir}/BUILD-BF
a827a2a3 66staticbuilddir=${debdir}/BUILD-STATIC
e5b16437 67mipsbuilddir=${debdir}/BUILD-MIPS
b1e22d52 68mipsbuilddir64=${debdir}/BUILD-MIPS-64
b90b826b 69# docdir=${maindir}/usr/share/doc/${package}
4d8f08f4 70MANDIR=/usr/share/man
b90b826b 71mandir=${tmpdir}${MANDIR}
4d8f08f4 72
dd198d68
TT
73UDEB_NAME = $(package)-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
74UDEB_PRIORITY = $(shell grep '^Package: e2fsprogs-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
75
417781af
TT
76BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
77BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
78
e254d05b
TT
79UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
80UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
81
541d173d
TT
82STAMPSDIR=debian/stampdir
83CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
84CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
a827a2a3 85CFGSTATICSTAMP=${STAMPSDIR}/configure-static-stamp
541d173d
TT
86BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
87BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
a827a2a3 88BUILDSTATICSTAMP=${STAMPSDIR}/build-static-stamp
541d173d 89
f77704e4 90CCOPTS = -g
4d8f08f4 91
1893e713 92INSTALL = install
b1e22d52 93INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 0755
1893e713 94
1d658a13
TT
95ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
96CCOPTS += -O2
1893e713 97endif
fbcb3a85
TT
98#ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
99#INSTALL_PROGRAM += -s
100#endif
1893e713 101
4d8f08f4
TT
102ifeq (${DEB_HOST_ARCH},alpha)
103CCOPTS += -DHAVE_NETINET_IN_H
4d8f08f4
TT
104else
105CCOPTS += -D__NO_STRING_INLINES
106endif
107
3e41608a 108ifeq (${DEB_HOST_ARCH_OS},linux)
a827a2a3
TT
109BUILD_STATIC = build-static
110E2FSCK_STATIC = ${staticbuilddir}/e2fsck/e2fsck.static
111else
112E2FSCK_STATIC = ${stdbuilddir}/e2fsck/e2fsck.static
3e41608a
ST
113endif
114
79786216
TT
115BF_CCOPTS = -Os -fomit-frame-pointer
116
117COMMON_CONF_FLAGS = \
7e8fe327 118 --enable-elf-shlibs --infodir=/usr/share/info --enable-fsck
79786216 119
7515a744 120STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression
79786216
TT
121
122BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
af773654 123 --disable-nls --disable-imager --disable-testio-debug \
61a679d4 124 --disable-uuidd --disable-tls \
8a8a12c1 125 --disable-debugfs --disable-e2initrd-helper
79786216 126
a827a2a3
TT
127STATIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
128 --disable-nls --disable-imager \
129 --disable-uuidd --disable-tls \
130 --disable-e2initrd-helper \
4f2e8f19 131 --with-ccopts=-fno-stack-protector
a827a2a3 132
2a4c77bc 133MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
fef2b38d 134 --disable-nls --disable-imager \
61a679d4 135 --disable-uuidd --disable-tls \
dd198d68 136 --disable-resizer # --disable-debugfs
b1e22d52 137
2a4c77bc
TT
138# we can't use those flags at configure time
139MIPS_CFLAGS= -G 0 -fno-pic -mno-abicalls
b1e22d52 140MIPS_CFLAGS_64= -mabi=64 -G 0 -fno-pic -mno-abicalls
e5b16437
TT
141
142ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
143ifneq (,$(findstring $(DEB_BUILD_ARCH),mips mipsel))
144ismips=ismips
145endif
146endif
147
541d173d 148${CFGSTDSTAMP}:
4d8f08f4 149 dh_testdir
541d173d 150
41b6ae60
TT
151 # Make sure we don't try to rebuild the configure scripts
152 find . -name configure | xargs touch
153
79786216
TT
154 mkdir -p ${stdbuilddir}
155ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
be5a72da 156 cd ${stdbuilddir} && AWK=/usr/bin/awk \
79786216
TT
157 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS}
158else
be5a72da 159 cd ${stdbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
79786216 160 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STD_CONF_FLAGS} \
a6ea47ab 161 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
79786216 162endif
e5b16437 163
b1e22d52
TT
164 # specially-built MIPS libs
165ifneq ($(ismips),)
166 mkdir -p ${mipsbuilddir} ${mipsbuilddir64}
167 cd ${mipsbuilddir} && AWK=/usr/bin/awk \
168 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
169 cd ${mipsbuilddir64} && AWK=/usr/bin/awk \
170 ${topdir}/configure ${MIPS_NOPIC_CONF_FLAGS}
171endif
e5b16437 172
541d173d
TT
173 mkdir -p ${STAMPSDIR}
174 touch ${CFGSTDSTAMP}
4d8f08f4 175
541d173d 176${CFGBFSTAMP}:
4d8f08f4 177 dh_testdir
541d173d
TT
178 rm -f config.cache
179
79786216 180 mkdir -p ${bfbuilddir}
4d8f08f4 181ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
be5a72da 182 cd ${bfbuilddir} && AWK=/usr/bin/awk \
79786216 183 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS}
4d8f08f4 184else
be5a72da 185 cd ${bfbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
79786216 186 ${topdir}/configure ${COMMON_CONF_FLAGS} ${BF_CONF_FLAGS} \
a6ea47ab 187 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
4d8f08f4 188endif
541d173d
TT
189 mkdir -p ${STAMPSDIR}
190 touch ${CFGBFSTAMP}
79786216 191
a827a2a3
TT
192${CFGSTATICSTAMP}:
193 dh_testdir
194 rm -f config.cache
195
196 mkdir -p ${staticbuilddir}
197ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
4f2e8f19 198 if type diet > /dev/null 2>&1 ; then \
3218dc9d
TT
199 cd ${staticbuilddir} && AWK=/usr/bin/awk \
200 ${topdir}/configure ${STATIC_CONF_FLAGS} \
201 --with-diet-libc; \
202 else \
203 cd ${staticbuilddir} && AWK=/usr/bin/awk \
204 ${topdir}/configure ${STATIC_CONF_FLAGS}; \
4f2e8f19 205 fi
a827a2a3
TT
206else
207 cd ${staticbuilddir} && AWK=/usr/bin/awk CC="${DEB_HOST_GNU_TYPE}-gcc" \
208 ${topdir}/configure ${COMMON_CONF_FLAGS} ${STATIC_CONF_FLAGS} \
209 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
210endif
211 mkdir -p ${STAMPSDIR}
212 touch ${CFGSTATICSTAMP}
213
214build: build-std build-bf $(BUILD_STATIC)
79786216 215
541d173d
TT
216build-std: ${BUILDSTDSTAMP}
217${BUILDSTDSTAMP}: ${CFGSTDSTAMP}
79786216 218 dh_testdir
26d68915 219 $(MAKE) -C ${stdbuilddir} all
7e8fe327 220 $(MAKE) -C ${stdbuilddir}/e2fsck e2fsck.static
e5b16437 221
79786216
TT
222 ( cd ${stdbuilddir}/doc && \
223 texi2html -split_chapter ${topdir}/doc/libext2fs.texinfo )
26d68915 224 ( cd ${stdbuilddir}/lib/et && $(MAKE) com_err.info && \
79786216 225 texi2html -split_chapter -expandinfo ${topdir}/lib/et/com_err.texinfo )
e5b16437 226
b1e22d52
TT
227 # specially-built MIPS libs
228ifneq ($(ismips),)
26d68915
TT
229 $(MAKE) -C ${mipsbuilddir}/util
230 $(MAKE) -C ${mipsbuilddir} \
b1e22d52
TT
231 CFLAGS="${CCOPTS} ${MIPS_CFLAGS}" \
232 LIB_SUBDIRS="lib/et lib/ext2fs" libs
26d68915
TT
233 $(MAKE) -C ${mipsbuilddir64}/util
234 $(MAKE) -C ${mipsbuilddir64} \
b1e22d52
TT
235 CFLAGS="${CCOPTS} ${MIPS_CFLAGS_64}" \
236 LIB_SUBDIRS="lib/et lib/ext2fs" libs
237endif
e5b16437 238
541d173d 239 touch ${BUILDSTDSTAMP}
79786216 240
541d173d
TT
241build-bf: ${BUILDBFSTAMP}
242${BUILDBFSTAMP}: ${CFGBFSTAMP}
79786216 243 dh_testdir
26d68915
TT
244 $(MAKE) -C ${bfbuilddir} libs
245 $(MAKE) -C ${bfbuilddir}/e2fsck all
246 $(MAKE) -C ${bfbuilddir}/misc all
541d173d 247 touch ${BUILDBFSTAMP}
4d8f08f4 248
a827a2a3
TT
249build-static: ${BUILDSTATICSTAMP}
250${BUILDSTATICSTAMP}: ${CFGSTATICSTAMP}
251 dh_testdir
26d68915 252 $(MAKE) -C ${staticbuilddir} libs
7e8fe327 253 $(MAKE) -C ${staticbuilddir}/e2fsck all e2fsck.static
a827a2a3
TT
254 touch ${BUILDSTATICSTAMP}
255
4d8f08f4
TT
256clean:
257 dh_testdir
541d173d 258 rm -rf ${STAMPSDIR}
26d68915
TT
259 [ ! -f ${stdbuilddir}/Makefile ] || $(MAKE) -C ${stdbuilddir} distclean
260 [ ! -f ${bfbuilddir}/Makefile ] || $(MAKE) -C ${bfbuilddir} distclean
261 [ ! -f ${staticbuilddir}/Makefile ] || $(MAKE) -C ${staticbuilddir} distclean
a827a2a3 262 rm -rf ${stdbuilddir} ${bfbuilddir} ${staticbuilddir} ${mipsbuilddir} ${mipsbuilddir64}
8c5829fb 263 rm -f doc/libext2fs/*.html lib/et/com_err/*.html debian/*.substvars
4d8f08f4
TT
264 dh_clean
265
62775dc5 266install: cleanup install-std
79786216
TT
267
268# This rule allows to factorize the dh_clean between the 2 install rules
269# This must be launched before install-* (if launching them by hand, for
270# exemple) or results are unpredictable
271cleanup:
b90b826b
TT
272 dh_testdir
273 dh_testroot
ef797135 274 dh_prep
79786216
TT
275
276install-std: DH_OPTIONS=
277install-std: build
278 dh_testdir
279 dh_testroot
b90b826b 280 dh_installdirs
4d8f08f4 281
b90b826b 282 mkdir -p ${tmpdir}/sbin
26d68915 283 $(MAKE) -C ${stdbuilddir} install DESTDIR=${tmpdir} \
79786216
TT
284 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
285 # static libs and .h files
26d68915 286 $(MAKE) -C ${stdbuilddir} install-libs DESTDIR=${tmpdir} LDCONFIG=true
4d8f08f4 287
1893e713 288 # statically-linked fsck
a827a2a3 289 ${INSTALL_PROGRAM} $(E2FSCK_STATIC) ${tmpdir}/sbin
ec3bb41b 290 cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
4d8f08f4 291
020c5477
TT
292 ln -s et/com_err.h ${tmpdir}/usr/include
293
2a4c77bc
TT
294 dh_movefiles
295 test -z `find ${tmpdir} -type f`
296
b1e22d52
TT
297 # specially-built MIPS libs
298ifneq ($(ismips),)
299 $(INSTALL) -p -m 0644 ${mipsbuilddir}/lib/libext2fs.a \
300 ${debdir}/e2fslibs-dev/usr/lib/libext2fs-nopic.a
301 $(INSTALL) -p -m 0644 ${mipsbuilddir64}/lib/libext2fs.a \
302 ${debdir}/e2fslibs-dev/usr/lib/lib64ext2fs-nopic.a
303endif
e5b16437 304
62775dc5
TT
305install-udeb: DH_OPTIONS=
306install-udeb: build
79786216
TT
307 dh_testdir
308 dh_testroot
79786216 309
26d68915 310 $(MAKE) -C ${bfbuilddir} install-shlibs-libs-recursive DESTDIR=${udebdir} \
62775dc5 311 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
26d68915 312 $(MAKE) -C ${bfbuilddir}/e2fsck install DESTDIR=${udebdir} \
62775dc5 313 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
26d68915 314 $(MAKE) -C ${bfbuilddir}/misc install DESTDIR=${udebdir} \
79786216 315 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
26d68915 316 $(MAKE) -C ${bfbuilddir}/resize install DESTDIR=${udebdir} \
8a8a12c1 317 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
2a4c77bc 318
62775dc5 319 rm -rf ${udebdir}/usr
e3075aea 320 find ${udebdir}/sbin -type f -a ! -name e2fsck \
8a8a12c1
TT
321 -a ! -name mke2fs -a ! -name tune2fs \
322 -a ! -name resize2fs -a ! -name badblocks -print | xargs rm
e3075aea
TT
323
324 (cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
325 ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
3a4ec2ba 326 ln -s mke2fs mkfs.ext3 ; ln -s mke2fs mkfs.ext4)
dd198d68 327
417781af
TT
328 mkdir -p ${blkidudebdir}/lib
329 mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
79786216 330
e254d05b
TT
331 mkdir -p ${uuidudebdir}/lib
332 mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
333
b90b826b
TT
334binary-indep:
335 # no arch-independant debs.
4d8f08f4 336
b90b826b 337binary-arch: DH_OPTIONS= -a
dd198d68 338binary-arch: install install-udeb
b90b826b
TT
339 dh_testdir
340 dh_testroot
341
541d173d
TT
342 # lintian overrides
343 for i in $$(cd debian && echo *.lintian-overrides); do \
344 pkg=$${i%.lintian-overrides} ;\
b1e22d52 345 $(INSTALL) -m 0644 -D -p debian/$$i ${debdir}/$${pkg}/usr/share/lintian/overrides/$${pkg} ;\
541d173d 346 done
79786216 347
e5b16437 348 # mkinitrd script
1d658a13 349 mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
b1e22d52 350 $(INSTALL) -p -o root -g root -m 0755 debian/initrd-tools.e2fsprogs \
e2de6b9e
TT
351 debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
352
353 # initrd script
354 mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
b1e22d52 355 $(INSTALL) -p -o root -g root -m 0755 debian/initrd.ext3-add-journal \
e2de6b9e
TT
356 debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
357
e5b16437 358
b90b826b 359 # symlinks to prepare dh_installdocs run
1893e713 360
151c86ab
TT
361 mkdir -p ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}
362 mkdir -p ${debdir}/libblkid-dev/usr/share/doc
363 ln -sf libblkid${BLKID_SOVERSION} ${debdir}/libblkid-dev/usr/share/doc/libblkid-dev
b90b826b 364
151c86ab
TT
365 mkdir -p ${debdir}/libss${SS_SOVERSION}/usr/share/doc/libss${SS_SOVERSION}
366 mkdir -p ${debdir}/ss-dev/usr/share/doc
367 ln -sf libss${SS_SOVERSION} ${debdir}/ss-dev/usr/share/doc/ss-dev
b90b826b 368
151c86ab
TT
369 mkdir -p ${debdir}/libcomerr${COMERR_SOVERSION}/usr/share/doc/libcomerr${COMERR_SOVERSION}
370 mkdir -p ${debdir}/comerr-dev/usr/share/doc
e5b16437 371 ln -sf libcomerr${COMERR_SOVERSION} ${debdir}/comerr-dev/usr/share/doc/comerr-dev
4d8f08f4 372
151c86ab
TT
373 mkdir -p ${debdir}/libuuid${UUID_SOVERSION}/usr/share/doc/libuuid${UUID_SOVERSION}
374 mkdir -p ${debdir}/uuid-dev/usr/share/doc
ec3bb41b 375# ln -sf libuuid${UUID_SOVERSION} ${debdir}/uuid-dev/usr/share/doc/uuid-dev
4d8f08f4 376
151c86ab
TT
377 mkdir -p ${debdir}/e2fslibs/usr/share/doc/e2fslibs
378 mkdir -p ${debdir}/e2fslibs-dev/usr/share/doc
379 ln -sf e2fslibs ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs-dev
4d8f08f4 380
b1e22d52 381 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
6fe7d115
TT
382 ${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
383
e254d05b 384 dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
b90b826b 385
4d8f08f4 386 # HTML docs
b1e22d52
TT
387 $(INSTALL) -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
388 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/libext2fs/*.html \
151c86ab 389 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
b1e22d52
TT
390 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
391 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/com_err/*.html \
151c86ab 392 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/html-info/
4d8f08f4
TT
393
394 # texinfo docs
151c86ab 395 mkdir -p ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}
b1e22d52 396 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
151c86ab 397 ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/libext2fs.texi
b1e22d52 398 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
e5b16437 399 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/com_err.texi
4d8f08f4 400
b1e22d52
TT
401 $(INSTALL) -d ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
402 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
151c86ab
TT
403 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
404 ${debdir}/comerr-dev/usr/share/doc/libcomerr${COMERR_SOVERSION}/examples
b1e22d52
TT
405 $(INSTALL) -d ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
406 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
151c86ab
TT
407 ${debdir}/ss-dev/usr/share/doc/libss${SS_SOVERSION}/examples
408
60702c26
TT
409 if test -f /etc/lsb-release && \
410 grep -q DISTRIB_ID=Ubuntu /etc/lsb-release; then \
411 $(INSTALL) -p -m 0644 e2fsck/e2fsck.conf.ubuntu \
412 ${debdir}/e2fsprogs/etc/e2fsck.conf; \
413 fi
414
541d173d 415 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
79786216 416 dh_installinfo -pe2fslibs-dev ${stdbuilddir}/doc/libext2fs.info
4d8f08f4 417
ec3bb41b
TT
418 DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
419 -plibblkid${BLKID_SOVERSION} -plibcomerr${COMERR_SOVERSION} \
420 -plibss${SS_SOVERSION} -plibuuid${UUID_SOVERSION} \
fbcb3a85
TT
421 -pe2fslibs -puuid-dev -puuid-runtime -pe2fsck-static \
422 -pe2fsprogs-dbg -puuid-runtime-dbg -pe2fslibs-dbg \
423 -plibcomerr2-dbg -plibss2-dbg -plibblkid1-dbg -plibuuid1-dbg
4d8f08f4 424
a3f464ff 425 dh_fixperms
b1e22d52 426ifneq ($(ismips),)
30f142e4 427 dh_strip -k -Xlib64ext2fs-nopic.a
b1e22d52 428else
fbcb3a85 429 dh_strip -k
b1e22d52 430endif
4d8f08f4 431
fbcb3a85
TT
432 # debug package stuff
433 rm -rf ${udebdir}/usr
434 rm -rf ${blkidudebdir}/usr
435 rm -rf ${uuidudebdir}/usr
436
437 mkdir -p ${debugdir}/usr/lib
438 mv ${maindir}/usr/lib/debug ${debugdir}/usr/lib
439 rm -rf ${maindir}/usr/lib/debug
440 mv ${e2fsckstaticdir}/usr/lib/debug/sbin/* \
441 ${debugdir}/usr/lib/debug
442 rm -rf ${e2fsckstaticdir}/usr/lib
443
444 mkdir -p ${uuidruntimedbgdir}/usr/lib
445 mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/usr/lib
446 rmdir ${uuidruntimedir}/usr/lib
447
448 mkdir -p ${libext2dbgdir}/usr/lib
449 mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/usr/lib
450 rmdir ${libext2dir}/usr/lib
451
452 mkdir -p ${libcomerrdbgdir}/usr/lib
453 mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/usr/lib
454 rmdir ${libcomerrdir}/usr/lib
455
456 mkdir -p ${libssdbgdir}/usr/lib
457 mv ${libssdir}/usr/lib/debug ${libssdbgdir}/usr/lib
458 rmdir ${libssdir}/usr/lib
459
460 mkdir -p ${libuuiddbgdir}/usr/lib
461 mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/usr/lib
462 rmdir ${libuuiddir}/usr/lib
463
464 mkdir -p ${libblkiddbgdir}/usr/lib
465 mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/usr/lib
466 rmdir ${libblkiddir}/usr/lib
467
649bd289
TT
468 # dpkg symbol handling
469ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
470 for i in e2fslibs libcomerr2 libss2 libblkid1 libuuid1; \
471 do \
472 echo "Generating symbols for $$i..."; \
473 dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
474 cat debian/$$i.tmp-patch; \
475 patch debian/$$i.symbols < debian/$$i.tmp-patch; \
476 /bin/rm debian/$$i.tmp-patch; \
477 done
478endif
479
fbcb3a85
TT
480 $(INSTALL) -p -m 0644 debian/e2fsprogs.copyright \
481 ${debugdir}/usr/share/doc/e2fsprogs-dbg/copyright
482
483 $(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \
484 ${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright
485
486 $(INSTALL) -p -m 0644 debian/e2fslibs.copyright \
487 ${libext2dbgdir}/usr/share/doc/e2fslibs-dbg/copyright
488
489 $(INSTALL) -p -m 0644 debian/libcomerr2.copyright \
490 ${libcomerrdbgdir}/usr/share/doc/libcomerr2-dbg/copyright
491
492 $(INSTALL) -p -m 0644 debian/libss2.copyright \
493 ${libssdbgdir}/usr/share/doc/libss2-dbg/copyright
494
495 $(INSTALL) -p -m 0644 debian/libblkid.copyright \
496 ${libblkiddbgdir}/usr/share/doc/libblkid1-dbg/copyright
497
498 $(INSTALL) -p -m 0644 debian/libuuid1.copyright \
499 ${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright
500
b90b826b 501 dh_compress
4d8f08f4 502
e254d05b 503 dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
151c86ab
TT
504 dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
505 -V 'libcomerr2 (>= 1.33-3)'
a1788528 506 dh_makeshlibs -plibblkid${BLKID_SOVERSION} -V 'libblkid1 (>= 1.39-1)'
7512f136
TT
507 echo "udeb: libblkid 1 libblkid1-udeb" >> \
508 debian/libblkid1/DEBIAN/shlibs
509 echo "udeb: libuuid 1 libuuid1-udeb" >> debian/libuuid1/DEBIAN/shlibs
6fe7d115 510
b90b826b 511 dh_installdeb
79786216 512 dh_shlibdeps -l${stdbuilddir}/lib
151c86ab
TT
513 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
514 -u"-Ldebian/e2fsprogs.shlibs.local"
7a15db23
TT
515 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
516 -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
b90b826b 517
151c86ab 518 dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
e254d05b 519 -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
b90b826b 520 DH_OPTIONS= dh_gencontrol -pcomerr-dev \
d8a1a674 521 -u '-v${COMERR_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
b90b826b 522 DH_OPTIONS= dh_gencontrol -pss-dev \
d8a1a674 523 -u '-v${SS_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
b90b826b 524 DH_OPTIONS= dh_gencontrol -puuid-dev \
d8a1a674 525 -u '-v${UUID_VERSION}-${MAIN_VERSION} -VmainBinary=${MAIN_VERSION}'
bf5498cc
TT
526 dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
527 dh_gencontrol -plibblkid1-udeb -- -fdebian/files~
528 dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
b90b826b 529
bf5498cc
TT
530 dpkg-distaddfile $(UDEB_NAME) debian-installer $(UDEB_PRIORITY)
531 dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
532 dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
e254d05b
TT
533 dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
534 dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
dd198d68 535 dh_builddeb -pe2fsprogs-udeb --filename=$(UDEB_NAME)
417781af 536 dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
e254d05b
TT
537 dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
538
4d8f08f4
TT
539binary: binary-indep binary-arch
540
541.PHONY: binary binary-arch binary-indep clean checkroot