| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
# get upstream ABI variable, and export it for use by debhelper snippets |
| 4 |
include base/version.mak |
| 5 |
export GS_DOT_VERSION |
| 6 |
|
| 7 |
include /usr/share/dpkg/pkg-info.mk |
| 8 |
|
| 9 |
# detect if build targets experimental suite (or is a draft) |
| 10 |
DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION)) |
| 11 |
|
| 12 |
pkg-data = libgs10-common |
| 13 |
|
| 14 |
binaries := $(shell dh_listpackages) |
| 15 |
|
| 16 |
# don't run configure during autogen.sh |
| 17 |
export NOCONFIGURE = 1 |
| 18 |
|
| 19 |
fontdirs = /var/lib/ghostscript/fonts /usr/share/cups/fonts \ |
| 20 |
/usr/share/ghostscript/fonts /usr/local/lib/ghostscript/fonts \ |
| 21 |
/usr/share/fonts |
| 22 |
|
| 23 |
# Remove some of the scripts |
| 24 |
DEB_DH_INSTALL_ARGS_ALL += $(addprefix -Xbin/,\ |
| 25 |
unix-lpr.sh lprsetup.sh pv.sh fixmswrd.pl) |
| 26 |
|
| 27 |
# Do not include the Ghostscript loader executable with GTK support |
| 28 |
DEB_DH_INSTALL_ARGS_ALL += -Xbin/gsx |
| 29 |
|
| 30 |
# Strip CMap files (separately packaged in poppler-data) |
| 31 |
DEB_DH_INSTALL_ARGS_ALL += -X/Resource/CMap |
| 32 |
|
| 33 |
# Recommend fonts-droid (not ship DroidSansFallback.ttf) |
| 34 |
DEB_DH_INSTALL_ARGS_ALL += -XDroidSansFallback.ttf |
| 35 |
|
| 36 |
# relax symbols check when bootstrapping an arch or targeting experimental |
| 37 |
STAGE1 = $(findstring stage1,$(DEB_BUILD_PROFILES)) |
| 38 |
export DPKG_GENSYMBOLS_CHECK_LEVEL=$(if $(DEB_SUITE_EXP)$(STAGE1),0,1) |
| 39 |
|
| 40 |
# # FIXME: Enable parallel when not causing spurious errors like this: |
| 41 |
# <https://buildd.debian.org/status/fetch.php?pkg=ghostscript&arch=amd64&ver=9.25~dfsg-6&stamp=1541195477&raw=0> |
| 42 |
%: |
| 43 |
dh $@ --no-parallel |
| 44 |
|
| 45 |
# use upstream bootstrapping script |
| 46 |
override_dh_autoreconf: |
| 47 |
dh_autoreconf ./autogen.sh |
| 48 |
|
| 49 |
# * TODO: enable pcl when supporting system-shared libjpeg |
| 50 |
# <https://bugs.ghostscript.com/show_bug.cgi?id=696654> |
| 51 |
# * TODO: maybe enable openjpeg (requires fork for ICC and CMYK support) |
| 52 |
override_dh_auto_configure: |
| 53 |
dh_auto_configure -- \ |
| 54 |
--without-pcl \ |
| 55 |
--with-x --disable-gtk \ |
| 56 |
--disable-compile-inits \ |
| 57 |
--with-fontpath=$(subst $() ,:,$(strip $(fontdirs))) |
| 58 |
|
| 59 |
override_dh_auto_build: |
| 60 |
dh_auto_build -- so $(gs_opts) |
| 61 |
|
| 62 |
execute_after_dh_auto_build-indep: |
| 63 |
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS))) |
| 64 |
sphinx-build -bhtml doc/src doc/build/html |
| 65 |
endif |
| 66 |
|
| 67 |
# check that tracked issues are solved |
| 68 |
override_dh_auto_test: |
| 69 |
ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS))) |
| 70 |
GS="LD_LIBRARY_PATH=sobin GS_LIB=Resource/Init sobin/gsc" \ |
| 71 |
$(MAKE) --file debian/tests/smoke.mk |
| 72 |
GS="LD_LIBRARY_PATH=sobin GS_LIB=Resource/Init sobin/gsc" \ |
| 73 |
$(MAKE) --file debian/tests/issues/bug_700317/check.mk |
| 74 |
endif |
| 75 |
|
| 76 |
override_dh_auto_install: |
| 77 |
$(MAKE) soinstall DESTDIR=debian/tmp |
| 78 |
|
| 79 |
override_dh_install: |
| 80 |
# Rename /usr/bin/gsc, to not conflict with gambc |
| 81 |
mv debian/tmp/usr/bin/gsc debian/tmp/usr/bin/gs |
| 82 |
mkdir -p debian/tmp/usr/sbin/ |
| 83 |
|
| 84 |
install -m 755 debian/update-gsfontmap debian/tmp/usr/sbin |
| 85 |
|
| 86 |
# Move ICC profiles to shared dir, to allow reuse by others. |
| 87 |
mkdir -p debian/tmp/usr/share/color/icc |
| 88 |
mv debian/tmp/usr/share/ghostscript/$(GS_DOT_VERSION)/iccprofiles \ |
| 89 |
debian/tmp/usr/share/color/icc/ghostscript |
| 90 |
|
| 91 |
dh_install $(DEB_DH_INSTALL_ARGS_ALL) |
| 92 |
|
| 93 |
dh_link --package=$(pkg-data) -- $(DEB_DH_LINK_$(pkg-data)) |
| 94 |
dh_link --no-package=$(pkg-data) |
| 95 |
ifneq ($(filter $(pkg-data),$(binaries)),) |
| 96 |
file='debian/$(pkg-data)/usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Init/cidfmap'; \ |
| 97 |
! egrep -v '^(%([^%].*)?)?$$' "$$file" && rm "$$file" || ( \ |
| 98 |
echo; \ |
| 99 |
echo 'ERROR: cidfmap not virtually empty as expected,'; \ |
| 100 |
echo ' so some alternative to just dropping that file is required.'; \ |
| 101 |
echo ' More info at bug#531182.'; \ |
| 102 |
exit 1 ) |
| 103 |
rename 's/$$/.t1/' \ |
| 104 |
debian/$(pkg-data)/usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Font/* |
| 105 |
dh_linktree -p$(pkg-data) -- \ |
| 106 |
replace usr/share/fonts/type1/urw-base35 \ |
| 107 |
usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Font |
| 108 |
rename 's/\.t1$$//' \ |
| 109 |
debian/$(pkg-data)/usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Font/* |
| 110 |
endif |
| 111 |
|
| 112 |
execute_after_dh_installdocs-indep: |
| 113 |
ifeq (,$(filter nodoc,$(DEB_BUILD_PROFILES) $(DEB_BUILD_OPTIONS))) |
| 114 |
dh_sphinxdoc |
| 115 |
endif |
| 116 |
|
| 117 |
override_dh_compress: |
| 118 |
dh_compress -X.pdf |