2
## ----------------------------------------------------------------------
3
## debian/rules : package script for libxslt
4
## ----------------------------------------------------------------------
6
## ----------------------------------------------------------------------
7
## uncomment this to turn on verbose mode
10
# The versions of python currently supported
11
PYVERS=$(subst -dev,,$(subst python,,$(filter python%-dev,$(shell sed -n '/^Build-Depends/s/,//gp' debian/control))))
13
WORKAROUND_REMOVED_FILES=libexslt/exsltconfig.h libxslt/xsltconfig.h libxslt/xsltwin32config.h libxslt.spec
14
WORKAROUND_MODIFIED_FILES=python/libxslt-py.c
16
## ----------------------------------------------------------------------
17
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
20
## ----------------------------------------------------------------------
22
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
23
CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
25
CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
28
## ----------------------------------------------------------------------
31
## ----------------------------------------------------------------------
32
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
38
## ----------------------------------------------------------------------
41
## ----------------------------------------------------------------------
44
configure: configure-stamp
48
# Workaround backups because of non-idempotent upstream:
49
for file in $(WORKAROUND_REMOVED_FILES) $(WORKAROUND_MODIFIED_FILES); do \
50
cp -f -a $${file} $${file}-tmp; \
55
./configure $(CONFFLAGS) --prefix=/usr
60
build-stamp: configure-stamp
63
mv python/Makefile python/Makefile.bak
64
echo all: > python/Makefile
67
mv python/Makefile.bak python/Makefile
74
rm -f build-stamp configure-stamp install*-stamp
75
rm -f debian/python*.examples debian/python*.install
79
# Restore workaround backups of removed and modified files
80
-for file in $(WORKAROUND_REMOVED_FILES) $(WORKAROUND_MODIFIED_FILES); do \
81
test -r $${file}-tmp && \
82
mv -f $${file}-tmp $${file}; \
85
-test -r /usr/share/misc/config.sub && \
86
cp -f /usr/share/misc/config.sub config.sub
87
-test -r /usr/share/misc/config.guess && \
88
cp -f /usr/share/misc/config.guess config.guess
92
install: install-stamp install-python-stamp
93
install-stamp: build-stamp
99
mv -f python/Makefile python/Makefile.bak
100
echo install: > python/Makefile
101
$(MAKE) DESTDIR=$(PWD)/$(TMP_DIR) install
102
mv -f python/Makefile.bak python/Makefile
104
# Properly install documentation in /usr/share/doc/libxslt1-dev
105
install -d debian/tmp/usr/share/doc/libxslt1-dev/EXSLT
109
doc/libxslt-*.xml debian/tmp/usr/share/doc/libxslt1-dev
112
doc/EXSLT/libexslt-*.xml debian/tmp/usr/share/doc/libxslt1-dev
116
doc/tutorial2 debian/tmp/usr/share/doc/libxslt1-dev
118
doc/EXSLT/html debian/tmp/usr/share/doc/libxslt1-dev/EXSLT
120
# Special workaround for svn-buildpackage:
121
# Restore workaround backups of modified files.
122
-for file in $(WORKAROUND_MODIFIED_FILES); do \
123
test -r $${file}-tmp && \
124
cat $${file}-tmp > $${file}; \
127
build-python%-stamp: build-stamp
128
cd python && $(MAKE) clean && $(MAKE) PYTHON=/usr/bin/python$* PYTHON_VERSION=$* PYTHON_INCLUDES=/usr/include/python$*
132
install-python%-stamp: build-python%-stamp
133
rm build-python$*-stamp
134
cd python && $(MAKE) DESTDIR=`pwd`/../debian/tmp PYTHON=/usr/bin/python$* PYTHON_VERSION=$* PYTHON_INCLUDES=/usr/include/python$* install
136
sed s/PYVERS/$*/ debian/python-libxslt1.install.in > debian/python$*-libxslt1.install
137
cp debian/python-libxslt1.examples.in debian/python$*-libxslt1.examples
141
install-python-stamp: $(PYVERS:%=install-python%-stamp)
148
dh_installchangelogs -i
154
binary-arch: build install
157
dh_install -a --sourcedir=$(TMP_DIR)
159
dh_installdocs -a -A AUTHORS FEATURES NEWS README TODO
160
dh_installexamples -a
161
dh_installchangelogs -a ChangeLog
165
dh_compress -a -Xexamples/
169
dh_shlibdeps -L libxslt1.1 -l $(PWD)/debian/libxslt1.1/usr/lib
170
dh_shlibdeps -L libxslt1 -l $(PWD)/debian/libxslt1/usr/lib
176
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
178
binary: binary-indep binary-arch
179
.PHONY: clean build install binary-indep binary-arch binary configure