1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
|
#! /usr/bin/make -f
# Based on the sample debian/rules that uses debhelper.
# GNU copyright 1997 by Joey Hess.
#DEB_BUILD_OPTIONS?="debug nostrip"
export DEB_BUILD_OPTIONS
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE),m68k-linux)
DEB_BUILD_OPTIONS+=noopt
endif
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Try to preserve timestamps as much as possible
export INSTALL=/usr/bin/install -p
# Are we building a release version, or are we doing development?
CVS_BUILD=$(shell test ! -d CVS; echo $$?)
upstreamversion=$(shell dpkg-parsechangelog | grep Version | head -1 | sed -e 's/Version: //g' -e 's/-[A-Za-z0-9+\.]*$$//g')
# Features configuration
# ----------------------
#
# We're aiming for a package that's stable, with as much functionality as is
# reasonably possible.
features:=
# Spreadsheet indexer for beagle
features+= --enable-ssindex
# Plugins to access databases through the GDA framework and through GnomeDB.
#
# The GnomeDB plugin for gnumeric requires a version of GnomeDB that is not
# available as packages yet.
# Tue, 01 Sep 2009 20:49:41 +0200
# Likewise for GDA.
# Sun, 29 Nov 2009 22:29:18 +0100
# Psiconv is to be removed from squeeze (#609535)
# Wed, 26 Jan 2011 19:25:14 +0100
features+= --without-gda --without-gnomedb --without-psiconv
# Paradox database files plugin
features+= --with-paradox
# Perl plugin
features+= --with-perl
# The Python plugin
features+= PYTHON=/usr/bin/python --with-python
# Don't build a PDF of the documentation.
features+= --disable-pdfdocs
## Enable it for my development tree:
#features+= --enable-pdfdocs
confflags := --prefix=/usr \
--mandir=\$${prefix}/share/man \
--sysconfdir=/etc \
--localstatedir=/var/lib \
--libexecdir=/usr/bin \
--enable-compile-warnings=minimum \
$(features)
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
confflags += --build $(DEB_HOST_GNU_TYPE)
else
confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# Make the linker work a bit harder so dynamic loading can be done faster.
LDFLAGS += -Wl,-O1
# Make the linker only include actual dependencies on libraries, rather than
# for all libraries specified in the link line.
LDFLAGS += -Wl,--as-needed
source-updates:
# This target is not part of the regular package build process. It is used
# by the package maintainer for development purposes and may have
# dependencies beyond the build dependencies specified in debian/control.
rm -f configure-stamp
# Update files generated by autotools
env srcdir=`pwd` NOCONFIGURE=1 \
LIBTOOLIZE="libtoolize --copy" \
INTLTOOLIZE="intltoolize --copy" \
sh autogen.sh $(confflags)
convert icons/32x32/gnumeric.png -depth 4 debian/gnome-gnumeric.xpm
configure: configure-stamp
configure-stamp:
dh_testdir
# Prepare for build
mkdir build
cd build && env srcdir=`pwd`/.. \
../configure $(confflags) "CC=$(CC) $(LDFLAGS)" "CFLAGS=$(CFLAGS)"
touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
dh_testdir
cd build && $(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp debian/*substvars debian/*~ \
debian/buildinfo
rm -rf debian/tmp build
# Update config.{sub,guess} from autotools-dev, if possible.
-for f in config.sub config.guess ; do \
if test -r /usr/share/misc/$$f ; then \
OLDDATE=`./$$f -t | tr -d -` ; \
NEWDATE=`/usr/share/misc/$$f -t | tr -d -` ; \
if [ $$OLDDATE -lt $$NEWDATE ] ; then \
echo "GNU config automated update of $$f (replacing $$OLDDATE with $$NEWDATE)" 1>&2 ; \
cp -f /usr/share/misc/$$f $$f ; \
fi; \
fi; \
done
debconf-updatepo
-find -type f -name 'Makefile.in' | sed -e 's/\.in$$//' | xargs rm -f
-rm -f po/*.gmo
# Clean out files generated as part of the documentation generation
-rm -f doc/C/index.html doc/C/gnumeric.html doc/C/ld-id*.html \
omf-install/gnumeric-C.omf
-rm -rf doc/C/gnumeric doc/C/DBTOHTML_OUTPUT_DIR*
-rm -rf aclocal.m4 config.h.in stamp-h.in autom4te.cache \
doc/C/gnumeric.junk
-rm -f GNOME_Gnumeric.server.in GNOME_Gnumeric.server src/gnumeric-paths.h
dh_clean
install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
cd build && env GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 \
$(MAKE) install \
DESTDIR=`pwd`/../debian/tmp/ \
localstatedir=`pwd`/../debian/tmp/var/lib \
libexecdir=`pwd`/../debian/tmp/usr/bin \
scrollkeeper_localstate_dir=/var/lib/scrollkeeper
# Plugins are not intended as stand-alone executables
find `pwd`/debian/tmp/usr/lib/*/*/plugins -type f -print0 | xargs -0 chmod a-x
# Remove unwanted files: static libraries and documentation sources
find `pwd`/debian/tmp/usr/ -name '*.a' -print0 | xargs -0 rm -f
find `pwd`/debian/tmp/ -name '*.sgml' -print0 | xargs -0 rm -f
# Bonobo-only files
rm -rf debian/tmp/usr/lib/bonobo
# libspreadsheet is far from a mature library; loose the development
# files
rm -f debian/tmp/usr/lib/libspreadsheet*.la
rm -f debian/tmp/usr/lib/pkgconfig/libspreadsheet-*.pc
rm -rf debian/tmp/usr/include/libspreadsheet-*
# Outdated
rm -f debian/tmp/usr/share/mc/templates/gnumeric.desktop
# Remove scrollkeeper generated files as well; for a package they
# need to be (re)generated at package (de)install time.
rm -rf `pwd`/debian/tmp/var/lib/scrollkeeper
# Low-colour icon for use by the menu system
$(INSTALL) -m 644 debian/gnome-gnumeric.xpm `pwd`/debian/tmp/usr/share/pixmaps/
# Checksums of historical versions of conffiles
$(INSTALL) -m 644 debian/gnumeric-dialogs.schemas.md5sum debian/gnumeric-general.schemas.md5sum debian/gnumeric-plugins.schemas.md5sum `pwd`/debian/tmp/usr/share/gnumeric/
dh_install --sourcedir=`pwd`/debian/tmp --fail-missing
# Name the binary just "gnumeric"
cd debian/gnumeric/usr/bin && mv gnumeric-* gnumeric
dh_link usr/share/gnumeric/$(upstreamversion)/idl/GNOME_Gnumeric.idl usr/share/idl/GNOME_Gnumeric.idl
# Make the documentation accessible to gnumeric
dh_link -pgnumeric-doc usr/share/gnome/help/gnumeric usr/share/gnumeric/$(upstreamversion)/doc
dh_link -pgnumeric-doc usr/share/xml/docbook/stylesheet/nwalsh/images/ usr/share/gnumeric/$(upstreamversion)/doc/C/images
# Remove files from the main package that belong to a more
# specialist package
# (dh_install doesn't do the right thing here IMO; perhaps it
# doesn't like multiple globs in one line)
while read l ; do \
rm -rvf debian/gnumeric/$$l ; \
done < debian/gnumeric-plugins-extra.install
# Remove dirs that are now empty
-find debian/gnumeric -depth -type d | xargs rmdir >/dev/null 2>&1
# Build architecture-independent files here.
# Pass -i to all debhelper commands in this target to reduce clutter.
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installdebconf -i
dh_installdocs -i
dh_installexamples -i
dh_pycentral -i
#dh_python -i
dh_installmenu -i
# dh_installlogrotate -i
# dh_installemacsen -i
# dh_installpam -i
dh_installmime -i
# dh_installinit -i
dh_installcron -i
# dh_installman -i
dh_link -i
dh_installinfo -i
# dh_undocumented -i
dh_installchangelogs ChangeLog -i
dh_gconf -i
dh_icons -i
dh_link -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_perl -i
dh_gencontrol -v -i -- -VUpstream-Version=$(upstreamversion)
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installdebconf -a
dh_installdocs -a --noscripts
rm -rf `pwd`/debian/gnumeric-doc/usr/share/doc-base
dh_installexamples -a
dh_pycentral -a
#dh_python -a
dh_installmenu -a
# dh_installlogrotate -a
# dh_installemacsen -a
# dh_installpam -a
dh_installmime -a
# dh_installinit -a
dh_installcron -a
dh_installman -a
dh_link -a
dh_installinfo -a
# dh_undocumented -a
dh_installchangelogs ChangeLog -a
dh_gconf -a
dh_icons -a
dh_strip -a
dh_link -a
dh_compress -a
dh_buildinfo
dh_fixperms -a
dh_makeshlibs -a
dh_installdeb -a
dh_perl -a
dh_shlibdeps -v -a
dh_gencontrol -v -a -- -VUpstream-Version=$(upstreamversion)
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|