# be paranoid
export LC_ALL=C
-DEB_BUILD_ARCH := $(shell dpkg --print-architecture)
-DEB_BUILD_GNU_TYPE := $(shell ./config.guess)
-ifndef DEB_HOST_ARCH
- DEB_HOST_ARCH := ${DEB_BUILD_ARCH}
-endif
-DEB_HOST_GNU_CPU := $(patsubst hurd-%,%,$(DEB_HOST_ARCH))
-ifeq ($(filter-out hurd-%,${DEB_HOST_ARCH}),)
- DEB_HOST_GNU_SYSTEM := gnu
-else
-# FIXME: we won't have always just Hurd and Linux
- DEB_HOST_GNU_SYSTEM := linux
-endif
-DEB_HOST_GNU_TYPE := ${DEB_HOST_GNU_CPU}-${DEB_HOST_GNU_SYSTEM}
-
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
# find the version for the main package, from changelog file
-MAIN_VERSION = $(shell head -1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
+MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
# find versions for libraries going into their own packages, from their Makefile.in's,
# and sonames for all libs
COMERR_VERSION = $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
tmpdir=${debdir}/tmp
udebdir=${debdir}/e2fsprogs-udeb
blkidudebdir=${debdir}/libblkid1-udeb
+uuidudebdir=${debdir}/libuuid1-udeb
maindir=${debdir}/e2fsprogs
stdbuilddir=${debdir}/BUILD-STD
bfbuilddir=${debdir}/BUILD-BF
BLKID_UDEB_NAME = libblkid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
BLKID_UDEB_PRIORITY = $(shell grep '^Package: libblkid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
+UUID_UDEB_NAME = libuuid1-udeb_$(MAIN_VERSION)_$(DEB_HOST_ARCH).udeb
+UUID_UDEB_PRIORITY = $(shell grep '^Package: libuuid1-udeb' debian/control -A 10 | grep ^Priority: | cut -d ' ' -f 2)
+
STAMPSDIR=debian/stampdir
CFGSTDSTAMP=${STAMPSDIR}/configure-std-stamp
CFGBFSTAMP=${STAMPSDIR}/configure-bf-stamp
BUILDSTDSTAMP=${STAMPSDIR}/build-std-stamp
BUILDBFSTAMP=${STAMPSDIR}/build-bf-stamp
-CCOPTS = -O2 -fsigned-char
-LIBC-DEV = libc6-dev
+CCOPTS = -g -fsigned-char
INSTALL = install
INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
-CCOPTS += -g -O1
+ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+CCOPTS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
ifeq (${DEB_HOST_ARCH},alpha)
CCOPTS += -DHAVE_NETINET_IN_H
-LIBC-DEV = libc6.1-dev
else
CCOPTS += -D__NO_STRING_INLINES
endif
BF_CCOPTS = -Os -fomit-frame-pointer
COMMON_CONF_FLAGS = \
- --enable-elf-shlibs --enable-dynamic-e2fsck --disable-evms \
- --infodir=/usr/share/info
+ --enable-elf-shlibs --enable-dynamic-e2fsck \
+ --infodir=/usr/share/info --enable-fsck
STD_CONF_FLAGS = --with-ccopts="${CCOPTS}" --enable-compression
BF_CONF_FLAGS = --with-ccopts="${CCOPTS} ${BF_CCOPTS}" \
--disable-nls --disable-swapfs --disable-imager \
- --disable-resizer --disable-debugfs
+ --disable-resizer --disable-debugfs --disable-e2initrd-helper
MIPS_NOPIC_CONF_FLAGS = --with-ccopts="${CCOPTS}" \
--disable-nls \
${CFGSTDSTAMP}:
dh_testdir
+ # Make sure we don't try to rebuild the configure scripts
+ find . -name configure | xargs touch
+
mkdir -p ${stdbuilddir}
ifeq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
cd ${stdbuilddir} && \
rm -rf ${udebdir}/usr
find ${udebdir}/sbin -type f -a ! -name e2fsck \
- -a ! -name mke2fs -print | xargs rm
+ -a ! -name mke2fs -a ! -name tune2fs -print | xargs rm
(cd ${udebdir}/sbin; ln -s e2fsck fsck.ext2 ; \
ln -s e2fsck fsck.ext3 ; ln -s mke2fs mkfs.ext2 ; \
mkdir -p ${blkidudebdir}/lib
mv ${udebdir}/lib/libblkid.* ${blkidudebdir}/lib
+ mkdir -p ${uuidudebdir}/lib
+ mv ${udebdir}/lib/libuuid.* ${uuidudebdir}/lib
+
binary-indep:
# no arch-independant debs.
done
# mkinitrd script
- mkdir -p debian/e2fsprogs/etc/mkinitrd/scripts
- install -m755 debian/e2fsprogs.mkinitrd \
- debian/e2fsprogs/etc/mkinitrd/scripts/e2fsprogs
+ mkdir -p debian/e2fsprogs/usr/share/initrd-tools/scripts
+ install -m755 debian/initrd-tools.e2fsprogs \
+ debian/e2fsprogs/usr/share/initrd-tools/scripts/e2fsprogs
+
+ # initrd script
+ mkdir -p debian/e2fsprogs/usr/share/e2fsprogs
+ install -m755 debian/initrd.ext3-add-journal \
+ debian/e2fsprogs/usr/share/e2fsprogs/initrd.ext3-add-journal
+
# symlinks to prepare dh_installdocs run
mkdir -p ${debdir}/e2fsck-static/usr/share/doc/
install -m 644 debian/libblkid.copyright \
${debdir}/libblkid${BLKID_SOVERSION}/usr/share/doc/libblkid${BLKID_SOVERSION}/copyright
- dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb
+ dh_installdocs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
# HTML docs
install -d ${debdir}/e2fslibs-dev/usr/share/doc/e2fslibs/html-info/
dh_compress
dh_fixperms
- dh_makeshlibs
+ dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
dh_makeshlibs -plibcomerr${COMERR_SOVERSION} \
-V 'libcomerr2 (>= 1.33-3)'
dh_shlibdeps -l${stdbuilddir}/lib
dh_shlibdeps -pe2fsprogs -l${stdbuilddir}/lib \
-u"-Ldebian/e2fsprogs.shlibs.local"
+ dh_shlibdeps -pe2fsprogs-udeb -l${stdbuilddir}/lib \
+ -u"-Ldebian/e2fsprogs-udeb.shlibs.local"
dh_gencontrol -Ncomerr-dev -Nss-dev -Nuuid-dev \
- -Ne2fsprogs-udeb -Nlibblkid1-udeb
+ -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
DH_OPTIONS= dh_gencontrol -pcomerr-dev \
-u '-v${COMERR_VERSION}-${MAIN_VERSION}'
DH_OPTIONS= dh_gencontrol -pss-dev \
DH_OPTIONS= dh_gencontrol -puuid-dev \
-u '-v${UUID_VERSION}-${MAIN_VERSION}'
- dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb
- dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb
+ dh_md5sums -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
+ dh_builddeb -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
# udeb stuff
dh_gencontrol -pe2fsprogs-udeb -- -fdebian/files~
dpkg-distaddfile $(BLKID_UDEB_NAME) debian-installer $(BLKID_UDEB_PRIORITY)
dh_builddeb -plibblkid1-udeb --filename=$(BLKID_UDEB_NAME)
+ dh_gencontrol -plibuuid1-udeb -- -fdebian/files~
+ dpkg-distaddfile $(UUID_UDEB_NAME) debian-installer $(UUID_UDEB_PRIORITY)
+ dh_builddeb -plibuuid1-udeb --filename=$(UUID_UDEB_NAME)
+
binary: binary-indep binary-arch
.PHONY: binary binary-arch binary-indep clean checkroot