File: rules

package info (click to toggle)
gnustep-base 1.26.0-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 27,260 kB
  • sloc: objc: 204,878; ansic: 32,160; sh: 157; makefile: 128; cpp: 122; xml: 32
file content (210 lines) | stat: -rwxr-xr-x 6,504 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
#!/usr/bin/make -f
#export DH_VERBOSE = 1

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

# 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 #################################

# Objective-C version :
v_objc := 4:7.2

# GNUstep Make version :
v_make	:= 2.7.0-4

# GNUstep Base version :
v_base	:= $(shell . ./Version; echo $$VERSION)

# GNUstep Base SONAME version :
sov_base := $(shell . ./Version; echo $$MAJOR_VERSION.$$MINOR_VERSION)

#### PACKAGES NAMES ###################################
p_com	= gnustep-base-common
p_run	= gnustep-base-runtime
p_lib	= libgnustep-base$(sov_base)
p_dev	= libgnustep-base-dev
p_doc	= gnustep-base-doc

### DIRS ##############################################
GS_DTDs_DEBIAN = usr/share/xml/gnustep
GS_BASE_RESOURCES_UPSTREAM = $(GNUSTEP_SYSTEM_LIBRARY)/Libraries/gnustep-base/Versions/$(sov_base)/Resources
GS_BASE_RESOURCES_DEBIAN = usr/share/GNUstep/Libraries/gnustep-base/Versions/$(sov_base)/Resources

#####################################################"#

%:
	dh $@

# Ensure that debian/control is always up-to-date.
override_dh_testdir:
	m4 \
	    -DV_OBJC='$(v_objc)' \
	    -DV_MAKE='$(v_make)' \
	    -DSOV_BASE='$(sov_base)' \
	    debian/templates/control.m4 > debian/control
	dh_testdir

override_dh_auto_configure:
# generate libgnustep-baseN lintian overrides file
	m4 \
	    -DSOV_BASE='$(sov_base)' \
	    debian/templates/libgnustep-baseN.lintian-overrides.m4 > debian/$(p_lib).lintian-overrides

# generate maintainer scripts
	b=$(p_run); \
	for ext in preinst postinst prerm postrm; do \
	    if [ -f debian/templates/$$b.$$ext.in ]; then \
		sed -e 's,@GDOMAP@,$(GNUSTEP_SYSTEM_TOOLS)/gdomap,g' \
		    debian/templates/$$b.$$ext.in > debian/$$b.$$ext; \
	    fi; \
	done

# generate gdomap.init file
		sed -e 's,@GDOMAP@,$(GNUSTEP_SYSTEM_TOOLS)/gdomap,g' \
		    -e 's,@GSMAKEFILES@,$(GNUSTEP_MAKEFILES),g' \
		    debian/templates/$(p_run).gdomap.init.in > debian/$(p_run).gdomap.init;

# generate gnustep-base-runtime.install file
	sed -e 's,@GS_TOOLS@,$(GNUSTEP_SYSTEM_TOOLS),g' \
	    debian/templates/$(p_run).install.in > debian/$(p_run).install; \
		chmod a+x debian/$(p_run).install

# generate gnustep-base-runtime.links file
	sed -e 's,@GS_MANPAGES@,$(GNUSTEP_SYSTEM_DOC_MAN),g' \
	    debian/templates/$(p_run).links.in > debian/$(p_run).links;

# generate gnustep-base-common.install file
	sed -e 's,@GS_BASE_RESOURCES_UPSTREAM@,$(GS_BASE_RESOURCES_UPSTREAM),g' \
	    -e 's,@GS_BASE_RESOURCES_DEBIAN@,$(GS_BASE_RESOURCES_DEBIAN),g' \
	    debian/templates/$(p_com).install.in > debian/$(p_com).install

# generate gnustep-base-common.links file
	sed -e 's,@GS_BASE_RESOURCES_DEBIAN@,$(GS_BASE_RESOURCES_DEBIAN),g' \
	    debian/templates/$(p_com).links.in > debian/$(p_com).links

# generate gnustep-base-common.xmlcatalogs file
	sed -e 's,@GS_DTDs_DEBIAN@,/$(GS_DTDs_DEBIAN),g' \
	    debian/templates/$(p_com).xmlcatalogs.in > debian/$(p_com).xmlcatalogs

# generate libgnustep-baseN.install file
	sed -e 's,@GS_LIBS@,$(GNUSTEP_SYSTEM_LIBRARIES),g' \
	    debian/templates/libgnustep-baseN.install.in > debian/$(p_lib).install

# generate libgnustep-base-dev.install file
	sed -e 's,@GS_HEADERS@,$(GNUSTEP_SYSTEM_HEADERS),g' \
	    -e 's,@GS_LIBS@,$(GNUSTEP_SYSTEM_LIBRARIES),g' \
	    -e 's,@GS_MAKEFILES@,$(GNUSTEP_MAKEFILES),g' \
	    debian/templates/$(p_dev).install.in > debian/$(p_dev).install

# generate gnustep-base-doc.install file
	sed -e 's,@GS_DOC@,$(GNUSTEP_SYSTEM_DOC),g' \
	    -e 's,@GS_INFO@,$(GNUSTEP_SYSTEM_DOC_INFO),g' \
	    debian/templates/$(p_doc).install.in > debian/$(p_doc).install; \
		chmod a+x debian/$(p_doc).install

# Override the test for libkvm to ensure that /proc is used on
# GNU/kFreeBSD even if libkvm-dev is installed (#593898).
	dh_auto_configure -- \
	    ac_cv_lib_kvm_kvm_getenvv=no \
	    --disable-bfd  || (cat config.log; exit 1)

override_dh_auto_build-arch:
# build shared libs
	dh_auto_build -- \
	    $(verbose) \
	    $(optim) \
	    doc=no \
	    $(shell dpkg-buildflags --export=cmdline)

# build dev/static lib
	dh_auto_build -- \
	    -C Source \
	    $(verbose) \
	    $(optim) \
	    doc=no \
	    shared=no

override_dh_auto_build-indep:
# build shared libs
	dh_auto_build -- \
	    $(verbose) \
	    $(optim) \
	    doc=no

# build main doc. Make sure autogsdoc can find the libraries.
	LD_LIBRARY_PATH=$(CURDIR)/Source/obj:$$LD_LIBRARY_PATH \
	dh_auto_build -- \
	    -C Documentation \
	    $(verbose) \
	    $(optim) \
	    doc=yes

override_dh_auto_test:
	dh_auto_test -- \
	    $(verbose)  || (cat Tests/tests.log; exit 1)
# Print the results from a failing test on armhf; see d/p/armhf-test.patch.
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
ifeq ($(DEB_BUILD_ARCH),armhf)
	-cat Tests/base/NSInvocation/armhf.log
endif
endif

override_dh_auto_install-arch:
# install shared version of libraries
	dh_auto_install -- \
	    doc=no

# install dev/static lib
	dh_auto_install -- \
	    -C Source \
	    doc=no \
	    shared=no

override_dh_auto_install-indep:
# install shared version of libraries
	dh_auto_install -- \
	    doc=no

# install doc
	dh_auto_install -- \
	    -C Documentation \
	    doc=yes
# Delete duplicate files already shipped at /usr/share/doc/.
	$(RM) -r \
	  debian/tmp$(GNUSTEP_SYSTEM_DOC)/Developer/Base/ReleaseNotes/1.*
# Delete README which triggers lintian I: gnustep-base-common:
# package-contains-documentation-outside-usr-share-doc.  These
# instructions are unnecessary as the Debian package uses tzdata.
	$(RM) debian/tmp/usr/lib/GNUstep/Libraries/gnustep-base/Versions/$(sov_base)/Resources/NSTimeZones/README

override_dh_auto_clean-indep:
	dh_auto_clean -- \
	    doc=yes


override_dh_installcatalogs-indep:
# Bug #637093
	dh_installxmlcatalogs -p$(p_com) -n
	dh_installcatalogs --remaining-packages

# Install the gdomap init script
override_dh_installinit:
	dh_installinit -p$(p_run) --name=gdomap --no-enable --no-start

# Install examples
override_dh_installexamples:
	dh_installexamples -p$(p_doc) -X.cvsignore -X.gdbinit -X.arch-ids
	dh_installexamples --remaining-packages

override_dh_shlibdeps:
	dh_shlibdeps
# Recalculate dependencies of the shared library to ensure that
# gnustep-base-runtime is added as additional dependency.
	dh_makeshlibs -p$(p_lib) \
	  -V '$(p_lib) (>= $(v_base)), $(p_run) (>= $(v_base))'