File: rules

package info (click to toggle)
ltp 20060918-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,888 kB
  • ctags: 20
  • sloc: makefile: 150
file content (194 lines) | stat: -rwxr-xr-x 5,170 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
#!/usr/bin/make -f
# rules file for the LTP package
#

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

# This is the debhelper compatability version to use.
export DH_COMPAT=5

# For DBS
TAR_DIR=ltp-full-20060918
include /usr/share/dbs/dbs-build.mk
ifeq (,$(DEB_BUILD_GNU_TYPE))
 include /usr/share/dbs/dpkg-arch.mk
endif

# As this is a testing package, the testcases are not stripped,
# unlike the debian default. To silence lintian warnings, comment
# out the nostrip option in DEB_BUILD_OPTIONS below.
export DEB_BUILD_OPTIONS=nostrip

# FIXME Tidy this up with patterned depends rules later
build-stamp = ${STAMP_DIR}/build-stamp
build-ltp-commands-test-stamp  = ${STAMP_DIR}/build-ltp-commands-test-stamp
binary-ltp-kernel-test-stamp = ${STAMP_DIR}/binary-ltp-kernel-test-stamp 
binary-ltp-misc-test-stamp = ${STAMP_DIR}/binary-ltp-misc-test-stamp
binary-ltp-tools-stamp = ${STAMP_DIR}/binary-ltp-tools-stamp
binary-ltp-dev-stamp = ${STAMP_DIR}/binary-ltp-dev-stamp
binary-ltp-network-test-stamp = ${STAMP_DIR}/binary-ltp-network-test-stamp
binary-ltp-disc-test-stamp = ${STAMP_DIR}/binary-ltp-disc-test-stamp
binary-ltp-stamp = ${STAMP_DIR}/binary-ltp-stamp


clean: 
	dh_testdir
	dh_testroot
	rm -rf debian/*~ *.log ${SOURCE_DIR} ${STAMP_DIR}
	dh_clean


install: ${build-stamp}
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs


build-stamp build: ${patched}
	dh_testdir
	${MAKE} -C ${BUILD_TREE}
	touch ${build-stamp}

BUILD_ARCH_STAMPS = \
	${binary-ltp-commands-test-stamp}	\
	${binary-ltp-kernel-test-stamp} 	\
	${binary-ltp-misc-test-stamp}		\
	${binary-ltp-tools-stamp}		\
	${binary-ltp-dev-stamp}			\
	${binary-ltp-network-test-stamp}	\
	${binary-ltp-disc-test-stamp}

BUILD_INDEP_STAMPS = \
	${binary-ltp-stamp} 

# Build architecture-dependent files here.
binary-arch: ${BUILD_ARCH_STAMPS}
	dh_strip
	dh_installdocs
	dh_installchangelogs
	dh_compress
	dh_shlibdeps -Xdebian/ltp-kernel-test/${TEST_BIN}/dummy 
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep: ${BUILD_INDEP_STAMPS}
	dh_installdocs
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-arch binary-indep

TOP_DIR:=`pwd`
LTP_ROOT=usr/lib/debian-test/tests/linux
LTP_TOOLS_DIR=usr/lib/debian-test/tools
TEST_BIN=${LTP_ROOT}/testcases/bin
MANDIR=/usr/share/man

STRIP=strip -R .note -R .comment

${binary-ltp-commands-test-stamp}: ltp-commands-test
ltp-commands-test:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	${MAKE} -C ${BUILD_TREE}/testcases/commands install
	dh_install -p $@
	dh_strip -p $@
	touch ${binary-ltp-commands-test-stamp}

${binary-ltp-kernel-test-stamp}: ltp-kernel-test
ltp-kernel-test:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	rm -f ${BUILD_TREE}/testcases/bin/*
	${MAKE} -C ${BUILD_TREE}/testcases/kernel \
		bindir=${TOP_DIR}/debian/ltp-kernel-test/${TEST_BIN} \
		mandir=${TOP_DIR}/debian/ltp-kernel-test/${MANDIR} \
		install
	mv ${BUILD_TREE}/testcases/bin/* debian/ltp-kernel-test/${TEST_BIN}
	chmod +x debian/ltp-kernel-test/${TEST_BIN}/*.sh
        # the following are in disc-test instead
	rm -f debian/ltp-kernel-test/${TEST_BIN}/stress_{floppy,cd}
	dh_install -p $@
	dh_fixperms -p $@
	touch ${binary-ltp-kernel-test-stamp}

${binary-ltp-network-test-stamp}: ltp-network-test
ltp-network-test:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	rm -f ${BUILD_TREE}/testcases/bin/*
	${MAKE} -C ${BUILD_TREE}/testcases/network install
	dh_install -p $@
	chmod -x debian/$@/usr/lib/debian-test/tests/linux/network_commands
	# Rename to avoid collision with fsstress in ltp-kernel-test
	mv debian/$@/${TEST_BIN}/fsstress debian/$@/${TEST_BIN}/nfs_fsstress
	touch ${binary-ltp-network-test-stamp}

${binary-ltp-misc-test-stamp}: ltp-misc-test
ltp-misc-test:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	rm -f ${BUILD_TREE}/testcases/bin/*
	${MAKE} -C ${BUILD_TREE}/testcases/misc install
        # data files should not be executable
	# file testcases/bin/* | grep data | cut -f1 -d: | xargs chmod -x
	dh_install -p $@
	touch ${binary-ltp-misc-test-stamp}

${binary-ltp-disc-test-stamp}: ltp-disc-test
ltp-disc-test:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	rm -f ${BUILD_TREE}/testcases/bin/*
	${MAKE} -C ${BUILD_TREE}/testcases/kernel install
	dh_install -p $@
	touch ${binary-ltp-disc-test-stamp}

${binary-ltp-tools-stamp}: ltp-tools
ltp-tools:
	dh_testdir
	dh_testroot
	${MAKE} -C ${BUILD_TREE}/tools install
	dh_installdirs -p $@
	dh_installman -p $@ ${BUILD_TREE}/doc/man1/*
	dh_installexamples -p $@ ${BUILD_TREE}/pan/cgi
	dh_install -p $@
	chmod +x debian/ltp-tools/${LTP_TOOLS_DIR}/ltprun
	touch ${binary-ltp-tools-stamp}

${binary-ltp-dev-stamp}: ltp-dev
ltp-dev:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	dh_installman -p $@ ${BUILD_TREE}/doc/man3/*
	dh_install -p $@
	touch ${binary-ltp-dev-stamp}

${binary-ltp-stamp}: ltp
ltp:
	dh_testdir
	dh_testroot
	dh_installdirs -p $@
	dh_installman -p $@ debian/ltpmenu.1
	dh_install -p $@ ${BUILD_TREE}/ltpmenu usr/bin
	dh_installexamples -p $@ ${BUILD_TREE}/doc/examples/*
	touch ${binary-ltp-stamp}


.PHONY: build clean binary-indep binary-arch binary install