New Upstream Release (2.9.1)
[celtx-debian.git] / rules
blobabf982b18fd1289f7750825d5459a93fd59b361d
1 #!/usr/bin/make -f
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
6 # These are used for cross-compiling and for saving the configure script
7 # from having to guess our platform (since we know it already)
8 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
9 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
10 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
11 CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
12 else
13 CROSS= --build $(DEB_BUILD_GNU_TYPE)
14 endif
16 CFLAGS += -Wall -pipe -DDEBIAN `pkg-config nss nspr --cflags`
17 CXXFLAGS += -DDEBIAN `pkg-config nss nspr --cflags`
18 LDFLAGS = -Wl,-z,defs -Wl,--as-needed -Wl,--no-undefined `pkg-config nss nspr --libs`
20 CONFIGURE_OPTIONS = ac_add_options $(CROSS)
22 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
23 CONFIGURE_OPTIONS += --disable-optimize
24 else
25 CONFIGURE_OPTIONS += --enable-optimize=\"-O2 -fno-strict-aliasing -g\"
26 endif
28 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
29 CONFIGURE_OPTIONS += --enable-debug
30 else
31 CONFIGURE_OPTIONS += --disable-debug
32 endif
34 config: config-stamp
35 config-stamp:
36 dh_testdir
37 [ ! -d debian/patches ] || $(MAKE) -f /usr/share/quilt/quilt.make patch
39 cp debian/mozconfig.debian mozilla/.mozconfig
40 echo $(CONFIGURE_OPTIONS) >> mozilla/.mozconfig
42 ifneq "$(wildcard /usr/share/misc/config.sub)" ""
43 cp -f /usr/share/misc/config.sub mozilla/build/autoconf/config.sub
44 endif
45 ifneq "$(wildcard /usr/share/misc/config.guess)" ""
46 cp -f /usr/share/misc/config.guess mozilla/build/autoconf/config.guess
47 endif
49 touch $@
51 build: build-stamp
52 build-stamp: config
53 dh_testdir
54 cd mozilla && \
55 LDFLAGS="$(LDFLAGS)" \
56 CFLAGS="$(CFLAGS)" \
57 CXXFLAGS="$(CXXFLAGS)"\
58 $(MAKE) -f client.mk build_all
59 touch $@
61 clean:
62 dh_testdir
63 dh_testroot
64 rm -f build-stamp config-stamp
65 rm -f mozilla/config.status
66 rm -f mozilla/config.log
67 rm -f mozilla/nsprpub/config.status
68 rm -f mozilla/nsprpub/config.log
69 rm -f mozilla/.mozconfig
70 rm -f mozilla/build/autoconf/config.guess
71 rm -f mozilla/build/autoconf/config.sub
72 rm -rf obj-celtx
73 rm -f `find . -name "*.pyc"`
74 [ ! -d debian/patches ] || $(MAKE) -f /usr/share/quilt/quilt.make unpatch
75 dh_clean
77 install: build
78 dh_testdir
79 dh_testroot
80 dh_prep
81 dh_installdirs
83 cd obj-celtx/xpfe/components && $(MAKE)
84 cd obj-celtx && $(MAKE) install DESTDIR="$(CURDIR)"/debian/tmp
85 # Remove all empty directories.
86 perl -MFile::Find -e"finddepth(sub{rmdir},'$(CURDIR)/debian/tmp')"
88 mkdir -p debian/tmp/usr/share/pixmaps/
89 #cp mozilla/celtx/app/default.xpm debian/tmp/usr/share/pixmaps/celtx.xpm
90 cp debian/celtx.xpm debian/tmp/usr/share/pixmaps/celtx.xpm
91 cp mozilla/celtx/app/mozicon128.png debian/tmp/usr/share/pixmaps/celtx.png
92 cp mozilla/celtx/app/document.png debian/tmp/usr/share/pixmaps/celtx-doc.png
94 chmod -x `find debian -name "*.idl"`
95 chmod -x `find debian -name "*.celtx"`
96 chmod -x `find debian -name "*.xpm"`
97 chmod -x `find debian -name "*.png"`
98 chmod -x `find debian -name "*.rdf"`
99 chmod -x `find debian -name "*.js"`
100 chmod -x `find debian -name "*.sqlite"`
101 chmod -x `find debian -name "removed-files"`
103 # Build architecture-independent files here.
104 binary-indep: install
105 dh_testdir -i
106 dh_testroot -i
107 dh_installchangelogs -i
108 dh_installdocs -i
109 dh_install -i
110 dh_installman -i
111 dh_link -i
112 dh_compress -i
113 dh_fixperms -i
114 dh_makeshlibs -i
115 dh_shlibdeps -i
116 [ ! -e /usr/bin/dh_buildinfo ] || dh_buildinfo -i
117 dh_installdeb -i
118 dh_gencontrol -i
119 dh_md5sums -i
120 dh_builddeb -i
121 dh_desktop -i
123 # Build architecture-dependent files here.
124 binary-arch: install
125 dh_testdir -a
126 dh_testroot -a
127 dh_installchangelogs -a
128 dh_installdocs -a
129 dh_installexamples -a
130 dh_install -a
131 dh_installmenu -a
132 # dh_installmime -a
133 # dh_python -a
134 dh_installman -a
135 dh_link -a
136 dh_strip -a --dbg-package=celtx-dbg
137 dh_compress -a
138 dh_fixperms -a
139 # dh_perl -a
140 # dh_makeshlibs -a
141 [ ! -e /usr/bin/dh_buildinfo ] || dh_buildinfo -a
142 dh_installdeb -a
143 dh_shlibdeps -a
144 dh_gencontrol -a
145 dh_md5sums -a
146 dh_builddeb -a
148 get-orig-source:
149 rm -fv celtx-2-9-1-src.tar.bz2
150 wget http://download.celtx.com/source/celtx-2-9-1-src.tar.bz2
151 rm -rf celtx-2-9-1-src
152 tar xvfj celtx-2-9-1-src.tar.bz2
153 rm -v celtx-2-9-1-src.tar.bz2
154 rm -fv ../celtx_2.9.1+dfsg1.orig.tar.gz
155 cd celtx-2-9-1-src && sh ../debian/remove-nonfree.sh
156 tar cvfj ../celtx_2.9.1+dfsg1.orig.tar.bz2 celtx-2-9-1-src
157 rm -rf celtx-2-9-1-src
159 binary: binary-indep binary-arch
160 .PHONY: config build clean binary-indep binary-arch binary install get-orig-source