File: rules

package info (click to toggle)
gnumeric 1.12.32-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 129,260 kB
  • ctags: 25,173
  • sloc: ansic: 288,510; xml: 55,625; perl: 5,366; sh: 4,503; makefile: 2,905; yacc: 1,330; python: 203
file content (135 lines) | stat: -rwxr-xr-x 4,305 bytes parent folder | download
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
#! /usr/bin/make -f

# 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

# Make the linker work a bit harder so dynamic loading can be done faster.
#LDFLAGS += -Wl,-O1

# minimise needless linking
# Make the linker only include actual dependencies on libraries, rather than
# for all libraries specified in the link line.
#LDFLAGS += -Wl,--as-needed

export DEB_LDFLAGS_MAINT_APPEND= -Wl,-O1 -Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

UVER=$(shell dpkg-parsechangelog | grep Version | head -1 | sed -e 's/Version: //g' -e 's/-[A-Za-z0-9+\.]*$$//g')
$(info I: UVER=$(UVER))

## reproducible build: embedded gzip timestamps (#784672):
LAST_CHANGE=$(shell dpkg-parsechangelog -S Date)
export BUILD_TIMESTAMP=$(shell LC_ALL=C date -u "+%s" -d "$(LAST_CHANGE)")

CFLAGS += -Wall -g

%:
	dh $@ --parallel --with autoreconf,python2,gir

override_dh_autoreconf:
	debconf-updatepo -v
	dh_autoreconf --as-needed

# 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.
# 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]
features+= --without-gda

# Psion files support?
features+= --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 \
             --libdir=/usr/lib \
             --libexecdir=/usr/bin \
             --enable-compile-warnings=minimum \
             --enable-introspection=yes \
             --disable-silent-rules \
             --disable-maintainer-mode \
             $(features)
override_dh_auto_configure:
	dh_auto_configure -- "CC=$(CC) $(LDFLAGS)" "CFLAGS=$(CFLAGS)" \
            $(confflags)

override_dh_auto_test:
	## do not stop on failed tests
	-dh_auto_test

override_dh_auto_install:
	GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1 \
        dh_auto_install --destdir=$(CURDIR)/debian/tmp -- \
            localstatedir=$(CURDIR)/debian/tmp/var/lib \
            libexecdir=$(CURDIR)/debian/tmp/usr/bin \
            scrollkeeper_localstate_dir=/var/lib/scrollkeeper
	# Removing *.la files
	find $(CURDIR)/debian/tmp -name '*.la' -delete -printf 'removing %p\n'
	# Removing *.ico files
	find $(CURDIR)/debian/tmp -name '*.ico' -delete -printf 'removing %p\n'
	# Plugins are not intended as stand-alone executables
	find $(CURDIR)/debian/tmp/usr/lib/*/*/plugins -type f -executable \
            -printf 'removing executable flag from %p\n' -exec chmod a-x '{}' \;

override_dh_install:
	dh_buildinfo
	dh_install
	# Rename the binary just "gnumeric"
	if [ -d "debian/gnumeric/usr/bin" ]; then \
              cd debian/gnumeric/usr/bin \
           && mv -v gnumeric-* gnumeric ;\
        fi
	#
	# 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) -rv debian/gnumeric/$$l ; \
        done < debian/gnumeric-plugins-extra.install
	#
	# Wipe empty dirs if any
	find $(CURDIR)/debian -type d -empty -delete -printf 'removing %p\n'

override_dh_link:
	# Make the documentation accessible to gnumeric
	dh_link -pgnumeric-doc \
            usr/share/xml/docbook/stylesheet/nwalsh/images  usr/share/gnumeric/$(UVER)/doc/C/images \
            usr/share/gnome/help/gnumeric  usr/share/gnumeric/$(UVER)/doc

debian/gnumeric.preinst: debian/gnumeric.preinst.in
	sed -r 's/@UVER@/$(UVER)/g' $< > $@

override_dh_installdeb: debian/gnumeric.preinst
	dh_installdeb

override_dh_gencontrol:
	dh_gencontrol -v -- -VUpstream-Version=$(UVER)

override_dh_builddeb:
	dh_builddeb -- -Zxz