File: rules

package info (click to toggle)
canna 3.7p3-14
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,216 kB
  • ctags: 9,776
  • sloc: ansic: 85,928; sh: 2,777; yacc: 403; cpp: 389; lex: 379; makefile: 72; awk: 7
file content (87 lines) | stat: -rwxr-xr-x 3,498 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
#!/usr/bin/make -f
# -*- makefile -*-

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

override_dh_auto_clean:
	[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f Makefile ] || $(MAKE) distclean
	[ ! -f doc/man/guide/tex/Makefile ] || $(MAKE) -C doc/man/guide/tex clean
	[ ! -f doc/man/guide/tex/Makefile ] || $(MAKE) -C doc/man/guide/tex distclean
	# remove created symlinks
	rm -f doc/intern/canna.sty doc/lisp/canna.sty \
		doc/man/guide/tex/canna.sty doc/misc/canna.sty 
	# remove generated files 
	rm -f configure canuum/configure canuum/config.h.in Canna.conf accanna.h.in
	rm -fr $(CURDIR)/debian/tmpDefCannaSrvDir
	# restore autotools helper files
	for i in $(CURDIR)/canuum/config.guess $(CURDIR)/canuum/config.sub; do \
		[ -e $$i.dh-orig ] || continue; \
		mv -f $$i.dh-orig $$i; \
	done
	dh_auto_clean

override_dh_auto_build:
	dh_testdir
	dh_auto_clean
	# update autotools helper files
	for i in config.guess config.sub; do \
		[ ! -e $(CURDIR)/canuum/$$i.dh-orig ] || continue; \
		mv -f $(CURDIR)/canuum/$$i $(CURDIR)/canuum/$$i.dh-orig; \
		cp -f /usr/share/misc/$$i $(CURDIR)/canuum/$$i; \
	done
	./mkrelease.sh && xmkmf
	cd doc/man/guide/tex && xmkmf
	$(MAKE) canna \
		CDEBUGFLAGS="-g -Wall" \
		CCOPTIONS="$$(dpkg-buildflags --get CFLAGS) $$(dpkg-buildflags --get CPPFLAGS)" \
		LOCAL_LDFLAGS="$$(dpkg-buildflags --get LDFLAGS)" \
		SHLIBGLOBALSFLAGS="$$(dpkg-buildflags --get LDFLAGS)"
	$(MAKE) -C doc/man/guide/tex

override_dh_install:
	make install \
		cannaBinDir=$(CURDIR)/debian/tmp/usr/bin \
		cannaSrvDir=$(CURDIR)/debian/tmp/usr/sbin \
		cannaLibDir=$(CURDIR)/debian/tmp/var/lib/canna \
		cannaEtcDir=$(CURDIR)/debian/tmp/etc/canna \
		cannaShareDir=$(CURDIR)/debian/tmp/usr/share/canna \
		cannaManDir=$(CURDIR)/debian/tmp/usr/share/man \
		cannaIncDir=$(CURDIR)/debian/tmp/usr/include/canna \
		libCannaDir=$(CURDIR)/debian/tmp/usr/lib \
		cannaDocDir=$(CURDIR)/debian/tmp/usr/share/doc/libcanna1g \
		DicDir=$(CURDIR)/debian/tmp/var/lib/canna/dic \
		ErrDir=$(CURDIR)/debian/tmp/var/log/canna
	make install.man \
		cannaManDir=$(CURDIR)/debian/tmp/usr/share/man \
		MANSUFFIX=1 LIBMANSUFFIX=3
	(cd $(CURDIR)/debian/tmp/usr/bin/ && \
		rm -f cpdic lsdic mkdic mvdic rmdic syncdic \
			addwords delwords cannakill)
	install -d -m 755 $(CURDIR)/debian/tmp/etc/canna/dics.dir.d
	install -m 644 $(CURDIR)/debian/tmp/var/lib/canna/dic/canna/dics.dir \
		$(CURDIR)/debian/tmp/etc/canna/dics.dir.d/00canna.dics.dir
	rm -f $(CURDIR)/debian/tmp/var/lib/canna/dic/canna/dics.dir
	# 3.7 tries to install symlink to cannakill here, ignore it.
	rm -f $(CURDIR)/debian/tmp/usr/sbin/cannakill
	install -m 755 $(CURDIR)/debian/update-canna-dics_dir \
		$(CURDIR)/debian/tmp/usr/sbin
	# move /var/lib/canna/dic/*.cld and related file to template dir
	install -d -m 755 $(CURDIR)/debian/tmp/usr/lib/canna/debian-template/
	mv \
		$(CURDIR)/debian/tmp/var/lib/canna/dic/canna/*.cld \
		$(CURDIR)/debian/tmp/var/lib/canna/dic/canna/iroha.cbd \
		$(CURDIR)/debian/tmp/var/lib/canna/dic/canna/fuzokugo.cbd \
		$(CURDIR)/debian/tmp/usr/lib/canna/debian-template/
	chown -R root:root $(CURDIR)/debian/tmp/usr/lib/canna/debian-template/
	dh_install --sourcedir=debian/tmp
	dh_installman -pcanna $(CURDIR)/cmd/catdic/chmoddic.man  \
		$(CURDIR)/debian/manpages/update-canna-dics_dir.8 \
		$(CURDIR)/debian/manpages/canlisp.1 \
		$(CURDIR)/debian/manpages/forsort.1 \
		$(CURDIR)/debian/manpages/mergeword.1
	dh_installman -pcanna-utils $(CURDIR)/debian/manpages/chkconc.1 

%:
	dh $@