File: rules

package info (click to toggle)
gnustep-back 0.28.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,056 kB
  • sloc: objc: 39,893; ansic: 6,432; sh: 170; makefile: 154
file content (249 lines) | stat: -rwxr-xr-x 8,403 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
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
#!/usr/bin/make -f
#export DH_VERBOSE = 1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined

# config.mk is provided by gnustep-make package
include /usr/share/GNUstep/debian/config.mk

# Install in debian/tmp
export DESTDIR=$(CURDIR)/debian/tmp

##################### VERSION NUMBERS ###########################

# GNUstep Back version :
v_back := $(shell . ./Version; echo $$VERSION)

# GNUstep Back SONAME version :
sov_back := $(shell . ./Version; echo $$GNUSTEP_BACK_MAJOR_VERSION.$$GNUSTEP_BACK_MINOR_VERSION)

# GNUstep Back INTERFACE version :
ifv_back := $(shell . ./Version; echo $$INTERFACE_VERSION_NUMBER)

# GNUstep Gui version :
v_gui   := $(v_back)

# GNUstep Gui SONAME version :
sov_gui := $(sov_back)

#### PACKAGES NAMES #############################################

p_back          = gnustep-back$(sov_back)
p_art           = gnustep-back$(sov_back)-art
p_cairo         = gnustep-back$(sov_back)-cairo
p_xlib          = gnustep-back$(sov_back)-xlib
p_common        = gnustep-back-common

#### DIRS #######################################################

# build dirs
b_art           = $(CURDIR)/build-art
b_cairo         = $(CURDIR)/build-cairo
b_xlib          = $(CURDIR)/build-xlib

# Debian GNUstep fonts directory
DEB_GNUSTEP_FONTSDIR = /var/lib/GNUstep/Fonts

#################################################################

%:
	dh $@

# Ensure that debian/control is always up-to-date.
override_dh_testdir:
	m4 \
	    -DV_GUI='$(v_gui)' \
	    -DSOV_GUI='$(sov_gui)' \
	    -DSOV_BACK='$(sov_back)' \
		debian/templates/control.m4 > debian/control

override_dh_auto_configure:
# generate gnsutep-back-common.install file
	sed -e 's,@GNUSTEP_SYSTEM_TOOLS@,$(GNUSTEP_SYSTEM_TOOLS),g' \
	    -e 's,@GNUSTEP_SYSTEM_DOC@,$(GNUSTEP_SYSTEM_DOC),g' \
	    debian/templates/$(p_common).install.in > debian/$(p_common).install

# generate gnsutep-back-common.postinst script
	sed -e 's,@DEB_GNUSTEP_FONTSDIR@,$(DEB_GNUSTEP_FONTSDIR),g' \
	    debian/templates/$(p_common).postinst.in > debian/$(p_common).postinst

# generate gnsutep-back-common.preinst script
	sed -e 's,@DEB_GNUSTEP_FONTSDIR@,$(DEB_GNUSTEP_FONTSDIR),g' \
	    debian/templates/$(p_common).preinst.in > debian/$(p_common).preinst

# generate gnsutep-back-common.prerm script
	sed -e 's,@DEB_GNUSTEP_FONTSDIR@,$(DEB_GNUSTEP_FONTSDIR),g' \
	    debian/templates/$(p_common).prerm.in > debian/$(p_common).prerm

# generate gnustep-backN-art.postinst file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:art:g' \
	    -e 's:@PRIORITY@:10:g' \
	    debian/templates/gnustep-backN-backend.postinst.in > debian/$(p_art).postinst

# generate gnustep-backN-art.prerm file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:art:g' \
	    -e 's:@PRIORITY@:10:g' \
	    debian/templates/gnustep-backN-backend.prerm.in > debian/$(p_art).prerm

# generate gnustep-backN-cairo.postinst file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:cairo:g' \
	    -e 's:@PRIORITY@:15:g' \
	    debian/templates/gnustep-backN-backend.postinst.in > debian/$(p_cairo).postinst

# generate gnustep-backN-cairo.prerm file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:cairo:g' \
	    -e 's:@PRIORITY@:15:g' \
	    debian/templates/gnustep-backN-backend.prerm.in > debian/$(p_cairo).prerm

# generate gnustep-backN-xlib.postinst file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:xlib:g' \
	    -e 's:@PRIORITY@:5:g' \
	    debian/templates/gnustep-backN-backend.postinst.in > debian/$(p_xlib).postinst

# generate gnustep-backN-xlib.prerm file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:xlib:g' \
	    -e 's:@PRIORITY@:5:g' \
	    debian/templates/gnustep-backN-backend.prerm.in > debian/$(p_xlib).prerm

# generate gnustep-backN-art.install file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:art:g' \
	    debian/templates/gnustep-backN-backend.install.in > debian/$(p_art).install

# generate gnustep-backN-cairo.install file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:cairo:g' \
	    debian/templates/gnustep-backN-backend.install.in > debian/$(p_cairo).install

# generate gnustep-backN-xlib.install file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:xlib:g' \
	    debian/templates/gnustep-backN-backend.install.in > debian/$(p_xlib).install

# generate gnustep-backN-art.links file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:art:g' \
	    debian/templates/gnustep-backN-backend.links.in > debian/$(p_art).links

# generate gnustep-backN-cairo.links file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:cairo:g' \
	    debian/templates/gnustep-backN-backend.links.in > debian/$(p_cairo).links

# generate gnustep-backN-xlib.links file
	sed -e 's:@GNUSTEP_LIBRARY@:$(GNUSTEP_SYSTEM_LIBRARY):g' \
	    -e 's:@IFVER@:$(ifv_back):g' \
	    -e 's:@BACKEND@:xlib:g' \
	    debian/templates/gnustep-backN-backend.links.in > debian/$(p_xlib).links

# generate gnustep-backN.docs file
	sed -e 's,@GS_LIBRARY@,$(GNUSTEP_SYSTEM_LIBRARY),g' \
	    debian/templates/gnustep-backN.docs.in > debian/$(p_back).docs

# Configure cairo backend
	dh_auto_configure -- \
	    --enable-graphics=cairo --with-name=cairo \
	|| (cat config.log; exit 1)

# Configure art backend in a separate build dir
	dh_auto_configure --builddirectory=$(b_art) -- \
	    --enable-graphics=art --with-name=art \
	|| (cat $(b_art)/config.log; exit 1)

	cp Source -r $(b_art)/Source
	ln -sf \
	    ../Version ../Headers  ../configure ../back.make.in \
	    ../GNUmakefile ../GNUmakefile.postamble \
	    $(b_art)

# Likewise for xlib.
	dh_auto_configure --builddirectory=$(b_xlib) -- \
	    --enable-graphics=xlib --with-name=xlib \
	|| (cat $(b_xlib)/config.log; exit 1)

	cp Source -r $(b_xlib)/Source
	cp Tools -r $(b_xlib)/Tools
	ln -sf \
	    ../Version ../Headers  ../configure ../back.make.in \
	    ../GNUmakefile ../GNUmakefile.postamble \
	    $(b_xlib)

# dpkg-buildflags must be supplied on the command line because
# gnustep-make resets OBJCFLAGS and CFLAGS.
override_dh_auto_build:
	dh_auto_build -- -C Documentation
# Build cairo backend
	dh_auto_build -- \
	    $(verbose) \
	    $(optim) \
	    SERIAL_SUBDIRECTORIES=Source \
	    GNUSTEP_BUILD_DIR=$(b_cairo) \
	    $(shell dpkg-buildflags --export=cmdline)

# Build art backend
	dh_auto_build --builddirectory=$(b_art) -- \
	   $(verbose) \
	   $(optim) \
	   SERIAL_SUBDIRECTORIES=Source \
	   GNUSTEP_BUILD_DIR=$(b_art) \
	   $(shell dpkg-buildflags --export=cmdline)

# Build xlib + tools
	dh_auto_build --builddirectory=$(b_xlib) -- \
	   $(verbose) \
	   $(optim) \
	   fonts=no \
	   GNUSTEP_BUILD_DIR=$(b_xlib) \
	   $(shell dpkg-buildflags --export=cmdline)

override_dh_auto_install:
	dh_auto_install -- -C Documentation
# Install cairo backend
	dh_auto_install -- \
	   SERIAL_SUBDIRECTORIES=Source \
	   GNUSTEP_BUILD_DIR=$(b_cairo)

# Install art backend
	dh_auto_install --builddirectory=$(b_art) -- \
	    SERIAL_SUBDIRECTORIES=Source \
	    GNUSTEP_BUILD_DIR=$(b_art)

# Install the xlib backend along with the tools.
	dh_auto_install --builddirectory=$(b_xlib) -- \
	    fonts=no \
	    GNUSTEP_BUILD_DIR=$(b_xlib)

# Delete duplicate files already shipped at /usr/share/doc/.
	$(RM) -r debian/tmp$(GNUSTEP_SYSTEM_DOC)/Developer/Back/ReleaseNotes

override_dh_auto_clean:
	-dh_auto_clean -- -C Documentation
	dh_auto_clean
	rm -rf $(b_cairo) $(b_art) $(b_xlib)

# gnustep-gui's shlibs *must* be overridden, otherwise there are
# circular dependencies (#882078).
override_dh_shlibdeps:
	echo \
	  "libgnustep-gui $(sov_back) libgnustep-gui$(sov_back) (>= $(v_gui)), gnustep-gui-runtime (>= $(v_gui))" \
	  > debian/shlibs.local
	dh_shlibdeps
	rm debian/shlibs.local