~ubuntu-branches/ubuntu/karmic/libxslt/karmic

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-11-10 21:24:02 UTC
  • Revision ID: james.westby@ubuntu.com-20051110212402-c1ghkka0v0hn4k35
Tags: 1.1.15-1ubuntu1
* Resynchronize with Debian:
  - drop support for Python 2.2 and 2.3.
  - keep libxslt1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
## ----------------------------------------------------------------------
 
3
## debian/rules : package script for libxslt
 
4
## ----------------------------------------------------------------------
 
5
 
 
6
## ----------------------------------------------------------------------
 
7
## uncomment this to turn on verbose mode
 
8
#export DH_VERBOSE=1
 
9
 
 
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))))
 
12
 
 
13
WORKAROUND_REMOVED_FILES=libexslt/exsltconfig.h libxslt/xsltconfig.h libxslt/xsltwin32config.h libxslt.spec
 
14
WORKAROUND_MODIFIED_FILES=python/libxslt-py.c
 
15
 
 
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)
 
19
 
 
20
## ----------------------------------------------------------------------
 
21
CONFFLAGS =
 
22
ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 
23
        CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
 
24
else
 
25
        CONFFLAGS += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
 
26
endif
 
27
 
 
28
## ----------------------------------------------------------------------
 
29
CFLAGS = -Wall -g
 
30
 
 
31
## ----------------------------------------------------------------------
 
32
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 
33
        CFLAGS += -O0
 
34
else
 
35
        CFLAGS += -O2
 
36
endif
 
37
 
 
38
## ----------------------------------------------------------------------
 
39
TMP_DIR = debian/tmp
 
40
 
 
41
## ----------------------------------------------------------------------
 
42
## targets
 
43
 
 
44
configure: configure-stamp
 
45
configure-stamp:
 
46
        dh_testdir
 
47
 
 
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; \
 
51
        done
 
52
 
 
53
        # ./configure
 
54
        CFLAGS="$(CFLAGS)" \
 
55
        ./configure $(CONFFLAGS) --prefix=/usr
 
56
 
 
57
        touch configure-stamp
 
58
 
 
59
build: build-stamp
 
60
build-stamp: configure-stamp
 
61
        dh_testdir
 
62
 
 
63
        mv python/Makefile python/Makefile.bak
 
64
        echo all: > python/Makefile
 
65
        # Build libxslt
 
66
        $(MAKE)
 
67
        mv python/Makefile.bak python/Makefile
 
68
 
 
69
        touch build-stamp 
 
70
 
 
71
clean:
 
72
        dh_testdir
 
73
        dh_testroot
 
74
        rm -f build-stamp configure-stamp install*-stamp
 
75
        rm -f debian/python*.examples debian/python*.install
 
76
 
 
77
        -$(MAKE) distclean
 
78
        
 
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}; \
 
83
        done
 
84
 
 
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
 
89
 
 
90
        dh_clean -X.orig
 
91
 
 
92
install: install-stamp install-python-stamp
 
93
install-stamp: build-stamp
 
94
        dh_testdir
 
95
        dh_testroot
 
96
        dh_clean -k -X.orig
 
97
        dh_installdirs
 
98
 
 
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
 
103
 
 
104
        # Properly install documentation in /usr/share/doc/libxslt1-dev
 
105
        install -d debian/tmp/usr/share/doc/libxslt1-dev/EXSLT
 
106
        install -m 644 \
 
107
                doc/*.html \
 
108
                doc/*.gif \
 
109
                doc/libxslt-*.xml debian/tmp/usr/share/doc/libxslt1-dev
 
110
        install -m 644 \
 
111
                doc/EXSLT/*.html \
 
112
                doc/EXSLT/libexslt-*.xml debian/tmp/usr/share/doc/libxslt1-dev
 
113
        cp -a \
 
114
                doc/html \
 
115
                doc/tutorial \
 
116
                doc/tutorial2 debian/tmp/usr/share/doc/libxslt1-dev
 
117
        cp -a \
 
118
                doc/EXSLT/html debian/tmp/usr/share/doc/libxslt1-dev/EXSLT
 
119
 
 
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}; \
 
125
        done
 
126
 
 
127
build-python%-stamp: build-stamp
 
128
        cd python && $(MAKE) clean && $(MAKE) PYTHON=/usr/bin/python$* PYTHON_VERSION=$* PYTHON_INCLUDES=/usr/include/python$*
 
129
        
 
130
        touch $@
 
131
 
 
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
 
135
 
 
136
        sed s/PYVERS/$*/ debian/python-libxslt1.install.in > debian/python$*-libxslt1.install
 
137
        cp debian/python-libxslt1.examples.in debian/python$*-libxslt1.examples
 
138
 
 
139
        touch $@
 
140
 
 
141
install-python-stamp: $(PYVERS:%=install-python%-stamp)
 
142
        touch $@
 
143
 
 
144
binary-indep:
 
145
        dh_testdir
 
146
        dh_testroot
 
147
        dh_installdocs -i
 
148
        dh_installchangelogs -i
 
149
        dh_python -i
 
150
        dh_gencontrol -i
 
151
        dh_md5sums -i
 
152
        dh_builddeb -i
 
153
 
 
154
binary-arch: build install
 
155
        dh_testdir
 
156
        dh_testroot
 
157
        dh_install -a --sourcedir=$(TMP_DIR)
 
158
        dh_installman -a
 
159
        dh_installdocs -a -A AUTHORS FEATURES NEWS README TODO
 
160
        dh_installexamples -a
 
161
        dh_installchangelogs -a ChangeLog
 
162
        dh_python -a
 
163
        dh_link -a
 
164
        dh_strip -a
 
165
        dh_compress -a -Xexamples/
 
166
        dh_fixperms -a
 
167
        dh_makeshlibs -a -V
 
168
        dh_installdeb -a
 
169
        dh_shlibdeps -L libxslt1.1 -l $(PWD)/debian/libxslt1.1/usr/lib
 
170
        dh_shlibdeps -L libxslt1 -l $(PWD)/debian/libxslt1/usr/lib
 
171
        dh_gencontrol -a
 
172
        dh_md5sums -a
 
173
        dh_builddeb -a
 
174
 
 
175
source diff:
 
176
        @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
177
 
 
178
binary: binary-indep binary-arch
 
179
.PHONY: clean build install binary-indep binary-arch binary configure