#!/usr/bin/make -f include base/version.mak include /usr/share/dpkg/pkg-info.mk # detect if build targets experimental suite (or is a draft) DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION)) pkg-x11 = ghostscript-x pkg-data = libgs$(GS_VERSION_MAJOR)-common binaries := $(shell dh_listpackages) # don't run configure during autogen.sh export NOCONFIGURE = 1 fontdirs = /var/lib/ghostscript/fonts /usr/share/cups/fonts \ /usr/share/ghostscript/fonts /usr/local/lib/ghostscript/fonts \ /usr/share/fonts # Remove some of the scripts DEB_DH_INSTALL_ARGS_ALL += $(addprefix -Xbin/,\ unix-lpr.sh lprsetup.sh pv.sh fixmswrd.pl) # Do not include the Ghostscript loader executable with GTK support DEB_DH_INSTALL_ARGS_ALL += -Xbin/gsx # Move ICC profiles to shared dir, to allow reuse by others. DEB_DH_LINK_$(pkg-data) += \ /usr/share/color/icc/ghostscript usr/share/ghostscript/$(GS_DOT_VERSION)/iccprofiles # Strip CMap files (separately packaged in poppler-data) DEB_DH_INSTALL_ARGS_ALL += -X/Resource/CMap DEB_DH_LINK_$(pkg-data) += \ var/lib/ghostscript/CMap usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/CMap # Recommend fonts-droid (not ship DroidSansFallback.ttf) DEB_DH_INSTALL_ARGS_ALL += -XDroidSansFallback.ttf DEB_DH_LINK_$(pkg-data) += \ /usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf \ /usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/CIDFSubst/DroidSansFallback.ttf # relax symbols check when bootstrapping an arch or targeting experimental STAGE1 = $(findstring stage1,$(DEB_BUILD_PROFILES)) export DPKG_GENSYMBOLS_CHECK_LEVEL=$(if $(DEB_SUITE_EXP)$(STAGE1),0,1) # # FIXME: Enable parallel when not causing spurious errors like this: # %: dh $@ --no-parallel # use upstream bootstrapping script override_dh_autoreconf: dh_autoreconf ./autogen.sh # * TODO: enable pcl when supporting system-shared libjpeg # # * TODO: maybe enable openjpeg (requires fork for ICC and CMYK support) override_dh_auto_configure: dh_auto_configure -- \ --without-pcl \ --with-x --disable-gtk \ --enable-dynamic \ --disable-compile-inits \ --with-fontpath=$(subst $() ,:,$(strip $(fontdirs))) override_dh_auto_build: dh_auto_build -- so $(gs_opts) # check that tracked issues are solved override_dh_auto_test: GS="LD_LIBRARY_PATH=sobin GS_LIB=Resource/Init sobin/gsc" \ $(MAKE) --file debian/tests/smoke.mk GS="LD_LIBRARY_PATH=sobin GS_LIB=Resource/Init sobin/gsc" \ $(MAKE) --file debian/tests/issues/bug_700317/check.mk override_dh_auto_install: $(MAKE) soinstall DESTDIR=debian/tmp override_dh_install: # Rename /usr/bin/gsc, to not conflict with gambc mv debian/tmp/usr/bin/gsc debian/tmp/usr/bin/gs mkdir -p debian/tmp/usr/sbin/ install -m 755 debian/update-gsfontmap debian/tmp/usr/sbin # Move ICC profiles to shared dir, to allow reuse by others. mkdir -p debian/tmp/usr/share/color/icc mv debian/tmp/usr/share/ghostscript/$(GS_DOT_VERSION)/iccprofiles \ debian/tmp/usr/share/color/icc/ghostscript dh_install --package=$(pkg-data) $(DEB_DH_INSTALL_ARGS_ALL) \ usr/share/ghostscript/$(GS_DOT_VERSION)/ dh_install --no-package=$(pkg-data) $(DEB_DH_INSTALL_ARGS_ALL) dh_link --package=$(pkg-data) -- $(DEB_DH_LINK_$(pkg-data)) dh_link --no-package=$(pkg-data) ifneq ($(filter $(pkg-data),$(binaries)),) file='debian/$(pkg-data)/usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Init/cidfmap'; \ ! egrep -v '^(%([^%].*)?)?$$' "$$file" && rm "$$file" || ( \ echo; \ echo 'ERROR: cidfmap not virtually empty as expected,'; \ echo ' so some alternative to just dropping that file is required.'; \ echo ' More info at bug#531182.'; \ exit 1 ) rename 's/$$/.t1/' \ debian/$(pkg-data)/usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Font/* dh_linktree -p$(pkg-data) -- \ replace usr/share/fonts/type1/urw-base35 \ usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Font rename 's/\.t1$$//' \ debian/$(pkg-data)/usr/share/ghostscript/$(GS_DOT_VERSION)/Resource/Font/* endif override_dh_compress: dh_compress -X.pdf override_dh_strip: dh_strip --dbgsym-migration='ghostscript-dbg (<< 9.53.3~dfsg-2~)' # suppress shlibs resolving for library shipped with its only executable override_dh_makeshlibs: dh_makeshlibs --package=$(pkg-x11) -n dh_makeshlibs --no-package=$(pkg-x11)