File: rules

package info (click to toggle)
libaws 2.2dfsg-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,624 kB
  • ctags: 1,173
  • sloc: ada: 61,829; ansic: 6,483; makefile: 1,282; xml: 196; sh: 119; java: 112; python: 66; sed: 40
file content (165 lines) | stat: -rwxr-xr-x 5,535 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
#!/usr/bin/make -f
# Debian build script for AWS - Copyright (c) 2003, 2004, 2005, 2006
# Ludovic Brenta

# This build script is free software; you can redistribute it and/or
# modify it under terms of the GNU General Public License as published
# by the Free Software Foundation; either version 2, or (at your
# option) any later version. This build script is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE.  See the GNU General Public License for more details. You
# should have received a copy of the GNU General Public License
# distributed with this build script; see file
# /usr/share/common-licenses/GPL. If not, write to the Free Software
# Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

SHELL=/bin/bash
CC=gnatgcc

export DH_COMPAT=4
export SHELL=/bin/bash

# Parse the version number from the change log:
# major.minor-revision
regexp:=^Version: \([0-9]\+\)\.\([0-9]\+\)dfsg-\(.\+\)$$
major:=$(shell dpkg-parsechangelog | grep ^Version: | sed 's/$(regexp)/\1/')
minor:=$(shell dpkg-parsechangelog | grep ^Version: | sed  's/$(regexp)/\2/')
revision:=$(shell dpkg-parsechangelog | grep ^Version: | sed  's/$(regexp)/\3/')

file_to_spec=sed -e "s/\.ads//" -e "s/-/./g" -e "s!.*/!!g"

DEB_BUILD_ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
CPUS := $(shell getconf _NPROCESSORS_ONLN)

.SUFFIXES:

build: patch build-stamp
build-stamp: static-lib shared-lib tools doc
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -rf debian/tmp obj-static obj-shared obj-tools libaws.so
	$(MAKE) -C docs $@
	-quilt pop -a
	dh_clean -a -i

# Build architecture-independent files here.
binary-indep: build-stamp
	dh_testdir
	dh_testroot
	: # The doc package
	dh_installinfo -plibaws-doc docs/aws.info docs/style-guide.info
	dh_installdocs -plibaws-doc docs/*.html docs/*.txt readme.txt
	dh_installexamples -plibaws-doc demos/* -Xmakefile
	dh_installexamples -plibaws-doc web_elements
	dh_fixperms -i
	dh_installchangelogs -i
	dh_compress -i -X.adb -X.ads -X.thtml -X.wsdl
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

DIRS := config include include/ai302 soap src ssl xsrc
SOURCES := $(foreach d,$(DIRS),$(wildcard $(d)/*.ad[bs]))

# Build architecture-dependent files here.
binary-arch: build-stamp
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a
	: # The development package
	dh_installdirs -plibaws-dev \
		/usr/bin /usr/lib \
		/usr/share/ada/adainclude/aws \
		/usr/lib/ada/adalib/aws
	dh_install -plibaws-dev debian/tmp/libaws.a /usr/lib
	dh_install -plibaws-dev obj-shared/*.ali /usr/lib/ada/adalib/aws
	dh_install -plibaws-dev debian/aws.gpr /usr/share/ada/adainclude
	dh_install -plibaws-dev $(SOURCES) /usr/share/ada/adainclude/aws
	dh_install -plibaws-dev debian/tmp/aws-os_lib-definitions.ads \
	   /usr/share/ada/adainclude/aws
	dh_link -plibaws-dev \
		usr/lib/libaws.so.$(major).$(minor) usr/lib/libaws.so
	: # The -bin package
	for i in ada2wsdl awsres wsdl2aws; do \
	   if [ -x debian/tmp/$$i ] ; then \
	      dh_install    -plibaws-bin debian/tmp/$$i /usr/bin; \
	      dh_installman -plibaws-bin debian/$$i.1; \
	   fi \
	done
	: # The shared library package
	dh_install -plibaws$(major).$(minor) \
		debian/tmp/libaws.so.$(major).$(minor) /usr/lib
	: # Common to all architecture-dependent packages
	dh_strip -a -X.a
	dh_compress -a
	dh_fixperms -a -X.ali
	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a -Llibaws$(major).$(minor) -ldebian/libaws$(major).$(minor)/usr/lib
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary

patch:
	-quilt push -a

static-lib: debian/tmp/libaws.a
debian/tmp/libaws.a: debian/tmp/aws-os_lib-definitions.ads
debian/tmp/libaws.a: | debian/tmp obj-static
	: # Build the static library
	gnatmake -c -j$(CPUS) -g -Pdebian/build_aws.gpr -XOBJ_DIR=obj-static
	ar rc $@ obj-static/*.o
	ranlib $@

shared-lib: debian/tmp/libaws.so.$(major).$(minor)
debian/tmp/libaws.so.$(major).$(minor): debian/tmp/aws-os_lib-definitions.ads
debian/tmp/libaws.so.$(major).$(minor): | debian/tmp obj-shared
	: # Build the shared library
	gnatmake -c -j$(CPUS) -fPIC -Pdebian/build_aws.gpr -XOBJ_DIR=obj-shared
	gnatgcc -shared -o $@ obj-shared/*.o \
	   -lgnat -lgnarl -lxmlada2 -ltemplates_parser -lgnutls -lldap -lz \
	   -Wl,--soname,libaws.so.$(major).$(minor) -Wl,--export-dynamic
	chmod a=r obj-shared/*.ali
	: # A symlink for to build the tools
	ln -sf debian/tmp/libaws.so.$(major).$(minor) libaws.so

debian/tmp/aws-os_lib-definitions.ads: debian/tmp/check_config | debian/tmp
	$< $@

debian/tmp/check_config: config/src/check_config.c | debian/tmp
	$(CC) -o $@ $<

tools: debian/tmp/ada2wsdl debian/tmp/awsres debian/tmp/wsdl2aws

debian/tmp/ada2wsdl: debian/tmp/libaws.so.$(major).$(minor) | debian/tmp obj-tools
	gnatmake -j$(CPUS) -Pdebian/ada2wsdl.gpr -largs -L.

debian/tmp/awsres debian/tmp/wsdl2aws: debian/tmp/libaws.so.$(major).$(minor)
debian/tmp/awsres debian/tmp/wsdl2aws: | debian/tmp obj-tools
	: # Build awsres and wsdl2aws
	gnatmake -j$(CPUS) -Pdebian/tools.gpr -largs -L.

debian/tmp obj-static obj-shared:
	-mkdir $@

obj-tools: obj-shared debian/tmp/libaws.so.$(major).$(minor)
	-mkdir $@
	cp -p obj-shared/*.ali $@
	chmod a=r $(patsubst obj-shared/%,obj-tools/%,$(wildcard obj-shared/*.ali))

doc:
	chmod u+x docs/gentexifile
	$(MAKE) -C docs

.PHONY: patch static-lib shared-lib tools doc