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
|
#!/usr/bin/make -f
# -*- gmake -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independant
# package.
# Modified by Rafael Laboissiere <rafael@debian.org> on 1998/06/12
# for the plplot package
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Update build-depedencies in debian/control with "debian/rules control"
# after changing one of these.
BUILD_ADA = no
BUILD_D = no
BUILD_OCT = no
# Default slice, don't change. Will be extended as necessary based on
# the above.
SLICES=UNDEF
ifeq ($(BUILD_OCT),yes)
# Paths for Octave
MDIR = $(shell octave-config --print LOCALAPIFCNFILEDIR)
OCTDIR = $(shell octave-config --print LOCALAPIOCTFILEDIR)
octver := $(shell octave-config -v)
SLICES := $(SLICES)+OCT
endif
ifeq ($(BUILD_D),yes)
SLICES := $(SLICES)+D
endif
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
version := $(shell perl debian/get-upstream-version.pl < cmake/modules/plplot_version.cmake)
libpkg := libplplot12
docpkg := plplot-doc
debbase := $(shell pwd)/debian
debtmp := $(debbase)/tmp
debusr := $(debtmp)/usr
deblib := $(debusr)/lib/$(DEB_HOST_MULTIARCH)
debshr := $(debusr)/share
debdoc := $(debshr)/doc
debinfo := $(debshr)/info
debex := $(debshr)/plplot$(version)/examples
# Note cmake ignores CPPFLAGS so add them to CFLAGS and CXXFLAGS as a work around
CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) \
$(shell mkoctfile -p INCFLAGS)
CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
CFLAGS += -fvisibility=hidden
#Don't add -fvisibility=hidden to CXXFLAGS for now as this breaks the octave bindings.
CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
#CXXFLAGS += -fvisibility=hidden
FFLAGS = $(shell dpkg-buildflags --get FFLAGS)
FFLAGS += -fvisibility=hidden
LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
LDFLAGS += -Wl,--as-needed
CMAKE = xvfb-run cmake
JAVA_HOME = /usr/lib/jvm/default-java
PYVERS = $(shell pyversions -vr)
OCAMLABI := $(shell ocamlc -version)
OFILES := $(filter-out debian/control,$(patsubst %.in,%,$(wildcard debian/*.in)))
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
# Disable Ada build on sh4 - gnat not available at the moment.
ifeq ($(BUILD_ADA),yes)
ifneq (,$(findstring :$(DEB_BUILD_ARCH):,:sh4:))
BUILD_ADA = no
endif
endif
# Configure options
ifeq ($(BUILD_ADA),yes)
ADA_OPTIONS = -DENABLE_ada=ON
SLICES := $(SLICES)+ADA
endif
JAVA_OPTIONS = \
-DCMAKE_Java_RUNTIME=$(JAVA_HOME)/bin/java \
-DCMAKE_Java_COMPILER=$(JAVA_HOME)/bin/javac \
-DCMAKE_Java_ARCHIVE=$(JAVA_HOME)/bin/jar \
-DJAVACFLAGS="-source 1.5 -target 1.5"
CONFIGURE_OPTIONS = -DBUILD_TEST=ON \
-DBUILD_DOC=OFF -DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
-DUSE_RPATH=OFF -DPLD_psttf=OFF -DENABLE_tk=ON \
-DTCL_TCLSH=/usr/bin/tclsh8.5 \
$(ADA_OPTIONS) $(JAVA_OPTIONS)
ifeq ($(with_oct),yes)
CONFIGURE_OPTIONS += -DOCTAVE_OCT_DIR=$(OCTDIR)
endif
BUILD_DIR = $(debbase)/build_tmp
SRC_DIR = $(shell pwd)
control:
slice -o $(SLICES):debian/control debian/control.in
config: config-stamp
config-stamp: control
mkdir -p $(BUILD_DIR)
( cd $(BUILD_DIR) ; \
PKG_CONFIG_ENV=" " FC=gfortran \
JAVA_HOME=$(JAVA_HOME) DC=$(DC) \
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" FFLAGS="$(FFLAGS)" \
LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" \
$(CMAKE) $(SRC_DIR) $(CONFIGURE_OPTIONS) )
touch config-stamp
build-arch: build-arch-stamp
build-arch-stamp: config-stamp
dh_testdir
( cd $(BUILD_DIR) ; $(MAKE) )
-( cd $(BUILD_DIR) ; unset DISPLAY ; $(MAKE) test_noninteractive )
touch build-arch-stamp
build-indep: build-indep-stamp
build-indep-stamp: config-stamp
dh_testdir
( cd $(BUILD_DIR) ; $(CMAKE) $(SRC_DIR) $(CONFIGURE_OPTIONS) -DBUILD_DOC=ON ; \
cd doc ; $(MAKE) )
touch build-indep-stamp
clean:
dh_testdir
dh_testroot
rm -f build-arch-stamp build-indep-stamp install-arch-stamp install-indep-stamp \
config-stamp debian/files install-python*
rm -rf $(BUILD_DIR)
rm -rf $(debbase)/$(libpkg)
dh_clean
install-arch: install-arch-stamp install-python
dh_movefiles -a --no-package=$(libpkg) --no-package=libplplot-dev \
--no-package=python-plplot --no-package=python-plplot-qt \
--no-package=libplplot-java --no-package=libplplot-ada1 \
--no-package=libplplot-ocaml --no-package=libplplot-lua \
--no-package=libplplot-d --no-package=libplplot-ada1-dev
dh_movefiles --package=python-plplot-qt
dh_movefiles --package=python-plplot
dh_movefiles --package=libplplot-java
dh_movefiles --package=libplplot-ocaml
dh_movefiles --package=libplplot-lua
dh_movefiles --package=libplplot-d
ifeq ($(BUILD_ADA),yes)
dh_movefiles --package=libplplot-ada1
dh_movefiles --package=libplplot-ada1-dev
endif
dh_movefiles --package=libplplot-dev
dh_movefiles --package=$(libpkg)
install-arch-stamp: build-arch-stamp
dh_testdir
dh_testroot
ifeq ($(with_oct),yes)
#Strip bindings/octave/plplot_octave.oct as this is missed by.
# dh_strip.
strip --strip-unneeded --remove-section=.comment $(BUILD_DIR)/bindings/octave/plplot_octave.oct
endif
( cd $(BUILD_DIR) ; \
$(MAKE) DESTDIR=$(debtmp) install )
( cd $(debdoc)/plplot ; \
rm -f COPYING.LIB ; \
mv ChangeLog.release changelog )
mv $(debdoc)/plplot $(debdoc)/$(libpkg)
install -d $(debex)/perl
install --mode=644 examples/perl/x* examples/perl/README* \
$(debex)/perl
mv $(debex) $(debdoc)/$(libpkg)
for i in libplplot-dev plplot-tcl plplot-tcl-bin plplot-tcl-dev \
plplot12-driver-xwin octave-plplot python-plplot-qt \
$(if $(filter yes,$(with_oct)),octave-plplot) \
python-plplot libplplot-c++11 plplot12-driver-wxwidgets \
plplot12-driver-qt libplplot-java \
plplot12-driver-cairo libplplot-fortran10 \
libplplot-ocaml libplplot-lua libplplot-d ; do \
ln -s $(libpkg) $(debdoc)/$$i ; \
done
ln -s libqsastime0 $(debdoc)/libqsastime-dev
mv $(debshr)/java/plplot.jar $(debshr)/java/plplot-$(version).jar
( cd $(debshr)/java ; ln -s plplot-$(version).jar plplot.jar )
ifeq ($(BUILD_ADA),yes)
ln -s $(libpkg) $(debdoc)/libplplot-ada1
ln -s $(libpkg) $(debdoc)/libplplot-ada1-dev
endif
touch install-arch-stamp
install-indep: install-indep-stamp
dh_movefiles -i
install-indep-stamp: build-indep-stamp
( cd $(BUILD_DIR)/doc ; \
$(MAKE) DESTDIR=$(debtmp) install )
mkdir -p $(debdoc)/$(docpkg)
(cd $(debdoc)/plplot ; rm -f html/plplotdoc-html.proc ; mv html *.pdf $(debdoc)/$(docpkg))
touch install-indep-stamp
install-python: $(PYVERS:%=install-python%)
touch $@
install-python%: build-arch-stamp
( cd $(BUILD_DIR) ; \
$(CMAKE) $(SRC_DIR) $(CONFIGURE_OPTIONS) -DPYTHON_EXECUTABLE=/usr/bin/python$* -DPYTHON_LIBRARIES=/usr/lib/python$* -DPYTHON_LIBRARY=`python-config --configdir`/libpython$*.so -DPYTHON_INCLUDE_PATH="/usr/include/python$*;/usr/include/numpy;/usr/lib/pyshared/python$*/numpy/core/include/numpy" -DNUMERIC_INCLUDE_PATH=/usr/include/numpy ; \
for d in python qt_gui/pyqt4 ; do \
( cd bindings/$$d; \
$(MAKE) clean ; \
$(MAKE) ; \
$(MAKE) DESTDIR=$(debtmp) install ) ; \
done )
touch $@
# Build architecture-independent files here.
binary-indep: build-indep install-indep
dh_testdir -i
dh_testroot -i
dh_installdirs -i
dh_installdocs --package=$(docpkg)
dh_installchangelogs --package=$(docpkg)
dh_compress -i --exclude=.pdf
dh_fixperms -i
dh_installdeb -i
dh_lintian -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
binary-arch: build-arch install-arch
dh_testdir -a
dh_testroot -a
dh_installdirs -a
dh_installdocs --package=$(libpkg) --package=libcsiro0 --package=libqsastime0
dh_installchangelogs --package=$(libpkg) --package=libcsiro0 --package=libqsastime0
dh_python2 --package=python-plplot-qt --package=python-plplot
dh_numpy
dh_strip -a
dh_compress -a -Xexamples/
dh_fixperms -a
dh_makeshlibs -V -a
dh_shlibdeps -a --no-package=octave-plplot -L $(libpkg) \
-l $(debbase)/$(libpkg)/usr/lib/$(DEB_HOST_MULTIARCH):$(debbase)/plplot-tcl/usr/lib/$(DEB_HOST_MULTIARCH)
ifeq ($(with_oct),yes)
dpkg-shlibdeps -Tdebian/octave-plplot.substvars -S$(debbase)/$(libpkg)/usr/lib/*.so* -S/usr/lib/$(octver)/*.so* $(debbase)/octave-plplot/$(OCTDIR)/plplot_octave.oct
endif
dh_installdeb -a
# Replace tk copied files with symlinks
(cd $(debbase)/plplot-tcl-dev/usr/share/doc/${libpkg}/examples/tk ; for file in x??.tcl plgrid.tcl ; do rm -f $${file} ; ln -s ../tcl/$${file} . ; done)
dh_lintian -a
dh_gencontrol -a -- -VF:OCamlABI="$(OCAMLABI)"
dh_md5sums -a
dh_builddeb -a
binary: binary-arch binary-indep
get-orig-source:
uscan --force-download
.PHONY: build clean binary-indep binary-arch binary config \
control
.NOTPARALLEL:
|