File: rules

package info (click to toggle)
ghostscript 8.71~dfsg2-9%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 79,896 kB
  • ctags: 80,654
  • sloc: ansic: 501,432; sh: 25,689; python: 4,853; cpp: 3,633; perl: 3,597; tcl: 1,480; makefile: 1,187; lisp: 407; asm: 284; xml: 263; awk: 66; csh: 17; yacc: 15
file content (302 lines) | stat: -rwxr-xr-x 12,218 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2004-2009, Masayuki Hatta (mhatta) <mhatta@debian.org>
# Copyright © 2009-2010, Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for GPL Ghostscript
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk

# ABI by default follows upstream version (without repackaging suffix)
abi = $(DEB_UPSTREAM_TARBALL_VERSION)
libname = libgs
libpkgname = $(libname)8

DEB_UPSTREAM_URL = http://ghostscript.com/releases
DEB_UPSTREAM_TARBALL_MD5 = 51a522a5b4818bd3dc7c1c0e9dd22bad

# Non-DFSG license limited to verbatim copying
DEB_UPSTREAM_REPACKAGE_EXCLUDES += ./Resource/CMap/90ms-RKSJ-UCS2 \
	./Resource/CMap/90pv-RKSJ-UCS2 \
	./Resource/CMap/90pv-RKSJ-UCS2C \
	./Resource/CMap/Adobe-CNS1-B5pc \
	./Resource/CMap/Adobe-CNS1-ETenms-B5 \
	./Resource/CMap/Adobe-CNS1-H-CID \
	./Resource/CMap/Adobe-CNS1-H-Host \
	./Resource/CMap/Adobe-CNS1-H-Mac \
	./Resource/CMap/Adobe-CNS1-UCS2 \
	./Resource/CMap/Adobe-GB1-GBK-EUC \
	./Resource/CMap/Adobe-GB1-GBpc-EUC \
	./Resource/CMap/Adobe-GB1-H-CID \
	./Resource/CMap/Adobe-GB1-H-Host \
	./Resource/CMap/Adobe-GB1-H-Mac \
	./Resource/CMap/Adobe-GB1-UCS2 \
	./Resource/CMap/Adobe-Japan1-90ms-RKSJ \
	./Resource/CMap/Adobe-Japan1-90pv-RKSJ \
	./Resource/CMap/Adobe-Japan1-H-CID \
	./Resource/CMap/Adobe-Japan1-H-Host \
	./Resource/CMap/Adobe-Japan1-H-Mac \
	./Resource/CMap/Adobe-Japan1-PS-H \
	./Resource/CMap/Adobe-Japan1-PS-V \
	./Resource/CMap/Adobe-Japan1-UCS2 \
	./Resource/CMap/Adobe-Korea1-H-CID \
	./Resource/CMap/Adobe-Korea1-H-Host \
	./Resource/CMap/Adobe-Korea1-H-Mac \
	./Resource/CMap/Adobe-Korea1-KSCms-UHC \
	./Resource/CMap/Adobe-Korea1-KSCpc-EUC \
	./Resource/CMap/Adobe-Korea1-UCS2 \
	./Resource/CMap/B5pc-UCS2 \
	./Resource/CMap/B5pc-UCS2C \
	./Resource/CMap/CNS01-RKSJ-H \
	./Resource/CMap/CNS02-RKSJ-H \
	./Resource/CMap/CNS03-RKSJ-H \
	./Resource/CMap/CNS04-RKSJ-H \
	./Resource/CMap/CNS05-RKSJ-H \
	./Resource/CMap/CNS06-RKSJ-H \
	./Resource/CMap/CNS07-RKSJ-H \
	./Resource/CMap/CNS15-RKSJ-H \
	./Resource/CMap/ETen-B5-UCS2 \
	./Resource/CMap/GB-RKSJ-H \
	./Resource/CMap/GBK-EUC-UCS2 \
	./Resource/CMap/GBT-RKSJ-H \
	./Resource/CMap/GBpc-EUC-UCS2 \
	./Resource/CMap/GBpc-EUC-UCS2C \
	./Resource/CMap/HK-RKSJ-H \
	./Resource/CMap/Hojo-RKSJ-H \
	./Resource/CMap/KSC-RKSJ-H \
	./Resource/CMap/KSC2-RKSJ-H \
	./Resource/CMap/KSCms-UHC-UCS2 \
	./Resource/CMap/KSCpc-EUC-UCS2 \
	./Resource/CMap/KSCpc-EUC-UCS2C \
	./Resource/CMap/TCVN-RKSJ-H \
	./Resource/CMap/UCS2-90ms-RKSJ \
	./Resource/CMap/UCS2-90pv-RKSJ \
	./Resource/CMap/UCS2-B5pc \
	./Resource/CMap/UCS2-ETen-B5 \
	./Resource/CMap/UCS2-GBK-EUC \
	./Resource/CMap/UCS2-GBpc-EUC \
	./Resource/CMap/UCS2-KSCms-UHC \
	./Resource/CMap/UCS2-KSCpc-EUC
DEB_UPSTREAM_REPACKAGE_EXCLUDES += ./Resource/CMap/Identity-UTF16-H \
	./Resource/CMap/Identity-UTF16-V
# Sources unavailable
#DEB_UPSTREAM_REPACKAGE_EXCLUDES += ./jasper/doc/*.pdf
# unused sources cluttering authorship/licensing tracking
DEB_UPSTREAM_REPACKAGE_EXCLUDES += ./zlib/ ./libpng/ ./jasper/ ./jbig2dec/

# TODO: drop this before next upstream release
DEB_UPSTREAM_REPACKAGE_TAG = dfsg2

# Use system libraries
gs_opts = SHARE_ZLIB=1 SHARE_LIBPNG=1 SHARE_JPEG=1 SHARE_JPX=1 SHARE_LIBTIFF=1 SHARE_EXPAT=1 SHARE_JBIG2=1

gs_opts += CUPSDATA=/usr/share/ppd/ghostscript

# for building w/ FAPI
ifneq (,$(findstring FT_BRIDGE,$(DEB_BUILD_OPTIONS)))
FT_CFLAGS := $(shell pkg-config --cflags freetype2)
FT_LIBS := $(shell pkg-config --libs freetype2)
# TODO: document why CPPFLAGS is used (not CFLAGS)
CPPFLAGS += $(FT_CFLAGS)
LDFLAGS += $(FT_LIBS)
gs_opts += FT_BRIDGE=1 FT_CFLAGS="$(FT_CFLAGS)" FT_LIB="$(FT_LIBS)"
endif

# FIXME: build without PIC for -dev package
CFLAGS += -fPIC

DEB_CONFIGURE_EXTRA_FLAGS = \
	--with-ijs --with-jbig2dec --with-jasper --with-system-libtiff \
	--with-x --disable-gtk \
	--enable-dynamic --with-omni --enable-cups --disable-compile-inits \
	--with-drivers=ALL \
	--with-fontpath=/var/lib/ghostscript/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts
# cairo support still experimental and makes core gs depend on X11 libs.
DEB_CONFIGURE_EXTRA_FLAGS += --disable-cairo

DEB_MAKE_BUILD_TARGET = so gs.a $(gs_opts)
DEB_MAKE_INSTALL_TARGET = soinstall install-cups DESTDIR=$(DEB_DESTDIR) $(gs_opts)

DEB_DH_INSTALL_ARGS = --sourcedir=debian/tmp
DEB_DH_MAKESHLIBS_ARGS = -Pdebian/$(cdbs_curpkg)

# Preserve upstream-shipped patch noise
DEB_CLEAN_EXCLUDE += contrib/pcl3/eprn/eprnrend.c.orig

# put aside upstream-shipped temp files during build but after copyright-check
upstreamtmpfiles = cups/pstopxl cups/pstoraster
pre-build:: debian/stamp-upstreamtmpstuff
debian/stamp-upstreamtmpstuff: debian/stamp-copyright-check
	for file in $(upstreamtmpfiles); do \
		[ ! -e $$file ] || [ -e $$file.upstream ] || mv $$file $$file.upstream; \
	done
	touch $@
clean::
	for file in $(upstreamtmpfiles); do \
		[ ! -e $$file.upstream ] || mv -f $$file.upstream $$file; \
	done
	rm -f debian/stamp-upstreamtmpstuff

# Generate (and cleanup) files containing variables static per build
infiles = $(filter-out debian/control.in, $(wildcard debian/*.in))
outfiles = $(basename $(infiles))
DEB_PHONY_RULES += $(outfiles)
pre-build:: $(outfiles)
$(outfiles): update-config debian/stamp-copyright-check
	sed 's/__ABI__/$(abi)/' <$@.in >$@
clean::
	rm -f $(outfiles)

pre-build clean:: fail-source-not-repackaged

clean::
	[ ! -f Makefile ] || $(MAKE) soclean
	[ ! -f Makefile ] || $(MAKE) distclean
# These are somehow left...
	rm -rf sobin soobj gs.a

install/ghostscript::
	# Remove some of the scripts
	rm $(DEB_DESTDIR)/usr/bin/unix-lpr.sh $(DEB_DESTDIR)/usr/bin/lprsetup.sh $(DEB_DESTDIR)/usr/bin/pv.sh $(DEB_DESTDIR)/usr/bin/fixmswrd.pl

	# Do not include the Ghostscript loader executable with GTK support
	rm -f $(DEB_DESTDIR)/usr/bin/gsx

	# Rename /usr/bin/gsc, to not conflict with gambc
	mv $(DEB_DESTDIR)/usr/bin/gsc $(DEB_DESTDIR)/usr/bin/gs
	mkdir -p $(DEB_DESTDIR)/usr/sbin/
	install -m 755 debian/update-gsfontmap $(DEB_DESTDIR)/usr/sbin

install/$(libpkgname)::
	# Strip CMap files (shipped separately, registered with DeFoMa)
	rm -rf $(DEB_DESTDIR)/usr/share/ghostscript/$(abi)/Resource/CMap

install/libgs-dev::
	mkdir -p $(DEB_DESTDIR)/usr/lib/
	install -m 644 gs.a \
		$(DEB_DESTDIR)/usr/lib/libgs.a

# Let d-shlibs calculate development package dependencies
#  and handle shared library install
binary-post-install/$(libpkgname):: debian/stamp-local-shlibs-$(libname)
debian/stamp-local-shlibs-$(libname): binary-install/$(libpkgname)
	d-shlibmove --commit \
		--override s/libstdc++6.*-dev// \
		--override s/libgnutls26/libgnutls/ \
		--override s/libjasper1/libjasper/ \
		--override s/libpaper1/libpaper/ \
		--devunversioned --ignorelibdep \
		--movedev "debian/tmp/usr/include/*" usr/include/ \
		debian/tmp/usr/lib/$(libname).so
clean::
	rm -f debian/stamp-local-shlibs-$(libname)

install/$(libpkgname)::
	file='$(DEB_DESTDIR)/usr/share/ghostscript/$(abi)/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 )

# Needed at build time
# (separated in core, CUPS, X11 and autotools dependencies)
CDBS_BUILD_DEPENDS += , libjpeg-dev, libpaper-dev, libpng-dev, libz-dev, libfontconfig1-dev, libjasper-dev, libtiff-dev, libexpat-dev, libjbig2dec-dev
CDBS_BUILD_DEPENDS += , libcups2-dev (>= 1.3.7), libcupsimage2-dev (>= 1.1.20final+rc1-4)
CDBS_BUILD_DEPENDS += , freeglut3-dev | libglut-dev, libxt-dev, libxext-dev, libx11-dev, libice-dev, libsm-dev
CDBS_BUILD_DEPENDS += , pkg-config

# Needed (always, often, sometimes) at runtime
CDBS_DEPENDS_ghostscript += , gsfonts (>= 6.0-1), debconf | debconf-2.0, debianutils (>= 1.6), libgs8 (= $(DEB_VERSION))
CDBS_DEPENDS_ghostscript-cups += , ghostscript (>= 8.64~dfsg-8)
CDBS_DEPENDS_ghostscript-x += , ghostscript (= $(DEB_VERSION))
CDBS_DEPENDS_libgs-dev += , libgs8 (= $(DEB_VERSION))
CDBS_RECOMMENDS_ghostscript-cups += , cups, cups-client
CDBS_SUGGESTS_ghostscript += , ghostscript-x, ghostscript-cups, hpijs
CDBS_SUGGESTS_ghostscript-doc += , ghostscript

# Public virtual packages
CDBS_PROVIDES_ghostscript += , postscript-viewer

# Transitional quirk: gs renamed to gs-gpl (and later to ghostscript-x)
# TODO: drop when unused (was introduced before Etch)
CDBS_PROVIDES_ghostscript-x += , gs

# Transitional quirk: gs-gpl renamed to ghostscript (and later to ghostscript-x)
# TODO: drop after Squeeze (was introduced before Lenny)
CDBS_CONFLICTS_ghostscript += , gs-gpl (<< 8.63)
CDBS_REPLACES_ghostscript += , gs-gpl (<< 8.63)
CDBS_DEPENDS_gs-gpl += , ghostscript, ghostscript-x

# Transitional quirk: gs-gpl renamed to ghostscript (and later to ghostscript-x)
# TODO: drop when unused (was introduced before Lenny)
CDBS_PROVIDES_ghostscript-x += , gs-gpl

# Transitional quirk: gs-esp and gs-afpl dropped, functionality is in ghostscript-x
# TODO: drop after Squeeze (was introduced before Lenny)
CDBS_CONFLICTS_ghostscript += , gs-esp (<< 8.63), gs-afpl (<< 8.63)
CDBS_REPLACES_ghostscript += , gs-esp (<< 8.63), gs-afpl (<< 8.63)
CDBS_DEPENDS_gs-esp += , ghostscript, ghostscript-x

# Transitional quirk: gs-esp and gs-afpl dropped, functionality is in ghostscript-x
# TODO: drop when unused (was introduced before Lenny)
CDBS_PROVIDES_ghostscript-x += , gs-esp, gs-afpl

# Transitional quirk: parts of ghostscript split into ghostscript-x
# TODO: drop after Squeeze+1 (was introduced before Squeeze)
CDBS_BREAKS_ghostscript += , ghostscript-x (<< 8.64~dfsg-8)

# Transitional quirk: gs-cjk-resource dropped, functionality is in ghostscript
# TODO: drop after Squeeze (was introduced before Lenny)
CDBS_CONFLICTS_ghostscript += , gs-cjk-resource (<< 1.20010910-1)

# Transitional quirk: gs-common dropped, functionality is in ghostscript
# TODO: drop after Squeeze (was introduced before Lenny)
# Dropping gs-common closes: bug#539754
CDBS_CONFLICTS_ghostscript += , gs-common (<< 8.63)
CDBS_REPLACES_ghostscript += , gs-common (<< 8.63)
CDBS_DEPENDS_gs-common += , ghostscript

# Transitional quirk: gs-common dropped, functionality is in ghostscript
# TODO: drop when unused (was introduced before Lenny)
CDBS_PROVIDES_ghostscript += , gs-common

# Transitional quirk: libgs-esp-dev dropped, functionality is in libgs-dev
# TODO: drop after Squeeze (was introduced before Lenny)
CDBS_CONFLICTS_libgs-dev += , libgs-esp-dev
CDBS_REPLACES_libgs-dev += , libgs-esp-dev

# Transitional quirk: libgs-esp-dev dropped, functionality is in libgs-dev
# TODO: drop when unused (was introduced before Lenny)
CDBS_PROVIDES_libgs-dev += , libgs-esp-dev

# Transition: parts of ghostscript split into ghostscript-cups
# TODO: drop after Squeeze+1 (was introduced before Squeeze)
CDBS_CONFLICTS_ghostscript-cups += , ghostscript (<< 8.64~dfsg-8)
CDBS_REPLACES_ghostscript-cups += , ghostscript (<< 8.64~dfsg-8)

# Transition: arch-indep files moved from ghostscript to libgs8
# TODO: drop when libgs8 is dropped
CDBS_REPLACES_libgs8 += , ghostscript (<< 8.71~dfsg2-7)
CDBS_BREAKS_libgs8 += , ghostscript (<< 8.71~dfsg2-7)

# Needed for our packaging
# * recent d-shlibs needed to handle unversioned -dev package and
#   suppress library dependency here declared indirectly using CDBS
CDBS_BUILD_DEPENDS += , d-shlibs (>= 0.43)