File: rules

package info (click to toggle)
libpwiz 3.0.18342-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 15,072 kB
  • sloc: cpp: 157,552; sh: 4,185; makefile: 317
file content (236 lines) | stat: -rwxr-xr-x 6,793 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

export DH_VERBOSE=1
export DH_OPTIONS=-v

DEB_HOST_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE	?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
DEB_HOST_MULTIARCH	?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

DEBIAN_DIR = $(CURDIR)/debian
BUILD_DIR = $(DEBIAN_DIR)/build
INSTALL_DIR = $(BUILD_DIR)

# Path to the tools subdirectory in the top source dir to build the
# documentation.
export PATH := $(BUILD_DIR)/bin:$(CURDIR)/tools:$(PATH)
export LD_LIBRARY_PATH := $(BUILD_DIR)/lib/:$(LD_LIBRARY_PATH)

PROTEOWIZ_LIB_PACKAGE = libpwiz3
PROTEOWIZ_LIB_VERSION = 3.0.0
PROTEOWIZ_SOFT_VERSION = 3.0.9393
PROTEOWIZ_PACK_VERSION = $(PROTEOWIZ_SOFT_VERSION)-1

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CXXFLAGS += -O0
else
	CXXFLAGS += -O2
endif

$(info "---------------------------------------")
$(info DEB_HOST_GNU_TYPE: $(DEB_HOST_GNU_TYPE))
$(info DEB_BUILD_GNU_TYPE $(DEB_BUILD_GNU_TYPE))
$(info DEB_BUILD_OPTIONS: $(DEB_BUILD_OPTIONS))
$(info DEB_HOST_MULTIARCH: $(DEB_HOST_MULTIARCH))
$(info "---------------------------------------")

# Hardening stuff, see http://wiki.debian.org/Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)

ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
 CXXFLAGS += --param ggc-min-expand=5
endif

.NOTPARALLEL:

.PHONY: clean
clean:
	@echo "entering the clean target"
	dh_testdir
	dh_testroot

	rm -f debian/msconvert.1
	rm -f debian/idconvert.1
	rm -f debian/mscat.1
	rm -f debian/txt2mzml.1

# Remove the configure script that is shipped with the source tarball
	rm -f autools/conf.log autools/config.status

	rm -rf $(BUILD_DIR)

# Remove the generated includes directory:
	rm -rf debian/includes

# Remove the generated doc/dox/html directory:
	rm -rf doc/dox/html

	rm -f configure-stamp
	rm -f build-arch-stamp
	rm -f build-indep-stamp

	dh_clean

.PHONY: configure
configure: 
	@echo "entering the configure target"
	dh_testdir
	dh_prep -a

	mkdir -p $(BUILD_DIR)

# Duplicate the source tree, since it is not easy to build the
# software in a separate build directory.
	cp -rpf autotools libraries pwiz pwiz_tools $(BUILD_DIR)

# Craft a modified version of Makefile.am with a correct -L <>
# statement for the BOOST_LDPATH flag to the linker.

	echo "BOOST_LDPATH = /usr/lib/$(DEB_HOST_MULTIARCH)" > $(BUILD_DIR)/autotools/Makefile.am-tmp

	cat $(BUILD_DIR)/autotools/Makefile.am >> $(BUILD_DIR)/autotools/Makefile.am-tmp

  # Now add the path to the eigen3 include dir
	sed -i '/^AM_CPPFLAGS/ s|$$| -I "/usr/include/eigen3/Eigen"|' $(BUILD_DIR)/autotools/Makefile.am-tmp

  # Now add the path to the local eigen3 include dir (for the nnls.h file)
	sed -i '/^AM_CPPFLAGS/ s|$$| -I "$(BUILD_DIR)/libraries/Eigen"|' $(BUILD_DIR)/autotools/Makefile.am-tmp

  # Now add the path to the libsvm include dir
	sed -i '/^AM_CPPFLAGS/ s|$$| -I "$(BUILD_DIR)/libraries/libsvm-3.0"|' $(BUILD_DIR)/autotools/Makefile.am-tmp

	mv $(BUILD_DIR)/autotools/Makefile.am-tmp $(BUILD_DIR)/autotools/Makefile.am

# Remove parts of boost_aux now integrated in boost
	rm -f $(BUILD_DIR)/libraries/boost_aux/boost/interprocess/detail/*

# Regenerate the configure script
	cd $(BUILD_DIR)/autotools && autoreconf --force -i && cd .. && \
	autotools/configure --prefix=/usr

configure-stamp: configure
	@echo "entering the configure-stamp target"
	touch configure-stamp

build-arch-stamp: configure-stamp
	@echo "entering the build-arch-stamp target"

	cd $(BUILD_DIR) && \
	VERBOSE=1 BOOST_LDPATH=/usr/lib/$(DEB_HOST_MULTIARCH) $(MAKE) && \
	VERBOSE=1 DESTDIR=$(INSTALL_DIR) $(MAKE) install

# Now that the build is fine and the built files installed,
# remove all the RPATH stuff from these binaries.
	@echo "Removing the RPATH datum from the binaries." 
	sh debian/remove-rpath-from-binaries.sh

# Prepare a mirroring hierarchy for all the header files of the
# project. The mirror is in debian/includes/pwiz.
	@echo $(shell pwd)
	sh debian/make-included-headers-hierarchy.sh

# Produce the man pages for both libpwiz-tools binaries
	docbook-to-man debian/msconvert.sgml > debian/msconvert.1
	docbook-to-man debian/idconvert.sgml > debian/idconvert.1
	docbook-to-man debian/mscat.sgml > debian/mscat.1
	docbook-to-man debian/txt2mzml.sgml > debian/txt2mzml.1

	touch build-arch-stamp

# Build the documentation with doxygen in doc/dox. That creates an
# html file. Note that we need the binary-arch build because the files
# that go in the documentation are produced by the arch targets.
build-indep-stamp: build-arch-stamp
	@echo "entering the build-indep-stamp target"
	cd doc/dox && doxygen

# Remove the jquery.js file, since it is shipped in its own Debian package
	rm -f doc/dox/html/jquery.js

	touch build-indep-stamp


.PHONY: build
build: build-arch-stamp build-indep-stamp


.PHONY: build-indep
build-indep: build-indep-stamp


.PHONY: build-arch
build-arch: build-arch-stamp


# Build architecture-independent files here.
.PHONY: binary-indep
binary-indep: build-indep
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i
	dh_installdocs -i
	dh_install -i
	dh_installman -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_lintian -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i


# Build architecture-dependent files here.
.PHONY: binary-arch
binary-arch: build-arch
	dh_testdir -a
	dh_testroot -a
	dh_link
	dh_installchangelogs -a
	dh_installdocs -a
	dh_install -a
	dh_installmenu -a
	dh_installman -a
	dh_strip -a
# Do not compress the example source and binary files.
	dh_compress -av -Xexample-files

# Ensure that ldconfig is called.
	dh_makeshlibs -a

	dh_installdeb -a

# Generate the symbols for libs so that the call to dh_shlibdeps -a
# can work finding the dependencies upon
# $(PROTEOWIZ_LIB_PACKAGE). Specify the version
# $(PROTEOWIZ_LIB_VERSION) of the lib because otherwise,
# dpkg-gensymbols provides the full version with debian package
# version $(PROTEOWIZ_LIB_VERSION)-1, which we do not want.
	dpkg-gensymbols -P$(DEBIAN_DIR) -p$(PROTEOWIZ_LIB_PACKAGE) \
	-v$(PROTEOWIZ_LIB_VERSION) -c2 -d \
	-e$(BUILD_DIR)/usr/lib/libpwiz.so.$(PROTEOWIZ_LIB_VERSION) \
	-O$(DEBIAN_DIR)/$(PROTEOWIZ_LIB_PACKAGE)/DEBIAN/symbols

# Send the proper shared libs details for the library:
	echo "libpwiz 3 libpwiz3 (>= $(PROTEOWIZ_PACK_VERSION))" > \
	$(DEBIAN_DIR)/$(PROTEOWIZ_LIB_PACKAGE)/DEBIAN/shlibs

# Run the fixperms after generating the symbols and shlibs files so
# that the correct permissions are set for them also. Lintian was
# complaining.
	dh_fixperms -a
	dh_lintian -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


.PHONY: binary
binary: binary-arch binary-indep