File: rules

package info (click to toggle)
mgp 1.13a%2Bupstream20090219-8
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 3,232 kB
  • ctags: 3,009
  • sloc: ansic: 32,357; sh: 4,295; lisp: 1,405; yacc: 944; lex: 264; makefile: 130; perl: 117; awk: 9
file content (131 lines) | stat: -rwxr-xr-x 3,996 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
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
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
CFLAGS = -Wall
INSTALLFLAGS = -p
INSTPGMFLAGS =
debug=
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
CFLAGS += -g
debug=--enable-debug
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTPGMFLAGS += -s
endif

FONTDIR=/usr/share/fonts/truetype

package=mgp

build-arch: build-stamp
build-stamp:
	dh_testdir

	ln -sf /usr/share/misc/config.sub .
	ln -sf /usr/share/misc/config.guess .
	./configure --prefix=/usr $(debug) --enable-locale --enable-freetype --enable-freetype-charset16 --enable-xft2 --disable-vflib --enable-gif $(DEB_HOST_GNU_TYPE)
	#./configure --prefix=/usr $(debug) --enable-locale --disable-freetype --enable-xft2 --disable-vflib --enable-gif --with-m17n-lib $(DEB_HOST_GNU_TYPE)
	xmkmf
	make Makefiles
	# XXX: it take too much time to comile unimap.c with -O
	make CFLAGS="$(CFLAGS) -DFREETYPEFONTDIR=\\\"$(FONTDIR)\\\"" \
		LIBDIR=/etc \
		ctlwords.h unimap.o
	make CFLAGS="-O2 $(CFLAGS) -DFREETYPEFONTDIR=\\\"$(FONTDIR)\\\"" \
		LIBDIR=/etc
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-rm -f build-stamp install-stamp
	[ ! -f Makefile ] || make distclean
	-rm -f `find . -name "*~"`
	-rm -rf debian/mgp debian/files* core debian/substvars
	-rm -f Makefile Imakefile *._man
	rm -f config.guess config.sub

	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	make install DESTDIR=$(CURDIR)/debian/mgp prefix=$(CURDIR)/debian/mgp/usr \
		INSTPGMFLAGS="$(INSTPGMFLAGS)" INSTALLFLAGS="$(INSTALLFLAGS)" \
		LIBDIR=/etc
	make install.man DESTDIR=$(CURDIR)/debian/mgp prefix=$(CURDIR)/debian/mgp/usr \
		INSTALLFLAGS="$(INSTALLFLAGS)" \
		LIBDIR=/etc
	# contrib 
	install -d $(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el
	install -m 755 contrib/eqn2eps.sh \
		contrib/mgp2html.pl contrib/mgp2latex.pl \
		contrib/tex2eps.sh \
		$(CURDIR)/debian/mgp/usr/bin/
	install -m 644 contrib/mgp-el/README \
		$(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el
	install -m 644 contrib/mgp-el/mgp.sty \
		$(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el
	install -m 644 contrib/mgp-el/sample.tex \
		$(CURDIR)/debian/mgp/usr/share/doc/mgp/contrib/mgp-el
	install -m 644 contrib/mgp-mode.el contrib/mgp-el/mgp.el \
		$(CURDIR)/debian/mgp/usr/share/emacs/site-lisp/mgp
	-rm $(CURDIR)/debian/mgp/etc/mgp/*
	cp debian/default.mgp $(CURDIR)/debian/mgp/etc/mgp/default.mgp

	#Rename shell scripts to remove .sh extension.
	mv $(CURDIR)/debian/mgp/usr/bin/eqn2eps.sh \
		$(CURDIR)/debian/mgp/usr/bin/eqn2eps
	mv $(CURDIR)/debian/mgp/usr/bin/tex2eps.sh \
		$(CURDIR)/debian/mgp/usr/bin/tex2eps
	mv $(CURDIR)/debian/mgp/usr/bin/mgp2html.pl \
		$(CURDIR)/debian/mgp/usr/bin/mgp2html
	mv $(CURDIR)/debian/mgp/usr/bin/mgp2latex.pl \
		$(CURDIR)/debian/mgp/usr/bin/mgp2latex

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build-indep
# We have nothing to do by default.
build-indep:

# Build architecture-dependent files here.
binary-arch: build-arch install
#	dh_testversion
	dh_testdir
	dh_testroot
	dh_installdocs COPYRIGHT COPYRIGHT.jp FAQ \
		README README.fonts README.fonts.jp README.lang \
		SYNTAX TODO.jp USAGE USAGE.jp 
	dh_installexamples `find sample -type f ! -name '*akefile*' ! -name .cvsignore -print` debian/mgp-print6
	dh_installmenu
	dh_installmime
	dh_installcron
#	dh_installman 
	dh_installinit
	dh_installemacsen
	dh_installchangelogs RELNOTES
#	dh_movefiles
	dh_strip
	dh_compress --exclude=examples
	dh_fixperms
#	dh_suidregister
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch
build: build-indep build-arch
.PHONY: build clean binary-indep binary-arch binary build-indep build-arch