~ubuntu-branches/ubuntu/gutsy/libcgi-ssi-perl/gutsy

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Roszatycki
  • Date: 2004-08-09 11:16:17 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040809111617-c9bqf155kt13rt4w
Tags: 0.53-5
Remove Origin field and make lintian happy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /usr/bin/make -f
 
1
#!/usr/bin/make -f
2
2
# Generated automatically from debian/packages
3
 
# by yada v0.9.9, of Tue, 07 Dec 1999
4
 
# Modified by Piotr Roszatycki <dexter@debian.org>, Mon,  1 Oct 2001 13:14:11 +0200
5
 
 
6
 
DEB_HOST_GNU_CPU    := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
7
 
DEB_HOST_GNU_TYPE   := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
8
 
DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
9
 
 
 
3
# by yada v0.30, of Fri,  6 Aug 2004
 
4
 
 
5
DEB_HOST_ARCH        := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
6
DEB_HOST_GNU_CPU     := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
 
7
DEB_HOST_GNU_TYPE    := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
8
DEB_HOST_GNU_SYSTEM  := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
 
9
 
 
10
DEB_BUILD_ARCH       := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
10
11
DEB_BUILD_GNU_CPU    := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
11
12
DEB_BUILD_GNU_TYPE   := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
12
13
DEB_BUILD_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
19
20
default:
20
21
        @echo "Specify a target:"; \
21
22
        echo " build              compile the package"; \
 
23
        echo " build-arch         compile the architecture-dependent package"; \
 
24
        echo " build-indep        compile the architecture-independent package"; \
22
25
        echo " binary             make all binary packages"; \
23
26
        echo " binary-arch        make all architecture-dependent binary packages"; \
24
27
        echo " binary-indep       make all architecture-independent binary packages"; \
25
28
        echo " clean              clean up the source package"; \
26
29
        echo; \
27
 
        echo " depends            check build-time dependencies"; \
28
 
        echo " install-tree       compile the package and create the install trees"; \
29
30
        echo " clean-install-tree clean up only under debian/"; \
30
31
        echo
31
32
 
32
 
# Check build dependencies and conflicts
33
 
 
34
 
.PHONY: depends
35
 
depends: chmod-yada debian/depends-stamp
36
 
debian/depends-stamp:
37
 
        @echo 'Checking build conflicts and dependencies; just a minute...'
38
 
        @echo -n 'grep-dctrl...'; v=$$(grep-status -X -F Package 'grep-dctrl' | grep Version | head -1 | sed -e 's/^Version: //'); \
39
 
        if test ! "$$v"; then echo -n 'grep-dctrl (virtual package)...'; v=$$(grep-status -e -F Provides '(^grep-dctrl, |, grep-dctrl$$|^grep-dctrl$$)' | grep Version | head -1 | sed -e 's/^Version: //'); fi; \
40
 
        if test "$$v"; then \
41
 
            exit 0; \
42
 
        fi; \
43
 
        echo 'Build depends on `grep-dctrl'\'' (any version), which is not satisfied' | fmt; exit 1
44
 
        @echo -n 'yada...'; v=$$(grep-status -X -F Package 'yada' | grep Version | head -1 | sed -e 's/^Version: //'); \
45
 
        if test ! "$$v"; then echo -n 'yada (virtual package)...'; v=$$(grep-status -e -F Provides '(^yada, |, yada$$|^yada$$)' | grep Version | head -1 | sed -e 's/^Version: //'); fi; \
46
 
        if test "$$v"; then \
47
 
          if dpkg --compare-versions "$$v" '>=' '0.9.9'; then \
48
 
            exit 0; \
49
 
          fi; \
50
 
        fi; \
51
 
        echo 'Build depends on `yada'\'' (version >= 0.9.9), which is not satisfied' | fmt; exit 1
52
 
        @echo
53
 
        @echo 'Conflicts and dependencies all satisfied!'
54
 
        touch debian/depends-stamp
55
 
 
56
33
# Build the package and prepare the install tree
57
34
 
58
35
.PHONY: build-only build
59
36
build-only: debian/build-stamp
60
 
build: chmod-yada build-only
 
37
build: build-only
 
38
 
 
39
.PHONY: build-arch-only build-arch
 
40
build-arch-only: debian/build-arch-stamp
 
41
build-arch: build-arch-only
 
42
 
 
43
.PHONY: build-indep-only build-indep
 
44
build-indep-only: debian/build-indep-stamp
 
45
build-indep: build-indep-only
61
46
 
62
47
# Make sure these rules and the control file are up-to-date
63
48
 
64
 
.PHONY: rules control
 
49
.PHONY: rules control templates
65
50
rules: debian/rules
66
 
debian/rules: $(shell which yada) debian/packages
67
 
        $(shell which yada) rebuild rules
 
51
debian/rules: $(shell which yada) debian/packages-tmp
 
52
        yada rebuild rules
68
53
 
69
54
control: debian/control
70
 
debian/control: $(shell which yada) debian/packages
71
 
        $(shell which yada) rebuild control
72
 
 
73
 
debian/build-stamp: debian/depends-stamp
 
55
debian/control: $(shell which yada) debian/packages-tmp
 
56
        yada rebuild control
 
57
 
 
58
templates: debian/templates
 
59
debian/templates: $(shell which yada) debian/packages-tmp
 
60
        yada rebuild templates
 
61
 
 
62
debian/build-stamp: debian/build-arch-stamp debian/build-indep-stamp
74
63
        @[ -f $(shell which yada) -a -f debian/rules ]
75
64
        @umask 022 \
76
 
            && export PACKAGE="libcgi-ssi-perl" \
77
 
            && export VERSION="$(VERSION)" \
78
 
            && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
79
 
            && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
80
 
            && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
81
 
            && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
82
 
            && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
83
 
            && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" \
84
 
 && (\
 
65
          && export pwd="$$(pwd)" \
 
66
          && export TMPROOT="$$(pwd)/debian/tmp" \
 
67
          && export SOURCE="libcgi-ssi-perl" \
 
68
          && export VERSION="$(VERSION)" \
 
69
          && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
 
70
          && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
 
71
          && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
 
72
          && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
 
73
          && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
 
74
          && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" && (\
85
75
        echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
86
 
        echo -E 'CC=gcc';\
87
 
        echo -E 'CFLAGS="-O2 -Wall"';\
88
 
        echo -E 'LDFLAGS=';\
89
 
        echo -E 'if [ "$${DEB_BUILD_OPTIONS#*debug}" != "$$DEB_BUILD_OPTIONS" ]; then';\
90
 
        echo -E '    CFLAGS="$$CFLAGS -g"';\
 
76
        echo -E 'CC=$${CC:-gcc}';\
 
77
        echo -E 'CFLAGS=$${CFLAGS:--Wall -g}';\
 
78
        echo -E 'if [ "$${DEB_BUILD_OPTIONS#*noopt}" != "$$DEB_BUILD_OPTIONS" ]; then';\
 
79
        echo -E '    CFLAGS="$$CFLAGS -O0"';\
 
80
        echo -E 'else';\
 
81
        echo -E '    CFLAGS="$$CFLAGS -O2"';\
91
82
        echo -E 'fi';\
92
83
        echo -E 'PERL=$${PERL:-/usr/bin/perl}';\
93
 
        echo -E 'version=$$($$PERL -e '\''printf "%.3f", $$]'\'')';\
94
 
        echo -E 'if dpkg --compare-versions "$$version" lt "5.006"; then';\
95
 
        echo -E '    # potato';\
96
 
        echo -E '    $$PERL Makefile.PL';\
97
 
        echo -E '    make CFLAGS="$$CFLAGS" LDFLAGS="$$LDFLAGS" CC="$$CC"';\
98
 
        echo -E 'else';\
99
 
        echo -E '    # sid';\
100
 
        echo -E '    $$PERL Makefile.PL INSTALLDIRS=vendor # sid';\
101
 
        echo -E '    make OPTIMIZE="$$CFLAGS" CC="$$CC"';\
102
 
        echo -E 'fi') | /bin/sh
 
84
        echo -E '$$PERL Makefile.PL INSTALLDIRS=vendor';\
 
85
        echo -E 'make CC="$$CC" OPTIMIZE="$$CFLAGS"';\
 
86
        echo -E 'make test') | /bin/sh
103
87
        touch debian/build-stamp
104
88
 
 
89
debian/build-arch-stamp:
 
90
        @[ -f $(shell which yada) -a -f debian/rules ]
 
91
        touch debian/build-arch-stamp
 
92
 
 
93
debian/build-indep-stamp:
 
94
        @[ -f $(shell which yada) -a -f debian/rules ]
 
95
        touch debian/build-indep-stamp
 
96
 
105
97
.PHONY: install-tree
106
 
install-tree: chmod-yada install-tree-any
 
98
install-tree: install-tree-any
107
99
install-tree-any: \
108
100
        debian/tmp-libcgi-ssi-perl/DEBIAN/control
109
101
 
111
103
        rm -rf debian/tmp-libcgi-ssi-perl
112
104
        umask 022 && install -d debian/tmp-libcgi-ssi-perl/DEBIAN
113
105
        install -d debian/tmp-libcgi-ssi-perl/usr/share/doc/libcgi-ssi-perl
114
 
        umask 022; $(shell which yada) generate copyright \
115
 
                               >debian/tmp-libcgi-ssi-perl/usr/share/doc/libcgi-ssi-perl/copyright
 
106
        umask 022; yada generate copyright \
 
107
          > debian/tmp-libcgi-ssi-perl/usr/share/doc/libcgi-ssi-perl/copyright
116
108
        install -m 644 -p debian/changelog \
117
 
                          debian/tmp-libcgi-ssi-perl/usr/share/doc/libcgi-ssi-perl/changelog.Debian
 
109
          debian/tmp-libcgi-ssi-perl/usr/share/doc/libcgi-ssi-perl/changelog.Debian
118
110
        @umask 022 \
119
 
            && export PACKAGE="libcgi-ssi-perl" \
120
 
            && export ROOT="$$(pwd)/debian/tmp-libcgi-ssi-perl" \
121
 
            && export CONTROL="$$(pwd)/debian/tmp-libcgi-ssi-perl/DEBIAN" \
122
 
            && export VERSION="$(VERSION)" \
123
 
            && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
124
 
            && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
125
 
            && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
126
 
            && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
127
 
            && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
128
 
            && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" \
129
 
 && (\
 
111
          && export pwd="$$(pwd)" \
 
112
          && export ROOT="$$(pwd)/debian/tmp-libcgi-ssi-perl" \
 
113
          && export TMPROOT="$$(pwd)/debian/tmp" \
 
114
          && export CONTROL="$$(pwd)/debian/tmp-libcgi-ssi-perl/DEBIAN" \
 
115
          && export PACKAGE="libcgi-ssi-perl" \
 
116
          && export SOURCE="libcgi-ssi-perl" \
 
117
          && export VERSION="$(VERSION)" \
 
118
          && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
 
119
          && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
 
120
          && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
 
121
          && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
 
122
          && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
 
123
          && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" && (\
130
124
        echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
131
125
        echo -E 'PERL=$${PERL:-/usr/bin/perl}';\
132
 
        echo -E 'version=$$($$PERL -e '\''printf "%.3f", $$]'\'')';\
133
 
        echo -E 'if dpkg --compare-versions "$$version" lt "5.006"; then';\
134
 
        echo -E '    # potato';\
135
 
        echo -E '    archlib=$$($$PERL -MConfig -e '\''print $$Config{installarchlib}'\'')';\
136
 
        echo -E '    config="INSTALLDIRS=perl INSTALLMAN1DIR=$$ROOT/usr/share/man/man1 INSTALLMAN3DIR=$$ROOT/usr/share/man/man3 INSTALLPRIVLIB=$$ROOT/usr/lib/perl5 INSTALLARCHLIB=$$ROOT$$archlib"';\
137
 
        echo -E '    make pure_install $$config';\
138
 
        echo -E 'else';\
139
 
        echo -E '    # sid';\
140
 
        echo -E '    make install PREFIX=$$ROOT/usr';\
141
 
        echo -E 'fi';\
 
126
        echo -E 'make install PREFIX=$$ROOT/usr';\
142
127
        echo -E 'yada install -doc README';\
143
 
        echo -E 'yada install -doc -as changelog Changes';\
 
128
        echo -E 'yada install -doc -as changelog Changes') | /bin/sh
 
129
        @umask 022 \
 
130
          && export pwd="$$(pwd)" \
 
131
          && export ROOT="$$(pwd)/debian/tmp-libcgi-ssi-perl" \
 
132
          && export TMPROOT="$$(pwd)/debian/tmp" \
 
133
          && export CONTROL="$$(pwd)/debian/tmp-libcgi-ssi-perl/DEBIAN" \
 
134
          && export PACKAGE="libcgi-ssi-perl" \
 
135
          && export SOURCE="libcgi-ssi-perl" \
 
136
          && export VERSION="$(VERSION)" && (\
 
137
        echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
 
138
        echo -E 'yada perl';\
 
139
        echo -E 'yada python';\
144
140
        echo -E 'yada strip';\
145
 
        echo -E 'yada perl';\
146
 
        echo -E 'yada dpkg-shlibdeps') | /bin/sh
147
 
        $(shell which yada) compress libcgi-ssi-perl
148
 
        $(shell which yada) generate maintscripts libcgi-ssi-perl
 
141
        echo -E 'yada shlibdeps') | /bin/sh
 
142
        yada compress libcgi-ssi-perl
 
143
        yada generate maintscripts libcgi-ssi-perl
149
144
        find debian/tmp-libcgi-ssi-perl -type f -print \
150
145
          | sed -n 's/^debian\/tmp-libcgi-ssi-perl\(\/etc\/.*\)$$/\1/p' \
151
 
            > debian/tmp-libcgi-ssi-perl/DEBIAN/conffiles
 
146
          > debian/tmp-libcgi-ssi-perl/DEBIAN/conffiles
152
147
        if test ! -s debian/tmp-libcgi-ssi-perl/DEBIAN/conffiles; then rm -f debian/tmp-libcgi-ssi-perl/DEBIAN/conffiles; fi
153
 
        $(shell which yada) rebuild control
154
 
        $(shell which yada) generate substvars libcgi-ssi-perl
 
148
        yada rebuild control
 
149
        yada generate substvars libcgi-ssi-perl
155
150
        umask 022 && dpkg-gencontrol -isp -plibcgi-ssi-perl -Pdebian/tmp-libcgi-ssi-perl
156
151
 
157
152
# Build package files
158
153
 
159
154
.PHONY: binary binary-arch binary-indep
160
155
binary: binary-arch binary-indep
161
 
binary-arch: chmod-yada binary-arch-any
 
156
binary-arch: binary-arch-any
162
157
 
163
158
.PHONY: binary-arch-any
164
159
binary-arch-any:
165
 
binary-indep: chmod-yada \
 
160
binary-indep: \
166
161
        binary-package-libcgi-ssi-perl
167
162
 
168
163
.PHONY: binary-package-libcgi-ssi-perl
179
174
check-root:
180
175
        @[ `id -u` = 0 ] || (echo "You must be root to do this!"; false)
181
176
 
182
 
.PHONY: chmod-yada
183
 
chmod-yada:
184
 
        @if [ -f debian/yada -a ! -x debian/yada ]; then \
185
 
          chmod +x debian/yada; \
186
 
        fi
 
177
debian/packages-tmp: debian/packages 
 
178
        yada rebuild packages
187
179
 
188
 
# Clean up afterwards
 
180
## Clean up afterwards
189
181
 
190
182
.PHONY: clean clean-install-tree clean-build
191
 
clean: chmod-yada clean-install-tree clean-build debian/control debian/rules
 
183
 
 
184
clean: clean-install-tree clean-build debian/control debian/rules
 
185
        rm -f debian/packages-tmp debian/packages-tmp-new debian/packages-tmp-include
192
186
 
193
187
clean-build:
194
188
        @[ -f $(shell which yada) -a -f debian/rules ]
195
 
        rm -f debian/build-stamp debian/depends-stamp
196
 
        @umask 022 && (\
 
189
        rm -f debian/build-stamp debian/build-arch-stamp debian/build-indep-stamp
 
190
        @umask 022 \
 
191
          && export pwd="$$(pwd)" \
 
192
          && export TMPROOT="$$(pwd)/debian/tmp" \
 
193
          && export SOURCE="libcgi-ssi-perl" \
 
194
          && export VERSION="$(VERSION)" \
 
195
          && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
 
196
          && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
 
197
          && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
 
198
          && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
 
199
          && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
 
200
          && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" && (\
197
201
        echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
198
202
        echo -E 'test -f Makefile && touch Makefile && make distclean || true') | /bin/sh
 
203
        yada unpatch
 
204
        rm -rf debian/tmp
199
205
 
200
 
clean-install-tree: chmod-yada debian/rules
 
206
clean-install-tree: debian/rules
201
207
        @[ -f $(shell which yada) -a -f debian/rules ]
202
208
        rm -f debian/install-tree-stamp
203
 
        rm -rf debian/tmp* debian/files* debian/substvars
 
209
        rm -rf debian/tmp-* debian/files* debian/substvars debian/shlibs.local debian/ucf