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
)
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
)))
29 ifeq (,$(findstring nostrip
,$(DEB_BUILD_OPTIONS
)))
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
40 ifeq ($(DEB_BUILD_GNU_TYPE
),alpha-linux
)
41 # Required to avoid SIGFPE in kstars (#226966).
42 export CFLAGS
+= -mieee
43 export CXXFLAGS
+= -mieee
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
51 # BOOST_TEST=-e $(objdir)/kig/scripting/libscripting.la
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
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
;\
77 echo APPLYING PATCH\
: $${patch
##*/};\
78 patch
-p1
< $$patch ;\
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
91 # make build directory
94 # run configure with build tree $(objdir)
96 ..
/configure
$(configkde
) $(BOOST_FLAGS
)
101 build-stamp
: configure-stamp
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."; \
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
;\
130 echo REMOVING PATCH\
: $${patch
##*/};\
131 patch
-p1
-R
< $$patch ;\
139 # if Makefile exists run distclean
140 if
test -f Makefile
; then \
144 if
test -d CVS
; then \
145 $(MAKE
) -f admin
/Makefile.common cvs-clean
;\
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` ); \
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
; \
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; \
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; \
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.
208 # Install the correct upstream changelogs.
209 for pkg in
`dh_listpackages`; do \
211 kalzium | kbruch | khangman | kig | klettres | kmessedwords | kstars | ktouch
) \
212 DH_OPTIONS
='' dh_installchangelogs
-p
$$pkg $$pkg/ChangeLog
;; \
214 DH_OPTIONS
='' dh_installchangelogs
-p
$$pkg ;; \
225 dh_compress
-X.docbook
-X.css
-X-license
-X.dcl
-X.bz2
230 dh_shlibdeps
-ldebian
/libkdeedu1
/usr
/lib
-ldebian
/libkiten1
/usr
/lib
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