File: rules

package info (click to toggle)
ghostscript 8.62.dfsg.1-3.2lenny5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 55,332 kB
  • ctags: 73,646
  • sloc: ansic: 505,865; sh: 34,002; python: 4,917; cpp: 3,961; asm: 3,565; ada: 1,681; tcl: 1,469; pascal: 1,089; makefile: 885; cs: 879; lisp: 407; xml: 263; perl: 158; awk: 66; yacc: 15
file content (142 lines) | stat: -rwxr-xr-x 5,916 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

DEB_AUTO_UPDATE_AUTOCONF=yes

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/dpatch.mk

# for building w/ FAPI
#FT_CPPFLAGS = $(shell pkg-config --cflags freetype2)
#FT_LDFLAGS=$(shell pkg-config --libs freetype2)
#FT_OPTS := FT_BRIDGE=1 FT_CFLAGS=$(FT_CPPFLAGS) FT_LIB=$(FT_LDFLAGS)

#ifeq ($(DEB_HOST_ARCH),s390)
#	CC=gcc-3.4
#else
#	CC=gcc
#endif

# Handling DEB_BUILD_OPTIONS
#export DEB_BUILD_OPTIONS=noopt,nostrip
CFLAGS:=$(CFLAGS) -g $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2) 

DEB_CONFIGURE_SCRIPT_ENV := CFLAGS="$(CFLAGS) -fPIC" CPPFLAGS="$(FT_CPPFLAGS)" LDFLAGS="-lpaper $(FT_LDFLAGS)"
DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
	--with-ijs --with-jbig2dec --with-jasper --with-x --disable-gtk \
	--enable-dynamic --with-omni --enable-cups --disable-compile-inits \
	--with-drivers=ALL \
	--with-fontpath=/var/lib/defoma/gs.d/dirs/fonts:/usr/share/cups/fonts:/usr/share/ghostscript/fonts:/usr/local/lib/ghostscript/fonts:/usr/share/fonts:/usr/share/fonts/type1/gsfonts
DEB_MAKE_BUILD_TARGET := STDDIRS $(FT_OPTS)
DEB_MAKE_INSTALL_TARGET := soinstall install-shared install-cups install-contrib-extras \
		DESTDIR=$(CURDIR)/debian/ghostscript \
		prefix=/usr \
		datadir=/usr/share \
		gsdir=/usr/share/ghostscript \
		docdir=/usr/share/doc/ghostscript \
		exdir=/usr/share/doc/ghostscript/examples \
		CUPSSERVERBIN=/usr/lib/cups \
		CUPSSERVER=/usr/lib/cups \
		CUPSSERVERROOT=/etc/cups \
		CUPSDATA=/usr/share/ppd/ghostscript

fail-if-cmaps-exist:
	@test ! -d Resource/CMap || ( \
		echo; \
		echo 'ERROR: Source contains CMaps that are declared non-free.'; \
		echo '       Please strip Resource/CMap from source!'; \
		exit 1)

fail-if-jasper-pdfs-exist:
	@test ! -f jasper/doc/*.pdf || ( \
		echo; \
		echo 'ERROR: Source contains JasPer PDFs that are declared non-free.'; \
		echo '       Please remove PDFs from source!'; \
		exit 1)

clean::
	-cd jasper && $(MAKE) distclean
	[ ! -f Makefile ] || $(MAKE) soclean
	[ ! -f Makefile ] || $(MAKE) distclean
        # These are somehow left...
	-rm -rf sobin soobj cups/pstopxl cups/pstoraster

build/ghostscript::
	#/usr/bin/docbook-to-man debian/ghostscript.sgml > ghostscript.1

build/ghostscript-x::
	$(MAKE) obj/X11.so

build/libgs8::
	$(MAKE) so

install/ghostscript::
	# Move *.types and *.convs files from /etc/cups to
	# /usr/share/cups/mime, so that they are not considered conffiles
	mkdir -p $(CURDIR)/debian/ghostscript/usr/share/cups/mime/
	mv $(CURDIR)/debian/ghostscript/etc/cups/*.types \
	   $(CURDIR)/debian/ghostscript/usr/share/cups/mime/ 2> /dev/null || :
	mv $(CURDIR)/debian/ghostscript/etc/cups/*.convs \
	   $(CURDIR)/debian/ghostscript/usr/share/cups/mime/ 2> /dev/null || :
	rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc/cups
	rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/ghostscript/etc

	# Install DeFoMa script
	install -m 644 $(CURDIR)/debian/gs.defoma $(CURDIR)/debian/ghostscript/usr/share/defoma/scripts

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

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

	# Rename /usr/bin/gsc, to not conflict with gambc (bug LP #118785).
	mv $(CURDIR)/debian/ghostscript/usr/bin/gsc $(CURDIR)/debian/ghostscript/usr/bin/gs

	# Some convenience links
	ln -s /usr/bin/gs $(CURDIR)/debian/ghostscript/usr/bin/ghostscript
	ln -s /usr/share/man/man1/gs.1 $(CURDIR)/debian/ghostscript/usr/share/man/man1/ghostscript.1

	# Remove C headers, they go into the libgs-dev package
	rm -rf $(CURDIR)/debian/ghostscript/usr/include

install/ghostscript-x::
	# Separate the dynamic library for X support into the ghostscript-x
	# package
	mkdir -p $(CURDIR)/debian/ghostscript-x/usr/lib/
	mv $(CURDIR)/debian/ghostscript/usr/lib/ghostscript $(CURDIR)/debian/ghostscript-x/usr/lib/

install/ghostscript-doc::
	# Move documentation into the ghostscript-doc package
	mkdir -p $(CURDIR)/debian/ghostscript-doc/usr/share/
	mv $(CURDIR)/debian/ghostscript/usr/share/doc $(CURDIR)/debian/ghostscript-doc/usr/share/
	# Install cjk examples too
	install -d  $(CURDIR)/debian/ghostscript-doc/usr/share/doc/ghostscript/examples/cjk
	install -m 644 $(CURDIR)/examples/cjk/* $(CURDIR)/debian/ghostscript-doc/usr/share/doc/ghostscript/examples/cjk

binary-post-install/ghostscript::
	# for non-arch-all builds, we need to remove the
	# documentation manually, since install/ghostscript-doc is not called
	# for them
	rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/*.htm
	rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/*.html
	rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/*.css
	rm -f $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/README
	rm -rf $(CURDIR)/debian/ghostscript/usr/share/doc/ghostscript/examples

install/libgs8::
	# Move libgs into the libgs8 package
	mkdir -p $(CURDIR)/debian/libgs8/usr/lib/
	rm -f $(CURDIR)/debian/ghostscript/usr/lib/libgs*
	cp sobin/libgs.so.8.* $(CURDIR)/debian/libgs8/usr/lib/
	cp -P sobin/libgs.so.8 $(CURDIR)/debian/libgs8/usr/lib/

	# Move libgs.so link into the libgs-dev package
	# and install also the C headers there
	mkdir -p $(CURDIR)/debian/libgs-dev/usr/lib/
	cp -P sobin/libgs.so $(CURDIR)/debian/libgs-dev/usr/lib/
	mkdir -p $(CURDIR)/debian/libgs-dev/usr/include/ghostscript
	install -m 644 $(CURDIR)/src/iapi.h $(CURDIR)/debian/libgs-dev/usr/include/ghostscript
	install -m 644 $(CURDIR)/src/ierrors.h $(CURDIR)/debian/libgs-dev/usr/include/ghostscript
	install -m 644 $(CURDIR)/src/gdevdsp.h $(CURDIR)/debian/libgs-dev/usr/include/ghostscript