File: rules

package info (click to toggle)
wine 1.8.7-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 179,848 kB
  • ctags: 306,666
  • sloc: ansic: 2,517,827; perl: 18,150; yacc: 15,402; makefile: 7,623; objc: 5,762; lex: 4,207; sh: 893; cpp: 816; xml: 78; awk: 69
file content (195 lines) | stat: -rwxr-xr-x 6,472 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
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
#!/usr/bin/make -f

DEB_HOST_ARCH=$(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_BUILD_ARCH_OS=$(shell dpkg-architecture -qDEB_BUILD_ARCH_OS)
DEB_BUILD_ARCH_BITS=$(shell dpkg-architecture -qDEB_BUILD_ARCH_BITS)

VERSION=$(shell dpkg-parsechangelog -S Source | sed s/wine//g)
ifeq (x$(VERSION), x)
DEBSUFFIX=-stable
else
DEBSUFFIX=$(VERSION)
endif
export DEBSUFFIX

MANDIR=usr/share/man
BINDIR=usr/lib/wine$(VERSION)
DATDIR=usr/share/wine$(VERSION)
INCDIR=usr/include/wine$(VERSION)
LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/wine$(VERSION)

export VENDOR=$(shell dpkg-vendor --query Vendor && dpkg-parsechangelog -S Version)

# enable verbose build log
export DH_VERBOSE=1

# wine doesn't support fortify hardening and fails to build with pie
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-pie,-fortify

# linker options
export DEB_LDFLAGS_MAINT_APPEND+=-Wl,-rpath,/$(LIBDIR)

# configure options
CONFLAGS=--with-gnutls \
         --without-hal \
         --without-v4l \
         --without-sane \
         --without-capi \
         --without-gphoto \
         --without-gstreamer \
         --disable-tests \
         --enable-maintainer-mode \
         --libdir=/$(LIBDIR) \
         --bindir=/$(BINDIR) \
         --mandir=/$(MANDIR) \
         --includedir=/$(INCDIR) \
         --datarootdir=/$(DATDIR) \
         $(shell dpkg-buildflags --export=configure) \

# flags specific to kfreebsd
ifeq ($(DEB_BUILD_ARCH_OS), kfreebsd)
export DEB_LDFLAGS_MAINT_APPEND+=-lfreebsd-glue
endif

# enable oss only on kfreebsd
ifneq ($(DEB_HOST_ARCH_OS), kfreebsd)
CONFLAGS+=--without-oss
endif

# enable wine64 on 64-bit architectures
ifeq ($(DEB_BUILD_ARCH_BITS), 64)
CONFLAGS+=--enable-win64
endif

# on armel build for armv5t
ifeq ($(DEB_HOST_ARCH), armel)
export DEB_CFLAGS_MAINT_APPEND+=-march=armv5t
export DEB_LDFLAGS_MAINT_APPEND+=-march=armv5t
endif

# override maintainer mode config
export DEB_CFLAGS_MAINT_APPEND+=-Wno-error

# additional files to generate
INSTALLS=$(shell ls debian/*VERSION* | sed s/VERSION/$(VERSION)/) \
         debian/bug-control \

# sonames to compute additional dependencies
sonamesDepends=$(shell \
    grep "^\#define SONAME_" include/config.h | \
    grep -E "libfontconfig|libfreetype|libncurses" | \
    cut -d\" -f2)
sonamesRecommends=$(shell \
    grep "^\#define SONAME_" include/config.h | \
    grep -v libnetapi | \
    cut -d\" -f2)

debian/control: debian/control.in
	sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@

debian/wine$(VERSION)%: debian/wineVERSION%
	sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@

debian/wine32$(VERSION)%: debian/wine32VERSION%
	sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@

debian/wine64$(VERSION)%: debian/wine64VERSION%
	sed "s/VERSION/$(VERSION)/g;s/DEBSUFFIX/$(DEBSUFFIX)/g" < $< > $@

debian/libwine$(VERSION)%: debian/libwineVERSION%
	sed s/VERSION/$(VERSION)/g < $< > $@

debian/bug-control: debian/bug-control.in
	sed s/VERSION/$(VERSION)/g < $< > $@

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	./debian/scripts/generate libs/wine/cptable.generated cpmap
	./debian/scripts/generate server/trace.generated make_requests
	./debian/scripts/generate server/request.generated make_requests
	./tools/make_fir
	./tools/make_unicode
	./tools/make_requests
	cd dlls/opengl32 && ./make_opengl
	ln -s /usr/share/misc/config.sub tools || true
	ln -s /usr/share/misc/config.guess tools || true
	./configure $(CONFLAGS)

override_dh_auto_build-indep:
	./tools/makedep tools tools/sfnt2fon libs/port libs/wine fonts
	make -C libs/port
	make -C libs/wine
	make -C tools/sfnt2fon
	make -C fonts
	make -C tools wineapploader
	chmod 755 tools/wineapploader

override_dh_auto_install-indep: $(INSTALLS)
	mkdir -p debian/tmp
	cp ANNOUNCE debian/tmp/changelog
	cp programs/winedbg/README debian/tmp/README.winedbg
	sed "s|BINDIR|$(BINDIR)|g" debian/scripts/wineserver.in > debian/tmp/wineserver
	chmod 755 debian/tmp/wineserver
	sed "s|DEBSUFFIX|$(DEBSUFFIX)|g" debian/scripts/wineapploader.in > debian/tmp/wineapploader
	chmod 755 debian/tmp/wineapploader
	sed "s|BINDIR|$(BINDIR)|g;s|VERSION|$(VERSION)|g" debian/scripts/wine.in > debian/tmp/wine$(DEBSUFFIX)
	for dir in loader server programs/msiexec programs/winedbg \
	    programs/wineconsole programs/regedit programs/regsvr32 \
	    programs/wineboot programs/winefile programs/winepath \
	    programs/winecfg; do \
	    ./tools/makedep $$dir; \
	    make -C $$dir install-man; \
	    done
	for file in $$(find . ! -path "./debian/*" -name \*.man); do \
	    rename=$$(basename $$file | sed "s/\\./$(DEBSUFFIX)./;s/UTF-8\\.//"); \
	    cp $$file debian/tmp/$$rename || true; \
	    done
	# extract hicolor icon from logo.svg
	sed '/image\/png/d;s|width="611"|width="209"|' programs/winecfg/logo.svg > debian/tmp/wine$(DEBSUFFIX).svg

override_dh_auto_install-arch: $(INSTALLS)
	mkdir -p debian/tmp
	cp ANNOUNCE debian/tmp/changelog
	cp tools/winedump/README debian/tmp/README.winedump
	cp server/wineserver debian/tmp/wineserver$(DEB_BUILD_ARCH_BITS)
	sed "s|BINDIR|$(BINDIR)|g" debian/scripts/winegcc.in > debian/tmp/winegcc$(DEBSUFFIX)
	dh_auto_install
	for file in $$(find . ! -path "./debian/*" -name \*.man); do \
	    rename=$$(basename $$file | sed "s/\\./$(DEBSUFFIX)./;s/UTF-8\\.//"); \
	    cp $$file debian/tmp/$$rename || true; \
	    done
	cp loader/wine.man debian/tmp/usr/share/man/man1/wine64$(DEBSUFFIX).1
	test -f debian/tmp/$(BINDIR)/wine-preloader || \
	    cp debian/scripts/wine-preloader debian/tmp/$(BINDIR)

override_dh_strip:
	dh_strip --dbgsym-migration='libwine$(VERSION)-dbg (<< 1.8-2~)'

override_dh_shlibdeps:
	mkdir -p debian/tmp
	./debian/scripts/sonames2elf $(sonamesDepends) > debian/tmp/elf.depends
	./debian/scripts/sonames2elf $(sonamesRecommends) > debian/tmp/elf.recommends
	dpkg-shlibdeps --warnings=1 \
	    -pdlopen \
	    -dDepends -edebian/tmp/elf.depends \
	    -dRecommends -edebian/tmp/elf.recommends \
	    -Tdebian/libwine$(VERSION).substvars
	dh_shlibdeps

override_dh_gencontrol:
	dh_gencontrol -- \
	    -Vbuilt:Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W khronos-api unicode-data)" \

override_dh_bugfiles:
	dh_bugfiles -A

override_dh_clean:
	dh_clean -- $(INSTALLS)
	make -f debian/rules debian/control

override_dh_auto_clean:
	QUILT_PATCHES=debian/patches quilt push -af || true
	dh_auto_clean