Initial quick'n'dirty version of the package
[celtx-debian.git] / rules
blobf6dcd531d309565608ce7a5a432d59d290ede1de
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 # Build architecture-independent files here.
89 binary-indep: install
90 dh_testdir -i
91 dh_testroot -i
92 dh_installchangelogs -i
93 dh_installdocs -i
94 dh_install -i
95 chmod -x `find debian -name "*.idl"`
96 chmod -x `find debian -name "*.celtx"`
97 chmod -x `find debian -name "*.xpm"`
98 chmod -x `find debian -name "*.png"`
99 chmod -x `find debian -name "*.rdf"`
100 chmod -x `find debian -name "*.js"`
101 chmod -x `find debian -name "removed-files"`
102 dh_installman -i
103 dh_link -i
104 dh_compress -i
105 dh_fixperms -i
106 dh_makeshlibs -i
107 dh_shlibdeps -i
108 [ ! -e /usr/bin/dh_buildinfo ] || dh_buildinfo -i
109 dh_installdeb -i
110 dh_gencontrol -i
111 dh_md5sums -i
112 dh_builddeb -i
113 dh_desktop -i
115 # Build architecture-dependent files here.
116 binary-arch: install
117 dh_testdir -a
118 dh_testroot -a
119 dh_installchangelogs -a
120 dh_installdocs -a
121 dh_installexamples -a
122 dh_install -a
123 # dh_installmenu -a
124 # dh_installmime -a
125 # dh_python -a
126 dh_installman -a
127 # dh_desktop -a
128 dh_link -a
129 dh_strip -a --dbg-package=celtx-dbg
130 dh_compress -a
131 dh_fixperms -a
132 # dh_perl -a
133 # dh_makeshlibs -a
134 [ ! -e /usr/bin/dh_buildinfo ] || dh_buildinfo -a
135 dh_installdeb -a
136 dh_shlibdeps -a
137 dh_gencontrol -a
138 dh_md5sums -a
139 dh_builddeb -a
141 get-orig-source:
142 rm -f celtx-201-src.tar.bz2
143 wget http://download.celtx.com/source/celtx-201-src.tar.bz2
144 rm -rf celtx-201-src
145 tar xvfj celtx-201-src.tar.bz2
146 rm -f celtx-201-src.tar.bz2
147 cd celtx-201-src && sh ../debian/remove-nonfree.sh
148 tar cvfz ../celtx_2.0.1+dfsg1.orig.tar.gz celtx-201-src
149 rm -rf celtx-201-src
151 binary: binary-indep binary-arch
152 .PHONY: config build clean binary-indep binary-arch binary install get-orig-source