1#!/usr/bin/make -f
2# debian/rules for stardict.
3
4# Uncomment this to turn on verbose mode.
5#export DH_VERBOSE=1
6
7
8# These are used for cross-compiling and for saving the configure script
9# from having to guess our platform (since we know it already)
10DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12
13CFLAGS = -Wall -g
14
15ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
16	CFLAGS += -O0
17else
18	CFLAGS += -O2
19endif
20ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
21	INSTALL_PROGRAM += -s
22endif
23
24configure: configure-stamp
25configure-stamp:
26	dh_testdir
27
28	touch configure-stamp
29
30build: configure-stamp build-stamp
31
32build-stamp:
33	dh_testdir
34
35	# Add here commands to compile the package with gnome support
36	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
37		--prefix=/usr \
38		--mandir=\$${prefix}/share/man \
39		--infodir=\$${prefix}/share/info \
40		--sysconfdir=/etc \
41		--localstatedir=/var \
42		--disable-schemas-install \
43		--disable-gucharmap \
44		--disable-dictdotcn \
45		--disable-festival \
46		--disable-tools
47	$(MAKE)
48
49
50	#/usr/bin/docbook-to-man debian/stardict.sgml > stardict.1
51
52	touch build-stamp
53
54clean:
55	dh_testdir
56	dh_testroot
57	rm -f build-stamp configure-stamp
58
59	# Add here commands to clean up after the build process.
60	-$(MAKE) distclean
61
62	# Clean up
63	rm -f dict/po/.intltool-merge-cache
64	rm -f dict/intltool-extract
65	rm -f dict/intltool-merge
66	rm -f dict/intltool-update
67# I am not sure why we need these
68#ifneq "$(wildcard /usr/share/misc/config.sub)" ""
69#	cp -f /usr/share/misc/config.sub config.sub
70#endif
71#ifneq "$(wildcard /usr/share/misc/config.guess)" ""
72#	cp -f /usr/share/misc/config.guess config.guess
73#endif
74	dh_clean
75
76install: build
77	dh_testdir
78	dh_testroot
79	dh_clean -k
80	dh_installdirs
81
82	# Add here commands to install the package into debian/stardict.
83	$(MAKE) install DESTDIR=$(CURDIR)/debian/stardict
84	rm -f `find $(CURDIR)/debian/stardict -name "*.la"`
85
86	dh_movefiles --sourcedir=debian/stardict
87
88	install -m644 debian/stardict_16x16.xpm \
89		$(CURDIR)/debian/stardict/usr/share/pixmaps
90	install -m644 debian/stardict_32x32.xpm \
91		$(CURDIR)/debian/stardict/usr/share/pixmaps
92
93# Build architecture-independent files here.
94binary-indep: build install
95# We have nothing to do by default.
96
97# Build architecture-dependent files here.
98binary-arch: build install
99	dh_testdir
100	dh_testroot
101	dh_installchangelogs -pstardict dict/ChangeLog
102	dh_installdocs -pstardict
103#	dh_installexamples
104#	dh_install
105	dh_installmenu -pstardict
106#	dh_installdebconf
107	dh_installman -pstardict
108	dh_scrollkeeper
109	dh_gconf
110#	dh_link
111	dh_strip
112	dh_compress
113	dh_fixperms
114#	dh_perl
115	dh_pysupport /usr/bin/stardict
116#	dh_makeshlibs
117	dh_installdeb
118	dh_shlibdeps -L stardict -l debian/stardict/usr/bin
119	dh_gencontrol
120	dh_md5sums
121	dh_builddeb
122
123binary: binary-indep binary-arch
124.PHONY: build clean binary-indep binary-arch binary install
125