~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/make -f
2
 
# Made with the aid of debmake, by Christoph Lameter,
3
 
# based on the sample debian/rules file for GNU hello by Ian Jackson.
4
 
 
5
 
export DH_COMPAT=3
 
2
# Sample debian/rules that uses debhelper.
 
3
# GNU copyright 1997 to 1999 by Joey Hess.
 
4
 
 
5
# Uncomment this to turn on verbose mode.
 
6
#export DH_VERBOSE=1
 
7
 
 
8
# This is the debhelper compatibility version to use.
 
9
export DH_COMPAT=4
 
10
 
 
11
# This has to be exported to make some magic below work.
 
12
export DH_OPTIONS
 
13
 
 
14
# These are used for cross-compiling and for saving the configure script
 
15
# from having to guess our platform (since we know it already)
 
16
DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
17
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
6
18
 
7
19
INSTALL_DIR = install -p -d -o root -g root -m 755
8
20
INSTALL_FILE = install -p -o root -g root -m 644
9
 
INSTALL_SCRIPT = install -p -o root -g root -m 755
10
 
 
11
 
tmp = debian/tmp
12
 
overrides = $(tmp)/usr/share/lintian/overrides
13
 
pixmaps = $(tmp)/usr/share/pixmaps
14
 
icons = $(tmp)/usr/share/icons
15
 
kdedocs = $(tmp)/usr/share/doc/kde/HTML
16
 
 
17
 
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
18
 
ifeq ($(ARCH),alpha)
19
 
  COMPILER_FLAGS=CFLAGS="-O0 -mieee" CXXFLAGS="-O0 -mieee"
20
 
else
21
 
  ifeq ($(ARCH),hppa)
22
 
    COMPILER_FLAGS=CFLAGS="-Os -ffunction-sections -Wl,--stub-group-size=50000" CXXFLAGS="-Os -ffunction-sections -Wl,--stub-group-size=50000"
23
 
  else
24
 
    COMPILER_FLAGS=CXX=g++ CC=gcc
25
 
  endif
26
 
endif
27
 
 
28
 
build: build-stamp
 
21
 
 
22
objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
 
23
 
 
24
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
 
25
        CFLAGS += -g
 
26
endif
 
27
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 
28
        INSTALL_PROGRAM += -s
 
29
endif
 
30
 
 
31
# These options are for distributed compiling.
 
32
# DEB_CONCURRENCY_LEVEL must always be >= 1.
 
33
DEB_CONCURRENCY_LEVEL   ?= 1
 
34
do_parallel = -j$(DEB_CONCURRENCY_LEVEL)
 
35
DEB_DISTCC_HOSTS        ?= localhost
 
36
export DISTCC_HOSTS = $(DEB_DISTCC_HOSTS)
 
37
 
 
38
ifeq ($(DEB_BUILD_GNU_TYPE),i386-linux)
 
39
  # Uncomment the following 2 lines to enable i686 optimziation
 
40
  # You may want to tweak the settings to your likings
 
41
  #export CFLAGS=-O3 -march=i686 -ffast-math -finline-functions
 
42
  #export CXXFLAGS=-O3 -march=i686 -ffast-math -finline-functions
 
43
endif
29
44
 
30
45
-include debian/debiandirs
31
46
 
32
47
debian/debiandirs: admin/debianrules
33
48
        perl -w admin/debianrules echodirs > debian/debiandirs
34
49
 
35
 
build-stamp:
36
 
        dh_testdir
37
 
        if test ! -f configure; then \
38
 
          $(MAKE) -f admin/Makefile.common ;\
39
 
        fi 
40
 
        $(COMPILER_FLAGS) ./configure $(configkde) \
41
 
          --libdir=$(kde_libdir) --includedir=$(kde_includedir)
42
 
        $(MAKE) KDE_PLUGIN_DEBIAN="-module -no-undefined"
 
50
configure: configure-stamp
 
51
configure-stamp:
 
52
        dh_testdir
 
53
 
 
54
        # Apply Debian specific patches
 
55
        if test ! -f patch-stamp; then \
 
56
                for patch in $(CURDIR)/debian/patches/*.diff ;\
 
57
                do \
 
58
                        echo APPLYING PATCH\: $${patch##*/};\
 
59
                        patch -p1 < $$patch ;\
 
60
                done ;\
 
61
                touch patch-stamp ;\
 
62
        fi
 
63
 
 
64
        # KDE CVS does not have aclocal.m4 or configure
 
65
        # if test ! -f configure; then \
 
66
        #       $(MAKE) -f admin/Makefile.common ;\
 
67
        # fi
 
68
 
 
69
        # Force a rerun of automake/etc since this is required by the
 
70
        # debian patches.
 
71
        $(MAKE) -f admin/Makefile.common ;\
 
72
 
 
73
        # make build directory
 
74
        mkdir $(objdir)
 
75
 
 
76
        # ensure configure is executable
 
77
        chmod +x configure
 
78
 
 
79
        # run configure with build tree $(objdir)
 
80
        cd $(objdir) && \
 
81
        ../configure $(configkde)
 
82
 
 
83
        touch configure-stamp
 
84
 
 
85
build: build-stamp
 
86
build-stamp: configure-stamp 
 
87
        dh_testdir
 
88
 
 
89
        cd $(objdir) && \
 
90
        $(MAKE) $(do_parallel)
 
91
 
43
92
        touch build-stamp
44
93
 
45
 
clean: debian-clean
46
 
        dh_clean
47
 
 
48
94
debian-clean:
49
95
        dh_testdir
50
96
        dh_testroot
51
 
        -rm -f build-stamp install-stamp debian/debiandirs
 
97
 
 
98
        dh_clean
 
99
 
 
100
clean:
 
101
        dh_testdir
 
102
        dh_testroot
 
103
        rm -f build-stamp configure-stamp debian/debiandirs
 
104
 
 
105
        # Remove Debian specific patches
 
106
        if test -f patch-stamp; then \
 
107
                for patch in $(CURDIR)/debian/patches/*.diff ;\
 
108
                do \
 
109
                        echo REMOVING PATCH\: $${patch##*/};\
 
110
                        patch -p1 -R < $$patch ;\
 
111
                done ;\
 
112
                rm -f patch-stamp ;\
 
113
        fi
 
114
 
 
115
        # Remove build tree
 
116
        rm -rf $(objdir)
 
117
 
 
118
        # if Makefile exists run distclean
 
119
        if test -f Makefile; then \
 
120
                $(MAKE) distclean; \
 
121
        fi
 
122
 
52
123
        if test -d CVS; then \
53
 
          $(MAKE) -f admin/Makefile.common cvs-clean ;\
 
124
                $(MAKE) -f admin/Makefile.common cvs-clean ;\
54
125
        fi
55
 
        -$(MAKE) distclean
56
 
 
57
 
install: install-stamp
58
 
 
59
 
install-stamp: build
 
126
 
 
127
        dh_clean
 
128
 
 
129
install: DH_OPTIONS=
 
130
install: build
60
131
        dh_testdir
61
132
        dh_testroot
62
133
        dh_clean -k
63
134
        dh_installdirs
64
135
 
65
 
        # Install overrides.
66
 
        $(INSTALL_DIR) $(overrides)
67
 
        $(INSTALL_FILE) debian/*.override $(overrides)
68
 
        for i in `ls $(overrides)/`; do \
69
 
                mv $(overrides)/$$i $(overrides)/`echo $$i | sed -e 's#.override##'`; \
70
 
        done
71
 
 
72
 
        # Install pixmaps.
73
 
        $(INSTALL_DIR) $(pixmaps)
74
 
        $(INSTALL_FILE) debian/*.xpm $(pixmaps)
75
 
 
76
 
        # Install kformula icons.
77
 
        $(INSTALL_DIR) $(icons)/locolor/16x16/apps
78
 
        $(INSTALL_DIR) $(icons)/locolor/32x32/apps
79
 
        $(INSTALL_FILE) debian/kformula.lo16.xpm \
80
 
                $(icons)/locolor/16x16/apps/kformula.xpm
81
 
        $(INSTALL_FILE) kformula/kformula.xpm \
82
 
                $(icons)/locolor/32x32/apps/kformula.xpm
83
 
 
84
 
        # Main install.
85
 
        $(MAKE) install DESTDIR=`pwd`/$(tmp)
86
 
 
87
 
        # Add "#!/usr/bin/perl" to the head of kprconverter.pl.
88
 
        echo "#!/usr/bin/perl -w" > $(tmp)/usr/bin/kprconverter.pl.new
89
 
        echo -n "# -- Was: " >> $(tmp)/usr/bin/kprconverter.pl.new
90
 
        cat $(tmp)/usr/bin/kprconverter.pl >> $(tmp)/usr/bin/kprconverter.pl.new
91
 
        mv $(tmp)/usr/bin/kprconverter.pl.new $(tmp)/usr/bin/kprconverter.pl
92
 
        chmod 755 $(tmp)/usr/bin/kprconverter.pl
93
 
 
94
 
        # Sort out this mess where kivio wants to installed a shared library
95
 
        # in /usr/share with the wrong extension.
96
 
        # We'll put a symlink in kivio.links.
97
 
        $(INSTALL_DIR) $(tmp)/usr/lib/kivio
98
 
        mv $(tmp)/usr/share/apps/kivio/autoloadStencils/straight_connector.ksp \
99
 
                $(tmp)/usr/lib/kivio/libstraight_connector.so
 
136
        cd $(objdir) && \
 
137
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
100
138
 
101
139
        # Generate HTML docs.
102
 
        for i in `find $(tmp) -name "index.docbook"`; do \
103
 
          pushd . > /dev/null; cd `dirname $$i`; meinproc `basename $$i`; \
104
 
          popd > /dev/null; done
105
 
 
106
 
        # Make common links for docs.
107
 
        for p in `dh_listpackages`; do \
108
 
          for i in `find $(kdedocs) -type d -name $$p`; do \
109
 
            ln -f -n -s ../common $$i/common; done; done
110
 
 
111
 
        perl -w admin/debianrules cleanup
112
 
 
113
 
        touch install-stamp
114
 
        
 
140
        for i in `find debian/tmp -name "index.docbook"`; do \
 
141
          ( cd `dirname $$i`; meinproc `basename $$i` ); \
 
142
        done
 
143
 
 
144
        # Split into separate binary packages.
 
145
        dh_install --sourcedir=debian/tmp --list-missing
 
146
 
 
147
        # Don't override the openoffice.org mimelnk entries with our own.
 
148
        rm -f debian/koffice-data/usr/share/mimelnk/application/vnd.sun.xml.*.desktop
 
149
 
 
150
        # Install standard documentation links.
 
151
        for pkg in `dh_listpackages`; do \
 
152
          if test -d debian/$$pkg/usr/share/doc/kde/HTML/en/$$pkg; then \
 
153
            dh_link -p$$pkg usr/share/doc/kde/HTML/en/$$pkg \
 
154
              usr/share/doc/$$pkg/html; \
 
155
          fi; \
 
156
        done
 
157
 
 
158
        # Install lintian and linda overrides.
 
159
        for pkg in `dh_listpackages`; do \
 
160
          if test -e debian/$$pkg.override; then \
 
161
            $(INSTALL_DIR) debian/$$pkg/usr/share/lintian/overrides; \
 
162
            $(INSTALL_FILE) debian/$$pkg.override \
 
163
              debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
 
164
          fi; \
 
165
          if test -e debian/$$pkg.linda; then \
 
166
            $(INSTALL_DIR) debian/$$pkg/usr/share/linda/overrides; \
 
167
            $(INSTALL_FILE) debian/$$pkg.linda \
 
168
              debian/$$pkg/usr/share/linda/overrides/$$pkg; \
 
169
          fi; \
 
170
        done
 
171
 
 
172
# This single target is used to build all the packages, all at once, or
 
173
# one at a time. So keep in mind: any options passed to commands here will
 
174
# affect _all_ packages. Anything you want to only affect one package
 
175
# should be put in another target, such as the install target.
 
176
binary-common:
 
177
        dh_testdir
 
178
        dh_testroot
 
179
 
 
180
        # Install the correct upstream changelogs.
 
181
        for pkg in `dh_listpackages`; do \
 
182
          case "$$pkg" in \
 
183
            karbon | kchart | kexi | kivio | kpresenter | kspread | kugar | kword ) \
 
184
              DH_OPTIONS='' dh_installchangelogs -p$$pkg $$pkg/CHANGES ;; \
 
185
            koffice-libs ) \
 
186
              DH_OPTIONS='' dh_installchangelogs -p$$pkg lib/CHANGES ;; \
 
187
            * ) \
 
188
              DH_OPTIONS='' dh_installchangelogs -p$$pkg ;; \
 
189
          esac; \
 
190
        done
 
191
 
 
192
        dh_installdocs
 
193
        dh_installexamples
 
194
        dh_installman
 
195
        dh_installmenu
 
196
        dh_installmime
 
197
 
 
198
        # Rename some newly installed files, ensure all demo files
 
199
        # are once compressed and fix incorrect man page installations.
 
200
        for pkg in `dh_listpackages`; do \
 
201
          case "$$pkg" in \
 
202
            kugar ) \
 
203
              mv debian/kugar/usr/share/doc/kugar/examples/kugar.examples.README \
 
204
                debian/kugar/usr/share/doc/kugar/examples/README.examples; \
 
205
            ;; \
 
206
            kword | kspread ) \
 
207
              for eg in debian/$$pkg/usr/share/doc/$$pkg/examples/*.k??; do \
 
208
                if ! gzip -t $$eg > /dev/null 2>&1; then \
 
209
                  gzip -9 $$eg; \
 
210
                  mv $$eg.gz $$eg; \
 
211
                fi; \
 
212
              done; \
 
213
            ;; \
 
214
            kpresenter ) \
 
215
              mv debian/kpresenter/usr/share/man/pl/man1/kprconverter.1 \
 
216
                debian/kpresenter/usr/share/man/man1/kprconverter.pl.1; \
 
217
              rm -rf debian/kpresenter/usr/share/man/pl; \
 
218
            ;; \
 
219
          esac; \
 
220
        done
 
221
 
 
222
        dh_strip
 
223
        dh_link
 
224
        dh_compress -X.docbook -X.css -X-license -X.dcl -X.bz2 -X.ksp -X.kwd -X.kwt
 
225
        dh_fixperms
 
226
        dh_makeshlibs -V
 
227
        dh_installdeb
 
228
        dh_perl
 
229
 
 
230
        # Run dh_shlibdeps with package-specific library search paths.
 
231
        for pkg in `dh_listpackages`; do \
 
232
          echo "Checking dependencies for $$pkg..."; \
 
233
          case "$$pkg" in \
 
234
            koffice | koffice-doc-html ) \
 
235
              DH_OPTIONS='' dh_shlibdeps -p$$pkg ;; \
 
236
            koffice-* ) \
 
237
              DH_OPTIONS='' dh_shlibdeps -p$$pkg -ldebian/koffice-libs/usr/lib ;; \
 
238
            kexi ) \
 
239
              DH_OPTIONS='' dh_shlibdeps -p$$pkg \
 
240
                -ldebian/koffice-libs/usr/lib:debian/kugar/usr/lib:debian/$$pkg/usr/lib ;; \
 
241
            * ) \
 
242
              DH_OPTIONS='' dh_shlibdeps -p$$pkg \
 
243
                -ldebian/koffice-libs/usr/lib:debian/$$pkg/usr/lib ;; \
 
244
          esac; \
 
245
        done
 
246
 
 
247
        dh_gencontrol
 
248
        dh_md5sums
 
249
        dh_builddeb
 
250
 
 
251
# Build architecture independant packages using the common target.
115
252
binary-indep: build install
116
 
        dh_testdir
117
 
        dh_testroot
118
 
        dh_movefiles -i
119
 
        dh_installdocs -i
120
 
        dh_installexamples -i
121
 
        dh_installmenu -i
122
 
        dh_installmime -i
123
 
        dh_installman -i
124
 
        dh_installchangelogs -pkoffice-doc-html
125
 
        dh_link -i
126
 
        #dh_strip -i
127
 
        dh_compress -i
128
 
        dh_fixperms -i
129
 
        dh_installdeb -i
130
 
        dh_perl -i
131
 
        #dh_shlibdeps -i
132
 
        dh_gencontrol -i
133
 
        dh_md5sums -i
134
 
        dh_builddeb -i
 
253
        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
135
254
 
 
255
# Build architecture dependant packages using the common target.
136
256
binary-arch: build install
137
 
        dh_testdir
138
 
        dh_testroot
139
 
        dh_movefiles -a
140
 
        dh_installdebconf -a
141
 
        dh_installdocs -a
142
 
        dh_installexamples -a
143
 
        # Rename a couple of newly installed files.
144
 
        mv debian/kugar/usr/share/doc/kugar/examples/kugar.examples.README \
145
 
          debian/kugar/usr/share/doc/kugar/examples/README.examples
146
 
        # Ensure all demo files are once compressed.
147
 
        for i in kword kspread; do \
148
 
          for j in debian/$$i/usr/share/doc/$$i/examples/*.k??; do \
149
 
            if ! gzip -t $$j > /dev/null 2>&1; then \
150
 
              gzip -9 $$j; mv $$j.gz $$j; fi; done; done
151
 
        dh_installmenu -a
152
 
        dh_installmime -a
153
 
        dh_installman -a
154
 
        dh_undocumented -a
155
 
        dh_installchangelogs -pkoffice
156
 
        dh_installchangelogs -pkoffice-libs
157
 
        dh_installchangelogs -pkoffice-dev
158
 
        dh_installchangelogs -pkchart kchart/CHANGES
159
 
        dh_installchangelogs -pkformula
160
 
        dh_installchangelogs -pkontour
161
 
        dh_installchangelogs -pkivio kivio/CHANGELOG
162
 
        dh_installchangelogs -pkoshell
163
 
        dh_installchangelogs -pkpresenter kpresenter/CHANGES
164
 
        #dh_installchangelogs -pkrayon
165
 
        dh_installchangelogs -pkspread kspread/CHANGES
166
 
        dh_installchangelogs -pkugar kugar/ChangeLog
167
 
        dh_installchangelogs -pkword kword/CHANGES
168
 
        dh_link -a
169
 
        dh_strip -a
170
 
        dh_compress -a -X.docbook -X.bz2 -X.ksp -X.kwd -X.kwt
171
 
        dh_fixperms -a
172
 
        dh_makeshlibs -a -V
173
 
        dh_installdeb -a
174
 
        dh_perl -a
175
 
        dh_shlibdeps -pkoffice-dev \
176
 
          -ldebian/koffice-libs/usr/lib
177
 
        dh_shlibdeps -pkoffice-libs \
178
 
          -ldebian/koffice-libs/usr/lib
179
 
        dh_shlibdeps -pkchart \
180
 
          -ldebian/koffice-libs/usr/lib:debian/kchart/usr/lib
181
 
        dh_shlibdeps -pkformula \
182
 
          -ldebian/koffice-libs/usr/lib:debian/kformula/usr/lib
183
 
        dh_shlibdeps -pkontour \
184
 
          -ldebian/koffice-libs/usr/lib:debian/kontour/usr/lib
185
 
        dh_shlibdeps -pkivio \
186
 
          -ldebian/koffice-libs/usr/lib:debian/kivio/usr/lib
187
 
        dh_shlibdeps -pkoshell \
188
 
          -ldebian/koffice-libs/usr/lib:debian/koshell/usr/lib
189
 
        dh_shlibdeps -pkpresenter \
190
 
          -ldebian/koffice-libs/usr/lib:debian/kpresenter/usr/lib
191
 
        #dh_shlibdeps -pkrayon \
192
 
        #  -ldebian/koffice-libs/usr/lib:debian/krayon/usr/lib
193
 
        dh_shlibdeps -pkspread \
194
 
          -ldebian/koffice-libs/usr/lib:debian/kspread/usr/lib
195
 
        dh_shlibdeps -pkugar \
196
 
          -ldebian/koffice-libs/usr/lib:debian/kugar/usr/lib
197
 
        dh_shlibdeps -pkword \
198
 
          -ldebian/koffice-libs/usr/lib:debian/kword/usr/lib
199
 
        dh_gencontrol -a
200
 
        dh_md5sums -a
201
 
        dh_builddeb -a
 
257
        $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
202
258
 
203
 
# Below here is fairly generic really
 
259
# Any other binary targets build just one binary package at a time.
 
260
binary-%: build install
 
261
        $(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
204
262
 
205
263
binary: binary-indep binary-arch
206
 
.PHONY: binary binary-arch binary-indep clean debian-clean build install
 
264
.PHONY: build clean binary-indep binary-arch binary install configure