File: rules

package info (click to toggle)
expat 2.0.1-7%2Bsqueeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 3,212 kB
  • ctags: 2,792
  • sloc: sh: 26,083; ansic: 15,887; cpp: 364; makefile: 350; xml: 263
file content (124 lines) | stat: -rwxr-xr-x 3,846 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
#!/usr/bin/make -f
## ----------------------------------------------------------------------
## debian/rules : package script for expat
## ----------------------------------------------------------------------

## uncomment this to turn on verbose mode
#export DH_VERBOSE=1

include /usr/share/dpatch/dpatch.make

DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_ARCH      ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

BUILD64 = $(filter $(DEB_HOST_ARCH), i386 powerpc sparc s390)

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	CONFFLAGS = --build=$(DEB_HOST_GNU_TYPE)
else
	CONFFLAGS = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
endif

ifeq ($(DEB_HOST_ARCH),i386)
	HOST64FLAG = --host=x86_64-linux-gnu
endif
ifeq ($(DEB_HOST_ARCH),powerpc)
	HOST64FLAG = --host=ppc64-linux-gnu
endif
ifeq ($(DEB_HOST_ARCH),sparc)
	HOST64FLAG = --host=sparc64-linux-gnu
endif
ifeq ($(DEB_HOST_ARCH),s390)
	HOST64FLAG = --host=s390x-linux-gnu
endif

# -pthread -D_REENTRANT #551079
CFLAGS  = -Wall -g
LDFLAGS = -Wl,-Bsymbolic-functions
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

UPACKAGE = $(shell dh_listpackages | grep -- -udeb$$)

build/config.status: configure
	dh_testdir
	(mkdir -p $(@D); cd $(@D); CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
	 ../configure $(CONFFLAGS) --prefix=/usr --mandir=\$${prefix}/share/man)

buildw/config.status: configure
	dh_testdir
	(mkdir -p $(@D); cd $(@D); CFLAGS="$(CFLAGS) -DXML_UNICODE" LDFLAGS="$(LDFLAGS)" \
	 ../configure $(CONFFLAGS) --prefix=/usr --mandir=\$${prefix}/share/man)

build64/config.status: configure
	dh_testdir
	(mkdir -p $(@D); cd $(@D); CFLAGS="-m64 $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
	 ../configure $(CONFFLAGS) $(HOST64FLAG) --prefix=/usr --mandir=\$${prefix}/share/man \
	 --libdir=\$${prefix}/lib64)

buildw64/config.status: configure
	dh_testdir
	(mkdir -p $(@D); cd $(@D); CFLAGS="-m64 $(CFLAGS) -DXML_UNICODE" LDFLAGS="$(LDFLAGS)" \
	 ../configure $(CONFFLAGS) $(HOST64FLAG) --prefix=/usr --mandir=\$${prefix}/share/man \
	 --libdir=\$${prefix}/lib64)

clean: 
	dh_testdir
	dh_testroot
	rm -rf build/ build64/ buildw/ buildw64/
	rm -rf debian/tmp/
	dh_clean build-stamp patch-stamp debian/xmlwf.1

build: build-stamp
build-stamp: patch-stamp build/config.status buildw/config.status $(if $(BUILD64), build64/config.status buildw64/config.status)
	dh_testdir
	$(MAKE) -C build/
	$(MAKE) -C buildw/ buildlib LIBRARY=libexpatw.la
ifneq ($(BUILD64),)
	$(MAKE) -C build64/ buildlib
	$(MAKE) -C buildw64/ buildlib LIBRARY=libexpatw.la
endif
	docbook-to-man doc/xmlwf.sgml > debian/xmlwf.1
	touch $@

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	$(MAKE) -C build/ install DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C buildw/ installlib LIBRARY=libexpatw.la DESTDIR=$(CURDIR)/debian/tmp APIHEADER=
ifneq ($(BUILD64),)
	$(MAKE) -C build64/ installlib DESTDIR=$(CURDIR)/debian/tmp
	$(MAKE) -C buildw64/ installlib LIBRARY=libexpatw.la DESTDIR=$(CURDIR)/debian/tmp APIHEADER=
endif

binary-indep: build install
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install -s --sourcedir=debian/tmp
	dh_installdocs -s
	dh_installman -pexpat debian/xmlwf.1
	dh_installexamples -s
	dh_installchangelogs -s Changes
	dh_link -s
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
	chmod 644 $(CURDIR)/debian/libexpat1-dev/usr/share/doc/libexpat1-dev/examples/* \
	          $(CURDIR)/debian/libexpat1-dev/usr/share/aclocal/*
	dh_makeshlibs -s -V --add-udeb=$(UPACKAGE)
	dh_installdeb -s
	dh_shlibdeps -s -l $(CURDIR)/debian/libexpat1/usr/lib:$(CURDIR)/debian/lib64expat1/usr/lib64
	dh_gencontrol -s
	dh_md5sums -s
	dh_builddeb -s

binary: binary-indep binary-arch

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