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

NULL =
CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
else
        CFLAGS += -O2
endif

%:
	CONFIGURE="./configure --prefix=/usr" LD_LIBRARY_PATH=`pwd`/debian/libnx-x11/usr/lib/nx/X11:$$LD_LIBRARY_PATH dh $@ --with quilt

# before build, we will remove unused code / bundled libraries (keep this in sync with roll-tarball.sh)
UNUSED_CODE = nx-X11/extras/drm \
              nx-X11/extras/expat \
              nx-X11/extras/fontconfig \
              nx-X11/extras/freetype2 \
              nx-X11/extras/fonts \
              nx-X11/extras/ogl-sample \
              nx-X11/extras/regex \
              nx-X11/extras/rman \
              nx-X11/extras/ttf2pt1 \
              nx-X11/extras/x86emu \
              nx-X11/extras/zlib \
              nx-X11/lib/expat \
              nx-X11/lib/fontconfig \
              nx-X11/lib/fontenc \
              nx-X11/lib/font/FreeType \
              nx-X11/lib/font/include/fontenc.h \
              nx-X11/lib/freetype2 \
              nx-X11/lib/regex \
              nx-X11/lib/zlib \
              nx-X11/lib/FS \
              nx-X11/lib/ICE \
              nx-X11/lib/SM \
              nx-X11/lib/Xaw \
              nx-X11/lib/Xft \
              nx-X11/lib/Xt \
              nx-X11/lib/Xmu \
              nx-X11/lib/Xmuu \
              nx-X11/programs/Xserver/hw/darwin \
              nx-X11/programs/Xserver/hw/dmx \
              nx-X11/programs/Xserver/hw/kdrive \
              nx-X11/programs/Xserver/hw/sun \
              nx-X11/programs/Xserver/hw/sunLynx \
              nx-X11/programs/Xserver/hw/vfb \
              nx-X11/programs/Xserver/hw/xnest \
              nx-X11/programs/Xserver/hw/xwin \
              nx-X11/programs/xterm \
              $(NULL)

override_dh_auto_clean:
	rm -Rf nx-X11/.build-exports
	LD_LIBRARY_PATH=`pwd`/debian/libnx-x11/usr/lib/nx/X11:$$LD_LIBRARY_PATH dh_auto_clean

override_dh_clean:
	rm -f nx*/configure
	rm -f nx*/changelog
	rm -f nx-X11/programs/Xserver/hw/nxagent/changelog
	rm -f nx-X11/programs/nxauth/changelog
	rm -Rf replace.sh Makefile bin rgb VERSION.x2goagent etc/keystrokes.cfg
	rm -f debian/libnx-x11.postinst
	if [ -f nxcomp/.VERSION.NoMachine ]; then mv nxcomp/.VERSION.NoMachine nxcomp/VERSION; fi
	dh_clean

override_dh_auto_install:
	PREFIX=/usr dh_auto_install -Smakefile

override_dh_auto_build:

	# create copies of upstream changelogs so that names apply to Debian policy...
	cp -a nx-X11/CHANGELOG nx-X11/changelog
	cp -a nxcomp/CHANGELOG nxcomp/changelog
	if [ -f nxcomp/VERSION ]; then cp nxcomp/VERSION nxcomp/.VERSION.NoMachine; fi
	cp -a nxcompext/CHANGELOG nxcompext/changelog
	cp -a nxcompshad/CHANGELOG nxcompshad/changelog
	cp -a nx-X11/programs/Xserver/hw/nxagent/CHANGELOG nx-X11/programs/Xserver/hw/nxagent/changelog
	cp -a nx-X11/programs/nxauth/CHANGELOG nx-X11/programs/nxauth/changelog
	cp -a nxproxy/CHANGELOG nxproxy/changelog
	ln -s debian/Makefile.nx-libs Makefile
	ln -s debian/Makefile.replace.sh replace.sh
	ln -s debian/wrappers bin
	mkdir -p etc/
	ln -s ../debian/keystrokes.cfg etc/keystrokes.cfg
	ln -s debian/rgb
	ln -sf debian/VERSION VERSION.x2goagent
	ln -sf ../debian/VERSION nxcomp/VERSION

	# let's prep the libnx-x11.postinst script with the value of the build systems's DEB_BUILD_MULTIARCH variable
	sed debian/libnx-x11.postinst.in -e 's/#DEB_BUILD_MULTIARCH#/$(DEB_BUILD_MULTIARCH)/' > debian/libnx-x11.postinst

	# remove unused code / bundled libraries (see at the top of this file
        # for the exact list of files and folders
	rm -Rf $(UNUSED_CODE)

	LD_LIBRARY_PATH=`pwd`/debian/libnx-x11/usr/lib/nx/X11:$$LD_LIBRARY_PATH dh_auto_build --parallel

override_dh_strip:
	dh_strip --dbg-package=nx-x11-dbg