File: rules

package info (click to toggle)
wine 4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 209,096 kB
  • sloc: ansic: 2,906,412; perl: 18,817; yacc: 15,629; makefile: 9,134; objc: 6,543; lex: 4,315; python: 1,786; cpp: 1,042; sh: 771; java: 742; xml: 557; awk: 69; cs: 17
file content (229 lines) | stat: -rwxr-xr-x 8,254 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/usr/bin/make -f

# add DEB_* variables to the environment
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/vendor.mk

# determine whether this is a stable or development build
VERSION=$(shell echo $(DEB_SOURCE) | sed s/wine//g)
ifeq (x$(VERSION), x)
DEBSUFFIX=-stable
else
DEBSUFFIX=$(VERSION)
endif
export DEBSUFFIX

# installation paths
MANDIR=usr/share/man
BINDIR=usr/lib/wine$(VERSION)
DATDIR=usr/share/wine$(VERSION)
INCDIR=usr/include/wine$(VERSION)
LIBDIR=usr/lib/$(DEB_HOST_MULTIARCH)/wine$(VERSION)

# extra information to add to the version string
export VENDOR=$(DEB_VENDOR) $(DEB_VERSION)

# enable verbose build log
export DH_VERBOSE=1

# indicate that binary targets do not require root
export DEB_RULES_REQUIRES_ROOT=no

# enable hardening buildflags (fortify is not yet supported upstream)
export DEB_BUILD_MAINT_OPTIONS=hardening=+all,-fortify

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

# ignore shift overflow warnings (currently only an issue on arm)
export DEB_CFLAGS_MAINT_APPEND+=-Wno-shift-overflow

# ignore warning about deprecated CUPS API for now
export DEB_CFLAGS_MAINT_APPEND+=-Wno-deprecated-declarations

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

# 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)
CONFLAGS+=--with-float-abi=soft
export DEB_CFLAGS_MAINT_APPEND+=-march=armv5t
export DEB_LDFLAGS_MAINT_APPEND+=-march=armv5t
endif

# on arm64 build using clang
ifeq ($(DEB_HOST_ARCH), arm64)
export CC=clang
export CXX=clang++
export DEB_CFLAGS_MAINT_APPEND+=-Wno-enum-conversion -Wno-absolute-value
endif

# use date of the latest changelog update as the build date
export WIDL_TIME_OVERRIDE=$(SOURCE_DATE_EPOCH)

# 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:
	# output compiler information
	$(CC) --version
	# automatically generated files
	./debian/scripts/generate libs/port/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
	# autotools files
	ln -sf /usr/share/misc/config.sub tools
	ln -sf /usr/share/misc/config.guess tools
	# image files used to generate icons for parts of wine
	ln -sf ../../dlls/user32/resources/oic_hand.svg dlls/display.drv16/oic_hand.svg
	ln -sf ../../dlls/user32/resources/oic_bang.svg dlls/comctl32/idi_tt_warn_sm.svg
	ln -sf ../../dlls/user32/resources/oic_note.svg dlls/comctl32/idi_tt_info_sm.svg
	ln -sf ../../dlls/user32/resources/oic_hand.svg dlls/comctl32/idi_tt_error_sm.svg
	ln -sf ../../dlls/shell32/resources/move.svg dlls/comctl32/idi_dragarrow.svg
	ln -sf ../../dlls/shell32/resources/image.svg programs/regedit/bin.svg
	ln -sf ../../dlls/shell32/resources/folder.svg programs/regedit/folder.svg
	ln -sf ../../dlls/shell32/resources/document.svg programs/regedit/string.svg
	ln -sf ../../dlls/shell32/resources/mycomputer.svg programs/regedit/computer.svg
	ln -sf ../../dlls/shell32/resources/folder_open.svg programs/regedit/folderopen.svg
	ln -sf ../../dlls/shell32/resources/window.svg programs/taskmgr/window.svg
	ln -sf ../../dlls/shell32/resources/window.svg programs/taskmgr/windowsm.svg
	ln -sf ../../dlls/shell32/resources/drive.svg dlls/comdlg32/hdisk.svg
	ln -sf ../../dlls/shell32/resources/folder.svg dlls/comdlg32/folder.svg
	ln -sf ../../dlls/shell32/resources/network.svg dlls/comdlg32/network.svg
	ln -sf ../../dlls/shell32/resources/folder_open.svg dlls/comdlg32/folder2.svg
	ln -sf ../../dlls/shell32/resources/disk_drive.svg dlls/comdlg32/floppy.svg
	ln -sf ../../dlls/shell32/resources/optical_drive.svg dlls/comdlg32/cdrom.svg
	# execute wine's configure script
	./configure $(CONFLAGS)

override_dh_auto_build-indep:
	./tools/makedep libs/port tools/sfnt2fon fonts
	make -C libs/port
	make -C tools/sfnt2fon
	make -C fonts

override_dh_auto_install-indep: $(INSTALLS)
	mkdir -p debian/tmp
	cp ANNOUNCE debian/tmp/NEWS
	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/NEWS
	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_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