aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/001_add-main-makefile.full+lite.patch
blob: 1376d44f3719a38bbdd09b725bc1668732eea524 (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
Description: Provide main Makefile for whole source tree
 By design this patch is not needed to be sent upstream.
Forwarded: not-needed
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Last-Update: 2011-12-31
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,51 @@
+#!/usr/bin/make -f
+
+PREFIX ?= /usr/local
+CONFIGURE=./configure
+
+%:
+	if test -f bin/Makefile; then ${MAKE} -C bin $@; fi
+	if test -f nxcomp/Makefile; then ${MAKE} -C nxcomp $@; fi
+	if test -f nxproxy/Makefile; then ${MAKE} -C nxproxy $@; fi
+	if test -d nx-X11; then \
+	    if test -f nxcompext/Makefile; then ${MAKE} -C nxcompext $@; fi; \
+	    if test -f nxcompshad/Makefile; then ${MAKE} -C nxcompshad $@; fi; \
+	    if test -f nx-X11/Makefile; then ${MAKE} -C nx-X11 $@; fi; \
+	fi
+
+all: build
+
+test:
+	echo "No testing for NX (redistributed)"
+
+build-lite:
+	cd nxcomp && autoconf && (${CONFIGURE}) && ${MAKE}
+	cd nxproxy && autoconf && (${CONFIGURE}) && ${MAKE}
+
+build-full:
+# in the full case, we rely on "magic" in the nx-X11 imake-based makefiles...
+	cd nxcomp && autoconf
+	cd nxcompext && autoconf
+	cd nxcompshad && autoconf
+	cd nx-X11 && ${MAKE} World
+	cd nxproxy && autoconf && (${CONFIGURE}) && ${MAKE}
+
+build:
+	if ! test -d nx-X11; then \
+	    ${MAKE} build-lite; \
+	else \
+	    ${MAKE} build-full; \
+	fi
+
+uninstall:
+	if test -f bin/Makefile; then ${MAKE} -C bin $@; fi
+	if test -f nxcomp/Makefile; then ${MAKE} -C nxcomp $@; fi
+	if test -f nxproxy/Makefile; then ${MAKE} -C nxproxy $@; fi
+	if test -d nx-X11; then \
+	    if test -f nxcompext/Makefile; then ${MAKE} -C nxcompext $@; fi; \
+	    if test -f nxcompshad/Makefile; then ${MAKE} -C nxcompshad $@; fi; \
+	    if test -f nx-X11/Makefile; then \
+	        if test -d $(PREFIX)/lib/nx; then rm -rf $(PREFIX)/lib/nx; fi; \
+	        if test -d $(PREFIX)/include/nx; then rm -rf $(PREFIX)/include/nx; fi; \
+	    fi; \
+	fi
--- /dev/null
+++ b/bin/Makefile
@@ -0,0 +1,29 @@
+#!/usr/bin/make -f
+
+INSTALL_DIR=install -d -o root -g root -m 755
+INSTALL_FILE=install -o root -g root -m 644
+INSTALL_PROGRAM=install -o root -g root -m 755
+
+RM_FILE=rm -f
+RM_DIR=rmdir -p --ignore-fail-on-non-empty
+
+DESTDIR=
+PREFIX ?= /usr/local
+BINDIR=$(PREFIX)/bin
+NXLIBDIR=$(PREFIX)/lib/nx
+X2GOLIBDIR=$(PREFIX)/lib/x2go
+
+%:
+	echo "Nothing to do for $@..."
+
+install:
+	$(INSTALL_DIR) $(X2GOLIBDIR)/bin/
+	ln -sf $(NXLIBDIR)/bin/nxagent $(X2GOLIBDIR)/bin/x2goagent
+	find nx* | while read file; do $(INSTALL_PROGRAM) $$file $(BINDIR)/; done
+	find x2go* | while read file; do $(INSTALL_PROGRAM) $$file $(BINDIR)/; done
+
+uninstall:
+	find nx* | while read file; do rm -f $(BINDIR)/$$file; done
+	find x2go* | while read file; do rm -f $(BINDIR)/$$file; done
+	$(RM_FILE) $(X2GOLIBDIR)/bin/x2goagent
+	$(RM_DIR) $(X2GOLIBDIR)/bin/