File: rules

package info (click to toggle)
openafs 1.4.2-6etch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 42,324 kB
  • ctags: 55,614
  • sloc: ansic: 397,846; sh: 10,033; makefile: 9,203; perl: 7,679; java: 5,633; asm: 1,276; yacc: 983; lex: 318; tcl: 249; objc: 137; csh: 123
file content (317 lines) | stat: -rwxr-xr-x 10,871 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

# Tell Autoconf the correct system types.
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
    SYSTEM = --build $(DEB_HOST_GNU_TYPE)
else
    SYSTEM = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# Determine whether we're building with optimization.  This doesn't really
# work at the moment due to upstream problems.
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    DEBIAN_OPT_FLAGS = --disable-optimize --disable-lwp-optimize
    DEBIAN_KERN_FLAGS = --disable-kernel-optimize
else
    DEBIAN_OPT_FLAGS =
    DEBIAN_KERN_FLAGS =
endif

# Find kernel build information.
ifndef KSRC
    KSRC = /usr/src/linux
endif
ifndef KPKG_DEST_DIR
    KPKG_DEST_DIR = ..
endif
KVERS := $(shell perl debian/kernel-version $(KSRC))
export KSRC 
export KVERS
export KPKG_DEST_DIR

SYS_NAME  := $(shell KSRC="$(KSRC)" KVERS="$(KVERS)" sh debian/sysname)

package    = openafs
srcpkg     = openafs-modules-source
modulepkg := openafs-modules-$(KVERS)${INT_SUBARCH}
moduledir := debian/$(modulepkg)/lib/modules/$(KVERS)/fs

# These packages have lintian overrides.
LINTIAN_PACKAGES = openafs-dbserver openafs-client openafs-fileserver

# The /usr/share/doc directory for these packages should be a symlink to
# /usr/share/doc/openafs-client.  Any package on this list must depend on
# openafs-client.
DOC_PACKAGES = libpam-openafs-kaserver openafs-dbserver openafs-fileserver \
	openafs-kpasswd

# These variable is used only by get-orig-source, which will normally only be
# run by maintainers.
VERSION   = 1.4.2fc4
DEBVERS   = 1.4.2~fc4
UPSTREAM  = /afs/grand.central.org/software/openafs/candidate/$(VERSION)

# Download the upstream source, merge in the doc tarball, and do the
# repackaging that we have to do for DFSG reasons.  This assumes AFS is
# mounted, as it's generally only used by the package maintainers.
get-orig-source:
	cp $(UPSTREAM)/openafs-$(VERSION)-src.tar.bz2 .
	tar xjf openafs-$(VERSION)-src.tar.bz2
	rm openafs-$(VERSION)-src.tar.bz2
	cp $(UPSTREAM)/openafs-$(VERSION)-doc.tar.bz2 .
	tar xjf openafs-$(VERSION)-doc.tar.bz2
	rm openafs-$(VERSION)-doc.tar.bz2
	rm -r openafs-$(VERSION)/src/packaging/MacOS
	rm -r openafs-$(VERSION)/src/platform/DARWIN
	rm -r openafs-$(VERSION)/src/WINNT
	tar cf openafs_$(DEBVERS).orig.tar openafs-$(VERSION)
	rm -r openafs-$(VERSION)
	gzip -9 openafs_$(DEBVERS).orig.tar

configure: configure-stamp
configure-stamp:
	@if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
	dh_testdir
	sh regen.sh
	afslogsdir=/var/log/openafs afslocaldir=/etc/openafs/server-local \
	    sh configure \
	    --with-afs-sysname=$(SYS_NAME) --disable-kernel-module \
	    --prefix=/usr --mandir=\$${prefix}/share/man \
	    --sysconfdir=/etc --libexecdir=/usr/lib \
	    --localstatedir=/var/lib --enable-supergroups \
	    --enable-largefile-fileserver --enable-debug --enable-lwp-debug \
	    --with-krb5-conf=/usr/bin/krb5-config \
	    $(DEBIAN_OPT_FLAGS) $(SYSTEM)
	chmod a+x src/libafs/make_kbuild_makefile.pl         
	touch configure-stamp

build: build-arch build-indep
build-arch: configure-stamp build-stamp
build-indep:
build-stamp:
	dh_testdir
	mkdir -p $(CURDIR)/debian/tmp
	$(MAKE) install_nolibafs DESTDIR=$(CURDIR)/debian/tmp
	chmod +x debian/afs-rootvol debian/afs-newcell
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	rm -f build-modules-stamp configure-modules-stamp
	[ ! -f Makefile ] || $(MAKE) distclean
	dh_clean

install: DH_OPTIONS=
install: build
	dh_testdir
	dh_testroot
	dh_installdirs
	dh_install

	set -e; for pkg in $(LINTIAN_PACKAGES) ; do \
	    install -d debian/$$pkg/usr/share/lintian/overrides; \
	    install -m 644 -c debian/$$pkg.lintian \
	        debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
	done
	set -e; for pkg in $(DOC_PACKAGES) ; do \
	    ln -s openafs-client debian/$$pkg/usr/share/doc/$$pkg; \
	done

	mv debian/openafs-client/usr/bin/pagsh \
	    debian/openafs-client/usr/bin/pagsh.openafs
	mv debian/openafs-client/usr/share/man/man1/pagsh.1 \
	    debian/openafs-client/usr/share/man/man1/pagsh.openafs.1
	mv debian/openafs-client/usr/bin/up \
	    debian/openafs-client/usr/bin/afs-up
	mv debian/openafs-client/usr/share/man/man1/up.1 \
	    debian/openafs-client/usr/share/man/man1/afs-up.1

	install -m 644 -c debian/tmp/usr/lib/pam_afs.so.1 \
	    debian/libpam-openafs-kaserver/lib/security/pam_afs.so
	install -m 644 -c debian/tmp/usr/lib/pam_afs.krb.so.1 \
	    debian/libpam-openafs-kaserver/lib/security/pam_afs.krb.so

	install -d debian/openafs-dbserver/usr/share/man/man8
	/usr/bin/docbook-to-man debian/pt_util.sgml \
	    >debian/openafs-dbserver/usr/share/man/man8/pt_util.8
	( cd debian && pod2man --section 8 --center "Debian GNU/Linux" \
	    afs-rootvol ) \
	    >debian/openafs-dbserver/usr/share/man/man8/afs-rootvol.8
	( cd debian && pod2man --section 8 --center "Debian GNU/Linux" \
	    afs-newcell ) \
	    >debian/openafs-dbserver/usr/share/man/man8/afs-newcell.8

# Build architecture-independent files here.  Pass -i to all debhelper
# commands in this target to reduce clutter.
#
# Also install debian/openafs-client.NEWS in the openafs-modules-source
# package.
binary-indep: DH_OPTIONS=-i
binary-indep: build install binary-source
	dh_testdir
	dh_testroot
	dh_installchangelogs NEWS
	install -m 644 debian/openafs-client.NEWS \
	    debian/$(srcpkg)/usr/share/doc/$(srcpkg)/NEWS.Debian
	dh_installdocs -XQuickStartWindows -Xwinnotes
	dh_installexamples
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.  Pass -a to all debhelper commands
# in this target to reduce clutter.
#
# We would like to install debugging information for everything, but currently
# OpenAFS's makefiles strip all binaries when installed except for the
# fileserver and the volserver.  This is fixed in OpenAFS's development
# branch.  Until that's released, only retain debugging information for the
# fileserver and the volserver.
binary-arch: DH_OPTIONS=-a
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs NEWS
	dh_installdocs
	dh_installdebconf
	DH_OPTIONS= dh_installinit -popenafs-client -r -- defaults 25 18
	DH_OPTIONS= dh_installinit -popenafs-fileserver -r
	dh_link
	dh_strip --dbg-package=openafs-dbg
	rm -r debian/openafs-dbg/usr/lib/debug/sbin
	rm -r debian/openafs-dbg/usr/lib/debug/usr/bin
	rm -r debian/openafs-dbg/usr/lib/debug/usr/sbin
	cd debian/openafs-dbg/usr/lib/debug/usr/lib/openafs \
	    && rm buserver ptserver salvager vlserver
	dh_compress
	dh_fixperms
	chmod 700 debian/openafs-client/var/cache/openafs
	chmod 700 debian/openafs-dbserver/var/lib/openafs/db
	chmod 700 debian/openafs-fileserver/etc/openafs/server
	chmod 700 debian/openafs-fileserver/var/lib/openafs/cores
	dh_perl
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

#####################  Building openafs-modules-source  ######################

binary-source:
	dh_testdir
	dh_testroot
	-rm -rf debian/$(srcpkg) debian/substvars
	install -d debian/$(srcpkg)/usr/src/modules/$(package)
	find . \( -name \*.o -o -path ./debian/$(srcpkg) -o -path \*/CVS \
	    -o -path \*/.svn -o -path ./src/WINNT -o -path ./doc \
	    -o -path ./obj -o -path ./$(SYS_NAME) \
	    -o \( -path ./debian/\* -type d \) \
	    -o -path ./debian/\*debhelper \) -prune -o -print | \
	        cpio -admp debian/$(srcpkg)/usr/src/modules/$(package)
	cd debian/$(srcpkg)/usr/src/modules/$(package) && \
	    $(MAKE) -f debian/rules clean && \
	    mv debian/kern-sysname debian/sysname
	-cd debian/$(srcpkg)/usr/src/modules/$(package) && \
	    rm -rf src/libafs/rx src/libafs/afs src/libafs/afsint
	chown -R root.src debian/$(srcpkg)
	find debian/$(srcpkg) -type d | xargs chmod 755
	find debian/$(srcpkg) -type f -perm -100 | xargs chmod 755
	find debian/$(srcpkg) -type f -not -perm -100 | xargs chmod 644
	chmod 775 debian/$(srcpkg)/usr/src/modules
	cd debian/$(srcpkg)/usr/src && \
	    tar cf $(package).tar modules && \
	    rm -r modules
	gzip -9 debian/$(srcpkg)/usr/src/$(package).tar
	chmod 644 debian/$(srcpkg)/usr/src/$(package).tar.gz

####################  Module package support (make-kpkg)  ####################

kdist_configure: configure-modules-stamp

kdist_image: build-modules-stamp
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-modules
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean

kdist: build-modules-stamp
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules binary-modules
	KSRC="$(KSRC)" KMAINT="$(KMAINT)" KEMAIL="$(KEMAIL)" \
	    sh -v debian/genchanges.sh
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean

kdist_clean:
	$(ROOT_CMD) $(MAKE) $(MFLAGS) -f debian/rules clean

########################  Kernel module build rules  #########################

configure-modules: configure-modules-stamp
configure-modules-stamp:
	@if test x"$(SYS_NAME)" = x"UNKNOWN" ; then exit 1 ; fi
	@if test x"$(KVERS)" = x ; then \
	    echo 'No version in $(KSRC)/include/linux/version.h' >&2 ; \
	    exit 1 ; \
	fi
	sh debian/prep-modules $(KSRC)
	sh configure --with-afs-sysname=$(SYS_NAME) \
	    --with-linux-kernel-headers=$(KSRC) --prefix=`pwd`/debian/tmp \
	    --enable-debug --enable-lwp-debug --enable-kernel-debug \
	    $(DEBIAN_OPT_FLAGS) $(DEBIAN_KERN_FLAGS)
	touch configure-modules-stamp

build-modules: build-modules-stamp
build-modules-stamp: configure-modules-stamp
	make only_libafs
	touch build-modules-stamp

install-modules: build-modules-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	cd src/libafs && make install
	install -d -g root -o root -m 755 $(moduledir)
	install -g root -o root -m 755 debian/tmp/lib/openafs/*o $(moduledir)/
	if test -f $(moduledir)/openafs.o \
	        -a ! -f $(moduledir)/openafs.mp.o ; then \
	    ln $(moduledir)/openafs.o $(moduledir)/openafs.mp.o || exit 1 ; \
	fi

binary-modules: install-modules
	dh_testdir
	dh_testroot
	dh_installchangelogs NEWS
	dh_installdocs
	dh_installmodules
	dh_strip
	dh_link
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol -- -v`cat debian/VERSION`
	dh_md5sums
	dh_builddeb --destdir="$(KPKG_DEST_DIR)"

.PHONY: binary binary-arch binary-indep binary-modules binary-source build
.PHONY: build-arch build-indep build-modules clean configure configure-modules
.PHONY: install install-modules kdist kdist_clean kdist_configure kdist_image