aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: 9bda99719668ee3fecd123432f667dabf1d820f3 (plain)
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
#!/usr/bin/make -f

NULL =

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export LIBDIR = "/usr/lib/$(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)"
export LIBEXECDIR = "$(LIBDIR)/nx/bin"
export INCLUDEDIR = "/usr/include/$(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)"

%:
	CONFIGURE="./configure --disable-silent-rules \
	                       --prefix=/usr \
	                       --libdir=$(LIBDIR) \
	                       --includedir=$(INCLUDEDIR) \
	                       --libexecdir=$(LIBEXECDIR)" dh $@ --with quilt

override_dh_auto_clean:
	rm -Rf nx-X11/.build-exports
	dh_auto_clean

override_dh_clean:
	-rm nx-X11/lib/Makefile
	-rm nx-X11/lib/src/Makefile
	-rm nx-X11/lib/src/xkb/Makefile
	-rm nx-X11/lib/src/util/Makefile
	-rm nx-X11/lib/src/xcms/Makefile
	-rm nx-X11/lib/src/xlibi18n/Makefile
	-rm nx-X11/lib/modules/Makefile
	-rm nx-X11/lib/modules/om/Makefile
	-rm nx-X11/lib/modules/om/generic/Makefile
	-rm nx-X11/lib/modules/im/Makefile
	-rm nx-X11/lib/modules/im/ximcp/Makefile
	-rm nx-X11/lib/modules/lc/Makefile
	-rm nx-X11/lib/modules/lc/gen/Makefile
	-rm nx-X11/lib/modules/lc/def/Makefile
	-rm nx-X11/lib/modules/lc/Utf8/Makefile
	-rm nx-X11/lib/include/Makefile
	-rm nx-X11/config/Makefile
	-rm nx-X11/config/cf/Makefile
	-rm nx-X11/programs/Makefile
	-rm nx-X11/programs/Xserver/Makefile
	-rm nx-X11/programs/Xserver/os/Makefile
	-rm nx-X11/programs/Xserver/damageext/Makefile
	-rm nx-X11/programs/Xserver/miext/cw/Makefile
	-rm nx-X11/programs/Xserver/miext/damage/Makefile
	-rm nx-X11/programs/Xserver/xfixes/Makefile
	-rm nx-X11/programs/Xserver/composite/Makefile
	-rm nx-X11/programs/Xserver/Xi/Makefile
	-rm nx-X11/programs/Xserver/render/Makefile
	-rm nx-X11/programs/Xserver/randr/Makefile
	-rm nx-X11/programs/Xserver/record/Makefile
	-rm nx-X11/programs/Xserver/dix/Makefile
	-rm nx-X11/programs/Xserver/xkb/Makefile
	-rm nx-X11/programs/Xserver/hw/nxagent/Makefile
	-rm nx-X11/programs/Xserver/hw/nxagent/compext/Makefile
	-rm nx-X11/programs/Xserver/mi/Makefile
	-rm nx-X11/programs/Xserver/fb/Makefile
	-rm nx-X11/programs/Xserver/Xext/Makefile
	-rm nx-X11/programs/Xserver/include/Makefile
	-rm nx-X11/programs/Xserver/dbe/Makefile
	-rm nx-X11/programs/Xserver/GL/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/main/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/X/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/array_cache/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/GLcore/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/math/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/swrast/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/shader/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/shader/slang/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/shader/slang/library/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/shader/grammar/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/tnl/Makefile
	-rm nx-X11/programs/Xserver/GL/mesa/swrast_setup/Makefile
	-rm nx-X11/programs/Xserver/GL/glx/Makefile
	-rm nx-X11/include/Makefile
	-rm nx-X11/include/GL/Makefile
	-rm nx-X11/include/extensions/Makefile

	-rm nx-X11/config/cf/date.def
	-rm nx-X11/config/cf/nxversion.def
	-rm nx-X11/xmakefile

	dh_clean

override_dh_install:

	# strip static libs and remove .la files
	rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcomp.la
	strip --strip-debug --remove-section=.comment --remove-section=.note debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcomp.a
	rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcompshad.la
	strip --strip-debug --remove-section=.comment --remove-section=.note debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libXcompshad.a
	rm debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libNX_X11.la
	strip --strip-debug --remove-section=.comment --remove-section=.note debian/tmp/usr/lib/$(DEB_BUILD_MULTIARCH)/libNX_X11.a

	# remove extras, GL, and other unneeded headers
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/GL/
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XK*.h
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/*Xv*.h
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XRes*.h
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XIproto.h
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/extensions/XI.h
	rm -R debian/tmp/usr/include/$(DEB_BUILD_MULTIARCH)/nx-X11/Xtrans/

	dh_install --fail-missing

override_dh_auto_install:
	PREFIX=/usr dh_auto_install -Smakefile

override_dh_auto_build:

	PREFIX=/usr dh_auto_build --parallel -- CDEBUGFLAGS="$(CPPFLAGS) $(CFLAGS)" LOCAL_LDFLAGS="$(LDFLAGS)" SHLIBGLOBALSFLAGS='$(filter-out -pie,$(LDFLAGS))'

override_dh_strip:
	dh_strip -plibnx-x11-6 --dbg-package=libnx-x11-6-dbg
	dh_strip -plibxcomp3 --dbg-package=libxcomp3-dbg
	dh_strip -plibxcompshad3 --dbg-package=libxcompshad3-dbg
	dh_strip -pnxagent --dbg-package=nxagent-dbg
	dh_strip -pnxproxy --dbg-package=nxproxy-dbg

override_dh_makeshlibs:
	dh_makeshlibs -n

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..