File: rules

package info (click to toggle)
freetype 2.6.3-3.2
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 7,376 kB
  • ctags: 28
  • sloc: makefile: 116
file content (150 lines) | stat: -rwxr-xr-x 4,806 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
#!/usr/bin/make -f
#
# This is free software; see the GNU General Public Licence
# version 2 or later for copying conditions.  There is NO warranty.

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH     ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

ifneq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
  export LIBPNG_CFLAGS = -I/usr/include/libpng12
  export LIBPNG_LDFLAGS = -lpng12
endif

# Workaround for spurious error when building with gcc-4.4
ifeq (,$(filter m68k alpha,$(DEB_HOST_ARCH)))
export DEB_CFLAGS_MAINT_APPEND := -Werror
endif
export DEB_CFLAGS_MAINT_APPEND += $(shell dpkg-buildflags --get CPPFLAGS)

# always abort if there are any problems with the symbols file
DPKG_GENSYMBOLS_CHECK_LEVEL = 4
export DPKG_GENSYMBOLS_CHECK_LEVEL

VERSION = $(shell dpkg-parsechangelog | sed -n -e's/^Version: //p')
ver := $(shell dpkg-parsechangelog | sed -n -e's/^Version: \(.*\)-[^-]\+/\1/p')

freetype_ver := $(ver)
ftdocs_ver   := $(ver)
ft2demos_ver := $(ver)
dependency = $(libpkg) (>= 2.6)

freetype_u := freetype-$(freetype_ver)
ftdocs_u   := freetype-doc-$(ftdocs_ver)
ftdocs_d   := $(freetype_u)
ft2demos_u := ft2demos-$(ft2demos_ver)

libpkg := libfreetype6
devpkg := $(libpkg)-dev
docpkg := $(libpkg)-doc
demospkg := freetype2-demos
udebpkg := libfreetype6-udeb
docdir := usr/share/doc

libdoc = FTL.TXT CHANGES TODO ft2faq.html

%:
	dh $@

unpack:: unpack-stamp
unpack-stamp::
	# Unpack upstream tarballs
	@for i in $(freetype_u) $(ftdocs_u) $(ft2demos_u); do \
	    if [ -f $$i.tar.bz2 ]; then \
		echo "Unpacking $$i.tar.bz2 ..."; \
		tar -x --bzip2 -f $$i.tar.bz2; \
	    elif [ -f $$i.tar.gz ]; then \
		echo "Unpacking $$i.tar.gz ..."; \
		tar -x --gzip -f $$i.tar.gz; \
	    else \
		echo "Error!  $$i.tar.{bz2,gz} not found!"; \
		exit 1; \
	    fi \
	done
	ln -s $(ftdocs_d)/docs docs
	touch unpack-stamp

patch: unpack patch-stamp
patch-stamp:
	cd $(freetype_u) \
	    && QUILT_PATCHES=../debian/patches-freetype quilt --quiltrc /dev/null push -a
	cd $(freetype_u) && ./autogen.sh
	cd $(ft2demos_u) \
	    && QUILT_PATCHES=../debian/patches-ft2demos quilt --quiltrc /dev/null push -a
	touch patch-stamp

override_dh_auto_configure: patch
	dh_auto_configure -D $(freetype_u) -- --without-bzip2 --without-harfbuzz

override_dh_auto_build:
	dh_auto_build -D $(freetype_u)
ifneq (,$(filter $(demospkg), $(shell dh_listpackages)))
	dh_auto_build -D $(ft2demos_u) -- TOP_DIR=../$(freetype_u) \
		OBJ_DIR=../$(freetype_u)/objs
endif

override_dh_auto_clean:
	rm -f unpack-stamp patch-stamp
	rm -rf $(freetype_u) $(ft2demos_u) docs

override_dh_auto_install:
	dh_auto_install -D $(freetype_u) --destdir=$(CURDIR)/debian/tmp
ifneq (,$(filter $(demospkg), $(shell dh_listpackages)))
	$(freetype_u)/builds/unix/libtool --mode=install \
	    cp -av `find $(ft2demos_u)/bin -type f -perm -u=x -maxdepth 1` \
		$(CURDIR)/debian/$(demospkg)/usr/bin/
endif
	sed -i -e'/dependency_libs/s/'.*'//' debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libfreetype.la

override_dh_install:
	dh_install --fail-missing

override_dh_installdocs:
ifneq (,$(findstring $(libpkg), $(shell dh_listpackages)))
	dh_installdocs -p$(libpkg) $(addprefix $(freetype_u)/docs/,$(libdoc))
	mkdir debian/$(libpkg)/$(docdir)/$(libpkg)/pcf
	cp -a $(freetype_u)/src/pcf/README debian/$(libpkg)/$(docdir)/$(libpkg)/pcf/
endif
ifneq (,$(findstring $(devpkg), $(shell dh_listpackages)))
	dh_installdocs --link-doc=$(libpkg) -p$(devpkg) \
		-Xreference/README -Xreference/.gitignore \
		-XLICENSE.TXT -XGPL.TXT -XGPLv2.TXT -XBUILD -XINSTALL \
		$(addprefix -X,$(libdoc)) \
		$(ftdocs_d)/docs/*
endif
	dh_installdocs -N$(devpkg) -N$(libpkg) --link-doc=$(libpkg)

override_dh_installchangelogs:
ifneq (,$(findstring $(libpkg), $(shell dh_listpackages)))
	dh_installchangelogs -p$(libpkg) $(freetype_u)/ChangeLog
endif

override_dh_makeshlibs:
	dh_makeshlibs -V '$(dependency)' --add-udeb '$(udebpkg)'

# This variable is used only by get-orig-source, which will normally only
# be run by maintainers.
URL	= http://savannah.nongnu.org/download/freetype/

# Download the various upstream source tarballs and pack them into a
# single orig.tar.gz.  Assumes wget and gpg are available.
get-orig-source:
	@if [ ! -d "debian" ] ; then \
	    echo 'Run this from the top directory of the Debian source' >&2; \
	    exit 1; \
	fi
	mkdir freetype-$(ver)
	set -e; \
	cd freetype-$(ver); \
	for i in freetype freetype-doc ft2demos; do \
		wget $(URL)/$$i-$(ver).tar.bz2; \
		wget $(URL)/$$i-$(ver).tar.bz2.sig; \
		gpg --verify $$i-$(ver).tar.bz2.sig $$i-$(ver).tar.bz2 \
		&& rm $$i-$(ver).tar.bz2.sig; \
	done
	tar cf freetype_$(ver).orig.tar freetype-$(ver)
	rm -rf freetype-$(ver)
	gzip -9 freetype_$(ver).orig.tar

.PHONY: unpack patch get-orig-source