File: rules

package info (click to toggle)
ckeditor 4.16.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 258,804 kB
  • sloc: javascript: 239,590; sh: 184; makefile: 64; python: 37; php: 15; xml: 5
file content (89 lines) | stat: -rwxr-xr-x 3,601 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
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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE = 1

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/architecture.mk

REV  ?= $(shell echo "$(DEB_VERSION)" | sed 's/.*[-]\([[:digit:]][[:digit:]]*\)/\1/g')

CK_BASE = core/ckeditor_base
BUILDDIR = debian/builddir

%:
	dh $@

override_dh_clean:
	dh_clean
	rm -rf $(BUILDDIR)
	rm -rf builtsamples

# rebuilt long line
$(BUILDDIR)/${CK_BASE}.min.js: $(BUILDDIR)/${CK_BASE}.js $(BUILDDIR)/build.stamp
	cd $(BUILDDIR) && closure-compiler --js ${CK_BASE}.js --js_output_file ${CK_BASE}.min.js

$(BUILDDIR)/ckeditor.js: ckeditor.js $(BUILDDIR)/${CK_BASE}.min.js
	sed -e '/^\/\/[[:space:]]*AUTOGENERATED by debian/{r $(BUILDDIR)/${CK_BASE}.min.js' -e 'h;}' \
	    -e '$${x;/./{x;q0};x;q1}' $<  > $@

$(BUILDDIR)/build.stamp:
	mkdir $(BUILDDIR)
	rsync -a . $(BUILDDIR) --exclude debian --exclude .git
	rm -f $(BUILDDIR)/ckeditor.js
	touch $@

override_dh_auto_build: $(BUILDDIR)/build.stamp $(BUILDDIR)/ckeditor.js
	dh_auto_build
	cd $(BUILDDIR)/dev/builder \
        && xvfb-run \
           java -jar /usr/share/ckbuilder/ckbuilder.jar \
            -d 1 \
            --no-zip --no-tar --overwrite \
            --version="$(DEB_VERSION_UPSTREAM)" --revision="$(REV)" \
            --build ../../ _build

override_dh_installexamples:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	# update path for examples
	cp -fr samples builtsamples
	rsync -v -am  --include='*/' --include='*/*/' --include='*/*/samples/**' --exclude='*' plugins builtsamples
	# no flash
	rm -f builtsamples/plugins/htmlwriter/samples/outputforflash.html
	find builtsamples -type f -name '*.html' -exec sed -i 's,<script src="../ckeditor.js">,<script src="ckeditor/ckeditor.js">,g' {} \;
	find builtsamples -type f -name '*.html' -exec sed -i 's,<script src="../../ckeditor.js">,<script src="../ckeditor/ckeditor.js">,g' {} \;
	find builtsamples -type f -name '*.html' -exec sed -i 's,<script src="../../adapters/jquery.js">,<script src="../ckeditor/adapters/ckeditor.js">,g' {} \;
	sed -i 's,<script src="http://code.jquery.com/jquery-1.11.0.min.js">,<script src="jquery.js">,g' builtsamples/old/jquery.html
	sed -i 's,href="../../plugins/,href="../plugins/,g' builtsamples/old/index.html
	dh_installexamples
	ln -s ../../../javascript/ckeditor/ debian/ckeditor/usr/share/doc/ckeditor/examples/ckeditor
	ln -s ../../../../javascript/jquery/jquery.js debian/ckeditor/usr/share/doc/ckeditor/examples/old/jquery.js
else
	@echo '**********************************************************'
	@echo 'Skip examples                                             '
	@echo '**********************************************************'
endif

override_dh_install:
	dh_install -Xreadme -XREADME
	# remove internal files:
	find debian/ckeditor/usr/share/javascript/ckeditor -type f -name '_*' -not -name '_bootstrap.js' -delete -printf 'removed %p\n'

override_dh_installdocs:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES)))
	dh_installdocs
	# add skin readme
	rsync -v -am  --include='skins/' --include='skins/*/' --include='skins/*/readme.md' --exclude='*' skins debian/ckeditor/usr/share/doc/ckeditor
else
	@echo '**********************************************************'
	@echo 'Skip doc                                                  '
	@echo '**********************************************************'
endif

override_dh_installchangelogs:
	dh_installchangelogs CHANGES.md
	# word wrap
	# fold < CHANGES.md > debian/ckeditor/usr/share/doc/ckeditor/CHANGES.md

override_dh_compress:
	dh_compress -X examples/