]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame - debian/rules
Update release notes, etc., for the 1.47.3-rc3 release
[thirdparty/e2fsprogs.git] / debian / rules
CommitLineData
4d8f08f4 1#! /usr/bin/make -f
336ac184
TT
2
3# export DH_VERBOSE=1
965e82cb 4
697e21fa
TT
5export DEB_BUILD_MAINT_OPTIONS ?= hardening=+all
6
336ac184
TT
7DPKG_EXPORT_BUILDFLAGS = 1
8include /usr/share/dpkg/default.mk
9
4d8f08f4 10# be paranoid
d973c18b 11export LC_ALL ?= C
4d8f08f4 12
716ff03b 13ifeq ($(DEB_HOST_ARCH_OS), hurd)
d3c05957
TT
14SKIP_FUSE2FS=yes
15endif
16
288de9fb
TT
17ifeq ($(DEB_HOST_ARCH_OS), linux)
18export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)
19export deb_udevudevdir = $(shell pkg-config pkg-config --variable=udevdir udev | sed s,^/,,)
20endif
21
8c72de15
SM
22ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
23SKIP_FUSE2FS=yes
24endif
25
1b042c23
TT
26ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
27 NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
28 JOBS = -j$(NUMJOBS)
29endif
30
d973c18b 31COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
d973c18b 32SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
4d8f08f4 33
d973c18b 34topdir ?= $(shell pwd)
336ac184
TT
35tmpdir ?= ${topdir}/debian/tmp
36udebdir ?= ${topdir}/debian/e2fsprogs-udeb
37stdbuilddir ?= ${topdir}/debian/BUILD-STD
541d173d 38
d973c18b 39INSTALL ?= install
3da214e5 40INSTALL_PROGRAM ?= $(INSTALL) -p -m 0755
1893e713 41
618dcd2c 42ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
d0353818 43SYMBOL_LIBS := libext2fst64 libcom-err2 libss2
618dcd2c
TT
44endif
45
04f34e71
TT
46CFLAGS_SHLIB = $(CFLAGS)
47CFLAGS_STLIB = $(CFLAGS)
48LDFLAGS_SHLIB = $(LDFLAGS)
697e21fa
TT
49LDFLAGS_STATIC = $(filter-out -fPIE -fpie -pie,$(LDFLAGS))
50
336ac184 51BACKTRACE_CONF_FLAGS ?= $(shell if debian/scripts/test-backtrace ; then echo --disable-backtrace ; fi)
6e2393fd 52
cfb073a4 53COMMON_CONF_FLAGS = --enable-elf-shlibs --disable-ubsan \
336ac184
TT
54 --disable-addrsan --disable-threadsan --disable-e2initrd-helper \
55 --disable-fsck --disable-libblkid --disable-libuuid --disable-uuidd \
efeda9d5 56 --infodir=/usr/share/info --enable-symlink-install \
e84a4a61 57 --with-multiarch=$(DEB_HOST_MULTIARCH) \
336ac184 58 $(BACKTRACE_CONF_FLAGS) ${EXTRA_CONF_FLAGS}
79786216 59
336ac184
TT
60ifneq ($(SKIP_FUSE2FS),)
61COMMON_CONF_FLAGS += --disable-fuse2fs
62endif
efeda9d5 63
336ac184
TT
64ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
65CC ?= $(DEB_HOST_GNU_TYPE)-gcc
66COMMON_CONF_FLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
67endif
95f65c3d 68
018cd6e9
TT
69# work around Debian Bug #1070042
70ifeq ($(DEB_HOST_ARCH),mips64el)
71COMMON_CONF_FLAGS += --without-libarchive
72endif
73
336ac184
TT
74%:
75 dh $@ -B${stdbuilddir}
541d173d 76
336ac184 77override_dh_autoreconf:
41b6ae60 78
336ac184 79override_dh_auto_configure:
79786216 80 mkdir -p ${stdbuilddir}
be5a72da 81 cd ${stdbuilddir} && AWK=/usr/bin/awk \
336ac184 82 ../../configure ${COMMON_CONF_FLAGS}
4d8f08f4 83
336ac184 84override_dh_auto_build:
1b042c23 85 $(MAKE) -C ${stdbuilddir} V=1 $(JOBS) all
b637c57d 86ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
cd056798 87 $(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
b637c57d 88endif
2c0e8c7a
TT
89 if ! test -d debian/orig-gmo ; then \
90 mkdir debian/orig-gmo ; \
91 mv po/*.gmo po/*.po debian/orig-gmo ; \
92 cp debian/orig-gmo/*.po po ; \
93 fi
f921eda1 94 $(MAKE) -C ${stdbuilddir}/po V=1 update-gmo
e5b16437 95
922a40cf
TT
96 $(MAKE) -C ${stdbuilddir}/doc V=1 libext2fs.html
97 $(MAKE) -C ${stdbuilddir}/lib/et V=1 com_err.info com_err.html
40ab405c
TT
98 cat $(shell /bin/ls -1 ./doc/RelNotes/*.txt | tac) | \
99 gzip -9n > ${stdbuilddir}/NEWS.gz
e5b16437 100
336ac184 101override_dh_auto_clean:
2c0e8c7a
TT
102 if test -d debian/orig-gmo ; then \
103 rm -f po/*.gmo po/*.po ; \
104 mv debian/orig-gmo/* po ; \
105 rmdir debian/orig-gmo ; \
106 fi
336ac184 107 rm -rf ${stdbuilddir}
4d8f08f4 108
336ac184 109override_dh_auto_install:
b90b826b 110 mkdir -p ${tmpdir}/sbin
c1986ecb 111 $(MAKE) -C ${stdbuilddir} V=1 install DESTDIR=${tmpdir} \
79786216
TT
112 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
113 # static libs and .h files
c1986ecb 114 $(MAKE) -C ${stdbuilddir} V=1 install-libs DESTDIR=${tmpdir} LDCONFIG=true
4d8f08f4 115
b637c57d 116ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
1893e713 117 # statically-linked fsck
336ac184
TT
118 ${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
119 (cd debian/tmp/usr/share/man/man8 ; cp e2fsck.8 e2fsck.static.8)
b637c57d 120endif
a8ffb5c2 121
716ff03b 122ifeq ($(DEB_HOST_ARCH_OS), hurd)
b1c828e8
TT
123 ${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
124endif
125
336ac184 126override_dh_install:
922a40cf
TT
127 dh_install -p e2fsprogs --sourcedir=${stdbuilddir} NEWS.gz \
128 usr/share/doc/e2fsprogs
e98cdafb
TT
129 dh_install
130 dh_missing --fail-missing
922a40cf 131
b637c57d 132ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
336ac184
TT
133override_dh_lintian:
134 dh_lintian
135 $(INSTALL) -D -p -m644 debian/e2fsprogs-udeb.lintian-overrides \
136 debian/e2fsprogs-udeb/usr/share/lintian/overrides/e2fsprogs-udeb
b637c57d 137endif
b90b826b 138
336ac184 139override_dh_installinfo:
4d8f08f4 140 # HTML docs
336ac184 141 $(INSTALL) -d debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
4534f8bc 142 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
336ac184
TT
143 debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
144 $(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
4534f8bc 145 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
336ac184 146 debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
4d8f08f4
TT
147
148 # texinfo docs
336ac184 149 mkdir -p debian/comerr-dev/usr/share/doc/comerr-dev
b1e22d52 150 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
336ac184 151 debian/libext2fs-dev/usr/share/doc/libext2fs2/libext2fs.texi
b1e22d52 152 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
336ac184 153 debian/comerr-dev/usr/share/doc/comerr-dev/com_err.texi
4d8f08f4 154
336ac184 155 $(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/examples
b1e22d52 156 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
151c86ab 157 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
336ac184
TT
158 debian/comerr-dev/usr/share/doc/comerr-dev/examples
159 $(INSTALL) -d debian/ss-dev/usr/share/doc/ss-dev/examples
b1e22d52 160 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
336ac184 161 debian/ss-dev/usr/share/doc/ss-dev/examples
151c86ab 162
541d173d 163 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
146649cd 164 dh_installinfo -plibext2fs-dev ${stdbuilddir}/doc/libext2fs.info
4d8f08f4 165
a4c1bf4d 166ifneq ($(DEB_HOST_ARCH_OS), hurd)
a4c91450
DW
167override_dh_installsystemd:
168 dh_installsystemd -p e2fsprogs --no-restart-after-upgrade --no-stop-on-upgrade e2scrub_all.timer e2scrub_reap.service
a4c1bf4d 169endif
a4c91450 170
336ac184 171override_dh_makeshlibs:
95f65c3d 172 for i in $(SYMBOL_LIBS); \
649bd289
TT
173 do \
174 echo "Generating symbols for $$i..."; \
175 dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
176 cat debian/$$i.tmp-patch; \
177 patch debian/$$i.symbols < debian/$$i.tmp-patch; \
178 /bin/rm debian/$$i.tmp-patch; \
179 done
b637c57d 180 dh_makeshlibs $(if $(filter noudeb,$(DEB_BUILD_PROFILES)),,--add-udeb=e2fsprogs-udeb)
649bd289 181
336ac184 182override_dh_shlibdeps:
151c86ab 183 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
336ac184 184 -- -Ldebian/e2fsprogs.shlibs.local
b637c57d 185ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
7a15db23 186 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
336ac184 187 -- -Ldebian/e2fsprogs-udeb.shlibs.local
b637c57d 188endif
d3c05957 189ifeq ($(SKIP_FUSE2FS),)
d1335619 190 dh_shlibdeps -pfuse2fs -l${stdbuilddir}/lib \
336ac184 191 -- -Ldebian/e2fsprogs.shlibs.local
d3c05957 192endif
336ac184 193 dh_shlibdeps --remaining-packages -l${stdbuilddir}/lib
b90b826b 194
336ac184 195override_dh_gencontrol:
e98cdafb
TT
196 dh_gencontrol -pcomerr-dev -- -v${COMERR_VERSION}-${DEB_VERSION} -VmainBinary=${DEB_VERSION}
197 dh_gencontrol -pss-dev -- -v${SS_VERSION}-${DEB_VERSION} -VmainBinary=${DEB_VERSION}
41b40084 198 dh_gencontrol --remaining-packages -- -Vmisc:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version})' -W libc-dev-bin)"
910fae94 199
7f4c3bb1 200override_dh_auto_test:
20a18d54 201ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
1b042c23 202 PRINT_FAILED=yes $(MAKE) -C ${stdbuilddir} V=1 $(JOBS) check
20a18d54 203endif
7f4c3bb1 204
336ac184
TT
205test_printenv:
206 printenv | sort