moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / debian / rules
blob4786a5571b0ac3481611a11b723a2e9c468e9647
1 #!/usr/bin/make -f
2 # Sample debian/rules that uses debhelper.
3 # GNU copyright 1997 to 1999 by Joey Hess.
5 # Uncomment this to turn on verbose mode.
6 #export DH_VERBOSE=1
8 # This is the debhelper compatibility version to use.
9 export DH_COMPAT=4
11 # This has to be exported to make some magic below work.
12 export DH_OPTIONS
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)
19 INSTALL_DIR = install -p -d -o root -g root -m 755
20 INSTALL_FILE = install -p -o root -g root -m 644
22 libdocdir = debian/libkdeedu-dev/usr/share/doc/libkdeedu-dev
24 objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
26 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
27 CFLAGS += -g
28 endif
29 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
30 INSTALL_PROGRAM += -s
31 endif
33 ifeq ($(DEB_BUILD_GNU_TYPE),i386-linux)
34 # Uncomment the following 2 lines to enable i686 optimziation
35 # You may want to tweak the settings to your likings
36 #export CFLAGS=-O3 -march=i686 -ffast-math -finline-functions
37 #export CXXFLAGS=-O3 -march=i686 -ffast-math -finline-functions
38 endif
40 ifeq ($(DEB_BUILD_GNU_TYPE),alpha-linux)
41 # Required to avoid SIGFPE in kstars (#226966).
42 export CFLAGS += -mieee
43 export CXXFLAGS += -mieee
44 endif
46 # ifeq ($(DEB_BUILD_GNU_TYPE),arm-linux)
47 # # Required since boost.python is broken on arm (#245893).
48 # BOOST_FLAGS=--disable-kig-python-scripting
49 # BOOST_TEST=true
50 # else
51 # BOOST_TEST=-e $(objdir)/kig/scripting/libscripting.la
52 # endif
54 # We now have boost.python working on all platforms (as of 1.32.0).
55 BOOST_TEST=-e $(objdir)/kig/scripting/libscripting.la
57 -include debian/debiandirs
59 debian/debiandirs: admin/debianrules
60 perl -w admin/debianrules echodirs > debian/debiandirs
62 configure: configure-stamp
63 configure-stamp:
64 dh_testdir
66 # Make absolutely sure these aren't left around from the .orig.tar.gz.
67 -rm -f debian/patches/kstars.diff
68 -rm -f debian/README.Packaging debian/clean-sources
69 -rm -f debian/flashkard.* debian/kdeedu-doc-html.doc-base.flashkard
70 -rm -f debian/kiten.links
71 -rm -f debian/*.override
73 # Apply Debian specific patches
74 if test ! -f patch-stamp; then \
75 for patch in $(CURDIR)/debian/patches/*.diff ;\
76 do \
77 echo APPLYING PATCH\: $${patch##*/};\
78 patch -p1 < $$patch ;\
79 done ;\
80 touch patch-stamp ;\
83 # KDE CVS does not have aclocal.m4 or configure
84 if test ! -f configure; then \
85 $(MAKE) -f admin/Makefile.common ;\
88 # ensure configure is executable
89 chmod +x configure
91 # make build directory
92 mkdir $(objdir)
94 # run configure with build tree $(objdir)
95 cd $(objdir) && \
96 ../configure $(configkde) $(BOOST_FLAGS)
98 touch configure-stamp
100 build: build-stamp
101 build-stamp: configure-stamp
102 dh_testdir
104 cd $(objdir) && \
105 $(MAKE)
107 # Ensure that the boost scripting library built okay.
108 if ! test $(BOOST_TEST); then \
109 echo "ERROR: The boost scripting library was not built."; \
110 false; \
113 touch build-stamp
115 debian-clean:
116 dh_testdir
117 dh_testroot
119 dh_clean
121 clean:
122 dh_testdir
123 dh_testroot
124 rm -f build-stamp configure-stamp debian/debiandirs
126 # Remove Debian specific patches
127 if test -f patch-stamp; then \
128 for patch in $(CURDIR)/debian/patches/*.diff ;\
129 do \
130 echo REMOVING PATCH\: $${patch##*/};\
131 patch -p1 -R < $$patch ;\
132 done ;\
133 rm -f patch-stamp ;\
136 # Remove build tree
137 rm -rf $(objdir)
139 # if Makefile exists run distclean
140 if test -f Makefile; then \
141 $(MAKE) distclean; \
144 if test -d CVS; then \
145 $(MAKE) -f admin/Makefile.common cvs-clean ;\
148 dh_clean
150 install: DH_OPTIONS=
151 install: build
152 dh_testdir
153 dh_testroot
154 dh_clean -k
155 dh_installdirs
157 cd $(objdir) && \
158 $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
160 # Remove kiten's copies of edict and kanjidic since we'll symlink to
161 # the debian versions instead.
162 rm debian/tmp/usr/share/apps/kiten/edict
163 rm debian/tmp/usr/share/apps/kiten/kanjidic
165 # Generate HTML docs.
166 for i in `find debian/tmp -name "index.docbook"`; do \
167 ( cd `dirname $$i`; meinproc `basename $$i` ); \
168 done
170 # Split into separate binary packages.
171 dh_install --sourcedir=debian/tmp -Xkmathtool --list-missing
173 # Install library documentation.
174 $(INSTALL_DIR) $(libdocdir)
175 $(INSTALL_FILE) libkdeedu/extdate/README $(libdocdir)/README.extdate
176 $(INSTALL_FILE) libkdeedu/kdeeduplot/README $(libdocdir)/README.kdeeduplot
178 # Install standard documentation links.
179 for pkg in `dh_listpackages`; do \
180 if test -d debian/$$pkg/usr/share/doc/kde/HTML/en/$$pkg; then \
181 dh_link -p$$pkg usr/share/doc/kde/HTML/en/$$pkg \
182 usr/share/doc/$$pkg/html; \
183 fi; \
184 done
186 # Install lintian and linda overrides.
187 for pkg in `dh_listpackages`; do \
188 if test -e debian/$$pkg.override; then \
189 $(INSTALL_DIR) debian/$$pkg/usr/share/lintian/overrides; \
190 $(INSTALL_FILE) debian/$$pkg.override \
191 debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
192 fi; \
193 if test -e debian/$$pkg.linda; then \
194 $(INSTALL_DIR) debian/$$pkg/usr/share/linda/overrides; \
195 $(INSTALL_FILE) debian/$$pkg.linda \
196 debian/$$pkg/usr/share/linda/overrides/$$pkg; \
197 fi; \
198 done
200 # This single target is used to build all the packages, all at once, or
201 # one at a time. So keep in mind: any options passed to commands here will
202 # affect _all_ packages. Anything you want to only affect one package
203 # should be put in another target, such as the install target.
204 binary-common:
205 dh_testdir
206 dh_testroot
208 # Install the correct upstream changelogs.
209 for pkg in `dh_listpackages`; do \
210 case "$$pkg" in \
211 kalzium | kbruch | khangman | kig | klettres | kmessedwords | kstars | ktouch ) \
212 DH_OPTIONS='' dh_installchangelogs -p$$pkg $$pkg/ChangeLog ;; \
213 * ) \
214 DH_OPTIONS='' dh_installchangelogs -p$$pkg ;; \
215 esac; \
216 done
218 dh_installdocs
219 dh_installexamples
220 dh_installman
221 dh_installmenu
222 dh_installmime
223 dh_strip
224 dh_link
225 dh_compress -X.docbook -X.css -X-license -X.dcl -X.bz2
226 dh_fixperms
227 dh_makeshlibs -V
228 dh_installdeb
229 dh_perl
230 dh_shlibdeps -ldebian/libkdeedu1/usr/lib -ldebian/libkiten1/usr/lib
231 dh_gencontrol
232 dh_md5sums
233 dh_builddeb
235 # Build architecture independant packages using the common target.
236 binary-indep: build install
237 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
239 # Build architecture dependant packages using the common target.
240 binary-arch: build install
241 $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
243 # Any other binary targets build just one binary package at a time.
244 binary-%: build install
245 $(MAKE) -f debian/rules binary-common DH_OPTIONS=-p$*
247 binary: binary-indep binary-arch
248 .PHONY: build clean binary-indep binary-arch binary install configure