File: rules

package info (click to toggle)
gnustep-base 1.31.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,580 kB
  • sloc: objc: 239,446; ansic: 36,519; cpp: 122; sh: 112; makefile: 100; xml: 32
file content (166 lines) | stat: -rwxr-xr-x 5,976 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
#!/usr/bin/make -f
#export DH_VERBOSE = 1

include /usr/share/GNUstep/debian/config.mk
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-undefined

export DESTDIR=$(CURDIR)/debian/tmp

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

# The GCC major version.  To support cross builds, gnustep-base must
# build-depend on the right libobjc-*-dev package -- the build fails
# otherwise with dpkg-shlibdeps errors.  Unfortunately, the package
# name is volatile and changes with each GCC major version.  This
# allows an automatic update of the package name in Build-Depends.
v_gcc := $(shell gcc -dumpversion)

# Required version of the Objective-C compiler and runtime (GCC).
# If set to the empty string, no versioned dependency is generated.
v_objc :=
ifeq (,$(v_objc))
m4_objc := -DV_OBJC=''
else
m4_objc := -DV_OBJC=' (>= $(v_objc))'
endif

# GNUstep Make version; as above to handle cases when the (old)stable
# version is sufficient enough.
v_make	:= 2.9.3
ifeq (,$(v_make))
m4_make := -DV_MAKE=''
else
m4_make := -DV_MAKE=' (>= $(v_make))'
endif

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

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

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

ifneq (,$(filter cross,$(DEB_BUILD_PROFILES)))
cross_flags := --enable-procfs
endif

%:
	dh $@

# Ensure that debian/control is always up-to-date.
override_dh_testdir:
	m4 $(m4_objc) $(m4_make) -DV_GCC='$(v_gcc)' -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 gnustep-base-common.links and maintainer scripts.
	sed -e 's,@GS_BASE_RESOURCES_DEBIAN@,$(GS_BASE_RESOURCES_DEBIAN),g' \
	  debian/templates/$(p_com).links.in > debian/$(p_com).links
	sed -e 's,@GS_BASE_RESOURCES_DEBIAN@,$(GS_BASE_RESOURCES_DEBIAN),g' \
	  debian/templates/$(p_com).prerm.in > debian/$(p_com).prerm
	sed -e 's,@GS_BASE_RESOURCES_DEBIAN@,$(GS_BASE_RESOURCES_DEBIAN),g' \
	  debian/templates/$(p_com).postinst.in > debian/$(p_com).postinst
# Generate libgnustep-baseSONAME.install file.
	cp debian/templates/libgnustep-baseN.install.in \
	  debian/$(p_lib).install

# When "nodoc" is present in DEB_BUILD_OPTIONS, the gnustep-make-doc
# package is created nearly empty, as required by Policy.  If it is
# also present in DEB_BUILD_PROFILES, the package is not built at all.
ifdef docs
	cp debian/templates/$(p_doc).install.in debian/$(p_doc).install
	cp debian/templates/$(p_doc).links.in debian/$(p_doc).links
endif

# Workaround FTBFS with Autoconf/2.71 (#995007) related to
# AC_CONFIG_AUX_DIR; more investigation is needed for a proper fix.
# In principle it is not necessary to pass --with-installation-domain
# because it is derived by gnustep-config which in turn checks the
# GNUSTEP_INSTALLATION_DOMAIN variable (defined in config.mk which is
# included here).  However, for some reason 1.28.0-1 mysteriously
# failed to build on GNU/Hurd so this is an attempt to fix it.
	dh_auto_configure -- \
	  CURRENT_GNUSTEP_MAKEFILES=$(GNUSTEP_MAKEFILES) \
	  --with-installation-domain=SYSTEM \
	  --disable-bfd $(cross_flags)

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

override_dh_auto_build-indep:
	dh_auto_build -- $(verbose) $(optim) doc=no
ifdef docs
	LD_LIBRARY_PATH=$(CURDIR)/Source/obj:$$LD_LIBRARY_PATH \
	  dh_auto_build -- -C Documentation $(verbose) $(docs)
endif

override_dh_auto_test:
	dh_auto_test -- $(verbose) || (cat Tests/tests.log; exit 1)

override_dh_auto_install-arch:
	dh_auto_install -- doc=no
	dh_auto_install -- -C Source doc=no shared=no

override_dh_auto_install-indep:
	dh_auto_install -- doc=no
ifdef docs
	dh_auto_install -- -C Documentation $(docs)
# Delete duplicate files already shipped in /usr/share/doc.
	$(RM) -r \
	  debian/tmp$(GNUSTEP_SYSTEM_DOC)/Developer/Base/ReleaseNotes/1.*
endif
# 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$(GS_BASE_RESOURCES_UPSTREAM)/NSTimeZones/README
# Delete timezones, we use tzdata.
	$(RM) -r debian/tmp$(GS_BASE_RESOURCES_UPSTREAM)/NSTimeZones/zones
# Delete accidental temporary file sneaked in 1.31.0.
	rm debian/tmp$(GS_BASE_RESOURCES_UPSTREAM)/NSTimeZones/.*.swp

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

override_dh_installinit:
	dh_installinit -p$(p_run) --name=gdomap --no-enable --no-start

override_dh_installsystemd:
	dh_installsystemd -p$(p_run) --name=gdomap --no-enable --no-start

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

execute_before_dh_link:
	dh_gnustep

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))'