mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-19 23:11:55 +08:00
15c23fed7b
Defining HAVE_NETINET_IN_H for Alpha and __NO_STRING_INLINES for the PowerMac QUICK bootloader date back to over two decades, to 1997 and 1998, respectively. These two architectures are no longer supported by Debian, and it's not clear they are actually needed in 2019 even for someone building for these architectures. So let's drop them and see if anyone complains (or notices). Signed-off-by: Theodore Ts'o <tytso@mit.edu>
196 lines
6.3 KiB
Makefile
Executable File
196 lines
6.3 KiB
Makefile
Executable File
#! /usr/bin/make -f
|
|
|
|
# export DH_VERBOSE=1
|
|
|
|
export DEB_BUILD_MAINT_OPTIONS ?= hardening=+all
|
|
|
|
DPKG_EXPORT_BUILDFLAGS = 1
|
|
include /usr/share/dpkg/default.mk
|
|
|
|
# be paranoid
|
|
export LC_ALL ?= C
|
|
|
|
ifeq ($(DEB_HOST_ARCH_OS), hurd)
|
|
SKIP_FUSE2FS=yes
|
|
endif
|
|
|
|
ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
|
|
SKIP_FUSE2FS=yes
|
|
endif
|
|
|
|
COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
|
|
SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
|
|
|
|
topdir ?= $(shell pwd)
|
|
tmpdir ?= ${topdir}/debian/tmp
|
|
udebdir ?= ${topdir}/debian/e2fsprogs-udeb
|
|
stdbuilddir ?= ${topdir}/debian/BUILD-STD
|
|
|
|
INSTALL ?= install
|
|
INSTALL_PROGRAM ?= $(INSTALL) -p -o root -g root -m 0755
|
|
|
|
ifneq (,$(findstring update-symbols,$(DEB_BUILD_OPTIONS)))
|
|
SYMBOL_LIBS := libext2fs libcomerr2 libss2
|
|
endif
|
|
|
|
CFLAGS_SHLIB = $(CFLAGS)
|
|
CFLAGS_STLIB = $(CFLAGS)
|
|
LDFLAGS_SHLIB = $(LDFLAGS)
|
|
LDFLAGS_STATIC = $(filter-out -fPIE -fpie -pie,$(LDFLAGS))
|
|
|
|
BACKTRACE_CONF_FLAGS ?= $(shell if debian/scripts/test-backtrace ; then echo --disable-backtrace ; fi)
|
|
|
|
COMMON_CONF_FLAGS = --enable-elf-shlibs --enable-lto --disable-ubsan \
|
|
--disable-addrsan --disable-threadsan --disable-e2initrd-helper \
|
|
--disable-fsck --disable-libblkid --disable-libuuid --disable-uuidd \
|
|
--infodir=/usr/share/info --enable-symlink-install \
|
|
--with-multiarch=$(DEB_HOST_MULTIARCH) \
|
|
$(BACKTRACE_CONF_FLAGS) ${EXTRA_CONF_FLAGS}
|
|
|
|
ifneq ($(SKIP_FUSE2FS),)
|
|
COMMON_CONF_FLAGS += --disable-fuse2fs
|
|
endif
|
|
|
|
ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
|
|
CC ?= $(DEB_HOST_GNU_TYPE)-gcc
|
|
COMMON_CONF_FLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
|
|
endif
|
|
|
|
%:
|
|
dh $@ -B${stdbuilddir}
|
|
|
|
override_dh_autoreconf:
|
|
|
|
override_dh_auto_configure:
|
|
mkdir -p ${stdbuilddir}
|
|
cd ${stdbuilddir} && AWK=/usr/bin/awk \
|
|
../../configure ${COMMON_CONF_FLAGS}
|
|
|
|
override_dh_auto_build:
|
|
$(MAKE) -C ${stdbuilddir} V=1 all
|
|
$(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
|
|
if ! test -d debian/orig-gmo ; then \
|
|
mkdir debian/orig-gmo ; \
|
|
mv po/*.gmo po/*.po debian/orig-gmo ; \
|
|
cp debian/orig-gmo/*.po po ; \
|
|
fi
|
|
$(MAKE) -C ${stdbuilddir}/po V=1 update-gmo
|
|
|
|
$(MAKE) -C ${stdbuilddir}/doc V=1 libext2fs.html
|
|
$(MAKE) -C ${stdbuilddir}/lib/et V=1 com_err.info com_err.html
|
|
cat $(shell /bin/ls -1 ./doc/RelNotes/*.txt | tac) | \
|
|
gzip -9n > ${stdbuilddir}/NEWS.gz
|
|
|
|
override_dh_auto_clean:
|
|
if test -d debian/orig-gmo ; then \
|
|
rm -f po/*.gmo po/*.po ; \
|
|
mv debian/orig-gmo/* po ; \
|
|
rmdir debian/orig-gmo ; \
|
|
fi
|
|
rm -rf ${stdbuilddir}
|
|
|
|
override_dh_auto_install:
|
|
mkdir -p ${tmpdir}/sbin
|
|
$(MAKE) -C ${stdbuilddir} V=1 install DESTDIR=${tmpdir} \
|
|
INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
|
|
# static libs and .h files
|
|
$(MAKE) -C ${stdbuilddir} V=1 install-libs DESTDIR=${tmpdir} LDCONFIG=true
|
|
|
|
# statically-linked fsck
|
|
${INSTALL_PROGRAM} ${stdbuilddir}/e2fsck/e2fsck.static ${tmpdir}/sbin
|
|
(cd debian/tmp/usr/share/man/man8 ; cp e2fsck.8 e2fsck.static.8)
|
|
|
|
ifeq ($(DEB_HOST_ARCH_OS), hurd)
|
|
${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
|
|
endif
|
|
|
|
# install for e2fsprogs-udeb
|
|
$(MAKE) -C ${stdbuilddir} V=1 install-shlibs-libs-recursive DESTDIR=${udebdir} \
|
|
INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
|
|
$(MAKE) -C ${stdbuilddir}/e2fsck V=1 install DESTDIR=${udebdir} \
|
|
INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
|
|
$(MAKE) -C ${stdbuilddir}/misc V=1 install DESTDIR=${udebdir} \
|
|
INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
|
|
$(MAKE) -C ${stdbuilddir}/resize V=1 install DESTDIR=${udebdir} \
|
|
INSTALL_PROGRAM="${INSTALL_PROGRAM}" LDCONFIG=true
|
|
|
|
rm -rf ${udebdir}/usr
|
|
find ${udebdir}/sbin -type f -a ! -name e2fsck \
|
|
-a ! -name mke2fs -a ! -name tune2fs \
|
|
-a ! -name resize2fs -a ! -name badblocks -print | xargs rm
|
|
|
|
(cd ${udebdir}/sbin; ln -sf e2fsck fsck.ext2 ; \
|
|
ln -sf e2fsck fsck.ext3 ; ln -sf e2fsck fsck.ext4 ; \
|
|
ln -sf mke2fs mkfs.ext2 ; ln -sf mke2fs mkfs.ext3 ; \
|
|
ln -sf mke2fs mkfs.ext4)
|
|
|
|
override_dh_install:
|
|
dh_install -p e2fsprogs --sourcedir=${stdbuilddir} NEWS.gz \
|
|
usr/share/doc/e2fsprogs
|
|
dh_movefiles
|
|
test -z "`find ${tmpdir} -type f`"
|
|
|
|
override_dh_lintian:
|
|
dh_lintian
|
|
$(INSTALL) -D -p -m644 debian/e2fsprogs-udeb.lintian-overrides \
|
|
debian/e2fsprogs-udeb/usr/share/lintian/overrides/e2fsprogs-udeb
|
|
|
|
override_dh_installinfo:
|
|
# HTML docs
|
|
$(INSTALL) -d debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
|
|
$(INSTALL) -p -m 0644 ${stdbuilddir}/doc/*.html \
|
|
debian/libext2fs-dev/usr/share/doc/libext2fs2/html-info/
|
|
$(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
|
|
$(INSTALL) -p -m 0644 ${stdbuilddir}/lib/et/*.html \
|
|
debian/comerr-dev/usr/share/doc/comerr-dev/html-info/
|
|
|
|
# texinfo docs
|
|
mkdir -p debian/comerr-dev/usr/share/doc/comerr-dev
|
|
$(INSTALL) -p -m 0644 ${topdir}/doc/libext2fs.texinfo \
|
|
debian/libext2fs-dev/usr/share/doc/libext2fs2/libext2fs.texi
|
|
$(INSTALL) -p -m 0644 ${topdir}/lib/et/com_err.texinfo \
|
|
debian/comerr-dev/usr/share/doc/comerr-dev/com_err.texi
|
|
|
|
$(INSTALL) -d debian/comerr-dev/usr/share/doc/comerr-dev/examples
|
|
$(INSTALL) -p -m 0644 lib/ss/ss_err.et \
|
|
${stdbuilddir}/lib/ext2fs/ext2_err.et \
|
|
debian/comerr-dev/usr/share/doc/comerr-dev/examples
|
|
$(INSTALL) -d debian/ss-dev/usr/share/doc/ss-dev/examples
|
|
$(INSTALL) -p -m 0644 debugfs/debug_cmds.ct \
|
|
debian/ss-dev/usr/share/doc/ss-dev/examples
|
|
|
|
dh_installinfo -pcomerr-dev ${stdbuilddir}/lib/et/com_err.info
|
|
dh_installinfo -plibext2fs-dev ${stdbuilddir}/doc/libext2fs.info
|
|
|
|
override_dh_makeshlibs:
|
|
for i in $(SYMBOL_LIBS); \
|
|
do \
|
|
echo "Generating symbols for $$i..."; \
|
|
dpkg-gensymbols -p$$i -Pdebian/$$i > debian/$$i.tmp-patch; \
|
|
cat debian/$$i.tmp-patch; \
|
|
patch debian/$$i.symbols < debian/$$i.tmp-patch; \
|
|
/bin/rm debian/$$i.tmp-patch; \
|
|
done
|
|
dh_makeshlibs --add-udeb=e2fsprogs-udeb
|
|
|
|
override_dh_shlibdeps:
|
|
dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
|
|
-- -Ldebian/e2fsprogs.shlibs.local
|
|
dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
|
|
-- -Ldebian/e2fsprogs-udeb.shlibs.local
|
|
ifeq ($(SKIP_FUSE2FS),)
|
|
dh_shlibdeps -pfuse2fs -l${stdbuilddir}/lib \
|
|
-- -Ldebian/e2fsprogs.shlibs.local
|
|
endif
|
|
dh_shlibdeps --remaining-packages -l${stdbuilddir}/lib
|
|
|
|
override_dh_gencontrol:
|
|
dh_gencontrol -pcomerr-dev \
|
|
-- -v${COMERR_VERSION}-${DEB_VERSION} -VmainBinary=${DEB_VERSION}
|
|
dh_gencontrol -pss-dev \
|
|
-- -v${SS_VERSION}-${DEB_VERSION} -VmainBinary=${DEB_VERSION}
|
|
dh_gencontrol --remaining-packages
|
|
|
|
test_printenv:
|
|
printenv | sort
|