Package: jsxgraph / 1.3.5+dfsg1-2

40Makefile.patch Patch series | 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
Description: Modifications of Makefile to make symlinks
 Some files from the nodejs framework are necessary to build jsxgraph
 and its documentation. These modifications create and erase necessary
 symlinks during the build and the clean processes.
Index: jsxgraph/Makefile
===================================================================
--- jsxgraph.orig/Makefile
+++ jsxgraph/Makefile
@@ -1,13 +1,13 @@
 .PHONY: tests test test-server
 
 # build tools
-REQUIREJS=./node_modules/.bin/r.js
-UGLIFYJS=./node_modules/.bin/uglifyjs
-JSDOC2=nodejs ./node_modules/.bin/jsdoc2
+REQUIREJS=./node_modules/bin/r.js
+UGLIFYJS=/usr/bin/uglifyjs
+JSDOC2=java -jar /usr/share/java/jsrun.jar /usr/share/jsdoc-toolkit/app/run.js
 #JSDOC2=nodejs ./node_modules/.bin/jsdoc
 
-LINT=./node_modules/.bin/jslint
-HINT=./node_modules/.bin/jshint
+LINT=./node_modules/jslint/bin/jslint.js
+HINT=./node_modules/jshint/bin/hint
 JSTESTDRIVER=java -jar ./node_modules/jstestdriver/lib/jstestdriver.jar
 INTERN=./node_modules/.bin/intern-client
 
@@ -52,16 +52,28 @@ LINTFLAGS=--bitwise true --white true
 READERSOUT=build/bin/readers/geonext.min.js build/bin/readers/geogebra.min.js build/bin/readers/intergeo.min.js build/bin/readers/sketch.min.js
 
 # rules
-all: core core-min readers docs moodle
+all: symlinks core compressor core-min readers docs movedocs
+
+symlinks:
+	# add symlinks to replace node_modules utilities
+	#################################################
+	# replace almond
+	$(MKDIR) $(MKDIRFLAGS) node_modules/almond
+	ln -s /usr/lib/nodejs/almond/almond.js node_modules/almond/
+	$(MKDIR) $(MKDIRFLAGS) node_modules/requirejs/bin
+
+movedocs:
+	# change the location of zip files to make their packaging easier
+	mv distrib/*.zip .
 
 core:
 	$(MKDIR) $(MKDIRFLAGS) $(BUILDBIN)
-	$(REQUIREJS) -o $(BUILD)/core.build.json
+	nodejs $(REQUIREJS) -o $(BUILD)/core.build.json
 
 
 core-min:
 	$(MKDIR) $(MKDIRFLAGS) $(BUILDBIN)
-	$(REQUIREJS) -o $(BUILD)/core.build.json optimize=uglify2 out=$(BUILDBIN)/jsxgraphcore-min.js;
+	nodejs $(REQUIREJS) -o $(BUILD)/core.build.json optimize=uglify2 out=$(BUILDBIN)/jsxgraphcore-min.js;
 	{ $(CAT) COPYRIGHT; $(CAT) $(BUILDBIN)/jsxgraphcore-min.js; } > $(BUILDBIN)/jsxgraphcore.min.js
 	$(CP) $(BUILDBIN)/jsxgraphcore.min.js $(OUTPUT)/jsxgraphcore.js
 
@@ -85,11 +97,12 @@ docs: core core-min
 	$(MKDIR) $(MKDIRFLAGS) $(OUTPUT)
 
 	# update template related files
-	$(CP) distrib/jquery.min.js $(JSDOC2TPLSTAT)/jquery.min.js
+	ln -s /usr/share/javascript/jquery/jquery.min.js $(JSDOC2TPLSTAT)/
 	$(CP) $(BUILDBIN)/jsxgraphcore.min.js $(JSDOC2TPLSTAT)/jsxgraphcore.js
 	$(CP) distrib/jsxgraph.css $(JSDOC2TPLSTAT)/jsxgraph.css
 
 	# update the plugin
+	$(MKDIR) $(MKDIRFLAGS) ./node_modules/jsdoc2/app/plugins
 	$(CP) $(JSDOC2PLG)/*.js ./node_modules/jsdoc2/app/plugins/
 
 	# run node-jsdoc2
@@ -104,22 +117,11 @@ docs: core core-min
 	# Test
 	$(CD) $(OUTPUT) && $(UNZIP) -o docs.zip
 
-moodle: core core-min $(READERSOUT)
-	$(MKDIR) $(MKDIRFLAGS) $(TMP)
-	$(MKDIR) $(MKDIRFLAGS) $(TMP)/jsxgraph
-	$(CP) $(BUILDBIN)/jsxgraphcore.min.js $(TMP)/jsxgraph/jsxgraphcore.js
-	$(CP) distrib/jsxgraph.css $(TMP)/jsxgraph/jsxgraph.css
-	$(CP) ../moodle-jsxgraph-plugin/moodle2/*.php $(TMP)/jsxgraph/
-	$(CP) ../moodle-jsxgraph-plugin/moodle2/styles.css $(TMP)/jsxgraph/
-	$(CP) ../moodle-jsxgraph-plugin/README.md $(TMP)/jsxgraph/
-	$(CP) -r ../moodle-jsxgraph-plugin/moodle2/lang $(TMP)/jsxgraph/
-	$(CP) $(BUILDREADERS)/* $(TMP)/jsxgraph/
-
-	# zip -r tmp/jsxgraph.zip tmp/jsxgraph
-	$(CD) $(TMP) && $(ZIP) $(ZIPFLAGS) jsxgraph_moodle.zip jsxgraph/
-	$(CP) $(TMP)/jsxgraph_moodle.zip $(OUTPUT)/jsxgraph_moodle.zip
-
-	$(RM) $(RMFLAGS) tmp
+	# Protect against privacy breaches
+	sed -e 's/.*gaJsHost.*//' \
+	    -e 's/.*pageTracker.*//' \
+	    distrib/docs/index.html > distrib/docs/index.html.tmp && \
+	  mv distrib/docs/index.html.tmp distrib/docs/index.html
 
 readers: $(READERSOUT)
 	$(MKDIR) $(MKDIRFLAGS) $(OUTPUT)
@@ -130,14 +132,14 @@ build/bin/readers/%.min.js: src/reader/%
 	{ $(CAT) COPYRIGHT; $(UGLIFYJS) $^; } > $@
 
 compressor: core
-	$(REQUIREJS) -o build/compressor.build.json
+	nodejs $(REQUIREJS) -o build/compressor.build.json
 	{ $(CAT) JSXCompressor/COPYING; $(CAT) $(BUILDBIN)/jsxcompressor.js; } > JSXCompressor/jsxcompressor.min.js
 	$(CP) $(BUILDBIN)/jsxgraphcore.js JSXCompressor/jsxgraphcore.js
 	$(CP) distrib/jsxgraph.css JSXCompressor/jsxgraph.css
 
 plot:
 	$(MKDIR) $(MKDIRFLAGS) $(BUILDBIN)
-	$(REQUIREJS) -o build/plot.build.json
+	nodejs $(REQUIREJS) -o build/plot.build.json
 
 hint:
 	$(HINT) src/$(LINTLIST).js
@@ -145,11 +147,38 @@ hint:
 lint:
 	$(LINT) $(LINTFLAGS) src/$(LINTLIST).js
 
-test-server:
-	$(JSTESTDRIVER) --port $(JSTESTPORT)
+#test-server:
+#	$(JSTESTDRIVER) --port $(JSTESTPORT)
+
+#test: core
+#	$(JSTESTDRIVER) $(JSTESTSERVER) $(JSTESTFLAGS) --basePath ./ --config test/jsTestDriver.conf
 
-test: core
-	$(JSTESTDRIVER) $(JSTESTSERVER) $(JSTESTFLAGS) --basePath ./ --config test/jsTestDriver.conf
+#tests:
+#	$(INTERN) config=tests/intern
 
-tests:
-	$(INTERN) config=tests/intern
+clean:
+	for d in $$(ls node_modules/ | grep -v bin); do \
+	  rm -rf node_modules/$$d; \
+	done
+	rm -f build/bin/jsxgraphcore.js
+	rm -f doc/jsdoc-tk/template/static/jquery.min.js
+	rm -rf distrib/docs/*
+	rm -f docs.zip
+	rm -f jsxgraph_moodle.zip
+	rm -f JSXCompressor/jsxcompressor.min.js
+	rm -f JSXCompressor/jsxgraph.css
+	rm -f JSXCompressor/jsxgraphcore.js
+	rm -f build/bin/jsxcompressor.js
+	rm -f build/bin/jsxgraphcore-min.js
+	rm -f build/bin/jsxgraphcore.min.js
+	rm -f build/bin/readers/geogebra.min.js
+	rm -f build/bin/readers/geonext.min.js
+	rm -f build/bin/readers/intergeo.min.js
+	rm -f build/bin/readers/sketch.min.js
+	rm -f distrib/geogebra.min.js
+	rm -f distrib/geonext.min.js
+	rm -f distrib/intergeo.min.js
+	rm -f distrib/jsxgraphcore.js
+	rm -f distrib/sketch.min.js
+	rm -f doc/jsdoc-tk/template/static/jsxgraph.css
+	rm -f doc/jsdoc-tk/template/static/jsxgraphcore.js