~ubuntu-branches/ubuntu/wily/openms/wily

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Filippo Rusconi
  • Date: 2012-11-12 15:58:12 UTC
  • Revision ID: package-import@ubuntu.com-20121112155812-e6mvctvil4ko9npv
Tags: 1.9.0-1
1.9.0 First Debian package release (Closes: #691129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
# Based on the initial work of Joey Hess and Craig Small.
 
3
 
 
4
# There are patches in the source package
 
5
include /usr/share/quilt/quilt.make
 
6
 
 
7
# Uncomment this to turn on verbose mode.
 
8
export DH_VERBOSE=1
 
9
export DH_OPTIONS=-v
 
10
 
 
11
CMAKE=/usr/bin/cmake
 
12
 
 
13
DEB_HOST_GNU_TYPE       ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
14
DEB_BUILD_GNU_TYPE      ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
15
 
 
16
DEBIAN_DIR = $(CURDIR)/debian
 
17
 
 
18
BUILD_DIR = $(DEBIAN_DIR)/build
 
19
 
 
20
# Path to the tools subdirectory in the top source dir to build the
 
21
# documentation.
 
22
export PATH := $(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)
 
23
export LD_LIBRARY_PATH := $(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)
 
24
 
 
25
OPENMS_LIB_PACKAGE = libopenms1
 
26
OPENMS_LIB_VERSION = 1.9.0
 
27
 
 
28
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
29
        CXXFLAGS += -O0
 
30
else
 
31
        CXXFLAGS += -O2
 
32
endif
 
33
 
 
34
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 
35
         NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 
36
         MAKEFLAGS += -j$(NUMJOBS)
 
37
endif
 
38
 
 
39
$(info "---------------------------------------")
 
40
$(info NUMJOBS: $(NUMJOBS))
 
41
$(info MAKEFLAGS: $(MAKEFLAGS))
 
42
$(info DEB_BUILD_OPTIONS: $(DEB_BUILD_OPTIONS))
 
43
$(info "---------------------------------------")
 
44
 
 
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
 
49
CFLAGS+=$(CPPFLAGS)
 
50
CXXFLAGS+=$(CPPFLAGS)
 
51
 
 
52
# .NOTPARALLEL: 
 
53
 
 
54
.PHONY: clean
 
55
clean: unpatch
 
56
        dh_testdir
 
57
        dh_testroot
 
58
 
 
59
        dh_clean
 
60
 
 
61
        rm -rf $(BUILD_DIR)
 
62
 
 
63
# Remove the generated xpm icon files:
 
64
        rm -f debian/TOPPView.xpm
 
65
        rm -f debian/TOPPAS.xpm
 
66
 
 
67
# Remove the generated topp.1 man page:
 
68
        rm -f debian/topp.1
 
69
 
 
70
build-arch-stamp: $(QUILT_STAMPFN)
 
71
        dh_testdir
 
72
        dh_prep -a
 
73
 
 
74
        mkdir -p $(BUILD_DIR)
 
75
 
 
76
# On the command line, use
 
77
# -DCONTRIB_LIB_DIR=/usr/lib/$(dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
78
 
 
79
        @echo "DEB_BUILD_GNU_TYPE: $(DEB_BUILD_GNU_TYPE)"
 
80
 
 
81
        cd $(BUILD_DIR) && \
 
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 ../.. 
 
87
 
 
88
# Build the libs and executable binaries
 
89
        VERBOSE=1 $(MAKE) -C $(BUILD_DIR) \
 
90
        OpenMS TOPP UTILS GUI test_build Tutorials_build 
 
91
 
 
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
 
96
 
 
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
 
103
# fail.
 
104
        @echo $(shell pwd)
 
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
 
109
 
 
110
# Build the documentation, which needs a running XWindow server. We
 
111
# thus use the doc_minimal target.
 
112
 
 
113
        cd $(BUILD_DIR) && \
 
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 ../.. 
 
119
 
 
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 
 
124
 
 
125
        # There are two files that we do not want to ship because
 
126
        # they exist in their own Debian packages.
 
127
 
 
128
        rm -f $(BUILD_DIR)/doc/html/jquery.js
 
129
 
 
130
        touch build-arch-stamp
 
131
 
 
132
 
 
133
#  Note that this requires a build of the binary arch stuff.
 
134
build-indep-stamp: build-arch-stamp
 
135
 
 
136
        touch build-indep-stamp
 
137
 
 
138
 
 
139
.PHONY: build
 
140
build:  build-arch-stamp build-indep-stamp
 
141
 
 
142
 
 
143
.PHONY: build-indep
 
144
build-indep: build-indep-stamp
 
145
 
 
146
 
 
147
.PHONY: build-arch
 
148
build-arch: build-arch-stamp
 
149
 
 
150
 
 
151
# Build architecture-independent files here.
 
152
.PHONY: binary-indep
 
153
binary-indep: build-indep
 
154
        dh_testdir -i
 
155
        dh_testroot -i
 
156
        dh_installchangelogs -i CHANGELOG 
 
157
        dh_installdocs -i
 
158
        dh_install -i
 
159
        dh_installman -i
 
160
        dh_compress -XOpenMS_tutorial.pdf -XTOPP_tutorial.pdf -i
 
161
        dh_fixperms -i
 
162
        dh_installdeb -i
 
163
        dh_lintian -i
 
164
        dh_gencontrol -i
 
165
        dh_md5sums -i
 
166
        dh_builddeb -i
 
167
 
 
168
 
 
169
# Build architecture-dependent files here.
 
170
.PHONY: binary-arch
 
171
binary-arch: build-arch
 
172
        dh_testdir -a
 
173
        dh_testroot -a
 
174
        dh_link
 
175
        dh_installchangelogs -a CHANGELOG
 
176
        dh_installdocs -a
 
177
        dh_install -a
 
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*
 
182
        dh_installmenu -a
 
183
        dh_installman -a
 
184
        dh_strip -a
 
185
        dh_compress -a
 
186
        dh_fixperms -a
 
187
        dh_installdeb -a
 
188
 
 
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
 
194
# not want.
 
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
 
200
 
 
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
 
206
 
 
207
        dh_lintian -a
 
208
        dh_shlibdeps -a
 
209
        dh_gencontrol -a
 
210
        dh_md5sums -a
 
211
        dh_builddeb -a
 
212
 
 
213
 
 
214
.PHONY: binary
 
215
binary: binary-arch binary-indep