]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blame_incremental - debian/rules
Update release notes, etc., for the 1.47.3-rc3 release
[thirdparty/e2fsprogs.git] / debian / rules
... / ...
CommitLineData
1#! /usr/bin/make -f
2
3# export DH_VERBOSE=1
4
5export DEB_BUILD_MAINT_OPTIONS ?= hardening=+all
6
7DPKG_EXPORT_BUILDFLAGS = 1
8include /usr/share/dpkg/default.mk
9
10# be paranoid
11export LC_ALL ?= C
12
13ifeq ($(DEB_HOST_ARCH_OS), hurd)
14SKIP_FUSE2FS=yes
15endif
16
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
22ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
23SKIP_FUSE2FS=yes
24endif
25
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
31COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
32SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
33
34topdir ?= $(shell pwd)
35tmpdir ?= ${topdir}/debian/tmp
36udebdir ?= ${topdir}/debian/e2fsprogs-udeb
37stdbuilddir ?= ${topdir}/debian/BUILD-STD
38
39INSTALL ?= install
40INSTALL_PROGRAM ?= $(INSTALL) -p -m 0755
41
42ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
43SYMBOL_LIBS := libext2fst64 libcom-err2 libss2
44endif
45
46CFLAGS_SHLIB = $(CFLAGS)
47CFLAGS_STLIB = $(CFLAGS)
48LDFLAGS_SHLIB = $(LDFLAGS)
49LDFLAGS_STATIC = $(filter-out -fPIE -fpie -pie,$(LDFLAGS))
50
51BACKTRACE_CONF_FLAGS ?= $(shell if debian/scripts/test-backtrace ; then echo --disable-backtrace ; fi)
52
53COMMON_CONF_FLAGS = --enable-elf-shlibs --disable-ubsan \
54 --disable-addrsan --disable-threadsan --disable-e2initrd-helper \
55 --disable-fsck --disable-libblkid --disable-libuuid --disable-uuidd \
56 --infodir=/usr/share/info --enable-symlink-install \
57 --with-multiarch=$(DEB_HOST_MULTIARCH) \
58 $(BACKTRACE_CONF_FLAGS) ${EXTRA_CONF_FLAGS}
59
60ifneq ($(SKIP_FUSE2FS),)
61COMMON_CONF_FLAGS += --disable-fuse2fs
62endif
63
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
68
69# work around Debian Bug #1070042
70ifeq ($(DEB_HOST_ARCH),mips64el)
71COMMON_CONF_FLAGS += --without-libarchive
72endif
73
74%:
75 dh $@ -B${stdbuilddir}
76
77override_dh_autoreconf:
78
79override_dh_auto_configure:
80 mkdir -p ${stdbuilddir}
81 cd ${stdbuilddir} && AWK=/usr/bin/awk \
82 ../../configure ${COMMON_CONF_FLAGS}
83
84override_dh_auto_build:
85 $(MAKE) -C ${stdbuilddir} V=1 $(JOBS) all
86ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
87 $(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
88endif
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
94 $(MAKE) -C ${stdbuilddir}/po V=1 update-gmo
95
96 $(MAKE) -C ${stdbuilddir}/doc V=1 libext2fs.html
97 $(MAKE) -C ${stdbuilddir}/lib/et V=1 com_err.info com_err.html
98 cat $(shell /bin/ls -1 ./doc/RelNotes/*.txt | tac) | \
99 gzip -9n > ${stdbuilddir}/NEWS.gz
100
101override_dh_auto_clean:
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
107 rm -rf ${stdbuilddir}
108
109override_dh_auto_install:
110 mkdir -p ${tmpdir}/sbin
111 $(MAKE) -C ${stdbuilddir} V=1 install DESTDIR=${tmpdir} \
112 INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
113 # static libs and .h files
114 $(MAKE) -C ${stdbuilddir} V=1 install-libs DESTDIR=${tmpdir} LDCONFIG=true
115
116ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
117 # statically-linked fsck
118 ${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
119 (cd debian/tmp/usr/share/man/man8 ; cp e2fsck.8 e2fsck.static.8)
120endif
121
122ifeq ($(DEB_HOST_ARCH_OS), hurd)
123 ${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
124endif
125
126override_dh_install:
127 dh_install -p e2fsprogs --sourcedir=${stdbuilddir} NEWS.gz \
128 usr/share/doc/e2fsprogs
129 dh_install
130 dh_missing --fail-missing
131
132ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
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
137endif
138
139override_dh_installinfo:
140 # HTML docs
141 $(INSTALL) -d debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
142 $(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
143 debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
144 $(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
145 $(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
146 debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
147
148 # texinfo docs
149 mkdir -p debian/comerr-dev/usr/share/doc/comerr-dev
150 $(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
151 debian/libext2fs-dev/usr/share/doc/libext2fs2/libext2fs.texi
152 $(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
153 debian/comerr-dev/usr/share/doc/comerr-dev/com_err.texi
154
155 $(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/examples
156 $(INSTALL) -p -m 0644 lib/ss/ss_err.et \
157 ${stdbuilddir}/lib/ext2fs/ext2_err.et \
158 debian/comerr-dev/usr/share/doc/comerr-dev/examples
159 $(INSTALL) -d debian/ss-dev/usr/share/doc/ss-dev/examples
160 $(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
161 debian/ss-dev/usr/share/doc/ss-dev/examples
162
163 dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
164 dh_installinfo -plibext2fs-dev ${stdbuilddir}/doc/libext2fs.info
165
166ifneq ($(DEB_HOST_ARCH_OS), hurd)
167override_dh_installsystemd:
168 dh_installsystemd -p e2fsprogs --no-restart-after-upgrade --no-stop-on-upgrade e2scrub_all.timer e2scrub_reap.service
169endif
170
171override_dh_makeshlibs:
172 for i in $(SYMBOL_LIBS); \
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
180 dh_makeshlibs $(if $(filter noudeb,$(DEB_BUILD_PROFILES)),,--add-udeb=e2fsprogs-udeb)
181
182override_dh_shlibdeps:
183 dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
184 -- -Ldebian/e2fsprogs.shlibs.local
185ifeq (,$(filter noudeb,$(DEB_BUILD_PROFILES)))
186 dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
187 -- -Ldebian/e2fsprogs-udeb.shlibs.local
188endif
189ifeq ($(SKIP_FUSE2FS),)
190 dh_shlibdeps -pfuse2fs -l${stdbuilddir}/lib \
191 -- -Ldebian/e2fsprogs.shlibs.local
192endif
193 dh_shlibdeps --remaining-packages -l${stdbuilddir}/lib
194
195override_dh_gencontrol:
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}
198 dh_gencontrol --remaining-packages -- -Vmisc:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version})' -W libc-dev-bin)"
199
200override_dh_auto_test:
201ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
202 PRINT_FAILED=yes $(MAKE) -C ${stdbuilddir} V=1 $(JOBS) check
203endif
204
205test_printenv:
206 printenv | sort