File: rules

package info (click to toggle)
freerdp2 2.0.0~git20190204.1.2693389a+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 22,772 kB
  • sloc: ansic: 307,908; xml: 1,676; sh: 770; perl: 231; makefile: 158; python: 65
file content (140 lines) | stat: -rwxr-xr-x 5,736 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)
ifneq (,$(filter armel,$(DEB_HOST_ARCH)))
WITH_NEON = -DWITH_NEON=OFF
else
WITH_NEON =
endif

DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifeq (,$(filter linux, $(DEB_HOST_ARCH_OS)))
WITH_WAYLAND = -DWITH_WAYLAND=OFF
WITH_LIBSYSTEMD = -DWITH_LIBSYSTEMD=OFF
WITH_ALSA = -DWITH_ALSA=OFF
else
WITH_WAYLAND =
WITH_LIBSYSTEMD =
WITH_ALSA =
endif

NULL =

DEB_HOST_ARCH_OS?=$(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
LINUX_URBDRC_CLIENT = -DCHANNEL_URBDRC=ON \
                      -DCHANNEL_URBDRC_CLIENT=ON \
                      $(NULL)
else
LINUX_URBDRC_CLIENT = -DCHANNEL_URBDRC=OFF \
                      -DCHANNEL_URBDRC_CLIENT=OFF \
                      $(NULL)
endif

DEB_CMAKE_EXTRA_FLAGS :=  -DCMAKE_INSTALL_INCLUDEDIR=include/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) \
                          -DCMAKE_SKIP_RPATH=FALSE \
                          -DCMAKE_SKIP_INSTALL_RPATH=TRUE \
                          -DWITH_PULSE=ON \
                          ${WITH_ALSA} \
                          -DWITH_CHANNELS=ON \
                          -DBUILTIN_CHANNELS=ON \
                          -DWITH_CUPS=ON \
                          -DWITH_PCSC=ON \
                          -DWITH_JPEG=ON \
                          -DWITH_GSTREAMER_0_10=OFF \
                          -DWITH_GSTREAMER_1_0=ON \
                          $(LINUX_URBDRC_CLIENT) \
                          -DWITH_SERVER=ON \
                          -DBUILD_TESTING=OFF \
                          -DCMAKE_BUILD_TYPE=RELWITHDEBINFO \
                          $(WITH_WAYLAND) \
                          $(WITH_LIBSYSTEMD) \
                          -DWITH_CLIENT_INTERFACE=OFF \
                          -DWITH_ICU=ON \
                          $(WITH_NEON) \
                          $(NULL)

# Ubuntu can't have ffmpeg in main
ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes),yes)
DEB_CMAKE_EXTRA_FLAGS += -DWITH_FFMPEG=OFF -DWITH_GSM=OFF
else
DEB_CMAKE_EXTRA_FLAGS += -DWITH_GSM=ON
endif

%:
	dh $@

.PHONY: override_dh_auto_configure override_dh_install override_dh_strip
override_dh_auto_configure:
	dh_auto_configure -- $(DEB_CMAKE_EXTRA_FLAGS)

override_dh_install:
	rm -rf debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.a
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/freerdp/
	dh_install

override_dh_missing:
	dh_missing --fail-missing

override_dh_strip:
	dh_strip -plibfreerdp2-2 --dbgsym-migration='libfreerdp2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibfreerdp-server2-2 --dbgsym-migration='libfreerdp-server2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibfreerdp-shadow2-2 --dbgsym-migration='libfreerdp-shadow2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibfreerdp-shadow-subsystem2-2 --dbgsym-migration='libfreerdp-shadow2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibfreerdp-client2-2 --dbgsym-migration='libfreerdp-client2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibwinpr2-2 --dbgsym-migration='libwinpr2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibwinpr-tools2-2 --dbgsym-migration='libwinpr-tools2-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -pfreerdp2-x11 --dbgsym-migration='freerdp2-x11-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -pfreerdp2-shadow-x11 --dbgsym-migration='freerdp2-shadow-x11-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -pwinpr-utils --dbgsym-migration='winpr-utils-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -pfreerdp2-wayland --dbgsym-migration='freerdp2-wayland-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'
	dh_strip -plibuwac0-0 --dbgsym-migration='libuwac0-dbg (<< 2.0.0~git20161130.1.e60d0d5+dfsg1-1~exp1~)'

include /usr/share/dpkg/pkg-info.mk

PKD   = $(word 1,$(abspath $(dir $(MAKEFILE_LIST))))
PKG   = $(DEB_SOURCE)
UVER  = $(shell echo $(DEB_VERSION) | cut -d "-" -f1)
DTYPE = +dfsg1
VER  ?= $(subst $(DTYPE),,$(UVER))

UURL = git://github.com/FreeRDP/FreeRDP.git
UREV = $(shell echo $(VER) | cut -d"." -f5)

## http://wiki.debian.org/onlyjob/get-orig-source
.PHONY: get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
	@

$(PKG)_$(VER)$(DTYPE).orig.tar.xz: $(info I: GIT Revision=$(UREV))
	$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
	@echo "# Downloading..."
	git clone $(UURL) $(PKG)-$(VER) \
	    || $(RM) -r $(PKG)-$(VER)
	cd $(PKG)-$(VER) \
	    && git checkout "$(UREV)" \
	    && ( echo "# Generating ChangeLog..." \
	       ; git --no-pager log --format="%ai %aN (%h) %n%n%x09*%w(68,0,10) %s%n" > ChangeLog \
	       ; touch -d "$$(git log -1 --format='%ci')" ChangeLog) \
	    && echo "# Setting times..." \
	    && for F in $$(git ls-tree -r --name-only HEAD); do touch --no-dereference -d "$$(git log -1 --format="%ai" -- $$F)" "$$F"; done \
	    && echo "# Cleaning-up..." \
	    && rm -rf \
	        client/Android/ \
	        client/iOS/ \
	        client/Mac/ \
	        client/Windows/ \
	        scripts/OpenSSL-DownloadAndBuild.command \
	        winpr/libwinpr/crt/utf.* \
	    && $(RM) -r .git .git* \
	    && echo "$(UREV)+debian" > .source_version
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
	    | XZ_OPT="-6v" tar -caf "../$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
	    && $(RM) -r "$(PKG)-$(VER)"