File: rules

package info (click to toggle)
ckeditor 4.4.4%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 25,632 kB
  • ctags: 2,419
  • sloc: sh: 190; python: 37; makefile: 29; php: 15; xml: 5
file content (54 lines) | stat: -rwxr-xr-x 1,895 bytes parent folder | 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
#!/usr/bin/make -f

export DH_VERBOSE = 1
export CK_BASE = core/ckeditor_base

%:
	dh $@

override_dh_auto_build:
	dh_auto_build

	# manually build ckeditor.js from core/ckeditor_base.min.js
	closure-compiler --js ${CK_BASE}.js --js_output_file ${CK_BASE}.min.js
	# replace AUTOGENERATED by debian in ckeditor.js by contents of
	# core/ckeditor_base.min.js. The ${x;/./{x;q0};x;q1} and -e 'h;}
	# assure that sed return 1 if AUTOGENERATED tag is not found.
	sed -e '/^\/\/[[:space:]]*AUTOGENERATED by debian/{r core/ckeditor_base.min.js' -e 'h;}' \
	    -e '$${x;/./{x;q0};x;q1}' 'ckeditor.js' > ckeditor.js.inc
	    
	# update path for examples
	cp -fr samples builtsamples
	find builtsamples -type f -name '*.html' -exec sed -i 's,<script src="../ckeditor.js">,<script src="/usr/share/javascript/ckeditor/ckeditor.js">,g' {} \;


override_dh_clean:
	dh_clean
	test ! -f ${CK_BASE}.min.js || rm -f ${CK_BASE}.min.js
	test ! -f ckeditor.js.inc || rm -f ckeditor.js.inc
	test ! -d  builtsamples || rm -rf builtsamples

override_dh_install:
	dh_install

	# manually override ckeditor.js from core/ckeditor_base.min.js
	cp -f ckeditor.js.inc debian/ckeditor/usr/share/javascript/ckeditor/ckeditor.js

	# remove internal file
	find debian/ckeditor/usr/share/javascript/ckeditor -type f \
		\(-name '_*' -not -name '_bootstrap.js' \) | xargs rm -f
	# remove build file
	find debian/ckeditor/usr/share/javascript/ckeditor -type f -name 'build-config.js' | xargs rm -f
	# remove extra LICENSE.md
	find debian/ckeditor/usr/share/javascript/ckeditor/plugins -type f -name 'LICENSE.md' | xargs rm -f
	# remove dev dir
	find debian/ckeditor/usr/share/javascript/ckeditor/ -type d -name 'dev' | xargs rm -rf

override_dh_installchangelogs:
	dh_installchangelogs CHANGES.md

override_dh_fixperms:
	dh_fixperms

	# setting rights
	find debian/ckeditor/usr/share/javascript/ckeditor -type f | xargs chmod 0644