debian: create dbgsym packages if debhelper supports them

Starting with Debian Stretch, we now have support for dbgsym packages
which are uploaded to a separate package archive.  Since some people
might want to try to backport e2fsprogs 1.43 for Jessie set things up
so that the package can be built on older Debiain systems (where the
legacy dbg packages will be created) as well as newer (as of this
writing, Debian Sid or Stretch).

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debian
Theodore Ts'o 2016-05-20 13:37:58 -04:00
parent 01995578ed
commit a67286396e
3 changed files with 56 additions and 26 deletions

2
debian/compat vendored
View File

@ -1 +1 @@
7 9

18
debian/control.in vendored
View File

@ -7,7 +7,7 @@ Source: e2fsprogs
Section: admin Section: admin
Priority: required Priority: required
Maintainer: Theodore Y. Ts'o <tytso@mit.edu> Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
Build-Depends: gettext, texinfo, pkg-config, gcc-multilib [mips mipsel], libfuse-dev, libattr1-dev, debhelper (>= 7.0), UTIL_LINUX_NG_DEFINES m4 Build-Depends: gettext, texinfo, pkg-config, gcc-multilib [mips mipsel], libfuse-dev, libattr1-dev, debhelper (>= 9.0), UTIL_LINUX_NG_DEFINES m4
Standards-Version: 3.9.8 Standards-Version: 3.9.8
Homepage: http://e2fsprogs.sourceforge.net Homepage: http://e2fsprogs.sourceforge.net
@ -259,7 +259,7 @@ Description: ext2/ext3/ext4 file system utilities
This package contains programs for creating, checking, and maintaining This package contains programs for creating, checking, and maintaining
ext2/3/4-based file systems. It also includes the "badblocks" program, ext2/3/4-based file systems. It also includes the "badblocks" program,
which can be used to scan for bad blocks on a disk or other storage device. which can be used to scan for bad blocks on a disk or other storage device.
ifdef(`USE_DBGSYM',,``
Package: e2fsprogs-dbg Package: e2fsprogs-dbg
Section: debug Section: debug
Priority: extra Priority: extra
@ -269,8 +269,9 @@ Description: debugging information for e2fsprogs
This package includes the debug information useful for debugging e2fsprogs This package includes the debug information useful for debugging e2fsprogs
and its libraries, contained in the e2fsprogs and e2fsck-static packages. and its libraries, contained in the e2fsprogs and e2fsck-static packages.
The debug information is used for execution tracing and core The debug information is used for execution tracing and core
dump analysis. dump analysis.
ifdef(`UTIL_LINUX_NG',,`` '')
ifdef(`USE_DBGSYM',,ifdef(`UTIL_LINUX_NG',,``
Package: uuid-runtime-dbg Package: uuid-runtime-dbg
Section: debug Section: debug
Priority: extra Priority: extra
@ -281,8 +282,8 @@ Description: debugging information for uuid-runtime
uuid runtime programs, contained in the uuid-runtime package. uuid runtime programs, contained in the uuid-runtime package.
The debugging information is used for execution tracing and core The debugging information is used for execution tracing and core
dump analysis. dump analysis.
'')dnl ''))dnl
ifdef(`USE_DBGSYM',,``
Package: e2fslibs-dbg Package: e2fslibs-dbg
Section: debug Section: debug
Priority: extra Priority: extra
@ -312,7 +313,8 @@ Description: debugging information for libss2
This package includes the debug information useful for debugging the This package includes the debug information useful for debugging the
ss library, contained in the libss2 package. The debug information ss library, contained in the libss2 package. The debug information
is used for execution tracing and core dump analysis. is used for execution tracing and core dump analysis.
ifdef(`UTIL_LINUX_NG',,`` '')dnl
ifdef(`USE_DBGSYM',,ifdef(`UTIL_LINUX_NG',,``
Package: libblkid1-dbg Package: libblkid1-dbg
Section: debug Section: debug
Priority: extra Priority: extra
@ -332,4 +334,4 @@ Description: debugging information for libuuid1
This package includes the debug information useful for debugging the This package includes the debug information useful for debugging the
UUID library, contained in the libuuid1 package. The debug UUID library, contained in the libuuid1 package. The debug
information is used for execution tracing and core dump analysis. information is used for execution tracing and core dump analysis.
'')dnl ''))dnl

62
debian/rules vendored
View File

@ -25,6 +25,18 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null
DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian) DISTRO :=$(shell sed -ne '/DISTRIB_ID/s/.*=//p' /etc/lsb-release 2>/dev/null || echo Debian)
UTIL_LINUX_NG ?= yes UTIL_LINUX_NG ?= yes
DH_VERSION := $(shell dpkg-query -W -f '$${Version}' debhelper)
# USE_DBGSYM :=
USE_DBGSYM ?= $(shell if dpkg --compare-versions $(DH_VERSION) ">=" 9.20160114 ; then echo yes ; fi)
ifeq ($(USE_DBGSYM),yes)
dh_strip_args = -p$(1) --dbgsym-migration='$(1)-dbg (<= 1.43-1)'
dh_strip_args2 = -p$(1) --dbgsym-migration='$(2)-dbg (<= 1.43-1)'
else
dh_strip_args = -p$(1) --dbg-package=$(1)-dbg
dh_strip_args2 = -p$(1) --dbg-package=$(2)-dbg
endif
# find the version for the main package, from changelog file # find the version for the main package, from changelog file
MAIN_VERSION = $(shell head -n 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, # find versions for libraries going into their own packages, from their Makefile.in's,
@ -211,9 +223,19 @@ endif
endif endif
M4_ARGS= M4_ARGS=
DBG_PACKAGES=
ifeq ($(USE_DBGSYM),yes)
M4_ARGS+=-DUSE_DBGSYM
else
DBG_PACKAGES += -pe2fsprogs-dbg -pe2fslibs-dbg -plibcomerr2-dbg -plibss2-dbg
M4_ARGS+=-UUSE_DBGSYM
endif
ifeq ($(UTIL_LINUX_NG),yes) ifeq ($(UTIL_LINUX_NG),yes)
M4_ARGS+=-DUTIL_LINUX_NG M4_ARGS+=-DUTIL_LINUX_NG
else else
DBG_PACKAGES += -puuid-runtime-dbg -plibuuid1-dbg -plibblkid1-dbg
M4_ARGS+=-UUTIL_LINUX_NG M4_ARGS+=-UUTIL_LINUX_NG
endif endif
@ -547,35 +569,30 @@ endif
DH_OPTIONS= dh_installchangelogs -pe2fsprogs \ DH_OPTIONS= dh_installchangelogs -pe2fsprogs \
-plibcomerr${COMERR_SOVERSION} \ -plibcomerr${COMERR_SOVERSION} \
-plibss${SS_SOVERSION} \ -plibss${SS_SOVERSION} \
-pe2fslibs \ -pe2fslibs $(DBG_PACKAGES)
-pe2fsprogs-dbg -pe2fslibs-dbg \
-plibcomerr2-dbg -plibss2-dbg
ifneq ($(BUILD_E2FSCK_STATIC),no) ifneq ($(BUILD_E2FSCK_STATIC),no)
DH_OPTIONS= dh_installchangelogs -pe2fsck-static DH_OPTIONS= dh_installchangelogs -pe2fsck-static
endif endif
ifneq ($(UTIL_LINUX_NG),yes) ifneq ($(UTIL_LINUX_NG),yes)
DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \ DH_OPTIONS= dh_installchangelogs -plibuuid${UUID_SOVERSION} \
-puuid-dev -puuid-runtime -puuid-runtime-dbg -plibuuid1-dbg \ -puuid-dev -puuid-runtime -plibblkid${BLKID_SOVERSION}
-plibblkid${BLKID_SOVERSION} -plibblkid1-dbg
endif endif
dh_fixperms dh_fixperms
dh_strip -pe2fsprogs --dbg-package=e2fsprogs-dbg dh_strip $(call dh_strip_args,e2fsprogs)
ifneq ($(BUILD_E2FSCK_STATIC),no) ifneq ($(BUILD_E2FSCK_STATIC),no)
dh_strip -pe2fsck-static --dbg-package=e2fsprogs-dbg dh_strip $(call dh_strip_args2,e2fsck-static,e2fsprogs)
endif endif
ifneq ($(ismips),) ifneq ($(ismips),)
dh_strip -pe2fslibs --dbg-package=e2fslibs-dbg -Xlib64ext2fs-nopic.a dh_strip $(call dh_strip_args,e2fslibs) -Xlib64ext2fs-nopic.a
else else
dh_strip -pe2fslibs --dbg-package=e2fslibs-dbg dh_strip $(call dh_strip_args,e2fslibs)
endif endif
dh_strip -plibss${SS_SOVERSION} --dbg-package=libss${SS_SOVERSION}-dbg dh_strip $(call dh_strip_args,libss${SS_SOVERSION})
dh_strip -plibcomerr${COMERR_SOVERSION} \ dh_strip $(call dh_strip_args,libcomerr${COMERR_SOVERSION})
--dbg-package=libcomerr${COMERR_SOVERSION}-dbg
ifneq ($(UTIL_LINUX_NG),yes) ifneq ($(UTIL_LINUX_NG),yes)
dh_strip -plibblkid${BLKID_SOVERSION} \ dh_strip $(call dh_strip_args,libblkid${BLKID_SOVERSION})
--dbg-package=libblkid${BLKID_SOVERSION}-dbg dh_strip $(call dh_strip_args,libuuid${UUID_SOVERSION})
dh_strip -plibuuid${UUID_SOVERSION} --dbg-package=libuuid${UUID_SOVERSION}-dbg
endif endif
dh_strip dh_strip
@ -589,11 +606,14 @@ endif
/bin/rm debian/$$i.tmp-patch; \ /bin/rm debian/$$i.tmp-patch; \
done done
for i in e2fsprogs e2fsprogs-dbg e2fslibs e2fslibs-dbg; do \ for i in e2fsprogs e2fslibs \
$(if $(filter $(USE_DBGSYM),yes),,e2fsprogs-dbg e2fslibs-dbg) ; \
do \
$(INSTALL) -p -m 0644 debian/copyright \ $(INSTALL) -p -m 0644 debian/copyright \
${debdir}/$$i/usr/share/doc/$$i/copyright; \ ${debdir}/$$i/usr/share/doc/$$i/copyright; \
done done
ifneq ($(USE_DBGSYM),yes)
ifneq ($(UTIL_LINUX_NG),yes) ifneq ($(UTIL_LINUX_NG),yes)
$(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \ $(INSTALL) -p -m 0644 debian/uuid-runtime.copyright \
${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright ${uuidruntimedbgdir}/usr/share/doc/uuid-runtime-dbg/copyright
@ -612,7 +632,7 @@ ifneq ($(UTIL_LINUX_NG),yes)
$(INSTALL) -p -m 0644 debian/libuuid1.copyright \ $(INSTALL) -p -m 0644 debian/libuuid1.copyright \
${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright ${libuuiddbgdir}/usr/share/doc/libuuid1-dbg/copyright
endif endif
endif
dh_compress dh_compress
dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb dh_makeshlibs -Ne2fsprogs-udeb -Nlibblkid1-udeb -Nlibuuid1-udeb
@ -680,3 +700,11 @@ debug_flags:
@echo CFLAGS is $(CFLAGS) @echo CFLAGS is $(CFLAGS)
@echo LDFLAGS is $(LDFLAGS) @echo LDFLAGS is $(LDFLAGS)
@echo CPPFLAGS is $(CPPFLAGS) @echo CPPFLAGS is $(CPPFLAGS)
debug:
echo $(DH_VERSION)
echo $(USE_DBGSYM)
echo $(call dh_strip_args,e2fsprogs)
echo $(call dh_strip_args2,e2fsck-static,e2fsprogs)
echo $(DBG_PACKAGES)
echo $(if $(filter $(USE_DBGSYM),yes),,e2fsprogs-dbg e2fslibs-dbg)