| 1 |
#!/usr/bin/make -f |
| 2 |
# |
| 3 |
# Copyright (C) 1999, 2000, 2001, 2002 Timshel Knoll |
| 4 |
# Licensed under the terms of the GNU General Public License |
| 5 |
# |
| 6 |
# Based (a long time ago) on parted's debian/rules, which in turn is based on |
| 7 |
# `Sample debian/rules that uses debhelper' from dh_make, |
| 8 |
# GNU Copyright (C) 1997 to 1999 by Joey Hess |
| 9 |
|
| 10 |
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) |
| 11 |
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) |
| 12 |
|
| 13 |
export DEB_BUILD_MAINT_OPTIONS := hardening=+all |
| 14 |
|
| 15 |
CONFFLAGS := --sbindir=/usr/sbin --enable-mtrace --enable-shared |
| 16 |
CONFFLAGS += --disable-gcc-warnings |
| 17 |
|
| 18 |
# Enable device-mapper only on Linux |
| 19 |
ifeq (linux, $(DEB_HOST_ARCH_OS)) |
| 20 |
CONFFLAGS += --enable-device-mapper |
| 21 |
else |
| 22 |
CONFFLAGS += --disable-device-mapper |
| 23 |
endif |
| 24 |
|
| 25 |
# Everything above here is common to the deb and udeb builds. |
| 26 |
CONFFLAGS_UDEB := $(CONFFLAGS) |
| 27 |
|
| 28 |
# Options specific to the udeb build. |
| 29 |
CONFFLAGS_UDEB += ac_cv_header_execinfo_h=no --libdir=/usr/lib |
| 30 |
CONFFLAGS_UDEB += --disable-static --without-readline |
| 31 |
|
| 32 |
%: |
| 33 |
dh $@ |
| 34 |
|
| 35 |
# parted 3.7 ships with Gnulib macros that conflict with those from the |
| 36 |
# currently-packaged version of gettext (0.23.2). Review this after the |
| 37 |
# gettext package is next updated. |
| 38 |
override_dh_autoreconf: |
| 39 |
AUTOPOINT=true dh_autoreconf |
| 40 |
|
| 41 |
override_dh_auto_configure: |
| 42 |
dh_auto_configure -Bbuild-deb -- $(CONFFLAGS) |
| 43 |
# We need to unset CFLAGS here to force debhelper to recompute it |
| 44 |
# with the new DEB_CFLAGS_MAINT_APPEND. We also need to unset |
| 45 |
# DH_INTERNAL_BUILDFLAGS to force debhelper to recompute any build |
| 46 |
# flags at all. If there's a better way to do this I'd like to hear |
| 47 |
# about it. |
| 48 |
env -u DH_INTERNAL_BUILDFLAGS -u CFLAGS DEB_CFLAGS_MAINT_APPEND=-Os \ |
| 49 |
dh_auto_configure -Bbuild-udeb -- $(CONFFLAGS_UDEB) |
| 50 |
|
| 51 |
override_dh_auto_build: |
| 52 |
dh_auto_build -Bbuild-deb |
| 53 |
# Only build binaries for the udeb pass. |
| 54 |
$(MAKE) -C build-udeb/lib |
| 55 |
$(MAKE) -C build-udeb/libparted |
| 56 |
$(MAKE) -C build-udeb/parted |
| 57 |
|
| 58 |
override_dh_auto_test: |
| 59 |
|
| 60 |
override_dh_auto_clean: |
| 61 |
[ ! -e Makefile ] || dh_auto_clean |
| 62 |
|
| 63 |
override_dh_auto_install: |
| 64 |
dh_auto_install -Bbuild-deb |
| 65 |
$(MAKE) -C build-udeb/libparted install DESTDIR=$(CURDIR)/debian/tmp-udeb |
| 66 |
$(MAKE) -C build-udeb/parted install DESTDIR=$(CURDIR)/debian/tmp-udeb |
| 67 |
rm -f debian/tmp/usr/lib/*/*.la |
| 68 |
rm -f debian/tmp-udeb/usr/lib/*.la debian/tmp-udeb/usr/lib/*.so |
| 69 |
|
| 70 |
override_dh_install: |
| 71 |
dh_install -Nparted-udeb -Nlibparted2-udeb -Nlibparted-fs-resize0-udeb |
| 72 |
dh_install -pparted-udeb -plibparted2-udeb -plibparted-fs-resize0-udeb --sourcedir=debian/tmp-udeb |
| 73 |
|
| 74 |
override_dh_installdocs-arch: |
| 75 |
dh_installdocs --link-doc=libparted2t64 |
| 76 |
|
| 77 |
override_dh_installdocs-indep: |
| 78 |
dh_installdocs -pparted-doc --doc-main-package=libparted2t64 |
| 79 |
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),) |
| 80 |
mkdir -p doc/libparted/API |
| 81 |
doxygen Doxyfile |
| 82 |
cp -a doc/libparted/API/html/ debian/parted-doc/usr/share/doc/parted-doc/API |
| 83 |
endif |
| 84 |
dh_installdocs --remaining-packages |
| 85 |
|
| 86 |
override_dh_makeshlibs: |
| 87 |
dh_makeshlibs -plibparted2t64 --add-udeb=libparted2-udeb -- -c4 |
| 88 |
dh_makeshlibs -plibparted-fs-resize0t64 --add-udeb=libparted-fs-resize0-udeb -- -c4 |