2
# Made with the aid of debmake, by Christoph Lameter,
3
# based on the sample debian/rules file for GNU hello by Ian Jackson.
2
# Sample debian/rules that uses debhelper.
3
# GNU copyright 1997 to 1999 by Joey Hess.
5
# Uncomment this to turn on verbose mode.
8
# This is the debhelper compatibility version to use.
11
# This has to be exported to make some magic below work.
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)
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
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
17
ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
19
COMPILER_FLAGS=CFLAGS="-O0 -mieee" CXXFLAGS="-O0 -mieee"
22
COMPILER_FLAGS=CFLAGS="-Os -ffunction-sections -Wl,--stub-group-size=50000" CXXFLAGS="-Os -ffunction-sections -Wl,--stub-group-size=50000"
24
COMPILER_FLAGS=CXX=g++ CC=gcc
22
objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
24
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
27
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
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)
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
30
45
-include debian/debiandirs
32
47
debian/debiandirs: admin/debianrules
33
48
perl -w admin/debianrules echodirs > debian/debiandirs
37
if test ! -f configure; then \
38
$(MAKE) -f admin/Makefile.common ;\
40
$(COMPILER_FLAGS) ./configure $(configkde) \
41
--libdir=$(kde_libdir) --includedir=$(kde_includedir)
42
$(MAKE) KDE_PLUGIN_DEBIAN="-module -no-undefined"
50
configure: configure-stamp
54
# Apply Debian specific patches
55
if test ! -f patch-stamp; then \
56
for patch in $(CURDIR)/debian/patches/*.diff ;\
58
echo APPLYING PATCH\: $${patch##*/};\
59
patch -p1 < $$patch ;\
64
# KDE CVS does not have aclocal.m4 or configure
65
# if test ! -f configure; then \
66
# $(MAKE) -f admin/Makefile.common ;\
69
# Force a rerun of automake/etc since this is required by the
71
$(MAKE) -f admin/Makefile.common ;\
73
# make build directory
76
# ensure configure is executable
79
# run configure with build tree $(objdir)
81
../configure $(configkde)
86
build-stamp: configure-stamp
90
$(MAKE) $(do_parallel)
51
-rm -f build-stamp install-stamp debian/debiandirs
103
rm -f build-stamp configure-stamp debian/debiandirs
105
# Remove Debian specific patches
106
if test -f patch-stamp; then \
107
for patch in $(CURDIR)/debian/patches/*.diff ;\
109
echo REMOVING PATCH\: $${patch##*/};\
110
patch -p1 -R < $$patch ;\
118
# if Makefile exists run distclean
119
if test -f Makefile; then \
52
123
if test -d CVS; then \
53
$(MAKE) -f admin/Makefile.common cvs-clean ;\
124
$(MAKE) -f admin/Makefile.common cvs-clean ;\
57
install: install-stamp
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##'`; \
73
$(INSTALL_DIR) $(pixmaps)
74
$(INSTALL_FILE) debian/*.xpm $(pixmaps)
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
85
$(MAKE) install DESTDIR=`pwd`/$(tmp)
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
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
137
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
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
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
111
perl -w admin/debianrules cleanup
140
for i in `find debian/tmp -name "index.docbook"`; do \
141
( cd `dirname $$i`; meinproc `basename $$i` ); \
144
# Split into separate binary packages.
145
dh_install --sourcedir=debian/tmp --list-missing
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
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; \
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; \
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; \
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.
180
# Install the correct upstream changelogs.
181
for pkg in `dh_listpackages`; do \
183
karbon | kchart | kexi | kivio | kpresenter | kspread | kugar | kword ) \
184
DH_OPTIONS='' dh_installchangelogs -p$$pkg $$pkg/CHANGES ;; \
186
DH_OPTIONS='' dh_installchangelogs -p$$pkg lib/CHANGES ;; \
188
DH_OPTIONS='' dh_installchangelogs -p$$pkg ;; \
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 \
203
mv debian/kugar/usr/share/doc/kugar/examples/kugar.examples.README \
204
debian/kugar/usr/share/doc/kugar/examples/README.examples; \
207
for eg in debian/$$pkg/usr/share/doc/$$pkg/examples/*.k??; do \
208
if ! gzip -t $$eg > /dev/null 2>&1; then \
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; \
224
dh_compress -X.docbook -X.css -X-license -X.dcl -X.bz2 -X.ksp -X.kwd -X.kwt
230
# Run dh_shlibdeps with package-specific library search paths.
231
for pkg in `dh_listpackages`; do \
232
echo "Checking dependencies for $$pkg..."; \
234
koffice | koffice-doc-html ) \
235
DH_OPTIONS='' dh_shlibdeps -p$$pkg ;; \
237
DH_OPTIONS='' dh_shlibdeps -p$$pkg -ldebian/koffice-libs/usr/lib ;; \
239
DH_OPTIONS='' dh_shlibdeps -p$$pkg \
240
-ldebian/koffice-libs/usr/lib:debian/kugar/usr/lib:debian/$$pkg/usr/lib ;; \
242
DH_OPTIONS='' dh_shlibdeps -p$$pkg \
243
-ldebian/koffice-libs/usr/lib:debian/$$pkg/usr/lib ;; \
251
# Build architecture independant packages using the common target.
115
252
binary-indep: build install
120
dh_installexamples -i
124
dh_installchangelogs -pkoffice-doc-html
253
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
255
# Build architecture dependant packages using the common target.
136
256
binary-arch: build install
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
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
170
dh_compress -a -X.docbook -X.bz2 -X.ksp -X.kwd -X.kwt
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
257
$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
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$*
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