File: rules

package info (click to toggle)
cgsi-gsoap 1.3.11-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 684 kB
  • sloc: ansic: 2,624; makefile: 602; sh: 335; perl: 52
file content (139 lines) | stat: -rwxr-xr-x 3,542 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
#!/usr/bin/make -f
# -*- makefile -*-

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

export SOURCE_DATE_EPOCH = \
	$(shell date -d "$$(dpkg-parsechangelog -c 1 -S Date)" +%s)

-include /usr/share/dpkg/buildflags.mk

INSTALLDIR = $(CURDIR)/debian/tmp

_prefix = /usr
_datadir = $(_prefix)/share
_docdir = $(_datadir)/doc

configure: configure-stamp

configure-stamp:
	dh_testdir

	[ ! -r src/Makefile.save ] && cp -p src/Makefile src/Makefile.save || :

	# Fix bad permissions
	find . '(' -name '*.h' -o -name '*.c' -o -name '*.cpp' -o \
		   -name '*.cc' ')' -exec chmod 644 {} ';'
	chmod 644 LICENSE RELEASE-NOTES

	# Remove -L/usr/lib and -L/usr/lib64 since they may cause problems
	sed -e 's!-L$$([A-Z_]*)/lib!!' \
	    -e 's!-L$$([A-Z_]*)/$$(LIBDIR)!!' -i src/Makefile

	# Remove gsoap version from library names
	sed -e 's!$$(GSOAP_VERSION)!!g' -i src/Makefile

	touch $@

build: build-indep build-arch

build-indep: build-stamp

build-arch: build-stamp

build-stamp: configure-stamp
	dh_testdir

	. ./VERSION && \
	cd src && \
	$(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC -I. `pkg-config --cflags gsoap`" \
		SHLIBLDFLAGS="$(LDFLAGS) -shared" \
		USE_VOMS=yes WITH_EMI=yes WITH_CPP_LIBS=yes \
		LIBDIR=lib/$(DEB_HOST_MULTIARCH) VERSION=$$VERSION all doc

	touch $@

clean:
	dh_testdir
	dh_testroot

	. ./VERSION && \
	cd src && \
	$(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC -I. `pkg-config --cflags gsoap`" \
		SHLIBLDFLAGS="$(LDFLAGS) -shared" \
		USE_VOMS=yes WITH_EMI=yes WITH_CPP_LIBS=yes \
		LIBDIR=lib/$(DEB_HOST_MULTIARCH) VERSION=$$VERSION clean

	rm -rf src/html
	rm -rf src/man
	rm -f src/doxygen_sqlite3.db

	rm -rf src/*.a
	rm -rf src/*.so

	[ -r src/Makefile.save ] && mv src/Makefile.save src/Makefile || :

	rm -f build-stamp configure-stamp

	dh_clean

install: build-stamp
	dh_testdir
	dh_testroot
	dh_prep

	# Yes, the makefile uses RPM_BUILD_ROOT instead of the normal DESTDIR

	. ./VERSION && \
	cd src && \
	$(MAKE) CFLAGS="$(CFLAGS) $(CPPFLAGS) -fPIC -I. `pkg-config --cflags gsoap`" \
		SHLIBLDFLAGS="$(LDFLAGS) -shared" \
		USE_VOMS=yes WITH_EMI=yes WITH_CPP_LIBS=yes \
		LIBDIR=lib/$(DEB_HOST_MULTIARCH) VERSION=$$VERSION \
		RPM_BUILD_ROOT=$(INSTALLDIR) install install.man

	mkdir -p $(INSTALLDIR)$(_docdir)/libcgsi-gsoap-dev
	mv $(INSTALLDIR)$(_docdir)/CGSI/html \
	   $(INSTALLDIR)$(_docdir)/libcgsi-gsoap-dev

binary-indep:

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs
	dh_install
	dh_missing --fail-missing
	dh_installman
	dh_lintian
	dh_link
	dh_strip --dbgsym-migration='libcgsi-gsoap-dbg (<< 1.3.10-3~)'
	dh_compress
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps

	if [ -r /usr/lib/$(DEB_HOST_MULTIARCH)/libgsoap.so ] ; then \
	   GSOAPLIB=`readlink /usr/lib/$(DEB_HOST_MULTIARCH)/libgsoap.so` ; \
	else \
	   GSOAPLIB=`readlink /usr/lib/libgsoap.so` ; \
	fi && \
	GSOAPPKG=`dpkg -S $$GSOAPLIB | sed 's/:.*//'` && \
	echo "gsoap:Depends=$$GSOAPPKG" >> debian/libcgsi-gsoap1.substvars

	MINGSOAPVER=`dpkg-query -W -f '$${source:Upstream-Version}' libgsoap-dev` && \
	LASTNUM=`echo $$MINGSOAPVER | sed 's/.*\.//'` && \
	LASTNUMP1=$$(($$LASTNUM + 1)) && \
	MAXGSOAPVER=`echo $$MINGSOAPVER | sed s/$$LASTNUM$$/$$LASTNUMP1/` && \
	echo "gsoap:Depends=libgsoap-dev (>= $$MINGSOAPVER), libgsoap-dev (<< $$MAXGSOAPVER)" \
	   >> debian/libcgsi-gsoap-dev.substvars

	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.Phony: binary binary-arch binary-indep build build-arch build-indep clean configure install