source: pkg/boss/main/pango1.0/trunk/debian/rules @ 4836

Revision 4836, 9.8 KB checked in by alanbach-guest, 5 years ago (diff)
  • Sync'd with Debian 1.22.4-1
  • Property svn:executable set to *
Line 
1#!/usr/bin/make -f
2
3DISABLE_UPDATE_UPLOADERS := 1
4include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk
5include /usr/share/gnome-pkg-tools/1/rules/check-dist.mk
6-include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk
7
8GNOME_MODULE := pango
9
10STAMP_DIR := debian/stampdir
11
12PATCH_DIR := debian/patches
13
14# rules in this debian/rules Makefile can be built concurrently as well as
15# upstream rules in Makefile; all $(MAKE) invocations will inherit this flag,
16# if you recurse into debian/rules ($(MAKE)
17# -f debian/rules in rules), you need to pass a flag to avoid adding "-jX" when
18# the childs encounters this line
19DEB_BUILD_OPTIONS_PARALLEL ?= $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
20MAKEFLAGS += $(if $(DEB_BUILD_OPTIONS_PARALLEL),-j$(DEB_BUILD_OPTIONS_PARALLEL))
21
22CFLAGS += -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2)
23
24# Ensure the build aborts when there are still references to undefined
25# symbols
26LDFLAGS += -Wl,-z,defs
27
28# Make the linker work a bit harder so dynamic loading can be done faster
29LDFLAGS += -Wl,-O1
30
31DEBVERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
32VERSION := $(shell echo $(DEBVERSION) | sed -e 's/-[^-]*$$//')
33APIVER := 1.0
34SONAME := 0
35MODVER := 1.6.0
36SHVERSION := 1.22.0
37
38DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
39DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
40
41# relative libdir
42ifneq (,$(findstring multiarch,$(DEB_BUILD_OPTIONS)))
43LIBDIR := usr/lib/$(DEB_HOST_GNU_TYPE)
44else
45LIBDIR := usr/lib
46endif
47
48# relative Pango Modules Path (separated by ":")
49MODULES_PATH := $(LIBDIR)/pango/$(MODVER)/modules
50
51# relative directory to store the generated Pango Module File
52MODULE_FILES_D := $(LIBDIR)/pango/$(MODVER)/module-files.d
53
54# Pango Module API version virtual Provide
55ifneq (,$(findstring multiarch,$(DEB_BUILD_OPTIONS)))
56PANGO_MODVER_DEP := pango$(APIVER)-multiarch-modver-$(MODVER)
57else
58PANGO_MODVER_DEP := pango$(APIVER)-modver-$(MODVER)
59endif
60
61# package names
62SHARED_PKG := libpango$(APIVER)-$(SONAME)
63UDEB_PKG := libpango$(APIVER)-udeb
64COMMON_PKG := libpango$(APIVER)-common
65DEV_PKG := libpango$(APIVER)-dev
66DEBUG_PKG := libpango$(APIVER)-$(SONAME)-dbg
67DOC_PKG := libpango$(APIVER)-doc
68
69# package groups, used in rule dependencies and in cleanup
70BINARY_INDEP_PKGS := $(DOC_PKG) $(COMMON_PKG)
71BINARY_ARCH_PKGS := $(SHARED_PKG) $(UDEB_PKG) $(DEV_PKG) $(DEBUG_PKG)
72ALL_PKGS := $(BINARY_INDEP_PKGS) $(BINARY_ARCH_PKGS)
73
74# list of flavors we build; each gets a builddir, a configure pass (configure
75# args are defined below), a build pass, and an install pass (in two steps)
76# Note: the shared flavor is required
77FLAVORS := shared static udeb
78
79# list of flavors to run the test suite on
80CHECK_FLAVORS := $(filter shared, $(FLAVORS))
81
82# build dir for the current flavor; this is only expanded in flavor specific
83# targets
84builddir = $(buildbasedir)/$*
85buildbasedir = $(CURDIR)/debian/build
86
87# install dir for the current flavor; this is only expanded in flavor specific
88# targets
89installdir = $(installbasedir)/$*
90installbasedir = $(CURDIR)/debian/install
91
92# configure flags
93common_configure_flags := \
94                        --prefix=/usr \
95                        --libdir=/$(LIBDIR) \
96                        --mandir=\$${prefix}/share/man \
97                        --infodir=\$${prefix}/share/info \
98                        --with-html-dir=\$${prefix}/share/doc/$(DOC_PKG) \
99                        --sysconfdir=/etc \
100                        --build=$(DEB_BUILD_GNU_TYPE)
101
102ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
103        common_configure_flags += --host=$(DEB_HOST_GNU_TYPE)
104endif
105
106shared_configure_flags := $(common_configure_flags) \
107                        --enable-shared \
108                        --disable-static
109static_configure_flags := $(common_configure_flags) \
110                        --disable-shared \
111                        --with-included-modules \
112                        --enable-static
113udeb_configure_flags := $(common_configure_flags) \
114                        --without-x \
115                        --enable-shared \
116                        --disable-debug
117
118# macro computing the list of 'debian/<pkg>.*" files which have a corresponding
119# ".in" file; pass the list of packages in $(1)
120dh_subst_files = $(patsubst %.in,%,$(wildcard $(addprefix debian/, $(addsuffix *.in, $(1)))))
121
122debian/dh_pangomodules.1: debian/dh_pangomodules
123        cd debian && pod2man -c "Pango" -r "$(DEBVERSION)" dh_pangomodules dh_pangomodules.1
124
125patch: $(STAMP_DIR)/patch-stamp
126
127$(STAMP_DIR)/patch-stamp:
128        dh_testdir
129        # apply patches
130        QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null push -a || test $$? = 2
131        # backup the original (potentially patched) files to restore them in
132        # the clean target
133        -test -r config.sub && cp config.sub config.sub.orig
134        -test -r config.guess && cp config.guess config.guess.orig
135        -test -r /usr/share/misc/config.sub && \
136                cp -f /usr/share/misc/config.sub config.sub
137        -test -r /usr/share/misc/config.guess && \
138                cp -f /usr/share/misc/config.guess config.guess
139        -mkdir -p $(STAMP_DIR)
140        touch $@
141
142$(STAMP_DIR)/configure-stamp-%: $(STAMP_DIR)/patch-stamp
143        dh_testdir
144        mkdir -p $(builddir)
145        cd $(builddir) && \
146                CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
147                        $(CURDIR)/configure $($*_configure_flags)
148        touch $@
149
150configure: $(addprefix $(STAMP_DIR)/configure-stamp-, $(FLAVORS))
151
152$(STAMP_DIR)/build-stamp-%: $(STAMP_DIR)/configure-stamp-%
153        dh_testdir
154        LD_LIBRARY_PATH=$(builddir)/pango/.libs:$(LD_LIBRARY_PATH) \
155                $(MAKE) -C $(builddir)
156        touch $@
157
158build: $(addprefix $(STAMP_DIR)/build-stamp-, $(FLAVORS))
159
160$(STAMP_DIR)/check-stamp-%: $(STAMP_DIR)/build-stamp-%
161        dh_testdir
162        # setting LD_LIBRARY_PATH for "make check" might be needed in the
163        # future, but doesn't seem necessary right now
164        #LD_LIBRARY_PATH=$(builddir)/pango/.libs:$(LD_LIBRARY_PATH)
165        # testsuite failures are ignored
166        -$(MAKE) -C $(builddir) check
167        touch $@
168
169check: $(addprefix $(STAMP_DIR)/check-stamp-, $(CHECK_FLAVORS))
170
171$(STAMP_DIR)/install-stamp-%: $(STAMP_DIR)/build-stamp-%
172        mkdir -p $(installdir)
173        $(MAKE) -C $(builddir) install \
174                DESTDIR=$(installdir)
175        touch $@
176
177install: $(addprefix $(STAMP_DIR)/install-stamp-, $(FLAVORS))
178
179# gross kludge to force control generation with the %.in target
180clean::
181        touch debian/control.in
182
183# always update debian/foo (do not rely on the timestamp of debian/control
184# versus debian/control.in which might break with svn, svn-buildpackage, or
185# dpkg-source)
186debian/%: debian/%.in
187        dh_testdir
188        sed -e "s#@SONAME@#$(SONAME)#g" \
189                -e "s#@APIVER@#$(APIVER)#g" \
190                -e "s#@VERSION@#$(VERSION)#g" \
191                -e "s#@PANGO_MODVER_DEP@#$(PANGO_MODVER_DEP)#g" \
192                -e "s#@LIBDIR@#$(LIBDIR)#g" \
193                -e "s#@MODULES_PATH@#$(MODULES_PATH)#g" \
194                -e "s#@MODULE_FILES_D@#$(MODULE_FILES_D)#g" \
195                -e "s#@GNOME_TEAM@#$(UPLOADERS)#g" \
196                $@.in >$@
197
198clean:: debian/control
199        dh_testdir
200        dh_testroot
201        # remove install and build dirs
202        rm -rf $(installbasedir)
203        rm -rf $(buildbasedir)
204        # restore files from backup (before unpatching)
205        -test -r config.sub.orig && mv -f config.sub.orig config.sub
206        -test -r config.guess.orig && mv -f config.guess.orig config.guess
207        # unapply patches, if any
208        QUILT_PATCHES=$(PATCH_DIR) quilt --quiltrc /dev/null pop -a -R || test $$? = 2
209        -rm -rf .pc
210        -rm -rf $(STAMP_DIR)
211        -rm -f $(call dh_subst_files,$(ALL_PKGS))
212        -rm -f debian/dh_pangomodules debian/dh_pangomodules.1
213        dh_clean
214
215maybe_check = $(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,check)
216
217binary-indep: build $(maybe_check) install $(call dh_subst_files,$(BINARY_INDEP_PKGS))
218        dh_testdir
219        dh_testroot
220        dh_installdirs -i
221        dh_install -i
222        dh_installchangelogs -i ChangeLog ChangeLog.*
223        dh_installdocs -i NEWS README
224        dh_installman -i
225        dh_link -i
226        dh_compress -i -X.sgml -X.devhelp
227        dh_fixperms -i
228        dh_installdeb -i
229        dh_gencontrol -i
230        dh_md5sums -i
231        dh_builddeb -i
232
233binary-arch: build $(maybe_check) install $(call dh_subst_files,$(BINARY_ARCH_PKGS)) debian/dh_pangomodules debian/dh_pangomodules.1
234        dh_testdir
235        dh_testroot
236        dh_install -s
237        # remove the rpath in libs and modules since a spurious /usr/lib RPATH
238        # appears on 64-bits arches which confuses dh_shlibdeps; the RPATH
239        # isn't needed in the udeb anyway as libcairo's udeb ships libs in
240        # /usr/lib; see #432258
241        chrpath -d debian/$(UDEB_PKG)/$(LIBDIR)/*.so.* \
242                debian/$(UDEB_PKG)/$(MODULES_PATH)/*.so
243        # Remove the thai module to avoid extraneous dependencies
244        rm -f debian/$(UDEB_PKG)/$(MODULES_PATH)/pango-thai-lang.so
245        # empty the dependency_libs in the *.la files
246        sed -i "/dependency_libs/ s/'.*'/''/" \
247                debian/$(DEV_PKG)/$(LIBDIR)/*.la
248        dh_installchangelogs -s -N$(SHARED_PKG) -N$(DEV_PKG) ChangeLog ChangeLog.*
249        dh_installdocs -s -N$(SHARED_PKG) -N$(DEV_PKG) NEWS README
250        dh_installdefoma -s
251        # fix the permissions of the development package because it ships
252        # dh_pangomodules which we need to invoke in this build
253        dh_fixperms -p$(DEV_PKG)
254        # generate $(SHARED_PKG).modules for the shared lib
255        LD_LIBRARY_PATH=$(CURDIR)/debian/$(SHARED_PKG)/$(LIBDIR):$(LD_LIBRARY_PATH) \
256        PANGO_QUERYMODULES=$(buildbasedir)/shared/pango/pango-querymodules \
257                debian/$(DEV_PKG)/usr/bin/dh_pangomodules \
258                        -p$(SHARED_PKG) -k
259        # generate $(UDEB_PKG).modules for the udeb
260        LD_LIBRARY_PATH=$(CURDIR)/debian/$(UDEB_PKG)/$(LIBDIR):$(LD_LIBRARY_PATH) \
261        PANGO_QUERYMODULES=$(buildbasedir)/udeb/pango/pango-querymodules \
262                debian/$(DEV_PKG)/usr/bin/dh_pangomodules \
263                        -p$(UDEB_PKG) -k
264        dh_installinfo -s
265        dh_installman -s
266        dh_link -s
267        dh_strip -s --dbg-package=$(DEBUG_PKG) -N$(UDEB_PKG)
268        dh_strip -p$(UDEB_PKG)
269        dh_compress -s -X.sgml -X.devhelp
270        dh_fixperms -s
271        dh_makeshlibs -p$(SHARED_PKG) \
272                -X$(MODULES_PATH) \
273                -V '$(SHARED_PKG) (>= $(SHVERSION))' \
274                --add-udeb=$(UDEB_PKG)
275        dh_installdeb -s
276        # override shlibs for libraries from this source before computing
277        # dependencies of packages generated from this source; we already have
278        # inter-dependencies expressed manually in the control file, we do not
279        # need the shlibs to add duplicates
280        sed -nr -e 's/(([^ ]+: )?([^ ]+) ([^ ]+)) .*/\1/p' \
281                debian/*/DEBIAN/shlibs \
282                >debian/shlibs.local
283        dh_shlibdeps -s -N$(UDEB_PKG)
284        dh_shlibdeps -p$(UDEB_PKG)
285        -rm -f debian/shlibs.local
286        dh_gencontrol -s
287        dh_md5sums -s
288        dh_builddeb -s
289
290binary: binary-indep binary-arch
291.PHONY: patch configure build check install clean binary-indep binary-arch binary
Note: See TracBrowser for help on using the repository browser.