File: rules

package info (click to toggle)
ace 5.7.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 33,052 kB
  • ctags: 32
  • sloc: sh: 3,871; makefile: 164; ansic: 20
file content (226 lines) | stat: -rwxr-xr-x 8,686 bytes parent folder | download
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
#!/usr/bin/make -f

# debian/rules file for ACE+TAO Debian GNU/Linux packages
# written February 2002 by Ossama Othman <ossama@debian.org>
# Modified August 2003 by Brian Nelson <pyro@debian.org>
# Copyright (C) 2004  Raphael Bossek <bossekr@debian.org>
# Copyright © 2005-2010 Thomas Girard <thomas.g.girard@free.fr>

INSTALL_755 := install -o root -g root -m 755

ACE_SUBDIR := ACE_wrappers
ACE_ARCHIVE := $(shell ls -1 ACE+TAO+CIAO-src-*.tar.bz2 2>/dev/null || echo ace-archive-missing)
MWCFLAGS := -type gnuace -noreldefs -genins
ACE_MAKE_FLAGS := versioned_so=2
PRJ_INSTALL_ALL := -k -s pkgconfig_files,man_files,lib_output,header_files,inline_files,exe_output,idl_files,pidl_files,template_files  -o lib_output=usr/lib -o exe_output=usr/bin -b idl_files=usr/share/idl -b pidl_files=usr/share/idl -b template_files=usr/include -b header_files=usr/include -b inline_files=usr/include -o man_files=usr/share/man/man1 -o pkgconfig_files=usr/lib/pkgconfig
PRJ_INSTALL_BIN := -k -s man_files,exe_output,lib_output  -o exe_output=usr/bin -o man_files=usr/share/man/man1 -o lib_output=usr/lib

MAN1 := debian/ace_netsvcs.1 \
	debian/tao_catior.1 \
	debian/tao_nslist.1 \
	debian/tao_nsadd.1 \
	debian/tao_nsdel.1 \
	debian/tao_tls_basic.1 \
	debian/tao_tls_event.1 \
	debian/tao_tls_notify.1 \
	debian/tao_tls_rtevent.1 \
	debian/TAO_ORB_Options.1 \
	debian/mpc-ace.1
# Where we install every file before calling dh_install
DT := debian/tmp

DOXYGEN_FILES_TO_REMOVE := -name '*.md5' -o \
                           -name '*.dot' -o \
                           -name '*.idx' -o \
                           -name '*.map' -o \
                           -name '*.tag' -o \
                           -name 'index.hh?'

export ACE_ROOT := $(shell pwd)/$(ACE_SUBDIR)
export MPC_ROOT := $(ACE_ROOT)/MPC
export TAO_ROOT := $(ACE_ROOT)/TAO
export CIAO_ROOT := $(TAO_ROOT)/CIAO
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(ACE_ROOT)/lib
export QTDIR := /usr/share/qt4

# This dpatches are only a place holders. The `prepatch' and `postbuild' targets stops
# here by default.
PREPATCH_MARK := 50-prepatch-dummy-mark.dpatch
POST_BUILD_MARK := 75-post-build-dummy-mark.dpatch
UNTIL_BUILD := $(PREPATCH_MARK)
UNTIL_POST_BUILD := $(POST_BUILD_MARK)

.NOTPARALLEL: debian/mpc-ace.sgml debian/%.1 prepatch extract doxygen clean install build binary-indep binary-arch binary
.PHONY: doxygen patch unpatch prepatch extract build clean binary-indep binary-arch binary install source diff configure

extract: extract-stamp
extract-stamp: $(ACE_ARCHIVE)
	tar -xjf $<
	cp debian/platform_macros.GNU $(ACE_ROOT)/include/makeinclude
	cp debian/config.h $(ACE_ROOT)/ace/config.h
	cp debian/default.features $(ACE_ROOT)/bin/MakeProjectCreator/config
	# We need to delete this one to prevent an empty library generation
	rm -f $(ACE_ROOT)/ace/ace_qt3reactor.mpc
	touch $@

debian/mpc-ace.sgml: ACE_wrappers/MPC/docs/MPC.sgml
	sed -e 's/mpc\.pl/mpc-ace/g' -e 's/mwc\.pl/mwc-ace/g' $< > $@

debian/%.1: debian/%.sgml
	docbook-to-man $< > $@

# Prepare a ACE_wrappers directory where most of the patches are applied.
prepatch: prepatch-stamp
prepatch-stamp: extract-stamp
	dpatch apply-until $(UNTIL_BUILD)
	touch $@

pl-stamp: prepatch-stamp
	for fn in `find "$(ACE_ROOT)" -name "*.pl"`; do (echo '#!/usr/bin/perl'; cat "$$fn") > "$${fn}T"; mv "$${fn}T" "$$fn"; chmod a+x "$$fn"; done
	touch $@

configure: configure-stamp
configure-stamp: prepatch-stamp pl-stamp
	cp debian/ACE-DPKG.mwc $(ACE_ROOT)
	cd $(ACE_ROOT) &&  ./bin/mwc.pl $(MWCFLAGS) ACE-DPKG.mwc
	cp debian/TAO-DPKG.mwc $(TAO_ROOT)
	cd $(TAO_ROOT) &&  ./../bin/mwc.pl $(MWCFLAGS) TAO-DPKG.mwc
	touch $@

patch: patch-stamp
patch-stamp: configure-stamp
	dpatch apply-until $(UNTIL_POST_BUILD)
	touch $@

unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

doxygen: doxygen-stamp
doxygen-stamp: build-stamp
	cd $(ACE_ROOT) && bin/generate_doxygen.pl -is_release -exclude_ciao
	find $(ACE_ROOT)/html/libace-doc $(DOXYGEN_FILES_TO_REMOVE) | xargs -r rm -f
	find $(ACE_ROOT)/html/libtao-doc $(DOXYGEN_FILES_TO_REMOVE) | xargs -r rm -f
#	Somehow search/ is still generated, even if we don't want it.
	find $(ACE_ROOT)/html -type d -name search | xargs -r rm -Rf
	touch $@

build: build-stamp manpages-stamp
build-stamp: patch-stamp
	dh_testdir
	cd $(ACE_ROOT) && $(MAKE) $(ACE_MAKE_FLAGS)
	cd $(TAO_ROOT) && $(MAKE) $(ACE_MAKE_FLAGS)
#       2nd-pass MPC generation is a quick bugfix related with write_install_files@MPC/modules/ProjectCreator.pm
	echo 2nd-pass MPC generation
	cd $(ACE_ROOT) &&  ./bin/mwc.pl $(MWCFLAGS) ACE-DPKG.mwc
	cd $(TAO_ROOT) &&  ./../bin/mwc.pl $(MWCFLAGS) TAO-DPKG.mwc
	touch $@

manpages-stamp: $(MAN1)
	touch $@

clean:
	dh_testdir
	rm -rf $(ACE_SUBDIR) debian/patched $(MAN1) *-stamp debian/mpc-ace.sgml
	dh_clean

post-build-patch: post-build-patch-stamp
post-build-patch-stamp: build-stamp
	dpatch apply-all
	touch $@


install: post-build-patch
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
#	Install ACE files in $(CURDIR)/$(DT)
	@echo Installing..
	for p in ace apps ACEXML Kokyu; do \
	  cd $(ACE_ROOT) && MPC/prj_install.pl $(PRJ_INSTALL_ALL) $(CURDIR)/$(DT) $$p; \
	done
#	Remove gperf headers -- we don't need them
	rm -Rf $(CURDIR)/$(DT)/usr/include/apps/gperf

	cd $(ACE_ROOT)/protocols && ../MPC/prj_install.pl $(PRJ_INSTALL_ALL) $(CURDIR)/$(DT) ace
	cd $(ACE_ROOT)/bin/PerlACE && ../../MPC/prj_install.pl -s script_files -b script_files=usr/lib/ace/bin/PerlACE $(CURDIR)/$(DT) PerlACE.ins

#	Install TAO files in $(CURDIR)/$(DT)
	cd $(TAO_ROOT) && ../MPC/prj_install.pl $(PRJ_INSTALL_ALL) $(CURDIR)/$(DT) tao
	cd $(TAO_ROOT) && ../MPC/prj_install.pl $(PRJ_INSTALL_ALL) $(CURDIR)/$(DT) orbsvcs/orbsvcs

	for p in orbsvcs TAO_IDL utils; do \
	  cd $(TAO_ROOT) && ../MPC/prj_install.pl $(PRJ_INSTALL_BIN) $(CURDIR)/$(DT) $$p ; \
	done

#	Install netsvcs files in $(CURDIR)/$(DT)
	cd $(ACE_ROOT) && ./MPC/prj_install.pl $(PRJ_INSTALL_BIN) $(CURDIR)/$(DT) netsvcs
	cd $(ACE_ROOT)/netsvcs/lib && ../../MPC/prj_install.pl -k -s header_files,inline_files,template_files  -b template_files=usr/include/netsvcs -b header_files=usr/include/netsvcs -b inline_files=usr/include/netsvcs $(CURDIR)/$(DT) .
	cd $(ACE_ROOT)/netsvcs/servers && ../../MPC/prj_install.pl -k -s svc_conf_files -b svc_conf_files=usr/share/ace-netsvcs $(CURDIR)/$(DT) .

#	Create .so links instead of copies
	cd $(CURDIR)/$(DT)/usr/lib && for f in $$(find -name 'lib*-*.so' -print) ; do ln -sf $${f#./*} $${f%%-*}.so ; done

#	Move orbsvcs files from include/tao/orbsvcs into include/orbsvcs
	cd $(CURDIR)/$(DT)/usr/include/orbsvcs && mv -f orbsvcs/* . && rm -rf orbsvcs  

#       Process pkgconfig_files *.pc.in
#	Add missing pkgconfig files -- TO REPORT UPSTREAM
	cp $(ACE_ROOT)/ACEXML/apps/svcconf/ACEXML_XML_Svc_Conf_Parser.pc.in $(TAO_ROOT)/tao/Compression/lzo/TAO_LzoCompressor.pc.in $(DT)/usr/lib/pkgconfig
	cd $(CURDIR) && for f in $(DT)/usr/lib/pkgconfig/*.pc.in ; do sh ./debian/generator_pkgconfig.sh $$f > $${f%%.in}  ; done && rm $(DT)/usr/lib/pkgconfig/*.pc.in

#	We provide scripts replacement for tao_idl and tao_ifr; they
#	automatically define ACE_ROOT and TAO_ROOT
	mkdir -p $(DT)/usr/lib/ace/TAO
	mv $(DT)/usr/bin/tao_idl $(DT)/usr/bin/tao_ifr $(DT)/usr/lib/ace/TAO

	$(INSTALL_755) -D debian/tao_idl $(DT)/usr/bin/tao_idl
	$(INSTALL_755) -D debian/tao_ifr $(DT)/usr/bin/tao_ifr

	rm -f $(DT)/usr/bin/TAO_Service
	dh_install --sourcedir=$(DT) --fail-missing

binary-indep: build install doxygen-stamp
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i

	chmod -x debian/libtao-doc/usr/share/doc/libtao-doc/examples/RTCORBA/Activity/svc.conf.server
	chmod -x debian/libtao-doc/usr/share/doc/libtao-doc/examples/Simulator/DOVEBrowser/make.bat
	chmod -x debian/libtao-doc/usr/share/doc/libtao-doc/examples/RTCORBA/Activity/svc.conf.client

	dh_installman -i
	dh_installchangelogs -i $(ACE_ROOT)/ChangeLog
	dh_perl -i
	dh_link -i
	dh_compress -i -Xexamples -Xtutorials
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a -A
	dh_installman -a
	dh_installinfo -pace-gperf $(ACE_ROOT)/apps/gperf/ace_gperf.info
	dh_installchangelogs -a $(ACE_ROOT)/ChangeLog
	dh_installchangelogs -pace-gperf $(ACE_ROOT)/apps/gperf/ChangeLog
	dh_strip -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -V
	dh_installdeb -a
	dh_shlibdeps -a -l `ls -1 debian/lib*.install | sed -e 's#\(.*\)\.install#\1/usr/lib#' | tr '\n' ':' | sed -e 's#:$$##'`
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

binary: binary-indep binary-arch