| 1 |
#! /usr/bin/make -f |
| 2 |
# Build the libgcrypt package for Debian. |
| 3 |
|
| 4 |
export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 |
| 5 |
export DEB_BUILD_MAINT_OPTIONS := hardening=+bindnow |
| 6 |
# DEB_HOST_MULTIARCH is set by dpkg-buildpackage but not mandated by policy, |
| 7 |
# provide fallback. |
| 8 |
ifeq ($(origin DEB_HOST_MULTIARCH), undefined) |
| 9 |
export DEB_HOST_MULTIARCH = \ |
| 10 |
$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) |
| 11 |
endif |
| 12 |
|
| 13 |
include /usr/share/dpkg/pkg-info.mk |
| 14 |
|
| 15 |
override_dh_auto_configure: |
| 16 |
# unbreak arch-only builds when texi is patched. |
| 17 |
if test doc/gcrypt.texi -nt doc/version.texi ; then \ |
| 18 |
touch --reference=doc/version.texi doc/gcrypt.texi ; \ |
| 19 |
fi |
| 20 |
dh_auto_configure --verbose --builddirectory=build -- \ |
| 21 |
--enable-noexecstack \ |
| 22 |
--enable-ld-version-script --enable-static |
| 23 |
|
| 24 |
override_dh_auto_build-indep: |
| 25 |
# use current version in /usr/share/texmf/tex/texinfo/, see #803081 |
| 26 |
rm -f build-aux/texinfo.tex |
| 27 |
cd build/doc && $(MAKE) stamp-vti |
| 28 |
cd build/doc && $(MAKE) pdf html |
| 29 |
for cpu in i686 x86_64; do \ |
| 30 |
mkdir -p build-$$cpu-w64-mingw32 && \ |
| 31 |
cd build-$$cpu-w64-mingw32 && \ |
| 32 |
env -u CFLAGS -u CPPFLAGS -u CXXFLAGS -u DFLAGS \ |
| 33 |
-u FCFLAGS -u FFLAGS -u GCJFLAGS -u LDFLAGS -u OBJCFLAGS \ |
| 34 |
-u OBJCXXFLAGS \ |
| 35 |
PKG_CONFIG_LIBDIR=/usr/$$cpu-w64-mingw32/pkgconfig \ |
| 36 |
../configure \ |
| 37 |
--enable-static \ |
| 38 |
--prefix=/usr/$$cpu-w64-mingw32 \ |
| 39 |
--host=$$cpu-w64-mingw32 --build=$(DEB_HOST_GNU_TYPE) \ |
| 40 |
&& \ |
| 41 |
$(MAKE) \ |
| 42 |
|| exit 1 ; \ |
| 43 |
cd .. ; \ |
| 44 |
done |
| 45 |
|
| 46 |
debian/tmp/usr/include/gcrypt.h: |
| 47 |
dh_auto_install --verbose --builddirectory=build |
| 48 |
|
| 49 |
override_dh_auto_install-indep: debian/tmp/usr/include/gcrypt.h |
| 50 |
for cpu in i686 x86_64; do \ |
| 51 |
cd build-$$cpu-w64-mingw32 && \ |
| 52 |
$(MAKE) install DESTDIR=$(shell pwd)/debian/tmp \ |
| 53 |
|| exit 1 ; \ |
| 54 |
cd .. ; \ |
| 55 |
done |
| 56 |
find debian/tmp -name libgcrypt.la -type f -delete |
| 57 |
|
| 58 |
override_dh_auto_install-arch: |
| 59 |
dh_auto_install --arch --verbose --builddirectory=build |
| 60 |
install -m755 debian/clean-up-unmanaged-libraries \ |
| 61 |
debian/libgcrypt20/usr/share/libgcrypt20/ |
| 62 |
|
| 63 |
override_dh_installinfo: |
| 64 |
dh_installinfo |
| 65 |
if test -e debian/libgcrypt20-doc ; then \ |
| 66 |
cd debian/libgcrypt20-doc/usr/share/info && \ |
| 67 |
sed -i -e 's:image src="\([^"]*.png"\):image src="/usr/share/doc/libgcrypt20-doc/html/\1:g' *.info* ; \ |
| 68 |
fi |
| 69 |
|
| 70 |
%: |
| 71 |
dh $@ --builddirectory=build |