2
# Based on the initial work of Joey Hess and Craig Small.
4
# There are patches in the source package
5
include /usr/share/quilt/quilt.make
7
# Uncomment this to turn on verbose mode.
13
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
14
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
16
DEBIAN_DIR = $(CURDIR)/debian
18
BUILD_DIR = $(DEBIAN_DIR)/build
20
# Path to the tools subdirectory in the top source dir to build the
22
export PATH := $(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)
23
export LD_LIBRARY_PATH := $(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)
25
OPENMS_LIB_PACKAGE = libopenms1
26
OPENMS_LIB_VERSION = 1.9.0
28
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
34
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
35
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
36
MAKEFLAGS += -j$(NUMJOBS)
39
$(info "---------------------------------------")
40
$(info NUMJOBS: $(NUMJOBS))
41
$(info MAKEFLAGS: $(MAKEFLAGS))
42
$(info DEB_BUILD_OPTIONS: $(DEB_BUILD_OPTIONS))
43
$(info "---------------------------------------")
45
# Hardening stuff, see http://wiki.debian.org/Hardening
46
# export DEB_BUILD_MAINT_OPTIONS = hardening=+all
47
DPKG_EXPORT_BUILDFLAGS = 1
48
include /usr/share/dpkg/buildflags.mk
63
# Remove the generated xpm icon files:
64
rm -f debian/TOPPView.xpm
65
rm -f debian/TOPPAS.xpm
67
# Remove the generated topp.1 man page:
70
build-arch-stamp: $(QUILT_STAMPFN)
76
# On the command line, use
77
# -DCONTRIB_LIB_DIR=/usr/lib/$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)
79
@echo "DEB_BUILD_GNU_TYPE: $(DEB_BUILD_GNU_TYPE)"
82
$(CMAKE) -DCMAKE_FIND_LIBRARY_SUFFIXES=".so" \
83
-DCONTRIB_LIB_DIR="/usr/lib;/usr/lib/$(DEB_BUILD_GNU_TYPE);/lib/$(DEB_BUILD_GNU_TYPE)" \
84
-DCF_OPENMS_DATA_PATH=/usr/share/openms-common/OpenMS/ \
85
-DCF_OPENMS_DOC_PATH=/usr/share/doc/openms-doc/ \
86
-DCMAKE_BUILD_TYPE=release ../..
88
# Build the libs and executable binaries
89
VERBOSE=1 $(MAKE) -C $(BUILD_DIR) \
90
OpenMS TOPP UTILS GUI test_build Tutorials_build
92
# Prepare the xpm-formatted pixmaps for the Debian menu system.
93
# Setting imagemagick to Build-Depends, for use of convert.
94
convert source/VISUAL/ICONS/TOPPAS.png -resize 32x32 debian/TOPPAS.xpm
95
convert source/VISUAL/ICONS/TOPPView.png -resize 32x32 debian/TOPPView.xpm
97
# Prepare the topp.1 man page with all the one-line description got
98
# from calling individually each program in $(BUILD_DIR)/bin with
99
# --help switch. The newly built libs need be in the path so that the
100
# binaries can execute. Same for the shared data path, because the
101
# binaries need it to run. Note the calling in sh ./ with the script
102
# shell being itself executable, otherwise git-buildpackage would
105
cd $(DEBIAN_DIR) && \
106
OPENMS_DATA_PATH=$(CURDIR)/share/OpenMS/ \
107
LD_LIBRARY_PATH=$(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)\
108
sh ./binaries-extract-one-line-man-desc.sh
110
# Build the documentation, which needs a running XWindow server. We
111
# thus use the doc_minimal target.
114
$(CMAKE) -DCMAKE_FIND_LIBRARY_SUFFIXES=".so" \
115
-DCONTRIB_LIB_DIR="/usr/lib;/usr/lib/$(DEB_BUILD_GNU_TYPE);/lib/$(DEB_BUILD_GNU_TYPE)" \
116
-DCF_OPENMS_DATA_PATH=/usr/share/openms-common/OpenMS/ \
117
-DCF_OPENMS_DOC_PATH=/usr/share/doc/openms-doc/ \
118
-DCMAKE_BUILD_TYPE=release ../..
120
VERBOSE=1 LD_LIBRARY_PATH=$(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)\
121
PATH=$(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)\
122
OPENMS_DATA_PATH=$(CURDIR)/share/OpenMS/ \
123
$(MAKE) -C $(BUILD_DIR) doc_minimal doc_tutorials
125
# There are two files that we do not want to ship because
126
# they exist in their own Debian packages.
128
rm -f $(BUILD_DIR)/doc/html/jquery.js
130
touch build-arch-stamp
133
# Note that this requires a build of the binary arch stuff.
134
build-indep-stamp: build-arch-stamp
136
touch build-indep-stamp
140
build: build-arch-stamp build-indep-stamp
144
build-indep: build-indep-stamp
148
build-arch: build-arch-stamp
151
# Build architecture-independent files here.
153
binary-indep: build-indep
156
dh_installchangelogs -i CHANGELOG
160
dh_compress -XOpenMS_tutorial.pdf -XTOPP_tutorial.pdf -i
169
# Build architecture-dependent files here.
171
binary-arch: build-arch
175
dh_installchangelogs -a CHANGELOG
178
# Now that install has been performed, remove all the Tutorial*
179
# binaries that will not ship in the topp package, but in the
180
# openms-doc package.
181
rm -vf $(DEBIAN_DIR)/topp/usr/bin/Tutorial*
189
# Generate the symbols for libs so that the call to
190
# dh_shlibdeps -a can work finding the dependencies upon
191
# $(OPENMS_LIB_PACKAGE). Specify the version (1.9.0) of the
192
# lib because otherwise, dpkg-gensymbols provides the full
193
# version with debian package version (1.9.0-1), which we do
195
dpkg-gensymbols -P$(DEBIAN_DIR) -p$(OPENMS_LIB_PACKAGE) \
196
-v$(OPENMS_LIB_VERSION) -c2 -d \
197
-e$(BUILD_DIR)/lib/libOpenMS.so.$(OPENMS_LIB_VERSION) \
198
-e$(BUILD_DIR)/lib/libOpenMS_GUI.so.$(OPENMS_LIB_VERSION) \
199
-O$(DEBIAN_DIR)/$(OPENMS_LIB_PACKAGE)/DEBIAN/symbols
201
# Send the proper shared libs details for the library:
202
echo "libOpenMS 1 libopenms1 (>= 1.9.0-1)" > \
203
$(DEBIAN_DIR)/$(OPENMS_LIB_PACKAGE)/DEBIAN/shlibs
204
echo "libOpenMS_GUI 1 libopenms1 (>= 1.9.0-1)" >> \
205
$(DEBIAN_DIR)/$(OPENMS_LIB_PACKAGE)/DEBIAN/shlibs
215
binary: binary-arch binary-indep