File: rules

package info (click to toggle)
libnss-db 2.2.3pre1-3
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,268 kB
  • ctags: 575
  • sloc: sh: 6,885; ansic: 4,420; makefile: 471; yacc: 318
file content (333 lines) | stat: -rwxr-xr-x 13,607 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
#!/usr/bin/make -f
# Generated automatically from debian/packages
# by yada v0.54, of Sun, 28 Oct 2007

DEB_HOST_ARCH        := $(shell dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null)
DEB_HOST_ARCH_OS     := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
DEB_HOST_ARCH_CPU    := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
DEB_HOST_GNU_CPU     := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU 2>/dev/null)
DEB_HOST_GNU_TYPE    := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE 2>/dev/null)
DEB_HOST_GNU_SYSTEM  := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM 2>/dev/null)

DEB_BUILD_ARCH       := $(shell dpkg-architecture -qDEB_BUILD_ARCH 2>/dev/null)
DEB_BUILD_ARCH_OS    := $(shell dpkg-architecture -qDEB_BUILD_ARCH_OS 2>/dev/null)
DEB_BUILD_ARCH_CPU   := $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU 2>/dev/null)
DEB_BUILD_GNU_CPU    := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU 2>/dev/null)
DEB_BUILD_GNU_TYPE   := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE 2>/dev/null)
DEB_BUILD_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM 2>/dev/null)

# Take account of old dpkg-architecture output.
ifeq ($(DEB_HOST_ARCH_CPU),)
  DEB_HOST_ARCH_CPU := $(DEB_HOST_GNU_CPU))
  ifeq ($(DEB_HOST_ARCH_CPU),i486)
    DEB_HOST_ARCH_OS := i386
  else
  ifeq ($(DEB_HOST_ARCH_CPU),x86_64)
    DEB_HOST_ARCH_OS := amd64
  endif
  endif
endif
ifeq ($(DEB_HOST_ARCH_OS),)
  DEB_HOST_ARCH_OS := $(subst -gnu,,$(DEB_HOST_GNU_SYSTEM))
  ifeq ($(DEB_HOST_ARCH_OS),gnu)
    DEB_HOST_ARCH_OS := hurd
  endif
endif
ifeq ($(DEB_BUILD_ARCH_CPU),)
  DEB_BUILD_ARCH_CPU := $(DEB_BUILD_GNU_CPU))
  ifeq ($(DEB_BUILD_ARCH_CPU),i486)
    DEB_BUILD_ARCH_OS := i386
  else
  ifeq ($(DEB_BUILD_ARCH_CPU),x86_64)
    DEB_BUILD_ARCH_OS := amd64
  endif
  endif
endif
ifeq ($(DEB_BUILD_ARCH_OS),)
  DEB_BUILD_ARCH_OS := $(subst -gnu,,$(DEB_BUILD_GNU_SYSTEM))
  ifeq ($(DEB_BUILD_ARCH_OS),gnu)
    DEB_BUILD_ARCH_OS := hurd
  endif
endif

LEFT_PARENTHESIS:=(
VERSION:=$(shell head -n1 debian/changelog | sed -e "s/^[0-9a-zA-Z.-]* $(LEFT_PARENTHESIS)//" -e "s/[^0-9a-zA-Z.:+~-].*//")

SHELL=/bin/bash

.PHONY: default
default:
	@echo "Specify a target:"; \
	echo " build              compile the package"; \
	echo " build-arch         compile the architecture-dependent package"; \
	echo " build-indep        compile the architecture-independent package"; \
	echo " binary             make all binary packages"; \
	echo " binary-arch        make all architecture-dependent binary packages"; \
	echo " binary-indep       make all architecture-independent binary packages"; \
	echo " clean              clean up the source package"; \
	echo; \
	echo " clean-install-tree clean up only under debian/"; \
	echo

# Build the package and prepare the install tree

.PHONY: build-only build
build-only: debian/build-stamp
build: build-only

.PHONY: build-arch-only build-arch
build-arch-only: debian/build-arch-stamp
build-arch: build-arch-only

.PHONY: build-indep-only build-indep
build-indep-only: debian/build-indep-stamp
build-indep: build-indep-only

# Make sure these rules and the control file are up-to-date

.PHONY: rules control templates
rules: debian/rules
debian/rules: $(shell which yada) debian/packages-tmp
	yada rebuild rules

control: debian/control
debian/control: $(shell which yada) debian/packages-tmp
	yada rebuild control

templates: debian/templates debian/po/POTFILES.in
debian/templates: $(shell which yada) debian/packages-tmp
	yada rebuild templates
debian/po/POTFILES.in: $(shell which yada) debian/packages-tmp
	yada rebuild templates

debian/build-stamp: debian/build-arch-stamp debian/build-indep-stamp
	@[ -f $(shell which yada) -a -f debian/rules ]
	yada patch "debian/patches/*.patch"
	@umask 022 \
	  && export pwd="$$(pwd)" \
	  && export TMPROOT="$$(pwd)/debian/tmp" \
	  && export SOURCE="libnss-db" \
	  && export VERSION="$(VERSION)" \
	  && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
	  && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
	  && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
	  && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
	  && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
	  && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" && (\
	echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
	echo -E 'CC=$${CC:-gcc}';\
	echo -E 'CFLAGS=$${CFLAGS:--Wall -pedantic -g}';\
	echo -E 'if [ "$${DEB_BUILD_OPTIONS#*noopt}" != "$$DEB_BUILD_OPTIONS" ]; then';\
	echo -E '    CFLAGS="$$CFLAGS -O0"';\
	echo -E 'else';\
	echo -E '    CFLAGS="$$CFLAGS -O2"';\
	echo -E 'fi';\
	echo -E 'if [ "$$DEB_HOST_ARCH_OS" = "linux" ]; then';\
	echo -E '    WITH_SELINUX="--with-selinux"';\
	echo -E 'fi';\
	echo -E '';\
	echo -E 'CPP=`$$CC -print-prog-name=cpp || true`';\
	echo -E 'CPP=$${CPP:-cpp}';\
	echo -E '';\
	echo -E 'VAR_DB=`echo | $$CPP -include paths.h -dD | awk '\''$$1 == "#define" && $$2 == "_PATH_VARDB" { print $$3 }'\'' | tr -d '\''"'\'' || true`';\
	echo -E 'VAR_DB=$${VAR_DB%/}';\
	echo -E 'VAR_DB=$${VAR_DB:-/var/db}';\
	echo -E '';\
	echo -E 'echo $$VAR_DB > VAR_DB';\
	echo -E '';\
	echo -E 'if ! [ -f backup-stamp ]; then';\
	echo -E '    for f in ABOUT-NLS Makefile.am Makefile.in acconfig.h aclocal.m4 config.guess     config.h.in config.sub configure configure.in ltmain.sh mkinstalldirs     src/Makefile.in; do';\
	echo -E '        if ! [ -e $$f.bak ]; then';\
	echo -E '            cp -a $$f $$f.bak';\
	echo -E '        fi';\
	echo -E '    done';\
	echo -E '    sleep 1 && touch backup-stamp';\
	echo -E 'fi';\
	echo -E '';\
	echo -E 'if ! [ gettextize-stamp -nt backup-stamp ]; then';\
	echo -E '    perl -MIPC::Run=start,pump -e '\''';\
	echo -E '        @rs = qw(gettextize --force --copy --no-changelog --intl);';\
	echo -E '        $$h=start \@rs, \$$in, \$$out;';\
	echo -E '        until ($$out =~ /Press Return to acknowledge/) { pump $$h; print "\r$$out"; flush STDOUT; }'\''';\
	echo -E '    rm -f *~ intl/*~ m4/*.in';\
	echo -E '    sleep 1 && touch gettextize-stamp';\
	echo -E 'fi';\
	echo -E '';\
	echo -E 'if ! [ autoconf-stamp -nt gettextize-stamp ]; then';\
	echo -E '    rm -f acconfig.h aclocal.m4 config.h.in configure ltmain.sh';\
	echo -E '    cp po/Makevars.template po/Makevars';\
	echo -E '    perl -MIPC::Run=start -e '\''';\
	echo -E '        @rs = qw(gettextize --force --copy --no-changelog --intl);';\
	echo -E '        $$h=start \@rs, \$$in, \$$out;';\
	echo -E '        until ($$out =~ /Press Return to acknowledge/) { $$h->pump; print "\r$$out"; flush STDOUT; }';\
	echo -E '	 $$h->kill_kill;'\''';\
	echo -E '    rm -f *~ intl/*~ m4/*.in';\
	echo -E '    libtoolize --force --copy';\
	echo -E '    aclocal-1.9 -I m4';\
	echo -E '    autoheader';\
	echo -E '    automake-1.9 --add-missing --copy';\
	echo -E '    autoconf';\
	echo -E '    sleep 1 && touch autoconf-stamp';\
	echo -E 'fi';\
	echo -E '';\
	echo -E 'if ! [ configure-stamp -nt autoconf-stamp ]; then';\
	echo -E '    test -d build || mkdir build';\
	echo -E '    pushd build';\
	echo -E '        CC="$$CC" CFLAGS="$$CFLAGS"';\
	echo -E '            ../configure \';\
	echo -E '                --prefix=/usr \';\
	echo -E '                $$WITH_SELINUX';\
	echo -E '    popd';\
	echo -E '    sleep 1 && touch configure-stamp';\
	echo -E 'fi';\
	echo -E '';\
	echo -E 'if ! [ build-stamp -nt configure-stamp ]; then';\
	echo -E '    pushd build';\
	echo -E '        make';\
	echo -E '        if ! [ makedb.1 -nt debian/man/makedb.pod ]; then';\
	echo -E '            pod2man --center="Debian GNU/Linux" --release="Debian" ../debian/man/makedb.pod makedb.1';\
	echo -E '        fi';\
	echo -E '        if ! [ libnss-db.default -nt debian/conf/default ]; then';\
	echo -E '            sed '\''s|@VAR_DB@|'\''"$$VAR_DB"'\''|g'\'' ../debian/conf/default > libnss-db.default.new';\
	echo -E '        mv -f libnss-db.default.new libnss-db.default';\
	echo -E '        fi';\
	echo -E '    popd';\
	echo -E '    sleep 1 && touch build-stamp';\
	echo -E 'fi') | /bin/bash
	touch debian/build-stamp

debian/build-arch-stamp:
	@[ -f $(shell which yada) -a -f debian/rules ]
	yada patch "debian/patches/*.patch"
	touch debian/build-arch-stamp

debian/build-indep-stamp: debian/build-arch-stamp
	@[ -f $(shell which yada) -a -f debian/rules ]
	yada patch "debian/patches/*.patch"
	touch debian/build-indep-stamp

.PHONY: install-tree
install-tree: install-tree-any
install-tree-any: \
	debian/tmp-libnss-db/DEBIAN/control

debian/tmp-libnss-db/DEBIAN/control: debian/build-stamp debian/control
	rm -rf debian/tmp-libnss-db
	umask 022 && install -d debian/tmp-libnss-db/DEBIAN
	install -d debian/tmp-libnss-db/usr/share/doc/libnss-db
	umask 022; yada generate copyright libnss-db \
	  > debian/tmp-libnss-db/usr/share/doc/libnss-db/copyright
	install -m 644 -p debian/changelog \
	  debian/tmp-libnss-db/usr/share/doc/libnss-db/changelog.Debian
	@umask 022 \
	  && export pwd="$$(pwd)" \
	  && export ROOT="$$(pwd)/debian/tmp-libnss-db" \
	  && export TMPROOT="$$(pwd)/debian/tmp" \
	  && export CONTROL="$$(pwd)/debian/tmp-libnss-db/DEBIAN" \
	  && export PACKAGE="libnss-db" \
	  && export SOURCE="libnss-db" \
	  && export VERSION="$(VERSION)" \
	  && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
	  && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
	  && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
	  && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
	  && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
	  && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" && (\
	echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
	echo -E 'VAR_DB=$$(cat VAR_DB)';\
	echo -E 'pushd build';\
	echo -E '    make install DESTDIR=$$ROOT slibdir=/usr/lib';\
	echo -E '    chmod -x $$ROOT/usr/lib/*.so';\
	echo -E '    yada install -conf -as libnss-db -into /etc/default libnss-db.default';\
	echo -E '    yada install -man makedb.1';\
	echo -E 'popd';\
	echo -E 'yada install -data -as Makefile -into $$VAR_DB debian/scripts/db-Makefile';\
	echo -E 'yada install -doc -as changelog ChangeLog';\
	echo -E 'yada install -doc NEWS README') | /bin/bash
	@umask 022 \
	  && export pwd="$$(pwd)" \
	  && export ROOT="$$(pwd)/debian/tmp-libnss-db" \
	  && export TMPROOT="$$(pwd)/debian/tmp" \
	  && export CONTROL="$$(pwd)/debian/tmp-libnss-db/DEBIAN" \
	  && export PACKAGE="libnss-db" \
	  && export SOURCE="libnss-db" \
	  && export VERSION="$(VERSION)" && (\
	echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
	echo -E 'yada perl';\
	echo -E 'yada python';\
	echo -E 'yada strip';\
	echo -E 'yada shlibdeps') | /bin/sh
	yada compress libnss-db
	yada generate maintscripts libnss-db
	find debian/tmp-libnss-db -type f -print \
	  | sed -n 's/^debian\/tmp-libnss-db\(\/etc\/.*\)$$/\1/p' \
	  > debian/tmp-libnss-db/DEBIAN/conffiles
	test -s debian/tmp-libnss-db/DEBIAN/conffiles || rm -f debian/tmp-libnss-db/DEBIAN/conffiles
	yada rebuild control
	yada generate substvars libnss-db
	umask 022 && dpkg-gencontrol -isp -plibnss-db -Pdebian/tmp-libnss-db

# Build package files

.PHONY: binary binary-arch binary-indep
binary: binary-arch binary-indep
binary-arch: binary-arch-any

.PHONY: binary-arch-any
binary-arch-any: \
	binary-package-libnss-db
binary-indep:

.PHONY: binary-package-libnss-db
binary-package-libnss-db: check-root debian/tmp-libnss-db/DEBIAN/control
	@[ -f $(shell which yada) -a -f debian/rules ]
	chown -R 0.0 debian/tmp-libnss-db
	chmod -R u=rwX,go=rX debian/tmp-libnss-db
	@if [ -d debian/tmp-libnss-db/usr/doc/libnss-db ]; then \
	  echo "*** Yada warning: /usr/doc/libnss-db should be /usr/share/doc/libnss-db";\
	fi
	dpkg-deb --build debian/tmp-libnss-db ..

.PHONY: check-root
check-root:
	@[ `id -u` = 0 ] || (echo "You must be root to do this!"; false)

debian/packages-tmp: debian/packages 
	yada rebuild packages

## Clean up afterwards

.PHONY: clean clean-install-tree clean-build

clean: clean-install-tree clean-build debian/control debian/rules
	rm -f debian/packages-tmp debian/packages-tmp-new debian/packages-tmp-include

clean-build:
	@[ -f $(shell which yada) -a -f debian/rules ]
	rm -f debian/build-stamp debian/build-arch-stamp debian/build-indep-stamp
	@umask 022 \
	  && export pwd="$$(pwd)" \
	  && export TMPROOT="$$(pwd)/debian/tmp" \
	  && export SOURCE="libnss-db" \
	  && export VERSION="$(VERSION)" \
	  && export DEB_HOST_GNU_CPU="$(DEB_HOST_GNU_CPU)" \
	  && export DEB_HOST_GNU_TYPE="$(DEB_HOST_GNU_TYPE)" \
	  && export DEB_HOST_GNU_SYSTEM="$(DEB_HOST_GNU_SYSTEM)" \
	  && export DEB_BUILD_GNU_CPU="$(DEB_BUILD_GNU_CPU)" \
	  && export DEB_BUILD_GNU_TYPE="$(DEB_BUILD_GNU_TYPE)" \
	  && export DEB_BUILD_GNU_SYSTEM="$(DEB_BUILD_GNU_SYSTEM)" && (\
	echo -E 'eval "yada () { perl $$(which yada) \"\$$@\"; }"; set -e; set -v';\
	echo -E 'rm -rf build || true';\
	echo -E 'for f in ABOUT-NLS Makefile.am Makefile.in acconfig.h aclocal.m4 config.guess     config.h.in config.sub configure configure.in ltmain.sh mkinstalldirs     src/Makefile.in; do';\
	echo -E '    test -e $$f.bak && test -e $$f && rm -rf $$f';\
	echo -E '    test -e $$f.bak && mv -f $$f.bak $$f';\
	echo -E 'done';\
	echo -E 'rm -f *-stamp || true';\
	echo -E 'rm -rf Makefile.in~ VAR_DB autom4te.cache configure.in~ depcomp     libnss-db.default libnss-db.default.new depconf makedb.1     m4/Makefile.in po/pl.gmo po/Makevars src/db-compat-copy-makedb.c || true') | /bin/sh
	yada unpatch
	rm -rf debian/tmp

clean-install-tree: debian/rules
	@[ -f $(shell which yada) -a -f debian/rules ]
	rm -f debian/install-tree-stamp
	rm -rf debian/tmp-* debian/files* debian/substvars debian/shlibs.local debian/ucf