2 # Based on the sample debian/rules that uses debhelper.
3 # GNU copyright 1997 by Joey Hess.
5 #DEB_BUILD_OPTIONS?="debug nostrip"
6 export DEB_BUILD_OPTIONS
8 export DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
9 export DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
11 ifeq ($(DEB_BUILD_GNU_TYPE
),m68k-linux
)
12 DEB_BUILD_OPTIONS
+=noopt
15 # Uncomment this to turn on verbose mode.
18 # Try to preserve timestamps as much as possible
19 export INSTALL
=/usr
/bin
/install -p
21 # Are we building a release version, or are we doing development?
22 CVS_BUILD
=$(shell test ! -d CVS
; echo
$$?
)
24 upstreamversion
=$(shell dpkg-parsechangelog | grep Version | head
-1 | sed
-e
's/Version: //g' -e
's/-[A-Za-z0-9+\.]*$$//g')
26 # Features configuration
27 # ----------------------
29 # We're aiming for a package that's stable, with as much functionality as is
30 # reasonably possible.
34 # Spreadsheet indexer for beagle
35 features
+= --enable-ssindex
37 # Plugins to access databases through the GDA framework.
39 # The GnomeDB plugin for gnumeric requires a version of GnomeDB that is not
40 # available as packages yet.
41 # Tue, 01 Sep 2009 20:49:41 +0200
42 features
+= --without-gda
44 # Psion files support?
45 features
+= --without-psiconv
47 # Paradox database files plugin
48 features
+= --with-paradox
51 features
+= --with-perl
54 features
+= PYTHON
=/usr
/bin
/python
--with-python
56 # Don't build a PDF of the documentation.
57 features
+= --disable-pdfdocs
59 ## Enable it for my development tree:
60 #features+= --enable-pdfdocs
62 confflags
:= --prefix=/usr \
63 --mandir=\
$${prefix}/share
/man \
65 --localstatedir
=/var
/lib \
66 --libexecdir
=/usr
/bin \
67 --enable-compile-warnings
=minimum \
68 --enable-introspection
=yes \
69 --disable-maintainer-mode \
72 ifeq ($(DEB_BUILD_GNU_TYPE
), $(DEB_HOST_GNU_TYPE
))
73 confflags
+= --build
$(DEB_HOST_GNU_TYPE
)
75 confflags
+= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
78 export DEB_BUILD_MAINT_OPTIONS
= hardening
=+all
79 DPKG_EXPORT_BUILDFLAGS
= 1
80 include /usr
/share
/dpkg
/buildflags.mk
84 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
90 # Make the linker work a bit harder so dynamic loading can be done faster.
93 # Make the linker only include actual dependencies on libraries, rather than
94 # for all libraries specified in the link line.
95 LDFLAGS
+= -Wl
,--as-needed
97 .PHONY
: source-updates
99 # This target is not part of the regular package build process. It is used
100 # by the package maintainer for development purposes and may have
101 # dependencies beyond the build dependencies specified in debian/control.
102 rm -f configure-stamp
103 # Update files generated by autotools
104 env
srcdir=`pwd` NOCONFIGURE
=1 \
105 LIBTOOLIZE
="libtoolize --copy" \
106 INTLTOOLIZE
="intltoolize --copy" \
107 sh autogen.sh
$(confflags
)
108 convert icons
/32x32
/gnumeric.png
-depth
4 debian
/gnome-gnumeric.xpm
114 dh_autotools-dev_updateconfig
116 cd build
&& env
srcdir=`pwd`/.. \
117 ..
/configure
$(confflags
) "CC=$(CC) $(LDFLAGS)" "CFLAGS=$(CFLAGS)"
119 touch configure-stamp
122 configure
: configure-stamp
124 build-stamp
: configure
131 build-arch
: build-stamp
134 build-indep
: build-stamp
137 build
: build-arch build-indep
143 rm -f build-stamp configure-stamp debian
/*substvars debian
/*~ \
146 rm -rf debian
/tmp build
150 -find
-type f
-name
'Makefile.in' | sed
-e
's/\.in$$//' | xargs
rm -f
153 # Clean out files generated as part of the documentation generation
154 -rm -f doc
/C
/index.html doc
/C
/gnumeric.html doc
/C
/ld-id
*.html \
155 omf-install
/gnumeric-C.omf
156 -rm -rf doc
/C
/gnumeric doc
/C
/DBTOHTML_OUTPUT_DIR
*
158 -rm -rf aclocal.m4 config.h.in stamp-h.in autom4te.cache \
161 -rm -f GNOME_Gnumeric.server.in GNOME_Gnumeric.server src
/gnumeric-paths.h
172 cd build
&& env GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
=1 \
174 DESTDIR
=`pwd`/..
/debian
/tmp
/ \
175 localstatedir
=`pwd`/..
/debian
/tmp
/var
/lib \
176 libexecdir
=`pwd`/..
/debian
/tmp
/usr
/bin \
177 scrollkeeper_localstate_dir
=/var
/lib
/scrollkeeper
179 # Plugins are not intended as stand-alone executables
180 find
`pwd`/debian
/tmp
/usr
/lib
/*/*/plugins
-type f
-print0 | xargs
-0 chmod a-x
181 # .la files are not needed for plugins
182 find
`pwd`/debian
/tmp
/usr
/lib
/*/*/plugins
-type f
-name
'*.la' -print0 | xargs
-0 rm -f
184 # Remove unwanted files: static libraries and documentation sources
185 find
`pwd`/debian
/tmp
/usr
/ -name
'*.a' -print0 | xargs
-0 rm -f
186 find
`pwd`/debian
/tmp
/ -name
'*.sgml' -print0 | xargs
-0 rm -f
188 rm -rf debian
/tmp
/usr
/lib
/bonobo
189 # libspreadsheet is far from a mature library; loose the development
191 rm -f debian
/tmp
/usr
/lib
/libspreadsheet
*.la
192 rm -f debian
/tmp
/usr
/lib
/pkgconfig
/libspreadsheet-
*.
pc
193 rm -rf debian
/tmp
/usr
/include/libspreadsheet-
*
196 rm -f debian
/tmp
/usr
/share
/mc
/templates
/gnumeric.desktop
198 # Remove scrollkeeper generated files as well; for a package they
199 # need to be (re)generated at package (de)install time.
200 rm -rf
`pwd`/debian
/tmp
/var
/lib
/scrollkeeper
202 # Low-colour icon for use by the menu system
203 $(INSTALL
) -m
644 debian
/gnome-gnumeric.xpm
`pwd`/debian
/tmp
/usr
/share
/pixmaps
/
205 dh_install
--sourcedir
=`pwd`/debian
/tmp
--fail-missing
207 # Name the binary just "gnumeric"
208 cd debian
/gnumeric
/usr
/bin
&& mv gnumeric-
* gnumeric
210 dh_link usr
/share
/gnumeric
/$(upstreamversion
)/idl
/GNOME_Gnumeric.idl usr
/share
/idl
/GNOME_Gnumeric.idl
212 # Make the documentation accessible to gnumeric
213 dh_link
-pgnumeric-doc usr
/share
/gnome
/help
/gnumeric usr
/share
/gnumeric
/$(upstreamversion
)/doc
215 dh_link
-pgnumeric-doc usr
/share
/xml
/docbook
/stylesheet
/nwalsh
/images
/ usr
/share
/gnumeric
/$(upstreamversion
)/doc
/C
/images
217 # Remove files from the main package that belong to a more
219 # (dh_install doesn't do the right thing here IMO; perhaps it
220 # doesn't like multiple globs in one line)
222 rm -rvf debian
/gnumeric
/$$l ; \
223 done
< debian
/gnumeric-plugins-extra.
install
225 # Remove dirs that are now empty
226 -find debian
/gnumeric
-depth
-type d | xargs rmdir
>/dev
/null
2>&1
228 # Build architecture-independent files here.
229 # Pass -i to all debhelper commands in this target to reduce clutter.
230 binary-indep
: build
install
236 dh_installexamples
-i
239 # dh_installlogrotate -i
240 # dh_installemacsen -i
249 dh_installchangelogs ChangeLog
-i
257 dh_gencontrol
-v
-i
-- -VUpstream-Version
=$(upstreamversion
)
261 # Build architecture-dependent files here.
263 binary-arch
: build
install
267 dh_installdocs
-a
--noscripts
268 rm -rf
`pwd`/debian
/gnumeric-doc
/usr
/share
/doc-base
269 dh_installexamples
-a
272 # dh_installlogrotate -a
273 # dh_installemacsen -a
282 dh_installchangelogs ChangeLog
-a
298 dh_gencontrol
-v
-a
-- -VUpstream-Version
=$(upstreamversion
)
303 binary
: binary-indep binary-arch