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
|
INSTALL = install
INSTALL_DIRECTORY = $(INSTALL) -d -m 0755
INSTALL_FILE = $(INSTALL) -m 0644
INSTALL_EXECUTABLE = $(INSTALL) -m 0755
DESTDIR :=
SYSCONFDIR := $(DESTDIR)/etc
PBUILDERCONFDIR := $(SYSCONFDIR)/pbuilder
BASHCOMPLETIONDIR := $(SYSCONFDIR)/bash_completion.d
BINDIR := $(DESTDIR)/usr/bin
PKGLIBDIR := $(DESTDIR)/usr/lib/pbuilder
SBINDIR := $(DESTDIR)/usr/sbin
EXAMPLEDIR := $(DESTDIR)/usr/share/doc/pbuilder/examples
EXAMPLE_LVMPBUILDERDIR := $(EXAMPLEDIR)/lvmpbuilder
EXAMPLE_LVMPBUILDER_LIBDIR := $(EXAMPLE_LVMPBUILDERDIR)/lib
EXAMPLE_PBUILDERTESTDIR := $(EXAMPLEDIR)/pbuilder-test
EXAMPLE_REBUILDDIR := $(EXAMPLEDIR)/rebuild
EXAMPLE_WORKAROUNDDIR := $(EXAMPLEDIR)/workaround
PKGDATADIR := $(DESTDIR)/usr/share/pbuilder
define newline
endef
NULL :=
BASHCOMPLETION_DATA += \
bash_completion.d/pbuilder \
$(NULL)
PBUILDERCONF_DATA += \
pbuilder-uml.conf \
$(NULL)
BIN_SCRIPTS += \
debuild-pbuilder \
pbuilder-user-mode-linux \
pdebuild \
pdebuild-user-mode-linux \
$(NULL)
PKGLIB_SCRIPTS += \
pbuilder-buildpackage \
pbuilder-buildpackage-funcs \
pbuilder-checkparams \
pbuilder-createbuildenv \
pbuilder-loadconfig \
pbuilder-modules \
pbuilder-runhooks \
pbuilder-satisfydepends-aptitude \
pbuilder-satisfydepends-checkparams \
pbuilder-satisfydepends-classic \
pbuilder-satisfydepends-experimental \
pbuilder-satisfydepends-funcs \
pbuilder-satisfydepends-gdebi \
pbuilder-uml-checkparams \
pbuilder-updatebuildenv \
pdebuild-checkparams \
pdebuild-internal \
pdebuild-uml-checkparams \
$(NULL)
# TODO add pbuilder-apt-config
SBIN_SCRIPTS += \
pbuilder \
$(NULL)
EXAMPLE_DATA += \
pbuilderrc \
$(NULL)
EXAMPLE_SCRIPTS += \
examples/B90lintian \
examples/B91dpkg-i \
examples/B92test-pkg \
examples/C10shell \
examples/C11screen \
examples/D10tmp \
examples/D20addnonfree \
examples/D80no-man-db-rebuild \
examples/D90chrootmemo \
examples/F90chrootmemo \
examples/B90list-missing \
examples/B91debc \
examples/execute_installtest.sh \
examples/execute_paramtest.sh \
examples/pbuilder-distribution.sh \
$(NULL)
EXAMPLE_LVMPBUILDER_DATA += \
examples/lvmpbuilder/README \
examples/lvmpbuilder/STRATEGY \
$(NULL)
EXAMPLE_LVMPBUILDER_SCRIPTS += \
examples/lvmpbuilder/lvmbuilder \
$(NULL)
EXAMPLE_LVMPBUILDER_LIB_DATA += \
examples/lvmpbuilder/lib/lvmbuilder-checkparams \
examples/lvmpbuilder/lib/lvmbuilder-modules \
examples/lvmpbuilder/lib/lvmbuilder-unimplemented \
$(NULL)
EXAMPLE_LVMPBUILDER_LIB_SCRIPTS += \
$(NULL)
EXAMPLE_PBUILDERTEST_DATA += \
examples/pbuilder-test/README \
examples/pbuilder-test/002_sample.c \
$(NULL)
EXAMPLE_PBUILDERTEST_SCRIPTS += \
examples/pbuilder-test/000_prepinstall \
examples/pbuilder-test/001_apprun \
examples/pbuilder-test/002_libfile \
examples/pbuilder-test/003_makecheck \
examples/pbuilder-test/004_ldd \
$(NULL)
EXAMPLE_REBUILD_DATA += \
examples/rebuild/README \
$(NULL)
EXAMPLE_REBUILD_SCRIPTS += \
examples/rebuild/buildall \
examples/rebuild/getlist \
$(NULL)
EXAMPLE_WORKAROUND_DATA += \
$(NULL)
EXAMPLE_WORKAROUND_SCRIPTS += \
examples/E50-initscripts-2.86.ds1-7.workaround.sh \
examples/G50-initscripts-2.86.ds1-11-cdebootstrap0.3.9.sh \
$(NULL)
PKGDATA_DATA += \
pbuilderrc \
pbuilder-uml.conf \
$(NULL)
NOINST_SCRIPTS += \
debuild.sh \
testlib.sh \
test_pbuilder-apt-config \
test_pbuilder-checkparams \
test_pbuilder-modules \
test_pbuilder-satisfydepends-checkparams \
test_pbuilder-satisfydepends-classic \
test_pbuilder-satisfydepends-funcs \
test_testlib.sh \
$(NULL)
# TODO: check bash_completion.pbuilder
# TODO: check man pages
# TODO: check pbuilderrcs and *.conf
# TODO: check subdirs, more examples etc.
CHECK_SCRIPTS += $(BIN_SCRIPTS) $(PKGLIB_SCRIPTS) $(SBIN_SCRIPTS) $(EXAMPLE_SCRIPTS) $(NOINST_SCRIPTS)
all:
check:
# syntax check
$(foreach script,$(CHECK_SCRIPTS),bash -n $(script)$(newline))
# testsuite
$(foreach test,$(wildcard ./test_*),$(test)$(newline))
full-check:
cd testsuite && ./run-test.sh
clean:
rm -f *.bak *~ TAGS
rm -f testsuite/testimage
rm -rf testsuite/testbuild testsuite/testbuild2
TAGS:
etags pbuilder-* pbuilder
install:
$(INSTALL_DIRECTORY) $(BASHCOMPLETIONDIR)
$(INSTALL_DIRECTORY) $(PBUILDERCONFDIR)
$(INSTALL_DIRECTORY) $(SBINDIR)
$(INSTALL_DIRECTORY) $(BINDIR)
$(INSTALL_DIRECTORY) $(PKGLIBDIR)
$(INSTALL_DIRECTORY) $(EXAMPLEDIR)
$(INSTALL_DIRECTORY) $(EXAMPLE_LVMPBUILDERDIR)
$(INSTALL_DIRECTORY) $(EXAMPLE_LVMPBUILDER_LIBDIR)
$(INSTALL_DIRECTORY) $(EXAMPLE_PBUILDERTESTDIR)
$(INSTALL_DIRECTORY) $(EXAMPLE_REBUILDDIR)
$(INSTALL_DIRECTORY) $(EXAMPLE_WORKAROUNDDIR)
$(INSTALL_DIRECTORY) $(PKGDATADIR)
$(INSTALL_DIRECTORY) $(DESTDIR)/var/cache/pbuilder/pbuilder-mnt
$(INSTALL_DIRECTORY) $(DESTDIR)/var/cache/pbuilder/pbuilder-umlresult
$(foreach file,$(PBUILDERCONF_DATA),$(INSTALL_FILE) $(file) $(PBUILDERCONFDIR)$(newline))
$(foreach file,$(BASHCOMPLETION_DATA),$(INSTALL_FILE) $(file) $(BASHCOMPLETIONDIR)$(newline))
$(foreach script,$(BIN_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(BINDIR)$(newline))
$(foreach script,$(PKGLIB_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(PKGLIBDIR)$(newline))
$(foreach script,$(SBIN_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(SBINDIR)$(newline))
$(foreach file,$(EXAMPLE_DATA),$(INSTALL_FILE) $(file) $(EXAMPLEDIR)$(newline))
$(foreach script,$(EXAMPLE_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(EXAMPLEDIR)$(newline))
$(foreach file,$(EXAMPLE_REBUILD_DATA),$(INSTALL_FILE) $(file) $(EXAMPLE_REBUILDDIR)$(newline))
$(foreach script,$(EXAMPLE_REBUILD_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(EXAMPLE_REBUILDDIR)$(newline))
$(foreach file,$(EXAMPLE_PBUILDERTEST_DATA),$(INSTALL_FILE) $(file) $(EXAMPLE_PBUILDERTESTDIR)$(newline))
$(foreach script,$(EXAMPLE_PBUILDERTEST_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(EXAMPLE_PBUILDERTESTDIR)$(newline))
$(foreach file,$(EXAMPLE_LVMPBUILDER_DATA),$(INSTALL_FILE) $(file) $(EXAMPLE_LVMPBUILDERDIR)$(newline))
$(foreach script,$(EXAMPLE_LVMPBUILDER_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(EXAMPLE_LVMPBUILDERDIR)$(newline))
$(foreach file,$(EXAMPLE_LVMPBUILDER_LIB_DATA),$(INSTALL_FILE) $(file) $(EXAMPLE_LVMPBUILDER_LIBDIR)$(newline))
$(foreach script,$(EXAMPLE_LVMPBUILDER_LIB_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(EXAMPLE_LVMPBUILDER_LIBDIR)$(newline))
$(foreach file,$(EXAMPLE_WORKAROUND_DATA),$(INSTALL_FILE) $(file) $(EXAMPLE_WORKAROUNDDIR)$(newline))
$(foreach script,$(EXAMPLE_WORKAROUND_SCRIPTS),$(INSTALL_EXECUTABLE) $(script) $(EXAMPLE_WORKAROUNDDIR)$(newline))
$(foreach file,$(PKGDATA_DATA),$(INSTALL_FILE) $(file) $(PKGDATADIR)$(newline))
# install -aptitude flavour as the default satisfydepends
ln -sf pbuilder-satisfydepends-aptitude $(PKGLIBDIR)/pbuilder-satisfydepends
$(MAKE) -C pbuildd $@
$(MAKE) -C Documentation $@
|