File: rules

package info (click to toggle)
xerces27 2.7.0-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,668 kB
  • ctags: 21
  • sloc: makefile: 73
file content (112 lines) | stat: -rwxr-xr-x 4,410 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
#!/usr/bin/make -f

# To distinguish variables that are truly local to this file (rather
# than for use by cdbs), we adopt the convention of starting local
# variables' names with l_.

l_LIBMAJOR=27
l_PKGNAME=libxerces$(l_LIBMAJOR)
l_LIBNAME1=libxerces-c
l_SHORTSONAME1=$(l_LIBNAME1).so.$(l_LIBMAJOR)
l_LONGSONAME1=$(l_SHORTSONAME1).0
l_LIBNAME2=libxerces-depdom
l_SHORTSONAME2=$(l_LIBNAME2).so.$(l_LIBMAJOR)
l_LONGSONAME2=$(l_SHORTSONAME2).0

l_PWD := $(shell pwd)
l_BUILD_DIR = build-tree/$(DEB_TAR_SRCDIR)
l_INSTALL = $(l_PWD)/debian

# Variables used by cdbs
DEB_TAR_SRCDIR = xerces-c-src_2_7_0
DEB_INSTALL_DIRS_libxerces27 = /usr/lib
DEB_INSTALL_DIRS_libxerces27-dev = /usr/include /usr/lib/$(l_PKGNAME)
DEB_INSTALL_EXAMPLES_libxerces27-dev = $(l_PWD)/$(l_BUILD_DIR)/samples/*
DEB_INSTALL_DOCS_libxerces27-doc = \
	$(l_PWD)/$(l_BUILD_DIR)/doc/*
DEB_INSTALL_DOCS_libxerces27-dev = \
	$(l_PWD)/$(l_BUILD_DIR)/credits.txt \
	$(l_PWD)/$(l_BUILD_DIR)/Readme.html
DEB_COMPRESS_EXCLUDE = sample html

# Exclude deprecrated dom library from shlib dependency calculation
# since it depends upon the other library which may in turn result in
# a circular dependency.  It is harmless for this to be passed to all
# dh_shlibdeps invocations for this package, so we won't worry about
# the fact that cdbs (as of 0.4.25) doesn't give us any good way to do
# this override on only one package.
override DEB_DH_SHLIBDEPS_ARGS = -X libxerces-depdom.so

# Include cdbs rules files.
include /usr/share/cdbs/1/rules/tarball.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk
include /usr/share/cdbs/1/rules/debhelper.mk

# Environment variables used by the build
export USELIBWWW=0
export ICUROOT=/usr

# As 0.4.21, cdbs creates but doesn't debian/compat.  It creates it
# conditionally, so this doesn't have a trivial fix.
clean::
	$(RM) debian/compat *.cdbs-config_list

configure/libxerces27 configure/libxerces27-dev::
	chmod a+x $(l_BUILD_DIR)/src/xercesc/runConfigure
	cd $(l_BUILD_DIR)/src/xercesc \
		&& XERCESCROOT=$(l_PWD)/$(l_BUILD_DIR) \
		sh runConfigure -plinux  -cgcc -xg++ -minmem -ticu \
		                   -z -g \
		                   -C --prefix=/usr \
				   -C --mandir=\$${prefix}/share/man \
				   -C --infodir=\$${prefix}/share/info

build/libxerces27::
	XERCESCROOT=$(l_PWD)/$(l_BUILD_DIR) \
		$(MAKE) -C $(l_BUILD_DIR)/src/xercesc

# The xerces install target installs development files as well as
# shared libraries, and it doesn't necessarily install the right
# shared library file names.  Here we use make install to create the
# development package, and we install the shared libraries for the
# runtime packages manually.  After running make install, remove all
# installed shared library files, create a versionless dangling
# symbolic link to the real shared library file that will be installed
# in the runtime package, install config.status, which is needed to
# build libxml-xerces-perl, and clean up some lintian warnings about
# executable files (that aren't fixed by dh_fixperms).
install/libxerces27-dev::
	XERCESCROOT=$(l_PWD)/$(l_BUILD_DIR) \
		$(MAKE) -C $(l_BUILD_DIR)/src/xercesc \
		install PREFIX=$(l_INSTALL)/$(cdbs_curpkg)/usr \
		prefix=$(l_INSTALL)/$(cdbs_curpkg)/usr
	cd $(l_INSTALL)/$(cdbs_curpkg)/usr/lib \
		&& rm -f $(l_LIBNAME1).so* \
		&& ln -sf $(l_SHORTSONAME1) $(l_LIBNAME1).so \
		&& rm -f $(l_LIBNAME2).so* \
		&& ln -sf $(l_SHORTSONAME2) $(l_LIBNAME2).so
	cp $(l_PWD)/$(l_BUILD_DIR)/src/xercesc/config.status \
		$(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_PKGNAME)
	find $(l_INSTALL)/$(cdbs_curpkg)/usr/include -type f -print | \
		xargs chmod -x
	find $(DEB_INSTALL_EXAMPLES_libxerces27-dev) \
		-type f -name '*.in' -print | xargs chmod -x
	find $(DEB_INSTALL_EXAMPLES_libxerces27-dev) \
		-name '*.cdbs-orig' -exec rm {} \;

install/libxerces27::
	cp $(l_PWD)/$(l_BUILD_DIR)/lib/$(l_LIBNAME1).so \
		$(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_LONGSONAME1)
	ln -sf $(l_LONGSONAME1) \
		$(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_SHORTSONAME1)
	cp $(l_PWD)/$(l_BUILD_DIR)/lib/$(l_LIBNAME2).so \
		$(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_LONGSONAME2)
	ln -sf $(l_LONGSONAME2) \
		$(l_INSTALL)/$(cdbs_curpkg)/usr/lib/$(l_SHORTSONAME2)

# Install lintian override files
binary-post-install/%::
	if [ -f debian/$*.lintian ]; then \
	    mkdir -p debian/$*/usr/share/lintian/overrides && \
	    cp -p debian/$*.lintian debian/$*/usr/share/lintian/overrides/$*; \
	fi