2 ## ----------------------------------------------------------------------
3 ## debian/rules : package script for expat
4 ## ----------------------------------------------------------------------
6 ## uncomment this to turn on verbose mode
9 include /usr/share/dpatch/dpatch.make
11 DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
15 BUILD64 = $(filter $(DEB_HOST_ARCH), powerpc sparc s390)
17 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
18 CONFFLAGS = --build=$(DEB_HOST_GNU_TYPE)
20 CONFFLAGS = --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
23 ifeq ($(DEB_HOST_ARCH),i386)
24 HOST64FLAG = --host=x86_64-linux-gnu
26 ifeq ($(DEB_HOST_ARCH),powerpc)
27 HOST64FLAG = --host=ppc64-linux-gnu
29 ifeq ($(DEB_HOST_ARCH),sparc)
30 HOST64FLAG = --host=sparc64-linux-gnu
32 ifeq ($(DEB_HOST_ARCH),s390)
33 HOST64FLAG = --host=s390x-linux-gnu
36 # -pthread -D_REENTRANT #551079
38 LDFLAGS = -Wl,-Bsymbolic-functions
39 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
45 UPACKAGE = $(shell dh_listpackages | grep -- -udeb$$)
47 build/config.status: configure
49 (mkdir -p $(@D); cd $(@D); CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
50 ../configure $(CONFFLAGS) --prefix=/usr --mandir=\$${prefix}/share/man)
52 buildw/config.status: configure
54 (mkdir -p $(@D); cd $(@D); CFLAGS="$(CFLAGS) -DXML_UNICODE" LDFLAGS="$(LDFLAGS)" \
55 ../configure $(CONFFLAGS) --prefix=/usr --mandir=\$${prefix}/share/man)
57 build64/config.status: configure
59 (mkdir -p $(@D); cd $(@D); CFLAGS="-m64 $(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
60 ../configure $(CONFFLAGS) $(HOST64FLAG) --prefix=/usr --mandir=\$${prefix}/share/man \
61 --libdir=\$${prefix}/lib64)
63 buildw64/config.status: configure
65 (mkdir -p $(@D); cd $(@D); CFLAGS="-m64 $(CFLAGS) -DXML_UNICODE" LDFLAGS="$(LDFLAGS)" \
66 ../configure $(CONFFLAGS) $(HOST64FLAG) --prefix=/usr --mandir=\$${prefix}/share/man \
67 --libdir=\$${prefix}/lib64)
72 rm -rf build/ build64/ buildw/ buildw64/
74 dh_clean build-stamp patch-stamp debian/xmlwf.1
77 build-stamp: patch-stamp build/config.status buildw/config.status $(if $(BUILD64), build64/config.status buildw64/config.status)
80 $(MAKE) -C buildw/ buildlib LIBRARY=libexpatw.la
82 $(MAKE) -C build64/ buildlib
83 $(MAKE) -C buildw64/ buildlib LIBRARY=libexpatw.la
85 docbook-to-man doc/xmlwf.sgml > debian/xmlwf.1
93 $(MAKE) -C build/ install DESTDIR=$(CURDIR)/debian/tmp
94 $(MAKE) -C buildw/ installlib LIBRARY=libexpatw.la DESTDIR=$(CURDIR)/debian/tmp APIHEADER=
96 $(MAKE) -C build64/ installlib DESTDIR=$(CURDIR)/debian/tmp
97 $(MAKE) -C buildw64/ installlib LIBRARY=libexpatw.la DESTDIR=$(CURDIR)/debian/tmp APIHEADER=
100 binary-indep: build install
101 binary-arch: build install
104 dh_install -s --sourcedir=debian/tmp
106 dh_installman -pexpat debian/xmlwf.1
107 dh_installexamples -s
108 dh_installchangelogs -s Changes
113 chmod 644 $(CURDIR)/debian/libexpat1-dev/usr/share/doc/libexpat1-dev/examples/* \
114 $(CURDIR)/debian/libexpat1-dev/usr/share/aclocal/*
115 dh_makeshlibs -s -V --add-udeb=$(UPACKAGE)
117 dh_shlibdeps -s -l $(CURDIR)/debian/libexpat1/usr/lib:$(CURDIR)/debian/lib64expat1/usr/lib64
122 binary: binary-indep binary-arch
124 .PHONY: clean build install binary-indep binary-arch binary