File: rules

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 14,936 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (147 lines) | stat: -rwxr-xr-x 5,483 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

%:
	dh $@

export DEB_BUILD_MAINT_OPTIONS := hardening=+all

# Tell compiler where should find lua headers
export DEB_CFLAGS_MAINT_APPEND = -I/usr/include/lua5.1

# Force the use of qt5
export QT_SELECT=qt5

# Qt insists on using -fPIC
export DEB_CXXFLAGS_MAINT_APPEND = -fPIC

# For reproducible builds
export FORCE_SOURCE_DATE = 1

BUILDDIR_NOX = $(CURDIR)/debian/build-nox
BUILDDIR_X11 = $(CURDIR)/debian/build-x11
BUILDDIR_QT = $(CURDIR)/debian/build-qt
MANPNOX = $(CURDIR)/debian/gnuplot-nox/usr/share/man/man1/gnuplot-nox.1

conf_opts += \
	--prefix=/usr \
	--mandir=\$${prefix}/share/man \
	--libexecdir=\$${prefix}/lib/gnuplot \
	--datadir=\$${prefix}/share/gnuplot \
	--with-gihdir=\$${prefix}/share/gnuplot \
	--without-lasergnu \
	--with-png \
	--with-gd \
	--without-lisp-files \
	--without-linux-vga \
	--with-bitmap-terminals \
	--with-readline=bsd \
	--with-texdir=./usr/local/share/texmf/tex

ifneq (,$(filter $(DEB_HOST_ARCH), mips mips64el powerpc mipsel))
	conf_opts += --without-lua
endif

override_dh_auto_configure:
	mkdir -p $(BUILDDIR_NOX)
	cd $(BUILDDIR_NOX); CONFIG_SHELL=/bin/sh ./../../configure $(conf_opts) --with-qt=no --without-x --disable-wxwidgets
ifeq (,$(filter $(DEB_BUILD_PROFILES),nox-only))
	mkdir -p $(BUILDDIR_X11)
	cd $(BUILDDIR_X11); CONFIG_SHELL=/bin/sh ../../configure $(conf_opts) --with-qt=no
	mkdir -p $(BUILDDIR_QT)
	cd $(BUILDDIR_QT); CONFIG_SHELL=/bin/sh ../../configure $(conf_opts)  --enable-qt
endif

override_dh_auto_build-arch:
	dh_auto_build -a -- -C $(BUILDDIR_NOX)/src
ifeq (,$(filter $(DEB_BUILD_PROFILES),nox-only))
	dh_auto_build -a -- -C $(BUILDDIR_X11) pkglibexecdir='$$(libexecdir)'
	dh_auto_build -a -- -C $(BUILDDIR_QT) pkglibexecdir='$$(libexecdir)'
endif

# Currently the docs are built in the -x11 configuration. Moving them to the
# -nox configuration causes some problems that I don't want to debug right now.
# So I don't build gnuplot-doc in the nox-only profile at all
ifeq (,$(filter $(DEB_BUILD_PROFILES),nox-only))
# the upstream build isn't set up properly: 'make -n' and 'make pdf' say stuff like
#
#   No rule to make target '../src/bf_test', needed by 'binary1'
#
# So I manually do a "make" and then "make" for the separate targets.
override_dh_auto_build-indep:
	$(MAKE) -C $(BUILDDIR_X11)/docs      && \
	$(MAKE) -C $(BUILDDIR_X11)/docs pdf  && \
	$(MAKE) -C $(BUILDDIR_X11)/docs html && \
	$(MAKE) -C $(BUILDDIR_X11)/docs info

	rm -f $(BUILDDIR_X11)/docs/htmldocs/internals.pl
	rm -f $(BUILDDIR_X11)/docs/htmldocs/labels.pl
	rm -f $(BUILDDIR_X11)/docs/htmldocs/images.log
	rm -f $(BUILDDIR_X11)/docs/htmldocs/WARNINGS
	rm -f $(BUILDDIR_X11)/docs/gpcard.ps

override_dh_installinfo:
	dh_installinfo -pgnuplot-doc $(BUILDDIR_X11)/docs/gnuplot.info

override_installchangelogs:
	dh_installchangelogs -pgnuplot-doc ChangeLog

override_dh_compress-indep:
	dh_compress -i -Xexamples -Xtutorial -Xhtmldocs -X.dvi -X.pdf -X.ps


else

override_dh_auto_build-indep:
	@echo "ERROR! The 'nox-only' profile is meant for arch-any builds ONLY. Currently this profile would"
	@echo "try to install some non-existing qt files into the gnuplot-data package, which would cause"
	@echo "dh_install to fail. See https://bugs.debian.org/1067582"
	false

endif

override_dh_auto_install:
	$(MAKE) -C $(BUILDDIR_NOX) install DESTDIR=$(CURDIR)/debian/tmp/NOX/ \
		pkglibexecdir='$$(libexecdir)'
	mv $(CURDIR)/debian/tmp/NOX/usr/bin/gnuplot $(CURDIR)/debian/tmp/NOX/usr/bin/gnuplot-nox
	mv $(CURDIR)/debian/tmp/NOX/usr/share/man/man1/gnuplot.1 $(CURDIR)/debian/tmp/NOX/usr/share/man/man1/gnuplot-nox.1
	mv $(CURDIR)/debian/tmp/NOX/usr/share/gnuplot/gnuplot.gih $(CURDIR)/debian/tmp/NOX/usr/share/gnuplot/gnuplot-nox.gih
ifeq (,$(filter $(DEB_BUILD_PROFILES),nox-only))
	$(MAKE) -C $(BUILDDIR_X11) install DESTDIR=$(CURDIR)/debian/tmp/X11/ \
		pkglibexecdir='$$(libexecdir)'
	mv $(CURDIR)/debian/tmp/X11/usr/bin/gnuplot $(CURDIR)/debian/tmp/X11/usr/bin/gnuplot-x11
	mv $(CURDIR)/debian/tmp/X11/usr/share/man/man1/gnuplot.1 $(CURDIR)/debian/tmp/X11/usr/share/man/man1/gnuplot-x11.1
	mv $(CURDIR)/debian/tmp/X11/usr/share/gnuplot/gnuplot.gih $(CURDIR)/debian/tmp/X11/usr/share/gnuplot/gnuplot-x11.gih
	$(MAKE) -C $(BUILDDIR_QT) install DESTDIR=$(CURDIR)/debian/tmp/QT/ \
		pkglibexecdir='$$(libexecdir)'
	mv $(CURDIR)/debian/tmp/QT/usr/bin/gnuplot $(CURDIR)/debian/tmp/QT/usr/bin/gnuplot-qt
	mv $(CURDIR)/debian/tmp/QT/usr/share/man/man1/gnuplot.1 $(CURDIR)/debian/tmp/QT/usr/share/man/man1/gnuplot-qt.1
	mv $(CURDIR)/debian/tmp/QT/usr/share/gnuplot/gnuplot.gih $(CURDIR)/debian/tmp/QT/usr/share/gnuplot/gnuplot-qt.gih
	rm -f $(BUILDDIR_X11)/demo/Makefil*
	rm -f $(BUILDDIR_X11)/demo/plugin/Makefil*
endif
	rm -f $(CURDIR)/../demo/Makefile
	rm -f $(CURDIR)/../demo/plugin/Makefile

execute_after_dh_installman:
	rm -rf $(CURDIR)/debian/tmp/NOX/usr/local
	rm -rf $(CURDIR)/debian/tmp/NOX/usr/share
ifeq (,$(filter $(DEB_BUILD_PROFILES),nox-only))
	rm -rf $(CURDIR)/debian/tmp/X11/usr/local
	rm -rf $(CURDIR)/debian/tmp/X11/usr/share
	rm -rf $(CURDIR)/debian/tmp/QT/usr/share/man
endif


execute_after_dh_installman-arch:
	# Fix manpage for nox-version. (Closes: #744218)
	sed -i 's/\[X11 options\] //g' $(MANPNOX)
	sed -i 's/plotting program/plotting program (no-X version)/g' $(MANPNOX)
	sed -i '/SH\ X11\ OPTIONS/,/command line\./ d' $(MANPNOX)

execute_after_dh_auto_clean:
	rm -rf $(BUILDDIR_NOX)
ifeq (,$(filter $(DEB_BUILD_PROFILES),nox-only))
	rm -rf $(BUILDDIR_X11)
	rm -rf $(BUILDDIR_QT)
endif